0.7.11.10:
[sbcl/lichteblau.git] / src / runtime / sparc-sunos-os.c
blob469c5a04bde81618d28d16b77c46b26754f6e8cc
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 "./signal.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"
27 #include "sbcl.h"
28 #include <sys/socket.h>
29 #include <sys/utsname.h>
31 #include <sys/types.h>
32 #include <signal.h>
33 #include <sys/time.h>
34 #include <sys/stat.h>
35 #include <unistd.h>
37 #include "validate.h"
40 os_context_register_t *
41 os_context_register_addr(os_context_t *context, int offset)
43 if (offset == 0) {
44 static int zero;
45 zero = 0;
46 return &zero;
47 } else if (offset < 16) {
48 return &context->uc_mcontext.gregs[offset+3];
49 } else if (offset < 32) {
50 /* FIXME: You know, this (int *) stuff looks decidedly
51 dubious */
52 int *sp = (int*) context->uc_mcontext.gregs[REG_SP];
53 return &(sp[offset-16]);
54 } else {
55 return 0;
59 os_context_register_t *
60 os_context_pc_addr(os_context_t *context)
62 return &(context->uc_mcontext.gregs[REG_PC]);
65 os_context_register_t *
66 os_context_npc_addr(os_context_t *context)
68 return &(context->uc_mcontext.gregs[REG_nPC]);
71 sigset_t *
72 os_context_sigmask_addr(os_context_t *context)
74 return &(context->uc_sigmask);
77 unsigned long
78 os_context_fp_control(os_context_t *context)
80 return (context->uc_mcontext.fpregs.fpu_fsr);
83 void os_flush_icache(os_vm_address_t address, os_vm_size_t length)
85 /* see sparc-assem.S */
86 sparc_flush_icache(address, length);