X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fruntime%2Fx86-linux-os.c;h=30a44daaa5ba423570097e721ab3688d05f29842;hb=d68f3f83e6c5b9bed9789279cbae346f240488cc;hp=560babb9fc1c7795e8d8b33fbe8ae0534058c796;hpb=5037c9ac22cbab91eb3cf1ee6261c8589e17e81d;p=sbcl.git diff --git a/src/runtime/x86-linux-os.c b/src/runtime/x86-linux-os.c index 560babb..30a44da 100644 --- a/src/runtime/x86-linux-os.c +++ b/src/runtime/x86-linux-os.c @@ -38,9 +38,6 @@ #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 @@ -67,30 +64,26 @@ os_context_register_addr(os_context_t *context, int offset) 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 */ } 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) { - /* probably the code snippet - * #ifdef __linux__ - * SET_FPU_CONTROL_WORD(context->__fpregs_mem.cw); - * #endif - * is relevant to implementing this correctly */ - - /* Note that currently this is not called, as there is an analogous - * stub in lisp-land (x86-vm.lisp), also returning 0, with the old - * lisp fp-control code. This is here more as a signpost of a possible - * way of restoring functionality, and if it is the way to go would - * need to be included for other architectures as well. */ - return 0; + return ((((context->uc_mcontext.fpregs->cw) & 0xffff) ^ 0x3f) | + (((context->uc_mcontext.fpregs->sw) & 0xffff) << 16)); } sigset_t * @@ -100,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) { }