1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/syscall.h Thu Mar 16 12:41:59 2006 +0000
1.5 + * $Id: syscall.h,v 1.1 2006-03-13 12:38:34 nkeynes Exp $
1.7 + * Generic syscall support - ability to add hooks into SH4 code to call out
1.10 + * Copyright (c) 2005 Nathan Keynes.
1.12 + * This program is free software; you can redistribute it and/or modify
1.13 + * it under the terms of the GNU General Public License as published by
1.14 + * the Free Software Foundation; either version 2 of the License, or
1.15 + * (at your option) any later version.
1.17 + * This program is distributed in the hope that it will be useful,
1.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.20 + * GNU General Public License for more details.
1.22 +#ifndef dream_syscall_H
1.23 +#define dream_syscall_H 1
1.25 +#include <stdint.h>
1.26 +#include <glib/gtypes.h>
1.33 +typedef void (*syscall_hook_func_t)( uint32_t hook_id );
1.37 + * Define a new hook without an indirect vector
1.39 +void syscall_add_hook( uint32_t hook_id, syscall_hook_func_t hook );
1.42 + * Define a new hook which indirects through the specified vector address
1.43 + * (which must be somewhere in main SH4 ram).
1.45 +void syscall_add_hook_vector( uint32_t hook_id, uint32_t vector_addr,
1.46 + syscall_hook_func_t hook );
1.49 + * Invoke a syscall from the SH4
1.51 +void syscall_invoke( uint32_t hook_id );
1.54 + * Repatch all syscall vectors (eg in case of system reset)
1.56 +void syscall_repatch_vectors( );
1.58 +/************************ Standard syscall hacks ************************/
1.61 + * Install the BIOS emu hack into ram (sets the vectors at 8C0000B0 through
1.64 +void bios_install( void );
1.67 + * Install the DCLoad syscall hack
1.69 +void dcload_install( void );