f50e0d4d82df5ba9be0b62adc50ae08889454b44
[sbcl.git] / src / runtime / arch.h
1 /*
2  * This software is part of the SBCL system. See the README file for
3  * more information.
4  *
5  * This software is derived from the CMU CL system, which was
6  * written at Carnegie Mellon University and released into the
7  * public domain. The software is in the public domain and is
8  * provided with absolutely no warranty. See the COPYING and CREDITS
9  * files for more information.
10  */
11
12 #ifndef __ARCH_H__
13 #define __ARCH_H__
14
15 #include "os.h"
16 #include "signal.h"
17 #include "thread.h"
18
19 /* Do anything we need to do when starting up the runtime environment
20  * on this architecture. */
21 extern void arch_init(void);
22
23 /* FIXME: It would be good to document these too! */
24 extern void arch_skip_instruction(os_context_t*);
25 extern boolean arch_pseudo_atomic_atomic(os_context_t*);
26 extern void arch_set_pseudo_atomic_interrupted(os_context_t*);
27 extern void arch_clear_pseudo_atomic_interrupted(os_context_t*);
28 extern os_vm_address_t arch_get_bad_addr(int, siginfo_t*, os_context_t*);
29 extern unsigned char *arch_internal_error_arguments(os_context_t*);
30 extern unsigned int arch_install_breakpoint(void *pc);
31 extern void arch_remove_breakpoint(void *pc, unsigned int orig_inst);
32 extern void arch_install_interrupt_handlers(void);
33 extern void arch_do_displaced_inst(os_context_t *context,
34                                    unsigned int orig_inst);
35
36 extern int arch_os_thread_init(struct thread *thread);
37 extern int arch_os_thread_cleanup(struct thread *thread);
38
39 extern lispobj funcall0(lispobj function);
40 extern lispobj funcall1(lispobj function, lispobj arg0);
41 extern lispobj funcall2(lispobj function, lispobj arg0, lispobj arg1);
42 extern lispobj funcall3(lispobj function, lispobj arg0, lispobj arg1,
43                         lispobj arg2);
44 extern lispobj *component_ptr_from_pc(lispobj *pc);
45
46 extern void fpu_save(void *);
47 extern void fpu_restore(void *);
48
49 #ifdef LISP_FEATURE_X86
50 extern unsigned int * single_stepping;
51 extern void restore_breakpoint_from_single_step(os_context_t * context);
52 #endif
53
54 extern void arch_handle_breakpoint(os_context_t* context);
55 extern void arch_handle_fun_end_breakpoint(os_context_t *context);
56 #ifdef trap_AfterBreakpoint
57 extern void arch_handle_after_breakpoint(os_context_t *context);
58 #endif
59 #ifdef trap_SingleStepAround
60 extern void arch_handle_single_step_trap(os_context_t *context, int trap);
61 #endif
62
63 #endif /* __ARCH_H__ */