1.0.27.46: Fix build on systems with "src" in the path.
[sbcl/tcr.git] / src / runtime / ppc-bsd-os.c
blobe77590c1f44ad676ab31162d378904bdf8b23341
1 #include <signal.h>
2 #include <machine/cpu.h>
3 #include "sbcl.h"
4 #include "runtime.h"
5 #include "thread.h"
8 int *
9 os_context_register_addr(os_context_t *context, int offset)
11 return &context->uc_mcontext.__gregs[offset];
14 int *
15 os_context_sp_addr(os_context_t *context)
17 return &(_UC_MACHINE_SP(context));
21 int *
22 os_context_pc_addr(os_context_t *context)
24 return &(_UC_MACHINE_PC(context));
27 int *
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()?) */
37 void
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
46 stack_t sigstack;
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;
52 sigstack.ss_flags=0;
53 sigstack.ss_size = 32*SIGSTKSZ;
54 sigaltstack(&sigstack,0);
55 #endif
57 return 1; /* success */
60 int arch_os_thread_cleanup(struct thread *thread) {
62 return 1; /* success */