Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 09:14:27

0001 /* -*- mode: C; c-basic-offset: 3; -*- */
0002 
0003 /*--------------------------------------------------------------------*/
0004 /*--- Common defs for s390x                  libvex_s390x_common.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_S390X_H
0030 #define __LIBVEX_PUB_S390X_H
0031 
0032 /* This file includes definitions for s390.
0033 
0034    It must be suitable for inclusion in assembler source files. */
0035 
0036 
0037 /*--------------------------------------------------------------*/
0038 /*--- Dedicated registers                                    ---*/
0039 /*--------------------------------------------------------------*/
0040 
0041 #define S390_REGNO_RETURN_VALUE         2
0042 #define S390_REGNO_TCHAIN_SCRATCH      12
0043 #define S390_REGNO_GUEST_STATE_POINTER 13
0044 #define S390_REGNO_LINK_REGISTER       14
0045 #define S390_REGNO_STACK_POINTER       15
0046 
0047 
0048 /*--------------------------------------------------------------*/
0049 /*--- Offsets in the stack frame allocated by the dispatcher ---*/
0050 /*--------------------------------------------------------------*/
0051 
0052 /* Dispatcher will save 8 FPRs at offsets 160 + 0 ... 160 + 56 */
0053 
0054 /* Where the dispatcher saves the r2 contents. */
0055 #define S390_OFFSET_SAVED_R2 160+72
0056 
0057 /* Where valgrind's FPC register is saved. */
0058 #define S390_OFFSET_SAVED_FPC_V 160+64
0059 
0060 /* Size of frame allocated by VG_(disp_run_translations)
0061    Need size for
0062        8 FPRs
0063      + 1 GPR  (SAVED_R2)
0064      + 1 FPC  (SAVED_FPC_V)
0065 
0066    Additionally, we need a standard frame for helper functions being called
0067    from client code. (See figure 1-16 in zSeries ABI) */
0068 #define S390_INNERLOOP_FRAME_SIZE ((8+1+1)*8 + 160)
0069 
0070 
0071 /*--------------------------------------------------------------*/
0072 /*--- Facility bits                                          ---*/
0073 /*--------------------------------------------------------------*/
0074 
0075 /* The value of the macro is the number of the facility bit as per POP. */
0076 #define S390_FAC_MSA     17  // message-security-assist
0077 #define S390_FAC_LDISP   18  // long displacement
0078 #define S390_FAC_HFPMAS  20  // HFP multiply-and-add-subtract
0079 #define S390_FAC_EIMM    21  // extended immediate
0080 #define S390_FAC_HFPUNX  23  // HFP unnormalized extension
0081 #define S390_FAC_ETF2    24  // ETF2-enhancement
0082 #define S390_FAC_STCKF   25  // store clock fast insn
0083 #define S390_FAC_PENH    26  // parsing-enhancement
0084 #define S390_FAC_ETF3    30  // ETF3-enhancement
0085 #define S390_FAC_XCPUT   31  // extract-CPU-time
0086 #define S390_FAC_GIE     34  // general insn extension
0087 #define S390_FAC_EXEXT   35  // execute extension
0088 #define S390_FAC_FPEXT   37  // floating-point extension
0089 #define S390_FAC_FPSE    41  // floating-point support enhancement
0090 #define S390_FAC_DFP     42  // decimal floating point
0091 #define S390_FAC_PFPO    44  // perform floating point operation insn
0092 #define S390_FAC_HIGHW   45  // high-word extension
0093 #define S390_FAC_LSC     45  // load/store on condition
0094 #define S390_FAC_DFPZC   48  // DFP zoned-conversion
0095 #define S390_FAC_MISC    49  // miscellaneous insn
0096 #define S390_FAC_CTREXE  50  // constrained transactional execution
0097 #define S390_FAC_LSC2    53  // load/store on condition 2 and load and zero rightmost byte
0098 #define S390_FAC_MSA5    57  // message-security-assist 5
0099 #define S390_FAC_MI2     58  // miscellaneous-instruction-extensions 2
0100 #define S390_FAC_TREXE   73  // transactional execution
0101 #define S390_FAC_MSA4    77  // message-security-assist 4
0102 #define S390_FAC_VX      129 // vector facility
0103 #define S390_FAC_VXE     135 // vector enhancements facility 1
0104 #define S390_FAC_VXE2    148 // vector enhancements facility 2
0105 #define S390_FAC_DFLT    151 // deflate-conversion facility
0106 #define S390_FAC_NNPA    165 // NNPA facility
0107 
0108 /*--------------------------------------------------------------*/
0109 /*--- Extensions                                             ---*/
0110 /*--------------------------------------------------------------*/
0111 
0112 /* The extension ID is stored in the low 16 bits of the guest_SYSNO pseudo
0113    register. */
0114 #define S390_EXT_ID_NBITS 16
0115 
0116 #define S390_EXT_PRNO    1
0117 #define S390_EXT_NNPA    2
0118 #define S390_EXT_DFLT    3
0119 #define S390_EXT_STFLE   4
0120 #define S390_EXT_KM      5
0121 #define S390_EXT_KMC     6
0122 #define S390_EXT_KIMD    7
0123 #define S390_EXT_KLMD    8
0124 #define S390_EXT_KMAC    9
0125 #define S390_EXT_PCC    10
0126 #define S390_EXT_KMCTR  11
0127 #define S390_EXT_KMO    12
0128 #define S390_EXT_KMF    13
0129 #define S390_EXT_KMA    14
0130 #define S390_EXT_KDSA   15
0131 
0132 /*--------------------------------------------------------------*/
0133 /*--- Miscellaneous                                          ---*/
0134 /*--------------------------------------------------------------*/
0135 
0136 /* Number of arguments that can be passed in registers */
0137 #define S390_NUM_GPRPARMS 5
0138 
0139 /* Number of double words needed to store all facility bits. */
0140 #define S390_NUM_FACILITY_DW 4
0141 
0142 #endif /* __LIBVEX_PUB_S390X_H */
0143 
0144 /*--------------------------------------------------------------------*/
0145 /*--- end                                    libvex_s390x_common.h ---*/
0146 /*--------------------------------------------------------------------*/