Search
lxdream.org :: lxdream/src/syscall.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/syscall.h
changeset 102:844a3f2a76ff
next182:e3b513538548
author nkeynes
date Tue Mar 14 11:44:29 2006 +0000 (18 years ago)
permissions -rw-r--r--
last change Add elf loader suppt
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/syscall.h Tue Mar 14 11:44:29 2006 +0000
1.3 @@ -0,0 +1,71 @@
1.4 +/**
1.5 + * $Id: syscall.h,v 1.1 2006-03-13 12:38:34 nkeynes Exp $
1.6 + *
1.7 + * Generic syscall support - ability to add hooks into SH4 code to call out
1.8 + * to the emu.
1.9 + *
1.10 + * Copyright (c) 2005 Nathan Keynes.
1.11 + *
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.16 + *
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.21 + */
1.22 +#ifndef dream_syscall_H
1.23 +#define dream_syscall_H 1
1.24 +
1.25 +#include <stdint.h>
1.26 +#include <glib/gtypes.h>
1.27 +
1.28 +#ifdef __cplusplus
1.29 +extern "C" {
1.30 +#endif
1.31 +
1.32 +
1.33 +typedef void (*syscall_hook_func_t)( uint32_t hook_id );
1.34 +
1.35 +
1.36 +/**
1.37 + * Define a new hook without an indirect vector
1.38 + */
1.39 +void syscall_add_hook( uint32_t hook_id, syscall_hook_func_t hook );
1.40 +
1.41 +/**
1.42 + * Define a new hook which indirects through the specified vector address
1.43 + * (which must be somewhere in main SH4 ram).
1.44 + */
1.45 +void syscall_add_hook_vector( uint32_t hook_id, uint32_t vector_addr,
1.46 + syscall_hook_func_t hook );
1.47 +
1.48 +/**
1.49 + * Invoke a syscall from the SH4
1.50 + */
1.51 +void syscall_invoke( uint32_t hook_id );
1.52 +
1.53 +/**
1.54 + * Repatch all syscall vectors (eg in case of system reset)
1.55 + */
1.56 +void syscall_repatch_vectors( );
1.57 +
1.58 +/************************ Standard syscall hacks ************************/
1.59 +
1.60 +/**
1.61 + * Install the BIOS emu hack into ram (sets the vectors at 8C0000B0 through
1.62 + * 8C0000C0)
1.63 + */
1.64 +void bios_install( void );
1.65 +
1.66 +/**
1.67 + * Install the DCLoad syscall hack
1.68 + */
1.69 +void dcload_install( void );
1.70 +
1.71 +#ifdef __cplusplus
1.72 +}
1.73 +#endif
1.74 +#endif
.