Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:13:29

0001 /* -*- mode: C; c-basic-offset: 3; -*- */
0002 
0003 /*---------------------------------------------------------------*/
0004 /*--- begin                              libvex_guest_s390x.h ---*/
0005 /*---------------------------------------------------------------*/
0006 
0007 /*
0008    This file is part of Valgrind, a dynamic binary instrumentation
0009    framework.
0010 
0011    Copyright IBM Corp. 2010-2017
0012 
0013    This program is free software; you can redistribute it and/or
0014    modify it under the terms of the GNU General Public License as
0015    published by the Free Software Foundation; either version 2 of the
0016    License, or (at your option) any later version.
0017 
0018    This program is distributed in the hope that it will be useful, but
0019    WITHOUT ANY WARRANTY; without even the implied warranty of
0020    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0021    General Public License for more details.
0022 
0023    You should have received a copy of the GNU General Public License
0024    along with this program; if not, see <http://www.gnu.org/licenses/>.
0025 
0026    The GNU General Public License is contained in the file COPYING.
0027 */
0028 
0029 #ifndef __LIBVEX_PUB_GUEST_S390X_H
0030 #define __LIBVEX_PUB_GUEST_S390X_H
0031 
0032 #include "libvex_basictypes.h"
0033 
0034 /*------------------------------------------------------------*/
0035 /*--- Vex's representation of the s390 CPU state.          ---*/
0036 /*------------------------------------------------------------*/
0037 
0038 typedef struct {
0039 
0040 /*------------------------------------------------------------*/
0041 /*--- ar registers                                         ---*/
0042 /*------------------------------------------------------------*/
0043 
0044    /*    0 */  UInt guest_a0;
0045    /*    4 */  UInt guest_a1;
0046    /*    8 */  UInt guest_a2;
0047    /*   12 */  UInt guest_a3;
0048    /*   16 */  UInt guest_a4;
0049    /*   20 */  UInt guest_a5;
0050    /*   24 */  UInt guest_a6;
0051    /*   28 */  UInt guest_a7;
0052    /*   32 */  UInt guest_a8;
0053    /*   36 */  UInt guest_a9;
0054    /*   40 */  UInt guest_a10;
0055    /*   44 */  UInt guest_a11;
0056    /*   48 */  UInt guest_a12;
0057    /*   52 */  UInt guest_a13;
0058    /*   56 */  UInt guest_a14;
0059    /*   60 */  UInt guest_a15;
0060 
0061 /*------------------------------------------------------------*/
0062 /*--- fpr & vr registers                                   ---*/
0063 /*------------------------------------------------------------*/
0064 
0065    /*
0066       FPRs[0-15] are mapped to the first double words of VR's[0-15].
0067       According to documentation if we modify fpr1 with FP insn then the content of vr1's 64..128
0068       bits is unpredictable. If we modify 64..128 of vr1 then fpr1's value is unpredictable too.
0069       In our implementation writing to one half of vr doesn't affect another part but
0070       apllications shouldn't rely on it.
0071    */
0072 
0073    /*   64 */  V128 guest_v0;
0074    /*   80 */  V128 guest_v1;
0075    /*   96 */  V128 guest_v2;
0076    /*  112 */  V128 guest_v3;
0077    /*  128 */  V128 guest_v4;
0078    /*  144 */  V128 guest_v5;
0079    /*  160 */  V128 guest_v6;
0080    /*  176 */  V128 guest_v7;
0081    /*  192 */  V128 guest_v8;
0082    /*  208 */  V128 guest_v9;
0083    /*  224 */  V128 guest_v10;
0084    /*  240 */  V128 guest_v11;
0085    /*  256 */  V128 guest_v12;
0086    /*  272 */  V128 guest_v13;
0087    /*  288 */  V128 guest_v14;
0088    /*  304 */  V128 guest_v15;
0089    /*  320 */  V128 guest_v16;
0090    /*  336 */  V128 guest_v17;
0091    /*  352 */  V128 guest_v18;
0092    /*  368 */  V128 guest_v19;
0093    /*  384 */  V128 guest_v20;
0094    /*  400 */  V128 guest_v21;
0095    /*  416 */  V128 guest_v22;
0096    /*  432 */  V128 guest_v23;
0097    /*  448 */  V128 guest_v24;
0098    /*  464 */  V128 guest_v25;
0099    /*  480 */  V128 guest_v26;
0100    /*  496 */  V128 guest_v27;
0101    /*  512 */  V128 guest_v28;
0102    /*  528 */  V128 guest_v29;
0103    /*  544 */  V128 guest_v30;
0104    /*  560 */  V128 guest_v31;
0105 
0106 /*------------------------------------------------------------*/
0107 /*--- gpr registers                                        ---*/
0108 /*------------------------------------------------------------*/
0109 
0110    /*  576 */  ULong guest_r0;
0111    /*  584 */  ULong guest_r1;
0112    /*  592 */  ULong guest_r2;
0113    /*  600 */  ULong guest_r3;
0114    /*  608 */  ULong guest_r4;
0115    /*  616 */  ULong guest_r5;
0116    /*  624 */  ULong guest_r6;
0117    /*  632 */  ULong guest_r7;
0118    /*  640 */  ULong guest_r8;
0119    /*  648 */  ULong guest_r9;
0120    /*  656 */  ULong guest_r10;
0121    /*  664 */  ULong guest_r11;
0122    /*  672 */  ULong guest_r12;
0123    /*  680 */  ULong guest_r13;
0124    /*  688 */  ULong guest_r14;
0125    /*  696 */  ULong guest_r15;
0126 
0127 /*------------------------------------------------------------*/
0128 /*--- S390 miscellaneous registers                         ---*/
0129 /*------------------------------------------------------------*/
0130 
0131    /*  704 */  ULong guest_counter;
0132    /*  712 */  UInt guest_fpc;
0133    /*  716 */  UChar unused[4]; /* 4-byte hole to get 8-byte alignment */
0134    /*  720 */  ULong guest_IA;
0135 
0136 /*------------------------------------------------------------*/
0137 /*--- S390 pseudo registers                                ---*/
0138 /*------------------------------------------------------------*/
0139 
0140    /*  728 */  ULong guest_SYSNO;
0141 
0142 /*------------------------------------------------------------*/
0143 /*--- 4-word thunk used to calculate the condition code    ---*/
0144 /*------------------------------------------------------------*/
0145 
0146    /*  736 */  ULong guest_CC_OP;
0147    /*  744 */  ULong guest_CC_DEP1;
0148    /*  752 */  ULong guest_CC_DEP2;
0149    /*  760 */  ULong guest_CC_NDEP;
0150 
0151 /*------------------------------------------------------------*/
0152 /*--- Pseudo registers. Required by all architectures      ---*/
0153 /*------------------------------------------------------------*/
0154 
0155    /* See comments at bottom of libvex.h */
0156    /*  768 */  ULong guest_NRADDR;
0157    /*  776 */  ULong guest_CMSTART;
0158    /*  784 */  ULong guest_CMLEN;
0159 
0160    /* Used when backing up to restart a syscall that has
0161       been interrupted by a signal. See also comment in
0162       libvex_ir.h */
0163    /*  792 */  ULong guest_IP_AT_SYSCALL;
0164 
0165    /* Emulation notes; see comments in libvex_emnote.h */
0166    /*  800 */  UInt guest_EMNOTE;
0167 
0168    /* For translation chaining */
0169    /*  804 */  UInt  host_EvC_COUNTER;
0170    /*  808 */  ULong host_EvC_FAILADDR;
0171 
0172 /*------------------------------------------------------------*/
0173 /*--- Force alignment to 16 bytes                          ---*/
0174 /*------------------------------------------------------------*/
0175    /*  816 */  UChar padding[0];
0176 
0177    /*  816 */  /* This is the size of the guest state */
0178 } VexGuestS390XState;
0179 
0180 
0181 /*------------------------------------------------------------*/
0182 /*--- Function prototypes                                  ---*/
0183 /*------------------------------------------------------------*/
0184 
0185 void LibVEX_GuestS390X_initialise(VexGuestS390XState *);
0186 
0187 /*------------------------------------------------------------*/
0188 /*--- Dedicated registers                                  ---*/
0189 /*------------------------------------------------------------*/
0190 
0191 #define guest_LR guest_r14  /* Link register */
0192 #define guest_SP guest_r15  /* Stack pointer */
0193 #define guest_FP guest_r11  /* Frame pointer */
0194 
0195 /*---------------------------------------------------------------*/
0196 /*--- end                                libvex_guest_s390x.h ---*/
0197 /*---------------------------------------------------------------*/
0198 
0199 #endif /* __LIBVEX_PUB_GUEST_S390X_H */