/usr/include/valgrind/libvex_guest_arm.h is in valgrind 1:3.13.0-2ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | /*---------------------------------------------------------------*/
/*--- begin libvex_guest_arm.h ---*/
/*---------------------------------------------------------------*/
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright (C) 2004-2017 OpenWorks LLP
info@open-works.net
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
The GNU General Public License is contained in the file COPYING.
*/
#ifndef __LIBVEX_PUB_GUEST_ARM_H
#define __LIBVEX_PUB_GUEST_ARM_H
#include "libvex_basictypes.h"
/*---------------------------------------------------------------*/
/*--- Vex's representation of the ARM CPU state. ---*/
/*---------------------------------------------------------------*/
typedef
struct {
/* 0 */
/* Event check fail addr and counter. */
UInt host_EvC_FAILADDR; /* 0 */
UInt host_EvC_COUNTER; /* 4 */
UInt guest_R0;
UInt guest_R1;
UInt guest_R2;
UInt guest_R3;
UInt guest_R4;
UInt guest_R5;
UInt guest_R6;
UInt guest_R7;
UInt guest_R8;
UInt guest_R9;
UInt guest_R10;
UInt guest_R11;
UInt guest_R12;
UInt guest_R13; /* stack pointer */
UInt guest_R14; /* link register */
UInt guest_R15T;
/* program counter[31:1] ++ [T], encoding both the current
instruction address and the ARM vs Thumb state of the
machine. T==1 is Thumb, T==0 is ARM. Hence values of the
form X--(31)--X1 denote a Thumb instruction at location
X--(31)--X0, values of the form X--(30)--X00 denote an ARM
instruction at precisely that address, and values of the form
X--(30)--10 are invalid since they would imply an ARM
instruction at a non-4-aligned address. */
/* 4-word thunk used to calculate N(sign) Z(zero) C(carry,
unsigned overflow) and V(signed overflow) flags. */
/* 72 */
UInt guest_CC_OP;
UInt guest_CC_DEP1;
UInt guest_CC_DEP2;
UInt guest_CC_NDEP;
/* A 32-bit value which is used to compute the APSR.Q (sticky
saturation) flag, when necessary. If the value stored here
is zero, APSR.Q is currently zero. If it is any other value,
APSR.Q is currently one. */
UInt guest_QFLAG32;
/* 32-bit values to represent APSR.GE0 .. GE3. Same
zero-vs-nonzero scheme as for QFLAG32. */
UInt guest_GEFLAG0;
UInt guest_GEFLAG1;
UInt guest_GEFLAG2;
UInt guest_GEFLAG3;
/* Various pseudo-regs mandated by Vex or Valgrind. */
/* Emulation notes */
UInt guest_EMNOTE;
/* For clinval/clflush: record start and length of area */
UInt guest_CMSTART;
UInt guest_CMLEN;
/* Used to record the unredirected guest address at the start of
a translation whose start has been redirected. By reading
this pseudo-register shortly afterwards, the translation can
find out what the corresponding no-redirection address was.
Note, this is only set for wrap-style redirects, not for
replace-style ones. */
UInt guest_NRADDR;
/* Needed for Darwin (but mandated for all guest architectures):
program counter at the last syscall insn (int 0x80/81/82,
sysenter, syscall, svc). Used when backing up to restart a
syscall that has been interrupted by a signal. */
/* 124 */
UInt guest_IP_AT_SYSCALL;
/* VFP state. D0 .. D15 must be 8-aligned. */
/* 128 */
ULong guest_D0;
ULong guest_D1;
ULong guest_D2;
ULong guest_D3;
ULong guest_D4;
ULong guest_D5;
ULong guest_D6;
ULong guest_D7;
ULong guest_D8;
ULong guest_D9;
ULong guest_D10;
ULong guest_D11;
ULong guest_D12;
ULong guest_D13;
ULong guest_D14;
ULong guest_D15;
ULong guest_D16;
ULong guest_D17;
ULong guest_D18;
ULong guest_D19;
ULong guest_D20;
ULong guest_D21;
ULong guest_D22;
ULong guest_D23;
ULong guest_D24;
ULong guest_D25;
ULong guest_D26;
ULong guest_D27;
ULong guest_D28;
ULong guest_D29;
ULong guest_D30;
ULong guest_D31;
UInt guest_FPSCR;
/* Not a town in Cornwall, but instead the TPIDRURO, on of the
Thread ID registers present in CP15 (the system control
coprocessor), register set "c13", register 3 (the User
Read-only Thread ID Register). arm-linux apparently uses it
to hold the TLS pointer for the thread. It's read-only in
user space. On Linux it is set in user space by various
thread-related syscalls. */
UInt guest_TPIDRURO;
/* Representation of the Thumb IT state. ITSTATE is a 32-bit
value with 4 8-bit lanes. [7:0] pertain to the next insn to
execute, [15:8] for the one after that, etc. The per-insn
update to ITSTATE is to unsignedly shift it right 8 bits,
hence introducing a zero byte for the furthest ahead
instruction. As per the next para, a zero byte denotes the
condition ALWAYS.
Each byte lane has one of the two following formats:
cccc 0001 for an insn which is part of an IT block. cccc is
the guarding condition (standard ARM condition
code) XORd with 0xE, so as to cause 'cccc == 0'
to encode the condition ALWAYS.
0000 0000 for an insn which is not part of an IT block.
If the bottom 4 bits are zero then the top 4 must be too.
Given the byte lane for an instruction, the guarding
condition for the instruction is (((lane >> 4) & 0xF) ^ 0xE).
This is not as stupid as it sounds, because the front end
elides the shift. And the am-I-in-an-IT-block check is
(lane != 0).
In the case where (by whatever means) we know at JIT time
that an instruction is not in an IT block, we can prefix its
IR with assignments ITSTATE = 0 and hence have iropt fold out
the testing code.
The condition "is outside or last in IT block" corresponds
to the top 24 bits of ITSTATE being zero.
*/
UInt guest_ITSTATE;
/* Padding to make it have an 16-aligned size */
UInt padding1;
}
VexGuestARMState;
/*---------------------------------------------------------------*/
/*--- Utility functions for ARM guest stuff. ---*/
/*---------------------------------------------------------------*/
/* ALL THE FOLLOWING ARE VISIBLE TO LIBRARY CLIENT */
/* Initialise all guest ARM state. */
extern
void LibVEX_GuestARM_initialise ( /*OUT*/VexGuestARMState* vex_state );
/* Calculate the ARM flag state from the saved data. */
extern
UInt LibVEX_GuestARM_get_cpsr ( /*IN*/const VexGuestARMState* vex_state );
#endif /* ndef __LIBVEX_PUB_GUEST_ARM_H */
/*---------------------------------------------------------------*/
/*--- libvex_guest_arm.h ---*/
/*---------------------------------------------------------------*/
|