Search
lxdream.org :: lxdream/src/syscall.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/syscall.h
changeset 209:ff67a7b9aa17
prev182:e3b513538548
next561:533f6b478071
author nkeynes
date Tue Dec 19 09:56:09 2006 +0000 (17 years ago)
permissions -rw-r--r--
last change Remove debug_dump call and dump at end of wait_irq
view annotate diff log raw
     1 /**
     2  * $Id: syscall.h,v 1.3 2006-08-07 13:18:16 nkeynes Exp $
     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 dream_syscall_H
    20 #define dream_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
    77 #endif
.