2 #include <machine/cpu.h>
9 os_context_register_addr(os_context_t *context, int offset)
11 #if defined(LISP_FEATURE_NETBSD)
12 return &context->uc_mcontext.__gregs[offset];
13 #elif defined(LISP_FEATURE_OPENBSD)
14 return &context->sc_frame.fixreg[offset];
18 #if defined(ARCH_HAS_STACK_POINTER) /* It's not defined on PPC. */
20 os_context_sp_addr(os_context_t *context)
22 #if defined(LISP_FEATURE_NETBSD)
23 return &(_UC_MACHINE_SP(context));
30 os_context_pc_addr(os_context_t *context)
32 #if defined(LISP_FEATURE_NETBSD)
33 return &(_UC_MACHINE_PC(context));
34 #elif defined(LISP_FEATURE_OPENBSD)
35 return &context->sc_frame.srr0;
40 os_context_lr_addr(os_context_t *context)
42 #if defined(LISP_FEATURE_NETBSD)
43 return &context->uc_mcontext.__gregs[_REG_LR];
44 #elif defined(LISP_FEATURE_OPENBSD)
45 return &context->sc_frame.lr;
49 os_context_register_t *
50 os_context_ctr_addr(os_context_t *context)
52 /* FIXME: Figure out how to make this happen. */
53 lose("was asked for context Counter (CTR) register, but don't know how");
56 os_context_register_t *
57 os_context_cr_addr(os_context_t *context)
59 /* FIXME: Figure out how to make this happen. */
60 lose("was asked for context Condition (CR) register, but don't know how");
63 /* FIXME: If this can be a no-op on BSD/x86, then it
64 * deserves a more precise name.
66 * (Perhaps os_prepare_data_area_to_be_executed()?) */
68 os_flush_icache(os_vm_address_t address, os_vm_size_t length)
70 ppc_flush_icache(address, length);
73 int arch_os_thread_init(struct thread *thread) {
75 #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
78 /* Signal handlers are run on the control stack, so if it is exhausted
79 * we had better use an alternate stack for whatever signal tells us
80 * we've exhausted it */
81 sigstack.ss_sp=((void *) thread)+dynamic_values_bytes;
83 sigstack.ss_size = 32*SIGSTKSZ;
84 sigaltstack(&sigstack,0);
87 return 1; /* success */
90 int arch_os_thread_cleanup(struct thread *thread) {
92 return 1; /* success */