1.0.15.35: fix bitrotted GC sanity checks
[sbcl.git] / src / runtime / ppc-bsd-os.c
1 #include <signal.h>
2 #include <machine/cpu.h>
3 #include "sbcl.h"
4 #include "runtime.h"
5 #include "thread.h"
6
7
8 int *
9 os_context_register_addr(os_context_t *context, int offset)
10 {
11     return &context->uc_mcontext.__gregs[offset];
12 }
13
14 int *
15 os_context_sp_addr(os_context_t *context)
16 {
17     return &(_UC_MACHINE_SP(context));
18 }
19
20
21 int *
22 os_context_pc_addr(os_context_t *context)
23 {
24     return &(_UC_MACHINE_PC(context));
25 }
26
27 int *
28 os_context_lr_addr(os_context_t *context)
29 {
30     return &context->uc_mcontext.__gregs[_REG_LR];
31 }
32
33 /* FIXME: If this can be a no-op on BSD/x86, then it
34  * deserves a more precise name.
35  *
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)
39 {
40    ppc_flush_icache(address, length);
41 }
42
43 int arch_os_thread_init(struct thread *thread) {
44
45 #ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
46     stack_t sigstack;
47
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
56
57     return 1;                  /* success */
58 }
59
60 int arch_os_thread_cleanup(struct thread *thread) {
61
62     return 1;                  /* success */
63 }