sewardj | d584f8f | 2004-11-22 16:02:34 +0000 | [diff] [blame^] | 1 | |
| 2 | /*---------------------------------------------------------------*/ |
| 3 | /*--- ---*/ |
| 4 | /*--- This file (libvex_guest_arm.h) is ---*/ |
| 5 | /*--- Copyright (c) 2004 OpenWorks LLP. All rights reserved. ---*/ |
| 6 | /*--- ---*/ |
| 7 | /*---------------------------------------------------------------*/ |
| 8 | |
| 9 | /* |
| 10 | This file is part of LibVEX, a library for dynamic binary |
| 11 | instrumentation and translation. |
| 12 | |
| 13 | Copyright (C) 2004 OpenWorks, LLP. |
| 14 | |
| 15 | This program is free software; you can redistribute it and/or modify |
| 16 | it under the terms of the GNU General Public License as published by |
| 17 | the Free Software Foundation; Version 2 dated June 1991 of the |
| 18 | license. |
| 19 | |
| 20 | This program is distributed in the hope that it will be useful, |
| 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or liability |
| 23 | for damages. See the GNU General Public License for more details. |
| 24 | |
| 25 | Neither the names of the U.S. Department of Energy nor the |
| 26 | University of California nor the names of its contributors may be |
| 27 | used to endorse or promote products derived from this software |
| 28 | without prior written permission. |
| 29 | |
| 30 | You should have received a copy of the GNU General Public License |
| 31 | along with this program; if not, write to the Free Software |
| 32 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 33 | USA. |
| 34 | */ |
| 35 | |
| 36 | #ifndef __LIBVEX_PUB_GUEST_ARM_H |
| 37 | #define __LIBVEX_PUB_GUEST_ARM_H |
| 38 | |
| 39 | #include "libvex_basictypes.h" |
| 40 | |
| 41 | /*---------------------------------------------------------------*/ |
| 42 | /*--- Vex's representation of the ARM CPU state. ---*/ |
| 43 | /*---------------------------------------------------------------*/ |
| 44 | |
| 45 | typedef |
| 46 | struct { |
| 47 | UInt guest_R0; |
| 48 | UInt guest_R1; |
| 49 | UInt guest_R2; |
| 50 | UInt guest_R3; |
| 51 | UInt guest_R4; |
| 52 | UInt guest_R5; |
| 53 | UInt guest_R6; |
| 54 | UInt guest_R7; |
| 55 | UInt guest_R8; |
| 56 | UInt guest_R9; |
| 57 | UInt guest_R10; |
| 58 | UInt guest_R11; |
| 59 | UInt guest_R12; |
| 60 | UInt guest_R13; |
| 61 | UInt guest_R14; |
| 62 | |
| 63 | UInt guest_R15; |
| 64 | |
| 65 | UInt guest_PSW; |
| 66 | |
| 67 | /* Padding to make it have an 8-aligned size */ |
| 68 | /* UInt padding; */ |
| 69 | } |
| 70 | VexGuestARMState; |
| 71 | |
| 72 | |
| 73 | |
| 74 | /*---------------------------------------------------------------*/ |
| 75 | /*--- Utility functions for arm guest stuff. ---*/ |
| 76 | /*---------------------------------------------------------------*/ |
| 77 | |
| 78 | #if 0 |
| 79 | /* ALL THE FOLLOWING ARE VISIBLE TO LIBRARY CLIENT */ |
| 80 | |
| 81 | /* Initialise all guest x86 state. The FPU is put in default mode. */ |
| 82 | extern |
| 83 | void LibVEX_GuestX86_initialise ( /*OUT*/VexGuestX86State* vex_state ); |
| 84 | |
| 85 | |
| 86 | /* Convert a saved x87 FPU image (as created by fsave) and write it |
| 87 | into the supplied VexGuestX86State structure. The non-FP parts of |
| 88 | said structure are left unchanged. |
| 89 | */ |
| 90 | extern |
| 91 | void LibVEX_GuestX86_put_x87 ( /*IN*/UChar* x87_state, |
| 92 | /*OUT*/VexGuestX86State* vex_state ); |
| 93 | |
| 94 | /* Extract from the supplied VexGuestX86State structure, an x87 FPU |
| 95 | image. */ |
| 96 | extern |
| 97 | void LibVEX_GuestX86_get_x87 ( /*IN*/VexGuestX86State* vex_state, |
| 98 | /*OUT*/UChar* x87_state ); |
| 99 | |
| 100 | |
| 101 | /* Given a 32-bit word containing native x86 %eflags values, set the |
| 102 | eflag-related fields in the supplied VexGuestX86State accordingly. |
| 103 | All other fields are left unchanged. */ |
| 104 | |
| 105 | extern |
| 106 | void LibVEX_GuestX86_put_eflags ( UInt eflags_native, |
| 107 | /*OUT*/VexGuestX86State* vex_state ); |
| 108 | |
| 109 | /* Extract from the supplied VexGuestX86State structure the |
| 110 | corresponding native %eflags value. */ |
| 111 | |
| 112 | extern |
| 113 | UInt LibVEX_GuestX86_get_eflags ( /*IN*/VexGuestX86State* vex_state ); |
| 114 | #endif /* 0 */ |
| 115 | |
| 116 | #endif /* ndef __LIBVEX_PUB_GUEST_ARM_H */ |
| 117 | |
| 118 | /*---------------------------------------------------------------*/ |
| 119 | /*--- libvex_guest_arm.h ---*/ |
| 120 | /*---------------------------------------------------------------*/ |