Fix vector-push-extend expansion for strings.
[sbcl.git] / src / runtime / sparc-linux-os.c
blob65a101d66d714b5e9f8e3666ef04c0c2e9ae2a1d
1 /*
2 * This is the SPARC Linux incarnation of arch-dependent OS-dependent
3 * routines. See also "linux-os.c".
4 */
6 /*
7 * This software is part of the SBCL system. See the README file for
8 * more information.
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.
17 #include <stdio.h>
18 #include <sys/param.h>
19 #include <sys/file.h>
20 #include "genesis/sbcl.h"
21 #include "os.h"
22 #include "arch.h"
23 #include "globals.h"
24 #include "interrupt.h"
25 #include "interr.h"
26 #include "lispregs.h"
28 #include <sys/types.h>
29 #include <signal.h>
30 #include <sys/time.h>
31 #include <sys/stat.h>
32 #include <unistd.h>
34 #include "validate.h"
36 #ifdef LISP_FEATURE_SB_THREAD
37 #error "Define threading support functions"
38 #else
39 int arch_os_thread_init(struct thread *thread) {
40 return 1; /* success */
42 int arch_os_thread_cleanup(struct thread *thread) {
43 return 1; /* success */
45 #endif
47 os_context_register_t *
48 os_context_register_addr(os_context_t *context, int offset)
50 if (offset == 0) {
51 static int zero;
52 zero = 0;
53 return (os_context_register_t*)&zero;
54 } else if (offset < 16) {
55 return &context->si_regs.u_regs[offset];
56 } else if (offset < 32) {
57 unsigned int *sp = (unsigned int*) context->si_regs.u_regs[14]; /* Stack Pointer */
58 return &(sp[offset-16]);
59 } else
60 return 0;
63 os_context_register_t *
64 os_context_npc_addr(os_context_t *context)
66 return &(context->si_regs.npc);
69 sigset_t *
70 os_context_sigmask_addr(os_context_t *context)
72 return (sigset_t*)&(context->si_mask);
75 void
76 os_restore_fp_control(os_context_t *context)
78 /* Included here, for reference, is an attempt at the PPC
79 variant. If it weren't the case that SPARC/Linux gave a Bus
80 Error on floating point exceptions, something like this would
81 have to be done. -- CSR, 2002-07-13
83 asm ("msfsf $255, %0" : : "m"
84 (os_context_fp_control(context) &
85 ~ (FLOAT_STICKY_BITS_MASK | FLOAT_EXCEPTIONS_BYTE_MASK)));
89 void
90 os_flush_icache(os_vm_address_t address, os_vm_size_t length)
92 /* This is the same for linux and solaris, so see sparc-assem.S */
93 extern void sparc_flush_icache(os_vm_address_t,os_vm_size_t);
94 sparc_flush_icache(address,length);