2 * The x86 Linux incarnation of arch-dependent OS-dependent routines.
3 * See also "linux-os.c".
7 * This software is part of the SBCL system. See the README file for
10 * This software is derived from the CMU CL system, which was
11 * written at Carnegie Mellon University and released into the
12 * public domain. The software is in the public domain and is
13 * provided with absolutely no warranty. See the COPYING and CREDITS
14 * files for more information.
18 #include <sys/param.h>
24 #include "interrupt.h"
28 #include <sys/socket.h>
29 #include <sys/utsname.h>
31 #include <sys/types.h>
33 /* #include <sys/sysinfo.h> */
39 size_t os_vm_page_size;
45 /* KLUDGE: As of kernel 2.2.14 on Red Hat 6.2, there's code in the
46 * <sys/ucontext.h> file to define symbolic names for offsets into
47 * gregs[], but it's conditional on __USE_GNU and not defined, so
48 * we need to do this nasty absolute index magic number thing
51 os_context_register_addr(os_context_t *context, int offset)
54 case 0: return &context->uc_mcontext.gregs[11]; /* EAX */
55 case 2: return &context->uc_mcontext.gregs[10]; /* ECX */
56 case 4: return &context->uc_mcontext.gregs[9]; /* EDX */
57 case 6: return &context->uc_mcontext.gregs[8]; /* EBX */
58 case 8: return &context->uc_mcontext.gregs[7]; /* ESP */
59 case 10: return &context->uc_mcontext.gregs[6]; /* EBP */
60 case 12: return &context->uc_mcontext.gregs[5]; /* ESI */
61 case 14: return &context->uc_mcontext.gregs[4]; /* EDI */
64 return &context->uc_mcontext.gregs[offset];
67 os_context_pc_addr(os_context_t *context)
69 return &context->uc_mcontext.gregs[14];
72 os_context_sp_addr(os_context_t *context)
74 return &context->uc_mcontext.gregs[17];
78 os_context_sigmask_addr(os_context_t *context)
80 return &context->uc_sigmask;
84 os_flush_icache(os_vm_address_t address, os_vm_size_t length)