0.7.7.9:
[sbcl.git] / src / runtime / hppa-linux-os.c
1 /*
2  * This is the HPPA Linux incarnation of arch-dependent OS-dependent
3  * routines. See also "linux-os.c".
4  */
5
6 /*
7  * This software is part of the SBCL system. See the README file for
8  * more information.
9  *
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.
15  */
16
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>
30
31 #include <sys/types.h>
32 #include <signal.h>
33 #include <sys/time.h>
34 #include <sys/stat.h>
35 #include <unistd.h>
36
37 #include "validate.h"
38 size_t os_vm_page_size;
39
40
41 os_context_register_t   *
42 os_context_register_addr(os_context_t *context, int offset)
43 {
44     if (offset == 0) {
45         /* KLUDGE: I'm not sure, but it's possible that Linux puts the
46            contents of the Processor Status Word in the (wired-zero)
47            slot in the mcontext. In any case, the following is
48            unlikely to do any harm: */
49         static int zero;
50         zero = 0;
51         return &zero;
52     } else {
53         return &(((struct sigcontext *) &(context->uc_mcontext))->sc_gr[offset]);
54     }
55 }
56
57 os_context_register_t *
58 os_context_pc_addr(os_context_t *context)
59 {
60     /* Why do I get all the silly ports? -- CSR, 2002-08-11 */
61     return &(((struct sigcontext *) &(context->uc_mcontext))->sc_iaoq[0]);
62 }
63
64 os_context_register_t *
65 os_context_npc_addr(os_context_t *context)
66 {
67     return &(((struct sigcontext *) &(context->uc_mcontext))->sc_iaoq[1]);
68 }
69
70 sigset_t *
71 os_context_sigmask_addr(os_context_t *context)
72 {
73     return &(context->uc_sigmask);
74 }
75
76 void 
77 os_restore_fp_control(os_context_t *context)
78 {
79     /* FIXME: Probably do something. */
80 }
81
82 void 
83 os_flush_icache(os_vm_address_t address, os_vm_size_t length)
84 {
85     /* FIXME: Maybe this is OK. */
86     sanctify_for_execution(address,length);
87 }