this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support showing dispatch queue name in LLDB

+36 -5
+32 -1
src/kernel/emulation/linux/bsdthread/bsdthread_register.c
··· 3 3 #include "../errno.h" 4 4 #include "../../../../../platform-include/sys/errno.h" 5 5 #include "../signal/sigexc.h" 6 + #include "../mach/lkm.h" 7 + #include "../../../../external/lkm/api.h" 8 + #include <stdint.h> 9 + #include <pthread/tsd_private.h> 6 10 #include <linux-syscalls/linux.h> 7 11 8 12 int pthread_obj_size; ··· 15 19 #define WORKQ_FEATURE_FINEPRIO 0x02 16 20 #define WORKQ_FEATURE_KEVENT 0x40 17 21 22 + struct _pthread_registration_data { 23 + uint64_t version; 24 + 25 + uint64_t dispatch_queue_offset; 26 + uint64_t main_qos; 27 + uint32_t tsd_offset; 28 + uint32_t return_to_kernel_offset; 29 + uint32_t mach_thread_self_offset; 30 + } __attribute__ ((packed)); 31 + 32 + static struct _pthread_registration_data g_pth_regdata; 33 + 18 34 long sys_bsdthread_register(void* thread_start, void* wqthread, int pthsize, 19 - void* dummy, void* targetconc, unsigned long long dpq_offset) 35 + const struct _pthread_registration_data* pth_regdata, 36 + unsigned long pth_regdata_len, unsigned long long dpq_offset) 20 37 { 21 38 pthread_obj_size = pthsize; 22 39 pthread_entry_point = (bsdthread_entry_t) thread_start; 23 40 wqueue_entry_point = (bsdwqthread_entry_t) wqthread; 41 + g_pth_regdata = *pth_regdata; 42 + 43 + struct set_thread_handles_args args; 44 + args.pthread_handle = (unsigned long) _pthread_getspecific_direct(_PTHREAD_TSD_SLOT_PTHREAD_SELF); 45 + args.dispatch_qaddr = args.pthread_handle + g_pth_regdata.tsd_offset + g_pth_regdata.dispatch_queue_offset; 46 + 47 + lkm_call(NR_set_thread_handles, &args); 48 + 24 49 return /* WORKQ_FEATURE_KEVENT | WORKQ_FEATURE_FINEPRIO | PTHREAD_FEATURE_QOS_MAINTENANCE 25 50 | PTHREAD_FEATURE_DISPATCHFUNC | PTHREAD_FEATURE_QOS_DEFAULT */ 0; 26 51 } ··· 29 54 void* funarg, unsigned long stacksize, unsigned int flags) 30 55 { 31 56 sigexc_thread_setup(); 57 + 58 + struct set_thread_handles_args args; 59 + args.pthread_handle = (unsigned long) self; 60 + args.dispatch_qaddr = args.pthread_handle + g_pth_regdata.tsd_offset + g_pth_regdata.dispatch_queue_offset; 61 + 62 + lkm_call(NR_set_thread_handles, &args); 32 63 pthread_entry_point(self, thread_port, funptr, funarg, stacksize, flags); 33 64 } 34 65
+4 -1
src/kernel/emulation/linux/bsdthread/bsdthread_register.h
··· 9 9 extern bsdthread_entry_t pthread_entry_point; 10 10 extern bsdwqthread_entry_t wqueue_entry_point; 11 11 12 + struct _pthread_registration_data; 13 + 12 14 long sys_bsdthread_register(void* thread_start, void* wqthread, int pthsize, 13 - void* dummy, void* targetconc, unsigned long long dpq_offset); 15 + const struct _pthread_registration_data* pth_regdata, 16 + unsigned long pth_regdata_len, unsigned long long dpq_offset); 14 17 void pthread_entry_point_wrapper(void* self, int thread_port, void* funptr, 15 18 void* funarg, unsigned long stacksize, unsigned int flags); 16 19 void wqueue_entry_point_wrapper(void* self, int thread_port, void* stackaddr,
-3
src/kernel/emulation/linux/signal/sigexc.c
··· 5 5 #include <stddef.h> 6 6 #include <sys/signal.h> 7 7 #include <linux-syscalls/linux.h> 8 - #include <pthread/tsd_private.h> 9 8 #include "sigaltstack.h" 10 9 #include "../mach/lkm.h" 11 10 #include "../../../../external/lkm/api.h" ··· 30 29 void darling_sigexc_uninstall(void); 31 30 void sigrt_handler(int signum, struct linux_siginfo* info, void* ctxt); 32 31 33 - #define SIGEXC_TSD_KEY 102 34 - #define SIGEXC_CONTEXT_TSD_KEY 103 35 32 static char sigexc_altstack[8*1024]; 36 33 37 34 #if defined(__x86_64__)