1.0.37.57: better DEFMETHOD pretty-printing
[sbcl/pkhuong.git] / src / runtime / hppa-hpux-os.c
blob166baf3a9c48e83368da46770c997e1d9f3f1cb6
1 /*
2 * This is the HPPA HPUX incarnation of arch-dependent OS-dependent
3 * routines. See also "hppa-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 "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>
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"
38 size_t os_vm_page_size;
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 */
46 int arch_os_thread_cleanup(struct thread *thread) {
47 return 1; /* success */
49 #endif
51 /* for hpux read /usr/include/machine/save_state.h
52 * os_context_register_addr() may not be used
53 * to modify registers without setting a state-flag too */
54 os_context_register_t *
55 os_context_register_addr(os_context_t *context, int offset)
57 return (os_context_register_t *)
58 ((unsigned int)(&((ucontext_t *) context)->uc_mcontext.ss_wide.ss_64)) + (offset * 2) + 1;
61 os_context_register_t *
62 os_context_pc_addr(os_context_t *context)
64 /* Why do I get all the silly ports? -- CSR, 2002-08-11 */
65 return ((unsigned int) &((ucontext_t *) context)->uc_mcontext.ss_wide.ss_64.ss_pcoq_head + 4);
68 os_context_register_t *
69 os_context_npc_addr(os_context_t *context)
71 return ((unsigned int) &((ucontext_t *) context)->uc_mcontext.ss_wide.ss_64.ss_pcoq_tail + 4);
74 sigset_t *
75 os_context_sigmask_addr(os_context_t *context)
77 return &(((ucontext_t *)context)->uc_subcontext.__uc_sigmask);
80 void
81 os_restore_fp_control(os_context_t *context)
83 /* FIXME: Probably do something. */
86 void
87 os_flush_icache(os_vm_address_t address, os_vm_size_t length)
89 /* FIXME: Maybe this is OK. */
90 sanctify_for_execution(address,length);