Search
lxdream.org :: lxdream/src/syscall.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/syscall.h
changeset 1100:50e702af9373
prev1014:f5914b2fd0db
next1296:30ecee61f811
author nkeynes
date Sun Mar 04 20:56:40 2012 +1000 (12 years ago)
permissions -rw-r--r--
last change Add support for armv7-a abi and make it the default - it's a good bit faster
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 void bios_boot( uint32_t syscallid );
    65 /**
    66  * Install the DCLoad syscall hack
    67  */
    68 void dcload_install( void );
    70 /**
    71  * Set the flag that indicates whether the dcload exit() syscall will be
    72  * honoured by exiting the VM.
    73  */
    74 void dcload_set_allow_unsafe( gboolean allow );
    76 #define IS_SYSCALL(pc)  (((uint32_t)pc)>=0xFFFFFF00)
    78 #ifdef __cplusplus
    79 }
    80 #endif
    82 #endif /* !lxdream_syscall_H */
.