2 * This is the PowerPC/Darwin incarnation of arch-dependent
3 * OS-dependent routines. See also "bsdos.c".
7 * This software is part of the SBCL system. See the README file for
10 * This software is derived from the CMU CL system, which was
11 * written at Carnegie Mellon University and released into the
12 * public domain. The software is in the public domain and is
13 * provided with absolutely no warranty. See the COPYING and CREDITS
14 * files for more information.
23 #include <mach-o/dyld.h>
25 #include "interr.h" /* for declaration of lose */
27 #ifdef LISP_FEATURE_SB_THREAD
28 #error "Define threading support functions"
30 int arch_os_thread_init(struct thread *thread) {
31 return 1; /* success */
33 int arch_os_thread_cleanup(struct thread *thread) {
34 return 1; /* success */
38 os_context_register_t *
39 os_context_register_addr(os_context_t *context, int offset)
41 ppc_saved_state_t *state = &context->uc_mcontext->ss;
44 return (os_context_register_t *) &state->r0;
46 return (os_context_register_t *) &state->r1;
48 return (os_context_register_t *) &state->r2;
50 return (os_context_register_t *) &state->r3;
52 return (os_context_register_t *) &state->r4;
54 return (os_context_register_t *) &state->r5;
56 return (os_context_register_t *) &state->r6;
58 return (os_context_register_t *) &state->r7;
60 return (os_context_register_t *) &state->r8;
62 return (os_context_register_t *) &state->r9;
64 return (os_context_register_t *) &state->r10;
66 return (os_context_register_t *) &state->r11;
68 return (os_context_register_t *) &state->r12;
70 return (os_context_register_t *) &state->r13;
72 return (os_context_register_t *) &state->r14;
74 return (os_context_register_t *) &state->r15;
76 return (os_context_register_t *) &state->r16;
78 return (os_context_register_t *) &state->r17;
80 return (os_context_register_t *) &state->r18;
82 return (os_context_register_t *) &state->r19;
84 return (os_context_register_t *) &state->r20;
86 return (os_context_register_t *) &state->r21;
88 return (os_context_register_t *) &state->r22;
90 return (os_context_register_t *) &state->r23;
92 return (os_context_register_t *) &state->r24;
94 return (os_context_register_t *) &state->r25;
96 return (os_context_register_t *) &state->r26;
98 return (os_context_register_t *) &state->r27;
100 return (os_context_register_t *) &state->r28;
102 return (os_context_register_t *) &state->r29;
104 return (os_context_register_t *) &state->r30;
106 return (os_context_register_t *) &state->r31;
109 return (os_context_register_t *) &context->uc_mcontext->es.dar;
112 return (os_context_register_t *) &context->uc_mcontext->es.dsisr;
114 lose("bad offset to os_context_register_addr");
118 os_context_register_t *
119 os_context_lr_addr(os_context_t *context)
121 return (os_context_register_t *) &context->uc_mcontext->ss.lr;
124 os_context_register_t *
125 os_context_pc_addr(os_context_t *context)
127 return &context->uc_mcontext->ss.srr0;
131 os_flush_icache(os_vm_address_t address, os_vm_size_t length)
134 ppc_flush_icache(address,length);