X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fx86-linux-os.c;h=30a44daaa5ba423570097e721ab3688d05f29842;hb=6fa4fe704a64808b55867d779a6ed72c29b7ef45;hp=ba3b0e830514daf2f4978f0b3d1cc3a8f12a4837;hpb=63fcb94b875a97e468d9add229e220ecceec2352;p=sbcl.git diff --git a/src/runtime/x86-linux-os.c b/src/runtime/x86-linux-os.c index ba3b0e8..30a44da 100644 --- a/src/runtime/x86-linux-os.c +++ b/src/runtime/x86-linux-os.c @@ -38,16 +38,13 @@ #include "validate.h" size_t os_vm_page_size; -#if defined GENCGC -#include "gencgc.h" -#endif /* KLUDGE: As of kernel 2.2.14 on Red Hat 6.2, there's code in the * file to define symbolic names for offsets into * gregs[], but it's conditional on __USE_GNU and not defined, so * we need to do this nasty absolute index magic number thing * instead. */ -register_t * +os_context_register_t * os_context_register_addr(os_context_t *context, int offset) { switch(offset) { @@ -63,15 +60,30 @@ os_context_register_addr(os_context_t *context, int offset) } return &context->uc_mcontext.gregs[offset]; } -register_t * + +os_context_register_t * os_context_pc_addr(os_context_t *context) { - return &context->uc_mcontext.gregs[14]; + return &context->uc_mcontext.gregs[14]; /* REG_EIP */ } -register_t * + +os_context_register_t * os_context_sp_addr(os_context_t *context) +{ + return &context->uc_mcontext.gregs[17]; /* REG_UESP */ +} + +os_context_register_t * +os_context_fp_addr(os_context_t *context) { - return &context->uc_mcontext.gregs[17]; + return &context->uc_mcontext.gregs[6]; /* REG_EBP */ +} + +unsigned long +os_context_fp_control(os_context_t *context) +{ + return ((((context->uc_mcontext.fpregs->cw) & 0xffff) ^ 0x3f) | + (((context->uc_mcontext.fpregs->sw) & 0xffff) << 16)); } sigset_t * @@ -81,6 +93,12 @@ os_context_sigmask_addr(os_context_t *context) } void +os_restore_fp_control(os_context_t *context) +{ + asm ("fldcw %0" : : "m" (context->uc_mcontext.fpregs->cw)); +} + +void os_flush_icache(os_vm_address_t address, os_vm_size_t length) { }