0.6.12.3:
[sbcl.git] / src / runtime / x86-linux-os.c
1 /*
2  * The x86 Linux incarnation of arch-dependent OS-dependent routines.
3  * See also linux-os.c
4  */
5
6
7 /* header files lifted wholesale from linux-os.c, some may be redundant */
8
9 #include <stdio.h>
10 #include <sys/param.h>
11 #include <sys/file.h>
12 #include "./signal.h"
13 #include "os.h"
14 #include "arch.h"
15 #include "globals.h"
16 #include "interrupt.h"
17 #include "interr.h"
18 #include "lispregs.h"
19 #include "sbcl.h"
20 #include <sys/socket.h>
21 #include <sys/utsname.h>
22
23 #include <sys/types.h>
24 #include <signal.h>
25 /* #include <sys/sysinfo.h> */
26 #include <sys/time.h>
27 #include <sys/stat.h>
28 #include <unistd.h>
29
30 #include "validate.h"
31 size_t os_vm_page_size;
32
33 #if defined GENCGC
34 #include "gencgc.h"
35 #endif
36
37 /* KLUDGE: As of kernel 2.2.14 on Red Hat 6.2, there's code in the
38  * <sys/ucontext.h> file to define symbolic names for offsets into
39  * gregs[], but it's conditional on __USE_GNU and not defined, so
40  * we need to do this nasty absolute index magic number thing
41  * instead. */
42 register_t *
43 os_context_register_addr(os_context_t *context, int offset)
44 {
45     switch(offset) {
46     case  0: return &context->uc_mcontext.gregs[11]; /* EAX */
47     case  2: return &context->uc_mcontext.gregs[10]; /* ECX */
48     case  4: return &context->uc_mcontext.gregs[9]; /* EDX */
49     case  6: return &context->uc_mcontext.gregs[8]; /* EBX */
50     case  8: return &context->uc_mcontext.gregs[7]; /* ESP */
51     case 10: return &context->uc_mcontext.gregs[6]; /* EBP */
52     case 12: return &context->uc_mcontext.gregs[5]; /* ESI */
53     case 14: return &context->uc_mcontext.gregs[4]; /* EDI */
54     default: return 0;
55     }
56     return &context->uc_mcontext.gregs[offset];
57 }
58 register_t *
59 os_context_pc_addr(os_context_t *context)
60 {
61     return &context->uc_mcontext.gregs[14];
62 }
63 register_t *
64 os_context_sp_addr(os_context_t *context)
65 {
66     return &context->uc_mcontext.gregs[17];
67 }
68
69 sigset_t *
70 os_context_sigmask_addr(os_context_t *context)
71 {
72     return &context->uc_sigmask;
73 }
74
75 void
76 os_flush_icache(os_vm_address_t address, os_vm_size_t length)
77 {
78 }
79