libvex_guest_s390x.h revision 8f943afc22a6a683b78271836c8ddc462b4824a9
1/* -*- 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
11   Copyright IBM Corp. 2010-2011
12
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"
35#include "libvex_emwarn.h"
36
37/*------------------------------------------------------------*/
38/*--- Vex's representation of the s390 CPU state.          ---*/
39/*------------------------------------------------------------*/
40
41typedef struct {
42
43/*------------------------------------------------------------*/
44/*--- ar registers                                         ---*/
45/*------------------------------------------------------------*/
46
47   /*    0 */  UInt guest_a0;
48   /*    4 */  UInt guest_a1;
49   /*    8 */  UInt guest_a2;
50   /*   12 */  UInt guest_a3;
51   /*   16 */  UInt guest_a4;
52   /*   20 */  UInt guest_a5;
53   /*   24 */  UInt guest_a6;
54   /*   28 */  UInt guest_a7;
55   /*   32 */  UInt guest_a8;
56   /*   36 */  UInt guest_a9;
57   /*   40 */  UInt guest_a10;
58   /*   44 */  UInt guest_a11;
59   /*   48 */  UInt guest_a12;
60   /*   52 */  UInt guest_a13;
61   /*   56 */  UInt guest_a14;
62   /*   60 */  UInt guest_a15;
63
64/*------------------------------------------------------------*/
65/*--- fpr registers                                        ---*/
66/*------------------------------------------------------------*/
67
68   /*   64 */  ULong guest_f0;
69   /*   72 */  ULong guest_f1;
70   /*   80 */  ULong guest_f2;
71   /*   88 */  ULong guest_f3;
72   /*   96 */  ULong guest_f4;
73   /*  104 */  ULong guest_f5;
74   /*  112 */  ULong guest_f6;
75   /*  120 */  ULong guest_f7;
76   /*  128 */  ULong guest_f8;
77   /*  136 */  ULong guest_f9;
78   /*  144 */  ULong guest_f10;
79   /*  152 */  ULong guest_f11;
80   /*  160 */  ULong guest_f12;
81   /*  168 */  ULong guest_f13;
82   /*  176 */  ULong guest_f14;
83   /*  184 */  ULong guest_f15;
84
85/*------------------------------------------------------------*/
86/*--- gpr registers                                        ---*/
87/*------------------------------------------------------------*/
88
89   /*  192 */  ULong guest_r0;
90   /*  200 */  ULong guest_r1;
91   /*  208 */  ULong guest_r2;
92   /*  216 */  ULong guest_r3;
93   /*  224 */  ULong guest_r4;
94   /*  232 */  ULong guest_r5;
95   /*  240 */  ULong guest_r6;
96   /*  248 */  ULong guest_r7;
97   /*  256 */  ULong guest_r8;
98   /*  264 */  ULong guest_r9;
99   /*  272 */  ULong guest_r10;
100   /*  280 */  ULong guest_r11;
101   /*  288 */  ULong guest_r12;
102   /*  296 */  ULong guest_r13;
103   /*  304 */  ULong guest_r14;
104   /*  312 */  ULong guest_r15;
105
106/*------------------------------------------------------------*/
107/*--- S390 miscellaneous registers                         ---*/
108/*------------------------------------------------------------*/
109
110   /*  320 */  ULong guest_counter;
111   /*  328 */  UInt guest_fpc;
112   /*  332 */  UChar unused[4]; /* 4-byte hole to get 8-byte alignment */
113   /*  336 */  ULong guest_IA;
114
115/*------------------------------------------------------------*/
116/*--- S390 pseudo registers                                ---*/
117/*------------------------------------------------------------*/
118
119   /*  344 */  ULong guest_SYSNO;
120
121/*------------------------------------------------------------*/
122/*--- 4-word thunk used to calculate the condition code    ---*/
123/*------------------------------------------------------------*/
124
125   /*  352 */  ULong guest_CC_OP;
126   /*  360 */  ULong guest_CC_DEP1;
127   /*  368 */  ULong guest_CC_DEP2;
128   /*  376 */  ULong guest_CC_NDEP;
129
130/*------------------------------------------------------------*/
131/*--- Pseudo registers. Required by all architectures      ---*/
132/*------------------------------------------------------------*/
133
134   /* See comments at bottom of libvex.h */
135   /*  384 */  ULong guest_NRADDR;
136   /*  392 */  ULong guest_TISTART;
137   /*  400 */  ULong guest_TILEN;
138
139   /* Used when backing up to restart a syscall that has
140      been interrupted by a signal. See also comment in
141      libvex_ir.h */
142   /*  408 */  ULong guest_IP_AT_SYSCALL;
143
144   /* Emulation warnings; see comments in libvex_emwarn.h */
145   /*  416 */  UInt guest_EMWARN;
146
147/*------------------------------------------------------------*/
148/*--- Force alignment to 16 bytes                          ---*/
149/*------------------------------------------------------------*/
150   /*  420 */  UChar padding[12];
151
152   /*  432 */  /* This is the size of the guest state */
153} VexGuestS390XState;
154
155
156/*------------------------------------------------------------*/
157/*--- Function prototypes                                  ---*/
158/*------------------------------------------------------------*/
159
160void LibVEX_GuestS390X_initialise(VexGuestS390XState *);
161
162/*------------------------------------------------------------*/
163/*--- Dedicated registers                                  ---*/
164/*------------------------------------------------------------*/
165
166#define guest_LR guest_r14  /* Link register */
167#define guest_SP guest_r15  /* Stack pointer */
168#define guest_FP guest_r11  /* Frame pointer */
169
170/*---------------------------------------------------------------*/
171/*--- end                                libvex_guest_s390x.h ---*/
172/*---------------------------------------------------------------*/
173
174#endif /* __LIBVEX_PUB_GUEST_S390X_H */
175