blob: 49ce571b6b6ed5c7563a1342cd41b5f5fb07240d [file] [log] [blame]
sewardjd584f8f2004-11-22 16:02:34 +00001
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
45typedef
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
sewardje77b88b2004-11-24 11:22:31 +000067 UInt guest_SYSCALLNO;
68
sewardjd584f8f2004-11-22 16:02:34 +000069 /* Padding to make it have an 8-aligned size */
70 /* UInt padding; */
71 }
72 VexGuestARMState;
73
74
75
76/*---------------------------------------------------------------*/
77/*--- Utility functions for arm guest stuff. ---*/
78/*---------------------------------------------------------------*/
79
80#if 0
81/* ALL THE FOLLOWING ARE VISIBLE TO LIBRARY CLIENT */
82
83/* Initialise all guest x86 state. The FPU is put in default mode. */
84extern
85void LibVEX_GuestX86_initialise ( /*OUT*/VexGuestX86State* vex_state );
86
87
88/* Convert a saved x87 FPU image (as created by fsave) and write it
89 into the supplied VexGuestX86State structure. The non-FP parts of
90 said structure are left unchanged.
91*/
92extern
93void LibVEX_GuestX86_put_x87 ( /*IN*/UChar* x87_state,
94 /*OUT*/VexGuestX86State* vex_state );
95
96/* Extract from the supplied VexGuestX86State structure, an x87 FPU
97 image. */
98extern
99void LibVEX_GuestX86_get_x87 ( /*IN*/VexGuestX86State* vex_state,
100 /*OUT*/UChar* x87_state );
101
102
103/* Given a 32-bit word containing native x86 %eflags values, set the
104 eflag-related fields in the supplied VexGuestX86State accordingly.
105 All other fields are left unchanged. */
106
107extern
108void LibVEX_GuestX86_put_eflags ( UInt eflags_native,
109 /*OUT*/VexGuestX86State* vex_state );
110
111/* Extract from the supplied VexGuestX86State structure the
112 corresponding native %eflags value. */
113
114extern
115UInt LibVEX_GuestX86_get_eflags ( /*IN*/VexGuestX86State* vex_state );
116#endif /* 0 */
117
118#endif /* ndef __LIBVEX_PUB_GUEST_ARM_H */
119
120/*---------------------------------------------------------------*/
121/*--- libvex_guest_arm.h ---*/
122/*---------------------------------------------------------------*/