Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-07 08:53:40

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 3 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 /*--- Extensions                                             ---*/
0073 /*--------------------------------------------------------------*/
0074 
0075 /* The extension ID is stored in the low 16 bits of the guest_SYSNO pseudo
0076    register. */
0077 #define S390_EXT_ID_NBITS 16
0078 
0079 #define S390_EXT_PRNO    1
0080 #define S390_EXT_NNPA    2
0081 #define S390_EXT_DFLT    3
0082 #define S390_EXT_STFLE   4
0083 #define S390_EXT_KM      5
0084 #define S390_EXT_KMC     6
0085 #define S390_EXT_KIMD    7
0086 #define S390_EXT_KLMD    8
0087 #define S390_EXT_KMAC    9
0088 #define S390_EXT_PCC    10
0089 #define S390_EXT_KMCTR  11
0090 #define S390_EXT_KMO    12
0091 #define S390_EXT_KMF    13
0092 #define S390_EXT_KMA    14
0093 #define S390_EXT_KDSA   15
0094 
0095 /*--------------------------------------------------------------*/
0096 /*--- Miscellaneous                                          ---*/
0097 /*--------------------------------------------------------------*/
0098 
0099 /* Number of arguments that can be passed in registers */
0100 #define S390_NUM_GPRPARMS 5
0101 
0102 /* Number of double words needed to store all facility bits. */
0103 #define S390_NUM_FACILITY_DW 4
0104 
0105 #endif /* __LIBVEX_PUB_S390X_H */
0106 
0107 /*--------------------------------------------------------------------*/
0108 /*--- end                                    libvex_s390x_common.h ---*/
0109 /*--------------------------------------------------------------------*/