13#include "DebugServer2/Base.h"
14#include "DebugServer2/Constants.h"
22enum { kCPUArchABI64 = 0x01000000U };
31 kCPUTypeAll64 = (kCPUTypeAll | kCPUArchABI64),
40 kCPUTypeI386 = kCPUTypeX86,
41 kCPUTypeX86_64 = (kCPUTypeX86 | kCPUArchABI64),
43 kCPUTypeMIPS64 = (kCPUTypeMIPS | kCPUArchABI64),
47 kCPUTypeHPPA64 = (kCPUTypeHPPA | kCPUArchABI64),
49 kCPUTypeARM64 = (kCPUTypeARM | kCPUArchABI64),
52 kCPUTypeSPARC64 = (kCPUTypeSPARC | kCPUArchABI64),
57 kCPUTypePOWERPC64 = (kCPUTypePOWERPC | kCPUArchABI64),
62 kCPUTypeRISCV32 = 0x5032,
63 kCPUTypeRISCV64 = 0x5064,
64 kCPUTypeRISCV128 = 0x5128,
72 kCPUSubTypeInvalid = (-2),
73 kCPUSubTypeMultiple = (-1),
79 kCPUSubTypeVAX_ALL = 0,
80 kCPUSubTypeVAX780 = 1,
81 kCPUSubTypeVAX785 = 2,
82 kCPUSubTypeVAX750 = 3,
83 kCPUSubTypeVAX730 = 4,
85 kCPUSubTypeUVAXII = 6,
86 kCPUSubTypeVAX8200 = 7,
87 kCPUSubTypeVAX8500 = 8,
88 kCPUSubTypeVAX8600 = 9,
89 kCPUSubTypeVAX8650 = 10,
90 kCPUSubTypeVAX8800 = 11,
91 kCPUSubTypeUVAXIII = 12,
97 kCPUSubTypeROMP_ALL = 0,
99 kCPUSubTypeRT_APC = 2,
100 kCPUSubTypeRT_135 = 3,
106 kCPUSubTypeMC680x0_ALL = 1,
107 kCPUSubTypeMC68030 = 1,
108 kCPUSubTypeMC68040 = 2,
109 kCPUSubTypeMC68030_ONLY = 3,
115#define __CPUSubTypeINTEL(f, m) ((f) + ((m) << 4))
117 kCPUSubTypeI386_ALL = __CPUSubTypeINTEL(3, 0),
118 kCPUSubType386 = __CPUSubTypeINTEL(3, 0),
119 kCPUSubType486 = __CPUSubTypeINTEL(4, 0),
120 kCPUSubType486SX = __CPUSubTypeINTEL(4, 8),
121 kCPUSubType586 = __CPUSubTypeINTEL(5, 0),
122 kCPUSubTypePENT = __CPUSubTypeINTEL(5, 0),
123 kCPUSubTypePENTPRO = __CPUSubTypeINTEL(6, 1),
124 kCPUSubTypePENTII_M3 = __CPUSubTypeINTEL(6, 3),
125 kCPUSubTypePENTII_M5 = __CPUSubTypeINTEL(6, 5),
126 kCPUSubTypeCELERON = __CPUSubTypeINTEL(7, 6),
127 kCPUSubTypeCELERON_MOBILE = __CPUSubTypeINTEL(7, 7),
128 kCPUSubTypePENTIUM_3 = __CPUSubTypeINTEL(8, 0),
129 kCPUSubTypePENTIUM_3_M = __CPUSubTypeINTEL(8, 1),
130 kCPUSubTypePENTIUM_3_XEON = __CPUSubTypeINTEL(8, 2),
131 kCPUSubTypePENTIUM_M = __CPUSubTypeINTEL(9, 0),
132 kCPUSubTypePENTIUM_4 = __CPUSubTypeINTEL(10, 0),
133 kCPUSubTypePENTIUM_4_M = __CPUSubTypeINTEL(10, 1),
134 kCPUSubTypeITANIUM = __CPUSubTypeINTEL(11, 0),
135 kCPUSubTypeITANIUM_2 = __CPUSubTypeINTEL(11, 1),
136 kCPUSubTypeXEON = __CPUSubTypeINTEL(12, 0),
137 kCPUSubTypeXEON_MP = __CPUSubTypeINTEL(12, 1),
139#undef __CPUSubTypeINTEL
145 kCPUSubTypeX86_ALL = 3,
146 kCPUSubTypeX86_64_ALL = 3,
147 kCPUSubTypeX86_ARCH1 = 4,
153 kCPUSubTypeMIPS_ALL = 0,
154 kCPUSubTypeMIPS_R2300 = 1,
155 kCPUSubTypeMIPS_R2600 = 2,
156 kCPUSubTypeMIPS_R2800 = 3,
157 kCPUSubTypeMIPS_R2000 = 4,
158 kCPUSubTypeMIPS_R2000a = 5,
159 kCPUSubTypeMIPS_R3000 = 6,
160 kCPUSubTypeMIPS_R3000a = 7,
166 kCPUSubTypeMC98000_ALL = 0,
167 kCPUSubTypeMC98601 = 1,
173 kCPUSubTypeHPPA_ALL = 0,
174 kCPUSubTypeHPPA_7100 = 0,
175 kCPUSubTypeHPPA_7100LC = 1,
181 kCPUSubTypeMC88000_ALL = 0,
182 kCPUSubTypeMC88100 = 1,
183 kCPUSubTypeMC88110 = 2,
189 kCPUSubTypeSPARC_ALL = 0,
195 kCPUSubTypeI860_ALL = 0,
196 kCPUSubTypeI860_860 = 1,
202 kCPUSubTypePOWERPC_ALL = 0,
203 kCPUSubTypePOWERPC_601 = 1,
204 kCPUSubTypePOWERPC_602 = 2,
205 kCPUSubTypePOWERPC_603 = 3,
206 kCPUSubTypePOWERPC_603e = 4,
207 kCPUSubTypePOWERPC_603ev = 5,
208 kCPUSubTypePOWERPC_604 = 6,
209 kCPUSubTypePOWERPC_604e = 7,
210 kCPUSubTypePOWERPC_620 = 8,
211 kCPUSubTypePOWERPC_750 = 9,
212 kCPUSubTypePOWERPC_7400 = 10,
213 kCPUSubTypePOWERPC_7450 = 11,
214 kCPUSubTypePOWERPC_970 = 100,
220 kCPUSubTypeARM_ALL = 0,
221 kCPUSubTypeARM_V4T = 5,
222 kCPUSubTypeARM_V6 = 6,
223 kCPUSubTypeARM_V5TEJ = 7,
224 kCPUSubTypeARM_XSCALE = 8,
225 kCPUSubTypeARM_V7 = 9,
226 kCPUSubTypeARM_V7F = 10,
227 kCPUSubTypeARM_V7S = 11,
228 kCPUSubTypeARM_V7K = 12,
229 kCPUSubTypeARM_V8 = 13,
230 kCPUSubTypeARM_V6M = 14,
231 kCPUSubTypeARM_V7M = 15,
232 kCPUSubTypeARM_V7EM = 16,
238 kCPUSubTypeARM64_ALL = 0,
239 kCPUSubTypeARM64_V8 = 1,
245 kCPUSubTypeRISCV32_ALL = 0,
251 kCPUSubTypeRISCV64_ALL = 0,
257 kCPSubTypeRISCV128_ALL = 0,
260static inline bool CPUTypeIs64Bit(CPUType type) {
261 return type & kCPUArchABI64 || type == kCPUTypeALPHA ||
262 type == kCPUTypeRISCV64;
265char const *GetCPUTypeName(CPUType type);
266char const *GetArchName(CPUType type, CPUSubType subtype);
267char const *GetArchName(CPUType type, CPUSubType subtype, Endian endian);