Fix make-array transforms.
[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 "sbcl.h"
21 #include "./signal.h"
22 #include "os.h"
23 #include "arch.h"
24 #include "globals.h"
25 #include "interrupt.h"
26 #include "interr.h"
27 #include "lispregs.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 #ifdef LISP_FEATURE_SB_THREAD
41 #error "Define threading support functions"
42 #else
43 int arch_os_thread_init(struct thread *thread) {
44     return 1;                  /* success */
45 }
46 int arch_os_thread_cleanup(struct thread *thread) {
47     return 1;                  /* success */
48 }
49 #endif
50
51 os_context_register_t   *
52 os_context_register_addr(os_context_t *context, int offset)
53 {
54     if (offset == 0) {
55         /* KLUDGE: I'm not sure, but it's possible that Linux puts the
56            contents of the Processor Status Word in the (wired-zero)
57            slot in the mcontext. In any case, the following is
58            unlikely to do any harm: */
59         static int zero;
60         zero = 0;
61         return &zero;
62     } else {
63         return &(((struct sigcontext *) &(context->uc_mcontext))->sc_gr[offset]);
64     }
65 }
66
67 os_context_register_t *
68 os_context_pc_addr(os_context_t *context)
69 {
70     /* Why do I get all the silly ports? -- CSR, 2002-08-11 */
71     return &(((struct sigcontext *) &(context->uc_mcontext))->sc_iaoq[0]);
72 }
73
74 os_context_register_t *
75 os_context_npc_addr(os_context_t *context)
76 {
77     return &(((struct sigcontext *) &(context->uc_mcontext))->sc_iaoq[1]);
78 }
79
80 sigset_t *
81 os_context_sigmask_addr(os_context_t *context)
82 {
83     return &(context->uc_sigmask);
84 }
85
86 void
87 os_restore_fp_control(os_context_t *context)
88 {
89     /* FIXME: Probably do something. */
90 }
91
92 void
93 os_flush_icache(os_vm_address_t address, os_vm_size_t length)
94 {
95     /* FIXME: Maybe this is OK. */
96     sanctify_for_execution(address,length);
97 }