X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fppc-linux-os.c;h=07124f11c4a56d023c804e2a10bce159eb119496;hb=c2ac5ba3964165ee2d21ccd4c6bf8bdc48e1a165;hp=c4a30f6ef645e27d99ad39fcf5ea414e3c26bbd7;hpb=c65f4c06c83c9dbf213cece638ad3d59710841bb;p=sbcl.git diff --git a/src/runtime/ppc-linux-os.c b/src/runtime/ppc-linux-os.c index c4a30f6..07124f1 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 @@ -41,10 +41,10 @@ size_t os_vm_page_size; int arch_os_thread_init(struct thread *thread) { - return 1; /* success */ + return 1; /* success */ } int arch_os_thread_cleanup(struct thread *thread) { - return 1; /* success */ + return 1; /* success */ } os_context_register_t * @@ -53,7 +53,7 @@ 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_regs->gregs)[offset]); + return &((context->uc_mcontext.uc_regs->gregs)[offset]); #endif } @@ -63,7 +63,7 @@ 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_regs->gregs)[PT_NIP]); + return &((context->uc_mcontext.uc_regs->gregs)[PT_NIP]); #endif } @@ -73,7 +73,7 @@ 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_regs->gregs)[PT_LNK]); + return &((context->uc_mcontext.uc_regs->gregs)[PT_LNK]); #endif } @@ -83,7 +83,7 @@ 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_oldsigmask; + return &context->uc_sigmask; #endif } @@ -96,41 +96,41 @@ os_context_fp_control(os_context_t *context) (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]; + return context->uc_mcontext.regs->gpr[PT_FPSCR]; #elif defined(GLIBC232_STYLE_UCONTEXT) - return context->uc_regs->gregs[PT_FPSCR]; + return context->uc_mcontext.uc_regs->gregs[PT_FPSCR]; #endif } -void +void os_restore_fp_control(os_context_t *context) { unsigned long control; double d; - - control = os_context_fp_control(context) & - /* FIXME: Should we preserve the user's requested rounding mode? - - Note that doing - - ~(FLOAT_STICKY_BITS_MASK | FLOAT_EXCEPTIONS_BYTE_MASK) - - here leads to infinite SIGFPE for invalid operations, as - there are bits in the control register that need to be - cleared that are let through by that mask. -- CSR, 2002-07-16 */ - - FLOAT_TRAPS_BYTE_MASK; - + + control = os_context_fp_control(context) & + /* FIXME: Should we preserve the user's requested rounding mode? + + Note that doing + + ~(FLOAT_STICKY_BITS_MASK | FLOAT_EXCEPTIONS_BYTE_MASK) + + here leads to infinite SIGFPE for invalid operations, as + there are bits in the control register that need to be + cleared that are let through by that mask. -- CSR, 2002-07-16 */ + + FLOAT_TRAPS_BYTE_MASK; + d = *((double *) &control); /* Hmp. Apparently the following doesn't work either: - + asm volatile ("mtfsf 0xff,%0" : : "f" (d)); causing segfaults at the first GC. */ } -void +void os_flush_icache(os_vm_address_t address, os_vm_size_t length) { /* see ppc-arch.c */