2 #include <machine/cpu.h>
9 os_context_register_addr(os_context_t
*context
, int offset
)
11 return &context
->uc_mcontext
.__gregs
[offset
];
15 os_context_sp_addr(os_context_t
*context
)
17 return &(_UC_MACHINE_SP(context
));
22 os_context_pc_addr(os_context_t
*context
)
24 return &(_UC_MACHINE_PC(context
));
28 os_context_lr_addr(os_context_t
*context
)
30 return &context
->uc_mcontext
.__gregs
[_REG_LR
];
33 /* FIXME: If this can be a no-op on BSD/x86, then it
34 * deserves a more precise name.
36 * (Perhaps os_prepare_data_area_to_be_executed()?) */
38 os_flush_icache(os_vm_address_t address
, os_vm_size_t length
)
40 ppc_flush_icache(address
, length
);
43 int arch_os_thread_init(struct thread
*thread
) {
45 #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
48 /* Signal handlers are run on the control stack, so if it is exhausted
49 * we had better use an alternate stack for whatever signal tells us
50 * we've exhausted it */
51 sigstack
.ss_sp
=((void *) thread
)+dynamic_values_bytes
;
53 sigstack
.ss_size
= 32*SIGSTKSZ
;
54 sigaltstack(&sigstack
,0);
57 return 1; /* success */
60 int arch_os_thread_cleanup(struct thread
*thread
) {
62 return 1; /* success */