X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fsparc-linux-os.c;h=fec797058331718e7f1bcf791c10272b414231f7;hb=b870615b146940f661e5d0e9069ca4e16e9f483d;hp=236acae856345bd3dc39195f08dc1abcace751df;hpb=68fd2d2dd6f265669a8957accd8a33e62786a97e;p=sbcl.git diff --git a/src/runtime/sparc-linux-os.c b/src/runtime/sparc-linux-os.c index 236acae..fec7970 100644 --- a/src/runtime/sparc-linux-os.c +++ b/src/runtime/sparc-linux-os.c @@ -30,7 +30,6 @@ #include #include -/* #include */ #include #include #include @@ -38,54 +37,58 @@ #include "validate.h" size_t os_vm_page_size; -#if defined GENCGC /* unlikely ... */ -#include "gencgc.h" -#endif os_context_register_t * os_context_register_addr(os_context_t *context, int offset) { - /* printf("Offset: %d,", offset); - printf("Context: %p\n", context); - printf("PC: %x,", context->si_regs.pc); - printf("NPC: %x\n", context->si_regs.npc); */ - if (offset == 0) { - static int zero; - zero = 0; - /* printf("Returning: %p pointing to %p\n", &zero, zero); */ - return &zero; - } else if (offset < 16) { - /* printf("Returning: %p pointing to %p\n", &context->si_regs.u_regs[offset], context->si_regs.u_regs[offset]); */ - return &context->si_regs.u_regs[offset]; - } else if (offset < 32) { - int *sp = (int*) context->si_regs.u_regs[14]; /* Stack Pointer ?? */ - /* printf("SP: %p\n", sp); - printf("Returning: %p pointing to %p\n", &(sp[offset-16]), sp[offset-16]); */ - return &(sp[offset-16]); - } else - return 0; + if (offset == 0) { + static int zero; + zero = 0; + return &zero; + } else if (offset < 16) { + return &context->si_regs.u_regs[offset]; + } else if (offset < 32) { + int *sp = (int*) context->si_regs.u_regs[14]; /* Stack Pointer */ + return &(sp[offset-16]); + } else + return 0; } os_context_register_t * os_context_pc_addr(os_context_t *context) { - return &(context->si_regs.pc); + return &(context->si_regs.pc); } os_context_register_t * os_context_npc_addr(os_context_t *context) { - return &(context->si_regs.npc); + return &(context->si_regs.npc); } sigset_t * os_context_sigmask_addr(os_context_t *context) { - return &(context->si_mask); + return &(context->si_mask); } -void os_flush_icache(os_vm_address_t address, os_vm_size_t length) +void +os_restore_fp_control(os_context_t *context) { - /* FIXME. There's a bit of stuff in the CMUCL version. It may or - may not be needed */ + /* Included here, for reference, is an attempt at the PPC + variant. If it weren't the case that SPARC/Linux gave a Bus + Error on floating point exceptions, something like this would + have to be done. -- CSR, 2002-07-13 + + asm ("msfsf $255, %0" : : "m" + (os_context_fp_control(context) & + ~ (FLOAT_STICKY_BITS_MASK | FLOAT_EXCEPTIONS_BYTE_MASK))); + */ +} + +void +os_flush_icache(os_vm_address_t address, os_vm_size_t length) +{ + /* This is the same for linux and solaris, so see sparc-assem.S */ + sparc_flush_icache(address,length); }