0.7.6.12:
[sbcl.git] / src / runtime / alpha-osf1-os.c
1 /*
2  * This is the Compaq/Digital Alpha Linux incarnation of
3  * arch-dependent OS-dependent routines. See also "linux-os.c".  */
4
5 /*
6  * This software is part of the SBCL system. See the README file for
7  * more information.
8  *
9  * This software is derived from the CMU CL system, which was
10  * written at Carnegie Mellon University and released into the
11  * public domain. The software is in the public domain and is
12  * provided with absolutely no warranty. See the COPYING and CREDITS
13  * files for more information.
14  */
15
16 /* Some of these header files may be redundant. -- Dan Barlow
17  * ca. 2001-05-01 */
18
19 #include <stdio.h>
20 #include <sys/param.h>
21 #include <sys/file.h>
22 #include "./signal.h"
23 #include "os.h"
24 #include "arch.h"
25 #include "globals.h"
26 #include "interrupt.h"
27 #include "interr.h"
28 #include "lispregs.h"
29 #include "sbcl.h"
30 #include <sys/socket.h>
31 #include <sys/utsname.h>
32
33 #include <sys/types.h>
34 #include <signal.h>
35 #include <sys/time.h>
36 #include <sys/stat.h>
37 #include <unistd.h>
38 #include <c_asm.h>
39 #include <ucontext.h>
40
41 #include "validate.h"
42 size_t os_vm_page_size;
43
44
45 os_context_register_t   *
46 os_context_register_addr(os_context_t *context, int offset)
47 {
48     return &context->uc_mcontext.sc_regs[offset];
49 }
50
51 os_context_register_t *
52 os_context_float_register_addr(os_context_t *context, int offset)
53 {
54     return &context->uc_mcontext.sc_fpregs[offset];
55 }
56
57 os_context_register_t *
58 os_context_pc_addr(os_context_t *context)
59 {
60     return &((context->uc_mcontext).sc_pc);
61 }
62
63 sigset_t *
64 os_context_sigmask_addr(os_context_t *context)
65 {
66     return &context->uc_sigmask;
67 }
68
69 unsigned long
70 os_context_fp_control(os_context_t *context)
71 {
72     return 0; /* FIXME */
73     /* ieee_fpcr_to_swcr((context->uc_mcontext).sc_fpcr); */
74 }
75
76
77 void os_flush_icache(os_vm_address_t address, os_vm_size_t length)
78 {
79 #ifdef __GNUC__
80     asm volatile ("imb" : : : "memory" ); 
81 #else
82     /* digital CC has different syntax */
83     asm("imb");
84 #endif
85 }