filename | src/syscall.h |
changeset | 736:a02d1475ccfd |
prev | 561:533f6b478071 |
next | 1014:f5914b2fd0db |
author | nkeynes |
date | Sat Dec 27 02:59:35 2008 +0000 (15 years ago) |
branch | lxdream-mem |
permissions | -rw-r--r-- |
last change | Replace fpscr_mask/fpscr flags in xlat_cache_block with a single xlat_sh4_mode, which tracks the field of the same name in sh4r - actually a little faster this way. Now depends on SR.MD, FPSCR.PR and FPSCR.SZ (although it doesn't benefit from the SR flag yet). Also fixed the failure to check the flags in the common case (code address returned by previous block) which took away the performance benefits, but oh well. |
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 #ifdef __cplusplus
75 }
76 #endif
78 #endif /* !lxdream_syscall_H */
.