X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fppc-linux-os.c;h=9df75610ee16213c9bb61a7ee2e80d3782c61473;hb=78fa16bf55be44cc16845be84d98023e83fb14bc;hp=f4fe13cb31cf892137a9ee3652efb477c5531683;hpb=7ff9e3f7f0d8b53a606a6f5769fc59512731984b;p=sbcl.git diff --git a/src/runtime/ppc-linux-os.c b/src/runtime/ppc-linux-os.c index f4fe13c..9df7561 100644 --- a/src/runtime/ppc-linux-os.c +++ b/src/runtime/ppc-linux-os.c @@ -18,6 +18,7 @@ #include #include #include +#include "sbcl.h" #include "./signal.h" #include "os.h" #include "arch.h" @@ -25,7 +26,6 @@ #include "interrupt.h" #include "interr.h" #include "lispregs.h" -#include "sbcl.h" #include #include @@ -36,11 +36,10 @@ #include #include "validate.h" +#include "ppc-linux-mcontext.h" + size_t os_vm_page_size; -struct thread *arch_os_get_current_thread() { - return all_threads; -} int arch_os_thread_init(struct thread *thread) { return 1; /* success */ } @@ -51,25 +50,41 @@ int arch_os_thread_cleanup(struct thread *thread) { os_context_register_t * os_context_register_addr(os_context_t *context, int offset) { +#if defined(GLIBC231_STYLE_UCONTEXT) return &((context->uc_mcontext.regs)->gpr[offset]); +#elif defined(GLIBC232_STYLE_UCONTEXT) + return &((context->uc_mcontext.uc_regs->gregs)[offset]); +#endif } os_context_register_t * os_context_pc_addr(os_context_t *context) { +#if defined(GLIBC231_STYLE_UCONTEXT) return &((context->uc_mcontext.regs)->nip); +#elif defined(GLIBC232_STYLE_UCONTEXT) + return &((context->uc_mcontext.uc_regs->gregs)[PT_NIP]); +#endif } os_context_register_t * os_context_lr_addr(os_context_t *context) { +#if defined(GLIBC231_STYLE_UCONTEXT) return &((context->uc_mcontext.regs)->link); +#elif defined(GLIBC232_STYLE_UCONTEXT) + return &((context->uc_mcontext.uc_regs->gregs)[PT_LNK]); +#endif } sigset_t * os_context_sigmask_addr(os_context_t *context) { +#if defined(GLIBC231_STYLE_UCONTEXT) + return &context->uc_sigmask; +#elif defined(GLIBC232_STYLE_UCONTEXT) return &context->uc_sigmask; +#endif } unsigned long @@ -80,7 +95,11 @@ os_context_fp_control(os_context_t *context) registers, and PT_FPSCR is an offset that is larger than 32 (the number of ppc registers), but that happens to get the right answer. -- CSR, 2002-07-11 */ +#if defined(GLIBC231_STYLE_UCONTEXT) return context->uc_mcontext.regs->gpr[PT_FPSCR]; +#elif defined(GLIBC232_STYLE_UCONTEXT) + return context->uc_mcontext.uc_regs->gregs[PT_FPSCR]; +#endif } void