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>
25 #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 struct thread *arch_os_get_current_thread() {
48 int arch_os_thread_init(struct thread *thread) {
49 return 1; /* success */
51 int arch_os_thread_cleanup(struct thread *thread) {
52 return 1; /* success */
57 os_context_register_t *
58 os_context_register_addr(os_context_t *context, int offset)
60 return &context->uc_mcontext.sc_regs[offset];
63 os_context_register_t *
64 os_context_float_register_addr(os_context_t *context, int offset)
66 return &context->uc_mcontext.sc_fpregs[offset];
69 os_context_register_t *
70 os_context_pc_addr(os_context_t *context)
72 return &((context->uc_mcontext).sc_pc);
76 os_context_sigmask_addr(os_context_t *context)
78 return &context->uc_sigmask;
82 os_context_fp_control(os_context_t *context)
84 return ieee_fpcr_to_swcr((context->uc_mcontext).sc_fpcr);
88 os_restore_fp_control(os_context_t *context)
90 /* FIXME: 0x7E0000 is defined as something useful in constants.h,
91 but without the L, which would probably lead to 32/64-bit
92 errors if we simply used it here. Ugh. CSR, 2003-09-15 */
93 arch_set_fp_control(os_context_fp_control(context) & ~(0x7e0000L));
96 void os_flush_icache(os_vm_address_t address, os_vm_size_t length)
98 asm volatile ("imb" : : : "memory" );