File indexing completed on 2025-01-18 10:13:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef __PUB_TOOL_MACHINE_H
0030 #define __PUB_TOOL_MACHINE_H
0031
0032 #include "pub_tool_basics.h" // ThreadID
0033 #include "libvex.h" // VexArchInfo
0034
0035 #if defined(VGP_x86_linux) || defined(VGP_x86_solaris) || defined(VGP_x86_freebsd)
0036 # define VG_MIN_INSTR_SZB 1
0037 # define VG_MAX_INSTR_SZB 16
0038 # define VG_CLREQ_SZB 14
0039
0040 # define VG_STACK_REDZONE_SZB 0
0041
0042 #elif defined(VGP_amd64_linux) || defined(VGP_amd64_solaris) || defined(VGP_amd64_freebsd)
0043 # define VG_MIN_INSTR_SZB 1
0044 # define VG_MAX_INSTR_SZB 16
0045 # define VG_CLREQ_SZB 19
0046 # define VG_STACK_REDZONE_SZB 128
0047
0048 #elif defined(VGP_ppc32_linux)
0049 # define VG_MIN_INSTR_SZB 4
0050 # define VG_MAX_INSTR_SZB 4
0051 # define VG_CLREQ_SZB 20
0052 # define VG_STACK_REDZONE_SZB 0
0053
0054 #elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
0055 # define VG_MIN_INSTR_SZB 4
0056 # define VG_MAX_INSTR_SZB 8
0057 # define VG_CLREQ_SZB 20
0058 # define VG_STACK_REDZONE_SZB 288
0059
0060
0061
0062 #elif defined(VGP_arm_linux)
0063 # define VG_MIN_INSTR_SZB 2
0064 # define VG_MAX_INSTR_SZB 4
0065 # define VG_CLREQ_SZB 20
0066 # define VG_STACK_REDZONE_SZB 0
0067
0068 #elif defined(VGP_arm64_linux)
0069 # define VG_MIN_INSTR_SZB 4
0070 # define VG_MAX_INSTR_SZB 4
0071 # define VG_CLREQ_SZB 20
0072 # define VG_STACK_REDZONE_SZB 0
0073
0074 #elif defined(VGP_s390x_linux)
0075 # define VG_MIN_INSTR_SZB 2
0076 # define VG_MAX_INSTR_SZB 6
0077 # define VG_CLREQ_SZB 10
0078 # define VG_STACK_REDZONE_SZB 0
0079
0080 #elif defined(VGP_x86_darwin)
0081 # define VG_MIN_INSTR_SZB 1
0082 # define VG_MAX_INSTR_SZB 16
0083 # define VG_CLREQ_SZB 14
0084
0085 # define VG_STACK_REDZONE_SZB 0
0086
0087 #elif defined(VGP_amd64_darwin)
0088 # define VG_MIN_INSTR_SZB 1
0089 # define VG_MAX_INSTR_SZB 16
0090 # define VG_CLREQ_SZB 19
0091 # define VG_STACK_REDZONE_SZB 128
0092
0093 #elif defined(VGP_mips32_linux)
0094 # define VG_MIN_INSTR_SZB 4
0095 # define VG_MAX_INSTR_SZB 8
0096 # define VG_CLREQ_SZB 20
0097 # define VG_STACK_REDZONE_SZB 0
0098
0099 #elif defined(VGP_mips64_linux)
0100 # define VG_MIN_INSTR_SZB 4
0101 # define VG_MAX_INSTR_SZB 8
0102 # define VG_CLREQ_SZB 20
0103 # define VG_STACK_REDZONE_SZB 0
0104
0105 #elif defined(VGP_nanomips_linux)
0106 # define VG_MIN_INSTR_SZB 2
0107 # define VG_MAX_INSTR_SZB 6
0108 # define VG_CLREQ_SZB 20
0109 # define VG_STACK_REDZONE_SZB 0
0110
0111 #else
0112 # error Unknown platform
0113 #endif
0114
0115
0116
0117
0118 Addr VG_(get_IP) ( ThreadId tid );
0119 Addr VG_(get_SP) ( ThreadId tid );
0120
0121
0122 Addr VG_(get_SP_s1) ( ThreadId tid );
0123 void VG_(set_SP_s1) ( ThreadId tid, Addr sp );
0124
0125
0126
0127
0128
0129
0130
0131 void
0132 VG_(get_shadow_regs_area) ( ThreadId tid,
0133 UChar* dst,
0134 Int shadowNo, PtrdiffT offset, SizeT size );
0135 void
0136 VG_(set_shadow_regs_area) ( ThreadId tid,
0137 Int shadowNo, PtrdiffT offset, SizeT size,
0138 const UChar* src );
0139
0140
0141
0142
0143
0144
0145 extern void VG_(apply_to_GP_regs)(void (*f)(ThreadId tid,
0146 const HChar* regname, UWord val));
0147
0148
0149
0150
0151 extern void VG_(thread_stack_reset_iter) ( ThreadId* tid );
0152
0153
0154
0155 extern Bool VG_(thread_stack_next) ( ThreadId* tid,
0156 Addr* stack_min,
0157 Addr* stack_max );
0158
0159
0160
0161 extern Addr VG_(thread_get_stack_max) ( ThreadId tid );
0162
0163
0164 extern SizeT VG_(thread_get_stack_size) ( ThreadId tid );
0165
0166
0167
0168 extern Addr VG_(thread_get_altstack_min) ( ThreadId tid );
0169
0170
0171
0172 extern SizeT VG_(thread_get_altstack_size) ( ThreadId tid );
0173
0174
0175
0176
0177
0178 extern void* VG_(fnptr_to_fnentry)( void* );
0179
0180
0181
0182
0183
0184 extern Int VG_(machine_get_size_of_largest_guest_register) ( void );
0185
0186
0187 extern void VG_(machine_get_VexArchInfo)( VexArch*,
0188 VexArchInfo* );
0189
0190 #endif
0191
0192
0193
0194