Delete a ton of cruft from the globaldb initialization logic.
[sbcl.git] / src / runtime / x86-64-sunos-os.c
blob2b3e37433b26cfedbfa26a4bf88f820828060a75
1 #include <stdio.h>
2 #include <sys/param.h>
3 #include <sys/file.h>
4 #include "sbcl.h"
5 #include "./signal.h"
6 #include "os.h"
7 #include "arch.h"
8 #include "globals.h"
9 #include "interrupt.h"
10 #include "interr.h"
11 #include "lispregs.h"
12 #include <sys/socket.h>
13 #include <sys/utsname.h>
15 #include <sys/types.h>
16 #include <signal.h>
17 #include <sys/time.h>
18 #include <sys/stat.h>
19 #include <unistd.h>
21 #ifdef LISP_FEATURE_SB_THREAD
22 #error "Threading is not supported for Solaris running on x86-64."
23 #endif
25 #include "validate.h"
28 int arch_os_thread_init(struct thread *thread) {
29 stack_t sigstack;
30 return 1;
33 int arch_os_thread_cleanup(struct thread *thread) {
34 return 1;
38 os_context_register_t *
39 os_context_register_addr(os_context_t *context, int offset)
41 #define RCASE(name) case reg_ ## name: return &context->uc_mcontext.gregs[REG_ ## name];
42 switch(offset) {
43 RCASE(RAX)
44 RCASE(RCX)
45 RCASE(RDX)
46 RCASE(RBX)
47 RCASE(RSP)
48 RCASE(RBP)
49 RCASE(RSI)
50 RCASE(RDI)
51 RCASE(R8)
52 RCASE(R9)
53 RCASE(R10)
54 RCASE(R11)
55 RCASE(R12)
56 RCASE(R13)
57 RCASE(R14)
58 RCASE(R15)
59 default:
60 if(offset<NGREG)
61 return &context->uc_mcontext.gregs[offset/2+4];
62 else return 0;
64 return &context->uc_mcontext.gregs[offset];
67 os_context_register_t *
68 os_context_pc_addr(os_context_t *context)
70 return &context->uc_mcontext.gregs[REG_RIP];
73 os_context_register_t *
74 os_context_sp_addr(os_context_t *context)
76 return &context->uc_mcontext.gregs[REG_RSP];
79 sigset_t *
80 os_context_sigmask_addr(os_context_t *context)
82 return &(context->uc_sigmask);
85 void os_flush_icache(os_vm_address_t address, os_vm_size_t length)
89 unsigned long
90 os_context_fp_control(os_context_t *context)
92 return context->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw;