Reduce pinned object table size, part 1 of 2.
[sbcl.git] / src / runtime / alpha-linux-os.c
blob7781821e2076094ca8373ab59ee8f94b3710b981
1 /*
2 * This is the Compaq/Digital Alpha Linux incarnation of
3 * arch-dependent OS-dependent routines. See also "linux-os.c". */
5 /*
6 * This software is part of the SBCL system. See the README file for
7 * more information.
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 */
18 #include <stdio.h>
19 #include <sys/param.h>
20 #include <sys/file.h>
21 #include "sbcl.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 <sys/socket.h>
30 #include <sys/utsname.h>
32 #include <sys/types.h>
33 #include <signal.h>
34 #include <sys/time.h>
35 #include <sys/stat.h>
36 #include <unistd.h>
37 #include <asm/fpu.h>
39 #include "validate.h"
40 size_t os_vm_page_size;
42 #ifdef LISP_FEATURE_SB_THREAD
43 #error "Define threading support functions"
44 #else
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 */
51 #endif
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);
72 sigset_t *
73 os_context_sigmask_addr(os_context_t *context)
75 return &context->uc_sigmask;
78 unsigned long
79 os_context_fp_control(os_context_t *context)
81 return ieee_fpcr_to_swcr((context->uc_mcontext).sc_fpcr);
84 void
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 */
98 ~(0x1UL<<6));
101 void os_flush_icache(os_vm_address_t address, os_vm_size_t length)
103 asm volatile ("imb" : : : "memory" );