filename | src/syscall.h |
changeset | 1014:f5914b2fd0db |
prev | 736:a02d1475ccfd |
next | 1100:50e702af9373 |
author | nkeynes |
date | Sun Jul 05 13:54:48 2009 +1000 (14 years ago) |
permissions | -rw-r--r-- |
last change | No-op merge lxdream-mem to tip to remove head (Long since merged in actuality) |
view | annotate | diff | log | raw |
1 /**
2 * $Id$
3 *
4 * Generic syscall support - ability to add hooks into SH4 code to call out
5 * to the emu.
6 *
7 * Copyright (c) 2005 Nathan Keynes.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19 #ifndef lxdream_syscall_H
20 #define lxdream_syscall_H 1
22 #include <stdint.h>
23 #include <glib/gtypes.h>
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
30 typedef void (*syscall_hook_func_t)( uint32_t hook_id );
33 /**
34 * Define a new hook without an indirect vector
35 */
36 void syscall_add_hook( uint32_t hook_id, syscall_hook_func_t hook );
38 /**
39 * Define a new hook which indirects through the specified vector address
40 * (which must be somewhere in main SH4 ram).
41 */
42 void syscall_add_hook_vector( uint32_t hook_id, uint32_t vector_addr,
43 syscall_hook_func_t hook );
45 /**
46 * Invoke a syscall from the SH4
47 */
48 void syscall_invoke( uint32_t hook_id );
50 /**
51 * Repatch all syscall vectors (eg in case of system reset)
52 */
53 void syscall_repatch_vectors( );
55 /************************ Standard syscall hacks ************************/
57 /**
58 * Install the BIOS emu hack into ram (sets the vectors at 8C0000B0 through
59 * 8C0000C0)
60 */
61 void bios_install( void );
63 /**
64 * Install the DCLoad syscall hack
65 */
66 void dcload_install( void );
68 /**
69 * Set the flag that indicates whether the dcload exit() syscall will be
70 * honoured by exiting the VM.
71 */
72 void dcload_set_allow_unsafe( gboolean allow );
74 #define IS_SYSCALL(pc) (((uint32_t)pc)>=0xFFFFFF00)
76 #ifdef __cplusplus
77 }
78 #endif
80 #endif /* !lxdream_syscall_H */
.