2 * This is the Compaq/Digital Alpha Linux incarnation of
3 * arch-dependent OS-dependent routines. See also "linux-os.c". */
6 * This software is part of the SBCL system. See the README file for
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.
16 /* These header files were lifted wholesale from linux-os.c, some may
17 * be redundant. -- Dan Barlow ca. 2001-05-01 */
19 #include <sys/param.h>
26 #include "interrupt.h"
29 #include <sys/socket.h>
30 #include <sys/utsname.h>
32 #include <sys/types.h>
40 size_t os_vm_page_size
;
42 #ifdef LISP_FEATURE_SB_THREAD
43 #error "Define threading support functions"
45 int arch_os_thread_init(struct thread
*thread
) {
46 return 1; /* success */
48 int arch_os_thread_cleanup(struct thread
*thread
) {
49 return 1; /* success */
54 os_context_register_t
*
55 os_context_register_addr(os_context_t
*context
, int offset
)
57 return &context
->uc_mcontext
.sc_regs
[offset
];
60 os_context_register_t
*
61 os_context_float_register_addr(os_context_t
*context
, int offset
)
63 return &context
->uc_mcontext
.sc_fpregs
[offset
];
66 os_context_register_t
*
67 os_context_pc_addr(os_context_t
*context
)
69 return &((context
->uc_mcontext
).sc_pc
);
73 os_context_sigmask_addr(os_context_t
*context
)
75 return &context
->uc_sigmask
;
79 os_context_fp_control(os_context_t
*context
)
81 return ieee_fpcr_to_swcr((context
->uc_mcontext
).sc_fpcr
);
85 os_restore_fp_control(os_context_t
*context
)
87 /* FIXME: 0x7E0000 is defined as something useful in constants.h,
88 but without the UL, which would probably lead to 32/64-bit
89 errors if we simply used it here. Ugh. CSR, 2003-09-15 */
90 arch_set_fp_control(os_context_fp_control(context
) & ~(0x7e0000UL
) &
91 /* KLUDGE: for some reason that I don't
92 understand, by the time we get here the
93 "enable denormalized traps" bit in the fp
94 control word is set. Since we really don't
95 want to tra every time someone types
96 LEAST-POSITIVE-SINGLE-FLOAT into the repl,
97 mask that bit out. -- CSR, 2003-09-15 */
101 void os_flush_icache(os_vm_address_t address
, os_vm_size_t length
)
103 asm volatile ("imb" : : : "memory" );