4 * Generic syscall support - ability to add hooks into SH4 code to call out
7 * Copyright (c) 2005 Nathan Keynes.
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.
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.
19 #ifndef lxdream_syscall_H
20 #define lxdream_syscall_H 1
23 #include <glib/gtypes.h>
30 typedef void (*syscall_hook_func_t)( uint32_t hook_id );
34 * Define a new hook without an indirect vector
36 void syscall_add_hook( uint32_t hook_id, syscall_hook_func_t hook );
39 * Define a new hook which indirects through the specified vector address
40 * (which must be somewhere in main SH4 ram).
42 void syscall_add_hook_vector( uint32_t hook_id, uint32_t vector_addr,
43 syscall_hook_func_t hook );
46 * Invoke a syscall from the SH4
48 void syscall_invoke( uint32_t hook_id );
51 * Repatch all syscall vectors (eg in case of system reset)
53 void syscall_repatch_vectors( );
55 /************************ Standard syscall hacks ************************/
58 * Install the BIOS emu hack into ram (sets the vectors at 8C0000B0 through
61 void bios_install( void );
64 * Install the DCLoad syscall hack
66 void dcload_install( void );
69 * Set the flag that indicates whether the dcload exit() syscall will be
70 * honoured by exiting the VM.
72 void dcload_set_allow_unsafe( gboolean allow );
74 #define IS_SYSCALL(pc) (((uint32_t)pc)>=0xFFFFFF00)
80 #endif /* !lxdream_syscall_H */
.