12 #include <sys/socket.h>
13 #include <sys/utsname.h>
15 #include <sys/types.h>
22 #ifdef LISP_FEATURE_SB_THREAD
23 #error "Define threading support functions"
25 int arch_os_thread_init(struct thread *thread) {
27 #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
28 /* Signal handlers are run on the control stack, so if it is exhausted
29 * we had better use an alternate stack for whatever signal tells us
30 * we've exhausted it */
31 sigstack.ss_sp=((void *) thread)+dynamic_values_bytes;
33 sigstack.ss_size = 32*SIGSTKSZ;
34 sigaltstack(&sigstack,0);
36 return 1; /* success */
38 int arch_os_thread_cleanup(struct thread *thread) {
39 return 1; /* success */
43 os_context_register_t *
44 os_context_register_addr(os_context_t *context, int offset)
46 /* Solaris x86 holds %esp value in UESP */
48 case reg_EAX: return &context->uc_mcontext.gregs[11];
49 case reg_ECX: return &context->uc_mcontext.gregs[10];
50 case reg_EDX: return &context->uc_mcontext.gregs[9];
51 case reg_EBX: return &context->uc_mcontext.gregs[8];
52 case reg_ESP: return &context->uc_mcontext.gregs[17]; /* REG_UESP */
53 case reg_EBP: return &context->uc_mcontext.gregs[6];
54 case reg_ESI: return &context->uc_mcontext.gregs[5];
55 case reg_EDI: return &context->uc_mcontext.gregs[4];
58 return &context->uc_mcontext.gregs[offset];
61 os_context_register_t *
62 os_context_pc_addr(os_context_t *context)
64 return &(context->uc_mcontext.gregs[14]); /* REG_EIP */
67 os_context_register_t *
68 os_context_sp_addr(os_context_t *context)
70 return &(context->uc_mcontext.gregs[17]); /* REG_UESP */
74 os_context_sigmask_addr(os_context_t *context)
76 return &(context->uc_sigmask);
79 void os_flush_icache(os_vm_address_t address, os_vm_size_t length)