2 * This is the SPARC Linux incarnation of arch-dependent OS-dependent
3 * routines. See also "linux-os.c".
7 * This software is part of the SBCL system. See the README file for
10 * This software is derived from the CMU CL system, which was
11 * written at Carnegie Mellon University and released into the
12 * public domain. The software is in the public domain and is
13 * provided with absolutely no warranty. See the COPYING and CREDITS
14 * files for more information.
18 #include <sys/param.h>
25 #include "interrupt.h"
28 #include <sys/socket.h>
29 #include <sys/utsname.h>
31 #include <sys/types.h>
38 size_t os_vm_page_size
;
40 #ifdef LISP_FEATURE_SB_THREAD
41 #error "Define threading support functions"
43 int arch_os_thread_init(struct thread
*thread
) {
44 return 1; /* success */
46 int arch_os_thread_cleanup(struct thread
*thread
) {
47 return 1; /* success */
51 os_context_register_t
*
52 os_context_register_addr(os_context_t
*context
, int offset
)
58 } else if (offset
< 16) {
59 return &context
->si_regs
.u_regs
[offset
];
60 } else if (offset
< 32) {
61 int *sp
= (int*) context
->si_regs
.u_regs
[14]; /* Stack Pointer */
62 return &(sp
[offset
-16]);
67 os_context_register_t
*
68 os_context_pc_addr(os_context_t
*context
)
70 return &(context
->si_regs
.pc
);
73 os_context_register_t
*
74 os_context_npc_addr(os_context_t
*context
)
76 return &(context
->si_regs
.npc
);
80 os_context_sigmask_addr(os_context_t
*context
)
82 return &(context
->si_mask
);
86 os_restore_fp_control(os_context_t
*context
)
88 /* Included here, for reference, is an attempt at the PPC
89 variant. If it weren't the case that SPARC/Linux gave a Bus
90 Error on floating point exceptions, something like this would
91 have to be done. -- CSR, 2002-07-13
93 asm ("msfsf $255, %0" : : "m"
94 (os_context_fp_control(context) &
95 ~ (FLOAT_STICKY_BITS_MASK | FLOAT_EXCEPTIONS_BYTE_MASK)));
100 os_flush_icache(os_vm_address_t address
, os_vm_size_t length
)
102 /* This is the same for linux and solaris, so see sparc-assem.S */
103 sparc_flush_icache(address
,length
);