blob: 8cf0919c64df1227508f0d94cd433a546ab15cf1 [file] [log] [blame]
sewardj2019a972011-03-07 16:04:07 +00001/* -*- mode: C; c-basic-offset: 3; -*- */
2
3/*---------------------------------------------------------------*/
4/*--- begin libvex_guest_s390x.h ---*/
5/*---------------------------------------------------------------*/
6
7/*
8 This file is part of Valgrind, a dynamic binary instrumentation
9 framework.
10
Elliott Hughesed398002017-06-21 14:41:24 -070011 Copyright IBM Corp. 2010-2017
sewardj2019a972011-03-07 16:04:07 +000012
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 02110-1301, USA.
27
28 The GNU General Public License is contained in the file COPYING.
29*/
30
31#ifndef __LIBVEX_PUB_GUEST_S390X_H
32#define __LIBVEX_PUB_GUEST_S390X_H
33
34#include "libvex_basictypes.h"
sewardj2019a972011-03-07 16:04:07 +000035
36/*------------------------------------------------------------*/
37/*--- Vex's representation of the s390 CPU state. ---*/
38/*------------------------------------------------------------*/
39
40typedef struct {
41
42/*------------------------------------------------------------*/
43/*--- ar registers ---*/
44/*------------------------------------------------------------*/
45
46 /* 0 */ UInt guest_a0;
47 /* 4 */ UInt guest_a1;
48 /* 8 */ UInt guest_a2;
49 /* 12 */ UInt guest_a3;
50 /* 16 */ UInt guest_a4;
51 /* 20 */ UInt guest_a5;
52 /* 24 */ UInt guest_a6;
53 /* 28 */ UInt guest_a7;
54 /* 32 */ UInt guest_a8;
55 /* 36 */ UInt guest_a9;
56 /* 40 */ UInt guest_a10;
57 /* 44 */ UInt guest_a11;
58 /* 48 */ UInt guest_a12;
59 /* 52 */ UInt guest_a13;
60 /* 56 */ UInt guest_a14;
61 /* 60 */ UInt guest_a15;
62
63/*------------------------------------------------------------*/
64/*--- fpr registers ---*/
65/*------------------------------------------------------------*/
66
67 /* 64 */ ULong guest_f0;
68 /* 72 */ ULong guest_f1;
69 /* 80 */ ULong guest_f2;
70 /* 88 */ ULong guest_f3;
71 /* 96 */ ULong guest_f4;
72 /* 104 */ ULong guest_f5;
73 /* 112 */ ULong guest_f6;
74 /* 120 */ ULong guest_f7;
75 /* 128 */ ULong guest_f8;
76 /* 136 */ ULong guest_f9;
77 /* 144 */ ULong guest_f10;
78 /* 152 */ ULong guest_f11;
79 /* 160 */ ULong guest_f12;
80 /* 168 */ ULong guest_f13;
81 /* 176 */ ULong guest_f14;
82 /* 184 */ ULong guest_f15;
83
84/*------------------------------------------------------------*/
85/*--- gpr registers ---*/
86/*------------------------------------------------------------*/
87
88 /* 192 */ ULong guest_r0;
89 /* 200 */ ULong guest_r1;
90 /* 208 */ ULong guest_r2;
91 /* 216 */ ULong guest_r3;
92 /* 224 */ ULong guest_r4;
93 /* 232 */ ULong guest_r5;
94 /* 240 */ ULong guest_r6;
95 /* 248 */ ULong guest_r7;
96 /* 256 */ ULong guest_r8;
97 /* 264 */ ULong guest_r9;
98 /* 272 */ ULong guest_r10;
99 /* 280 */ ULong guest_r11;
100 /* 288 */ ULong guest_r12;
101 /* 296 */ ULong guest_r13;
102 /* 304 */ ULong guest_r14;
103 /* 312 */ ULong guest_r15;
104
105/*------------------------------------------------------------*/
106/*--- S390 miscellaneous registers ---*/
107/*------------------------------------------------------------*/
108
109 /* 320 */ ULong guest_counter;
110 /* 328 */ UInt guest_fpc;
florianb3940762011-10-22 23:18:00 +0000111 /* 332 */ UChar unused[4]; /* 4-byte hole to get 8-byte alignment */
sewardj2019a972011-03-07 16:04:07 +0000112 /* 336 */ ULong guest_IA;
113
114/*------------------------------------------------------------*/
115/*--- S390 pseudo registers ---*/
116/*------------------------------------------------------------*/
117
118 /* 344 */ ULong guest_SYSNO;
119
120/*------------------------------------------------------------*/
121/*--- 4-word thunk used to calculate the condition code ---*/
122/*------------------------------------------------------------*/
123
124 /* 352 */ ULong guest_CC_OP;
125 /* 360 */ ULong guest_CC_DEP1;
126 /* 368 */ ULong guest_CC_DEP2;
127 /* 376 */ ULong guest_CC_NDEP;
128
129/*------------------------------------------------------------*/
130/*--- Pseudo registers. Required by all architectures ---*/
131/*------------------------------------------------------------*/
132
133 /* See comments at bottom of libvex.h */
134 /* 384 */ ULong guest_NRADDR;
sewardj05f5e012014-05-04 10:52:11 +0000135 /* 392 */ ULong guest_CMSTART;
136 /* 400 */ ULong guest_CMLEN;
sewardj2019a972011-03-07 16:04:07 +0000137
138 /* Used when backing up to restart a syscall that has
139 been interrupted by a signal. See also comment in
140 libvex_ir.h */
141 /* 408 */ ULong guest_IP_AT_SYSCALL;
142
florian6ef84be2012-08-26 03:20:07 +0000143 /* Emulation notes; see comments in libvex_emnote.h */
144 /* 416 */ UInt guest_EMNOTE;
sewardj2019a972011-03-07 16:04:07 +0000145
florian8844a632012-04-13 04:04:06 +0000146 /* For translation chaining */
147 /* 420 */ UInt host_EvC_COUNTER;
148 /* 424 */ ULong host_EvC_FAILADDR;
149
sewardj2019a972011-03-07 16:04:07 +0000150/*------------------------------------------------------------*/
florian95a487b2014-02-14 08:55:32 +0000151/*--- Force alignment to 16 bytes ---*/
sewardj2019a972011-03-07 16:04:07 +0000152/*------------------------------------------------------------*/
florian95a487b2014-02-14 08:55:32 +0000153 /* 432 */ UChar padding[0];
sewardj2019a972011-03-07 16:04:07 +0000154
florian95a487b2014-02-14 08:55:32 +0000155 /* 432 */ /* This is the size of the guest state */
sewardj2019a972011-03-07 16:04:07 +0000156} VexGuestS390XState;
157
158
159/*------------------------------------------------------------*/
160/*--- Function prototypes ---*/
161/*------------------------------------------------------------*/
162
163void LibVEX_GuestS390X_initialise(VexGuestS390XState *);
164
165/*------------------------------------------------------------*/
166/*--- Dedicated registers ---*/
167/*------------------------------------------------------------*/
168
sewardj60687882014-01-15 10:25:21 +0000169#define guest_LR guest_r14 /* Link register */
170#define guest_SP guest_r15 /* Stack pointer */
171#define guest_FP guest_r11 /* Frame pointer */
sewardj2019a972011-03-07 16:04:07 +0000172
173/*---------------------------------------------------------------*/
174/*--- end libvex_guest_s390x.h ---*/
175/*---------------------------------------------------------------*/
176
177#endif /* __LIBVEX_PUB_GUEST_S390X_H */