Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1227 lines
37 KiB

  1. /*
  2. * Copyright (c) 2000, Intel Corporation
  3. * All rights reserved.
  4. *
  5. * WARRANTY DISCLAIMER
  6. *
  7. * THESE MATERIALS ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  10. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
  11. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  12. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  13. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  14. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  15. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
  16. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THESE
  17. * MATERIALS, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  18. *
  19. * Intel Corporation is the author of the Materials, and requests that all
  20. * problem reports or change requests be submitted to it directly at
  21. * http://developer.intel.com/opensource.
  22. */
  23. #ifndef EM_H
  24. #define EM_H
  25. /*** UPDATED TO 2.6 draft ***/
  26. #include "iel.h"
  27. #include "EM_hints.h"
  28. /*****************************************************************************/
  29. /*** ***/
  30. /*** Enhanced mode architecture constants and macros ***/
  31. /*** ***/
  32. /*** NOTE: this header files assumes that the following typedef's exist: ***/
  33. /*** U8, U16, U32, U64. iel.h contains these typedefs, but one ***/
  34. /*** may want to define them differently. ***/
  35. /*** ***/
  36. /*****************************************************************************/
  37. #define EM_BUNDLE_SIZE 16
  38. #define EM_SYLLABLE_BITS 41
  39. #define EM_DISPERSAL_POS 0
  40. #define EM_DISPERSAL_BITS 5
  41. #define EM_SBIT_POS 0
  42. #define EM_TEMPLATE_POS 1
  43. #define EM_TEMPLATE_BITS 4
  44. #define EM_NUM_OF_TEMPLATES (1<<EM_TEMPLATE_BITS)
  45. /*** including the reserved!!! ***/
  46. #define EM_SYL2_POS (EM_DISPERSAL_POS+EM_DISPERSAL_BITS)
  47. #define EM_MAJOR_OPCODE_POS 37
  48. #define EM_MAJOR_OPCODE_BITS 4
  49. #define EM_PREDICATE_POS 0
  50. #define EM_PREDICATE_BITS 6
  51. #define EM_IL_SLOT_BITS 4
  52. #define EM_IL_SLOTS_MASK32 ((1<<EM_IL_SLOT_BITS)-1)
  53. typedef enum
  54. {
  55. EM_SLOT_0=0,
  56. EM_SLOT_1=1,
  57. EM_SLOT_2=2,
  58. EM_SLOT_LAST=3
  59. } EM_slot_num_t;
  60. /****************************************************************************/
  61. /*** the following macros needs iel. Bundle assumed to be in U128 ***/
  62. /*** Bring syllable binary to bits 0-40 of Syl; DO NOT mask off bits 41 ***/
  63. /*** and on (for movl, can use Slot=2 but then Maj.Op. is in bits 79-82!) ***/
  64. #define EM_GET_SYLLABLE(syl,bundle,slot) \
  65. IEL_SHR((syl), (bundle), EM_SYL2_POS+(slot)*EM_SYLLABLE_BITS)
  66. #define EM_GET_TEMPLATE(bundle) \
  67. ((IEL_GETDW0(bundle) >> EM_TEMPLATE_POS) & ((1<<EM_TEMPLATE_BITS)-1))
  68. #define EM_TEMPLATE_IS_RESERVED(templt) \
  69. (((templt)==3)||((templt)==10)||((templt)==13)||((templt)==15))
  70. #define EM_IL_GET_BUNDLE_ADDRESS(il,addr) \
  71. IEL_CONVERT2((addr),IEL_GETDW0(il) & \
  72. (unsigned int)(~EM_IL_SLOTS_MASK32), \
  73. IEL_GETDW1(il))
  74. #define EM_IL_GET_SLOT_NO(il) (IEL_GETDW0(il) & EM_IL_SLOTS_MASK32)
  75. #define EM_IL_SET(il,addr,slot) \
  76. IEL_CONVERT2((il), IEL_GETDW0(addr) | (slot), IEL_GETDW1(addr))
  77. #define EM_IS_IGNORED_SQUARE(template_role, major_opcode) \
  78. (((template_role) == EM_TROLE_BR) && \
  79. (major_opcode == 3 || major_opcode == 6) ? 1 : 0)
  80. #define EM_IS_GENERIC_INST(impls_flag) \
  81. ((impls_flag == ArchRev0) || (impls_flag & Impl_Brl))
  82. #define EM_IS_ITANIUM_INST(impls_flag) \
  83. (EM_IS_GENERIC_INST(impls_flag) || (impls_flag & Impl_Ipref) || (impls_flag & Impl_Itanium))
  84. /*****************************************************************************/
  85. typedef U64 EM_IL; /* Instruction (syllable) Location */
  86. typedef enum em_branch_type_s
  87. {
  88. EM_branch_type_none = 0x0,
  89. EM_branch_type_direct_cond = 0x1,
  90. EM_branch_type_direct_wexit = 0x2,
  91. EM_branch_type_direct_wtop = 0x3,
  92. EM_branch_type_direct_cloop = 0x4,
  93. EM_branch_type_direct_cexit = 0x5,
  94. EM_branch_type_direct_ctop = 0x6,
  95. EM_branch_type_direct_call = 0x7,
  96. EM_branch_type_direct_last = 0x8,
  97. EM_branch_type_indirect_cond = 0x9,
  98. EM_branch_type_indirect_ia = 0xa,
  99. EM_branch_type_indirect_ret = 0xb,
  100. EM_branch_type_indirect_call = 0xc,
  101. EM_branch_type_last
  102. } EM_branch_type_t;
  103. typedef enum em_cmp_type_s
  104. {
  105. EM_cmp_type_none = 0, /* none (dstT=REL, dstF=!REL) */
  106. EM_cmp_type_and = 1, /* and (dstT&=REL, dstF&=REL) */
  107. EM_cmp_type_or = 2, /* or (dstT|=REL, dstF|=REL) */
  108. EM_cmp_type_unc = 3, /* uncond (dstT=P&REL, dstF=P&!REL) */
  109. EM_cmp_type_or_andcm = 4, /* or.andcm (dstT|=REL, dstF&=!REL) */
  110. EM_cmp_type_last
  111. } EM_cmp_type_t;
  112. typedef enum EM_template_e
  113. {
  114. EM_template_mii = 0,
  115. EM_template_mi_i = 1,
  116. EM_template_mlx = 2,
  117. /*** 3 reserved ***/
  118. EM_template_mmi = 4,
  119. EM_template_m_mi = 5,
  120. EM_template_mfi = 6,
  121. EM_template_mmf = 7,
  122. EM_template_mib = 8,
  123. EM_template_mbb = 9,
  124. /*** 10 reserved ***/
  125. EM_template_bbb = 11,
  126. EM_template_mmb = 12,
  127. /*** 13 reserved ***/
  128. EM_template_mfb = 14,
  129. /*** 15 reserved ***/
  130. EM_template_last
  131. } EM_template_t;
  132. /***** Misc operands values: fclass, sync (stype), mux *****/
  133. typedef enum em_fclass_bit
  134. {
  135. EM_fclass_bit_pos = 0 ,
  136. EM_fclass_bit_neg = 1 ,
  137. EM_fclass_bit_zero = 2 ,
  138. EM_fclass_bit_unorm = 3 ,
  139. EM_fclass_bit_norm = 4 ,
  140. EM_fclass_bit_inf = 5 ,
  141. EM_fclass_bit_signan = 6 ,
  142. EM_fclass_bit_qnan = 7 ,
  143. EM_fclass_bit_nat = 8
  144. } EM_fclass_bit_t;
  145. #define EM_FCLASS_POS (1<<EM_fclass_bit_pos ) /*** 0x001 ***/
  146. #define EM_FCLASS_NEG (1<<EM_fclass_bit_neg ) /*** 0x002 ***/
  147. #define EM_FCLASS_ZERO (1<<EM_fclass_bit_zero ) /*** 0x004 ***/
  148. #define EM_FCLASS_UNORM (1<<EM_fclass_bit_unorm ) /*** 0x008 ***/
  149. #define EM_FCLASS_NORM (1<<EM_fclass_bit_norm ) /*** 0x010 ***/
  150. #define EM_FCLASS_INF (1<<EM_fclass_bit_inf ) /*** 0x020 ***/
  151. #define EM_FCLASS_SIGNAN (1<<EM_fclass_bit_signan) /*** 0x040 ***/
  152. #define EM_FCLASS_QNAN (1<<EM_fclass_bit_qnan ) /*** 0x080 ***/
  153. #define EM_FCLASS_NAT (1<<EM_fclass_bit_nat ) /*** 0x100 ***/
  154. #define EM_MUX_BRCST 0x0
  155. #define EM_MUX_MIX 0x8
  156. #define EM_MUX_SHUF 0x9
  157. #define EM_MUX_ALT 0xA
  158. #define EM_MUX_REV 0xB
  159. /*** sync-stype: arbitrary! need fix!!! <flags> ***/ /* !!!!!??? */
  160. #define EM_STYPE_LOAD 0x0
  161. #define EM_STYPE_STORE 0x1
  162. #define EM_STYPE_EXT 0x2
  163. #define EM_STYPE_PURGE 0x4
  164. #define EM_MAX_MEM_OPERAND_SIZE 32
  165. #define EM_NUM_OF_PRIVILEGE_LEVELS 4
  166. /*** shift of branch/chk (target21 <--> target25) ***/
  167. #define EM_IPREL_TARGET_SHIFT_AMOUNT 4
  168. /*****************************************************/
  169. /***** register-related constants and structures *****/
  170. /*****************************************************/
  171. /* branch register structure definition */
  172. typedef U64 EM_branch_reg_t;
  173. typedef struct EM_FPSR_s
  174. {
  175. U4byte trap:6,sf0:13,sf1:13;
  176. U4byte sf2:13,sf3:13,reserved:6;
  177. } EM_FPSR_t;
  178. #define EM_FPSR_S0_ABSOLUTE_MASK 0x7f
  179. #define EM_FPSR_SFX_TD_MASK 0x40
  180. #define EM_FPSR_SFX_PC_MASK 0x0c
  181. #define EM_FPSR_SFX_RESERVED_PC_VALUE 0x04
  182. typedef struct EM_RSC_s
  183. {
  184. U4byte mode:2, pl:2, be:1, reserved1:11, loadrs:14, reserved2:2;
  185. U4byte reserved3;
  186. } EM_RSC_t;
  187. typedef struct EM_BSP_s
  188. {
  189. U4byte ignored:3,pointer_low:29;
  190. U4byte pointer_high;
  191. } EM_BSP_t;
  192. typedef EM_BSP_t EM_BSPSTORE_t;
  193. typedef struct EM_EC_s
  194. {
  195. U4byte count:6, ignored1:26;
  196. U4byte ignored2;
  197. } EM_EC_t;
  198. typedef struct EM_RNAT_s
  199. {
  200. U4byte rse_nats_low;
  201. U4byte rse_nats_high:31, ignored:1;
  202. } EM_RNAT_t;
  203. #define EM_FRAME_RRB_MASK_LOW 0x3ffff
  204. #define EM_FRAME_RRB_MASK_HIGH 0xffffffc0
  205. #define EM_FRAME_FP_RRB_MASK 0xfe000000
  206. #define EM_FRAME_FP_RRB_BIT_POS 25
  207. #define EM_FRAME_RRB_FR_LOW_BIT_MASK 0x2000000
  208. #define EM_FRAME_SOL_POS 7
  209. #define EM_FRAME_SOL_MASK 0x3f80
  210. #define EM_FRAME_SOR_POS 14
  211. #define EM_FRAME_SOR_MASK 0x3c000
  212. #define EM_FRAME_SOR_ZERO_BITS_NUM 3
  213. #define EM_FRAME_SOF_MASK 0x7f
  214. typedef struct EM_frame_marker_s
  215. {
  216. U4byte sof:7, sol:7, sor:4, rrb_int:7, rrb_fp:7;
  217. U4byte rrb_pred:6, reserved:26;
  218. } EM_frame_marker_t;
  219. #define EM_PFS_CPL_BIT_POS 30
  220. #define EM_PFS_HIGH_EC_BIT_POS 20
  221. #define EM_PFS_CPL_MASK 0xc0000000
  222. #define EM_PFS_EC_MASK 0x03f00000
  223. typedef struct EM_PFS_s
  224. {
  225. U4byte pfm_l;
  226. U4byte pfm_h:6, reserved1:14, pec:6, reserved2:4, ppl:2;
  227. } EM_PFS_t;
  228. #define EM_PSR_CPL_MASK 0x3
  229. #define EM_PSR_CPL_BIT_POS 0
  230. #define EM_PSR_H_ED_MASK 0x800
  231. #define EM_PSR_H_ED_BIT_POS 0xb
  232. #define EM_PSR_H_MC_MASK 0x8
  233. #define EM_PSR_H_IT_MASK 0x10
  234. /*** PSR ***/
  235. typedef struct EM_PSR_s
  236. {
  237. U4byte
  238. reserved1:1, /* 0 */
  239. be:1, /* 1 */
  240. up:1, /* 2 */
  241. ac:1, /* 3 */
  242. mfl:1,/* 4 */
  243. mfh:1,/* 5 */
  244. reserved2:7,/* 6-12 */
  245. ic:1, /* 13 */
  246. i:1, /* 14 */
  247. pk:1, /* 15 */
  248. reserved3:1, /* 16 */
  249. dt:1, /* 17 */
  250. dfl:1,/* 18 */
  251. dfh:1,/* 19 */
  252. sp:1, /* 20 */
  253. pp:1, /* 21 */
  254. di:1, /* 22 */
  255. si:1, /* 23 */
  256. db:1, /* 24 */
  257. lp:1, /* 25 */
  258. tb:1, /* 26 */
  259. rt:1, /* 27 */
  260. reserved4:4; /* 28-31 */
  261. U4byte
  262. cpl:2, /* 32,33 */
  263. is:1, /* 34 */
  264. mc:1, /* 35 */
  265. it:1, /* 36 */
  266. id:1, /* 37 */
  267. da:1, /* 38 */
  268. dd:1, /* 39 */
  269. ss:1, /* 40 */
  270. ri:2, /* 41,42 */
  271. ed:1, /* 43 */
  272. bn:1, /* 44 */
  273. ia:1, /* 45 */
  274. reserved5:18; /* 46-63 */
  275. } EM_PSR_t;
  276. /*** DCR ***/
  277. typedef struct EM_DCR_s
  278. {
  279. U4byte
  280. pp:1, /* 0 */
  281. be:1, /* 1 */
  282. lc:1, /* 2 */
  283. reserved1:5, /* 3-7 */
  284. dm:1, /* 8 */
  285. dp:1, /* 9 */
  286. dk:1, /* 10 */
  287. dx:1, /* 11 */
  288. dr:1, /* 12 */
  289. da:1, /* 13 */
  290. dd:1, /* 14 */
  291. reserved4:1, /* 15 , - was 'du' before eas24 and became reserved */
  292. reserved2:16; /* 16-31 */
  293. U4byte reserved3; /* 32-63 */
  294. } EM_DCR_t;
  295. /**** ITM ****/
  296. typedef U64 EM_ITM_t;
  297. /**** IVA ****/
  298. typedef struct EM_IVA_s
  299. {
  300. U4byte
  301. ignored:15,
  302. iva_low:17;
  303. U4byte iva_high;
  304. } EM_IVA_t;
  305. /**** PTA ****/
  306. typedef struct EM_pta_s
  307. {
  308. U4byte
  309. ve:1, /* 0 */
  310. reserved1:1, /* 1 */
  311. size:6, /* 2-7 */
  312. vf:1, /* 8 */
  313. reserved2:6, /* 9-14 */
  314. base_low:17; /* 15-31 */
  315. U4byte
  316. base_high:32;/* 32-63 */
  317. } EM_PTA_t;
  318. /**** IPSR ****/
  319. typedef EM_PSR_t EM_IPSR_t;
  320. /**** ISR ****/
  321. typedef struct EM_ISR_s
  322. {
  323. U4byte
  324. code:16, /* 0-15 */
  325. iA_vector:8, /* 16-23 */
  326. reserved1:8; /* 24-31 */
  327. U4byte
  328. x:1, /* 32 */
  329. w:1, /* 33 */
  330. r:1, /* 34 */
  331. na:1, /* 35 */
  332. sp:1, /* 36 */
  333. rs:1, /* 37 */
  334. ir:1, /* 38 */
  335. ni:1, /* 39 */
  336. so:1, /* 40 */
  337. ei:2, /* 41-42 */
  338. ed:1, /* 43 */
  339. reserved2:20;/* 44-63 */
  340. } EM_ISR_t;
  341. /* Low 12 bits of low word of IFA is defined as
  342. ignored according to the TLB insertion format */
  343. typedef struct EM_IFA_s
  344. {
  345. U4byte
  346. ignored:12,
  347. vpn_low:20;
  348. U4byte
  349. vpn_high;
  350. } EM_IFA_t;
  351. typedef struct EM_IIP_s
  352. {
  353. U4byte
  354. vpn_low;
  355. U4byte
  356. vpn_high;
  357. } EM_IIP_t;
  358. typedef EM_IIP_t EM_vaddr_t;
  359. /* Unimplemented virtual and physical addresses */
  360. #define EM_MAX_IMPL_VA_MSB 60
  361. #define EM_MIN_IMPL_VA_MSB 50
  362. #define EM_MAX_IMPL_PA_MSB 62
  363. #define EM_MIN_IMPL_PA_MSB 31
  364. /**** ITIR ***/
  365. typedef struct EM_itir_s
  366. {
  367. U4byte
  368. reserved1:2, /* 0-1 */
  369. ps:6, /* 2-7 */
  370. key:24; /* 8-31 */
  371. U4byte
  372. reserved2:16, /* 32-47 */
  373. reserved4:15, /* 48-62 - was ppn */
  374. reserved3:1; /* 63 */
  375. } EM_ITIR_t;
  376. #define EM_ITR_PPN_HIGH_OFFSET 24
  377. /**** IIPA ****/
  378. typedef U64 EM_IIPA_t;
  379. /**** IFS ****/
  380. typedef struct
  381. {
  382. U4byte
  383. ifm_low; /* 0-31 */
  384. U4byte
  385. ifm_high:6, /* 32-37 */
  386. reserved:25, /* 38-62 */
  387. v:1; /* 63 */
  388. } EM_IFS_t;
  389. /**** IIM ****/
  390. typedef struct
  391. {
  392. U4byte
  393. imm21:21, /* 0-20 */
  394. ignored1:11; /* 21-31 */
  395. U4byte ignored2; /* 32-63 */
  396. } EM_IIM_t;
  397. typedef struct EM_IHA_s
  398. {
  399. U4byte ignored:3,iha_low:29;
  400. U4byte iha_high;
  401. } EM_IHA_t;
  402. /**** LID ****/
  403. typedef struct
  404. {
  405. U4byte
  406. reserved:16,
  407. eid:8,
  408. id:8;
  409. U4byte ignored;
  410. } EM_LID_t;
  411. /**** IVR ****/
  412. typedef struct
  413. {
  414. U4byte
  415. vec:8, /* not "vector" due to IAS issues */
  416. reserved:8,
  417. ignored1:16;
  418. U4byte ignored2;
  419. } EM_IVR_t;
  420. /**** TPR ****/
  421. typedef struct
  422. {
  423. U4byte
  424. ignored1:4,
  425. mic:4,
  426. reserved:8,
  427. mmi:1,
  428. ignored2:15;
  429. U4byte ignored3;
  430. } EM_TPR_t;
  431. /**** EOI ****/
  432. typedef struct
  433. {
  434. U4byte ignored1;
  435. U4byte ignored2;
  436. } EM_EOI_t;
  437. /**** IRR ****/
  438. typedef U64 EM_IRR_t;
  439. /**** ITV ****/
  440. typedef struct
  441. {
  442. U4byte
  443. vec:8, /* not "vector" due to IAS issues */
  444. reserved1:4,
  445. zero:1,
  446. reserved2:3,
  447. m:1,
  448. ignored1:15;
  449. U4byte ignored2;
  450. } EM_ITV_t;
  451. /**** PMV ****/
  452. typedef EM_ITV_t EM_PMV_t;
  453. /**** LRR ****/
  454. typedef struct
  455. {
  456. U4byte
  457. vec:8, /* not "vector" due to IAS issues */
  458. dm:3,
  459. reserved1:1,
  460. ignored3:1,
  461. ipp:1,
  462. reserved2:1,
  463. tm:1,
  464. m:1,
  465. ignored1:15;
  466. U4byte ignored2;
  467. } EM_LRR_t;
  468. /**** BHB ****/
  469. typedef struct
  470. {
  471. U4byte
  472. max:10,
  473. ignored:2,
  474. base_low:20;
  475. U4byte
  476. base_high;
  477. } EM_BHB_t;
  478. /**** THA ****/
  479. typedef struct
  480. {
  481. U4byte
  482. ptr:10,
  483. bh:1,
  484. ignored1:1,
  485. vaddr:20;
  486. U4byte
  487. ignored2;
  488. } EM_THA_t;
  489. /**** CMCV ****/
  490. typedef EM_ITV_t EM_CMCV_t;
  491. /**** RR ****/
  492. typedef struct EM_region_register_s
  493. {
  494. U4byte
  495. ve:1, /* 0 */
  496. reserved1:1, /* 1 */
  497. ps:6, /* 2-7 */
  498. rid:24; /* 8-31 */
  499. U4byte reserved2; /* 32-63 */
  500. } EM_RR_t;
  501. /**** PKR ****/
  502. typedef struct EM_key_register_s
  503. {
  504. U4byte
  505. v:1, /* 0 */
  506. wd:1, /* 1 */
  507. rd:1, /* 2 */
  508. xd:1, /* 3 */
  509. reserved1:4, /* 4-7 */
  510. key:24; /* 8-31 */
  511. U4byte reserved2; /* 32-63 */
  512. } EM_PKR_t;
  513. typedef U64 EM_DBR_EVEN_t;
  514. typedef U64 EM_IBR_EVEN_t;
  515. typedef struct EM_DBR_ODD_s
  516. {
  517. U4byte mask_low; /* 0 - 31 */
  518. U4byte mask_high:24, /* 32 - 55 */
  519. plm:4, /* 56 - 59 */
  520. ignored:2, /* 60 - 61 */
  521. w:1, /* 62 */
  522. r:1; /* 63 */
  523. } EM_DBR_ODD_t;
  524. typedef struct EM_IBR_ODD_s
  525. {
  526. U4byte mask_low; /* 0 - 31 */
  527. U4byte mask_high:24, /* 32 - 55 */
  528. plm:4, /* 56 - 59 */
  529. ignored:3, /* 60 - 62 */
  530. x:1; /* 63 */
  531. } EM_IBR_ODD_t;
  532. /**** PMC Registers ****/
  533. /**** PMC0 ****/
  534. typedef struct EM_PMC0_register_s
  535. {
  536. U4byte
  537. fr:1, /* 0 */
  538. ignored1:3, /* 1 - 3 */
  539. overflow:4, /* 4 - 7 */
  540. ignored2:24; /* 8 - 31 */
  541. U4byte ignored3; /* 32 - 63 */
  542. } EM_PMC0_t;
  543. /**** PMC1 - PMC3 ****/
  544. typedef U64 EM_PMC1_3_t;
  545. /**** PMC4 - ****/
  546. typedef struct EM_PMC_register_s
  547. {
  548. U4byte
  549. plm:4, /* 0 - 3 */
  550. ev:1, /* 4 */
  551. oi:1, /* 5 */
  552. pm:1, /* 6 */
  553. ignored1:1, /* 7 */
  554. es:8, /* 8 - 15 */
  555. umask:4, /* 16 - 19 */
  556. ignored2:12; /* 20 - 31 */
  557. U4byte ignored3; /* 32 - 63 */
  558. } EM_PMC_t;
  559. typedef struct EM_PMD_register_s
  560. {
  561. U4byte count; /* 0 - 31 */
  562. U4byte sxt; /* 32 - 63 */
  563. } EM_PMD_t;
  564. /* Number of implementet count bits in PMD */
  565. #define EM_PMD_COUNT_SIZE 32
  566. typedef U64 EM_MSR_t;
  567. typedef struct EM_tlb_insert_reg_s
  568. {
  569. U4byte
  570. p:1, /* 0 */
  571. mx:1, /* 1 */
  572. ma:3, /* 2-4 */
  573. a:1, /* 5 */
  574. d:1, /* 6 */
  575. pl:2, /* 7-8 */
  576. ar:3, /* 9-11 */
  577. ppn_low:20; /* 12-31 */
  578. U4byte
  579. ppn_high:12, /* 32-43 */
  580. reserved2:4, /* 44-47 - was ppn_high */
  581. reserved1:4, /* 48-51 */
  582. ed:1, /* 52 */
  583. ignored:11; /* 63-63 */
  584. } EM_tlb_insert_reg_t;
  585. typedef enum
  586. {
  587. EM_TLB_ar_r_r_r, /* 000 */
  588. EM_TLB_ar_rx_rx_rx, /* 001 */
  589. EM_TLB_ar_rw_rw_rw, /* 010 */
  590. EM_TLB_ar_rwx_rwx_rwx, /* 011 */
  591. EM_TLB_ar_r_rw_rw, /* 100 */
  592. EM_TLB_ar_rx_rx_rwx, /* 101 */
  593. EM_TLB_ar_rwx_rw_rw, /* 110 */
  594. EM_TLB_ar_x_x_rx, /* 111 */
  595. EM_TLB_ar_last
  596. } EM_page_access_right_t;
  597. typedef enum
  598. { /* ma mx */
  599. EM_VA_MA_WB = 0x0, /* 000 0 */
  600. EM_VA_MA_WT = 0x4, /* 010 0 */
  601. EM_VA_MA_WP = 0x6, /* 011 0 */
  602. EM_VA_MA_UC = 0x8, /* 100 0 */
  603. EM_VA_MA_UCC = 0x9, /* 100 1 */
  604. EM_VA_MA_UCE = 0xa, /* 101 0 */
  605. EM_VA_MA_WC = 0xc, /* 110 0 */
  606. EM_VA_MA_NATPAGE = 0xe /* 111 0 */
  607. } EM_vaddr_mem_attribute_t;
  608. /* encodings of guest memory attributes */
  609. typedef enum
  610. {
  611. EM_IA_GVA_MA_UC = 0x0, /* 000 */
  612. EM_IA_GVA_MA_WC = 0x1, /* 001 */
  613. EM_IA_GVA_MA_WT = 0x4, /* 100 */
  614. EM_IA_GVA_MA_WP = 0x5, /* 101 */
  615. EM_IA_GVA_MA_WB = 0x6, /* 110 */
  616. EM_IA_GVA_MA_UC_MINUS = 0x7 /* 111 */
  617. } EM_IA_vaddr_gmem_attribute_t;
  618. /* In eas24: attr = ma + mx */
  619. #define EM_VA_IS_MA_ATTRIBUTE_RESERVED(attr) \
  620. (((attr) == 0x2) || ((attr) == 0x4) || ((attr) == 0x6) || \
  621. ((attr) & 0x1))
  622. #define EM_GVA_IS_MA_ATTRIBUTE_RESERVED(attr) \
  623. (((attr) == 0x1) || ((attr) == 0x2) || ((attr) == 0x3) || \
  624. ((attr) == 0x5) || ((attr) == 0x7) || ((attr) == 0xb) || \
  625. ((attr) == 0xd) || ((attr) == 0xf))
  626. typedef EM_tlb_insert_reg_t EM_vhpt_short_format_t;
  627. typedef struct EM_vhpt_long_format_s
  628. {
  629. U4byte
  630. p:1, /* 0 */
  631. mx:1, /* 1 */
  632. ma:3, /* 2-4 */
  633. a:1, /* 5 */
  634. d:1, /* 6 */
  635. pl:2, /* 7-8 */
  636. ar:3, /* 9-11 */
  637. ppn_low:20; /* 12-31 */
  638. U4byte
  639. ppn_mid:12, /* 32-43 */
  640. reserved5:4, /* 44-47 - was ppn_mid*/
  641. reserved1:4, /* 48-51 */
  642. ed:1, /* 52 */
  643. ignored:11; /* 53-63 */
  644. U4byte
  645. reserved2:2, /* 0-1 */
  646. ps:6, /* 2-7 */
  647. key:24; /* 8-31 */
  648. U4byte
  649. reserved3:16,/* 32-47 */
  650. reserved6:15, /* 48-62 - was ppn_high */
  651. reserved4:1; /* 63 */
  652. U64 tag;
  653. U64 avl3;
  654. } EM_vhpt_long_format_t;
  655. typedef struct EM_gvhpt_short_format_s
  656. {
  657. U4byte
  658. p:1, /* 0 */
  659. w:1, /* 1 */
  660. u:1, /* 2 */
  661. pa10:2, /* 3-4 */
  662. a:1, /* 5 */
  663. d:1, /* 6 */
  664. pa2:1, /* 7 */
  665. g:1, /* 8 */
  666. ignored:3, /* 9-11 */
  667. ppn:20; /* 12 - 31 */
  668. }EM_gvhpt_short_format_t;
  669. typedef struct EM_gvhpt_long_format_s
  670. {
  671. U4byte
  672. p:1, /* 0 */
  673. w:1, /* 1 */
  674. u:1, /* 2 */
  675. pa10:2, /* 3-4 */
  676. a:1, /* 5 */
  677. d:1, /* 6 */
  678. pa2:1, /* 7 */
  679. g:1, /* 8 */
  680. ignored:3, /* 9-11 */
  681. ppn_low:20; /* 12 - 31 */
  682. U4byte
  683. ppn_high:16, /* 32-47 */
  684. reserved:16; /* 48-63 */
  685. }EM_gvhpt_long_format_t;
  686. /* the minimum VHPT size is 2^14 = 16K */
  687. #define EM_MIN_VHPT_SIZE_POWER 14
  688. /* define the number of registers */
  689. #define EM_NUM_OF_GREGS 128
  690. #define EM_NUM_OF_ADD22_GREGS 4
  691. #define EM_NUM_OF_FPREGS 128
  692. #define EM_NUM_OF_PREGS 64
  693. #define EM_NUM_OF_BREGS 8
  694. #define EM_NUM_OF_AREGS 128
  695. #define EM_NUM_OF_CREGS 128
  696. #define EM_NUM_OF_RREGS 8
  697. #define EM_NUM_OF_PKREGS 16
  698. #define EM_NUM_OF_DBREGS 32 /* guess for max value*/
  699. #define EM_NUM_OF_IBREGS 32 /* guess for max value*/
  700. #define EM_NUM_OF_PMCREGS 32 /* guess for max value*/
  701. #define EM_NUM_OF_PMDREGS 32 /* guess for max value*/
  702. #define EM_NUM_OF_MSREGS 2048 /* guess for max value*/
  703. #define EM_NUM_OF_KREGS 8 /* kernel registers are AREGS */
  704. #define EM_NUM_OF_CPUID_REGS 5 /* implementation independent part */
  705. #define EM_NUM_OF_IRREGS 4
  706. #define EM_NUM_OF_BANKED_REGS 16
  707. #define EM_FIRST_BANKED_REG 16
  708. #define EM_FIRST_IN_FP_LOW_REG_SET 0
  709. #define EM_FIRST_IN_FP_HIGH_REG_SET 32
  710. #define EM_PREDICATE_WIRED_TRUE 0
  711. #define EM_STACK_BASE_REGISTER 32
  712. #define EM_REGISTER_STACK_SIZE 96
  713. #define EM_GREG_ROTATING_BASE 32
  714. #define EM_PREG_ROTATING_BASE 16
  715. #define EM_NUM_OF_ROTATING_PREGS (EM_NUM_OF_PREGS - EM_PREG_ROTATING_BASE)
  716. #define EM_FPREG_ROTATING_BASE 32
  717. #define EM_NUM_OF_ROTATING_FPREGS (EM_NUM_OF_FPREGS - EM_FPREG_ROTATING_BASE)
  718. #define EM_GREGS_ROTATING_GROUPS 8
  719. /* kernel registers macros */
  720. #define EM_IS_AREG_A_KREG(n) (((n) >= EM_AR_KR0) && ((n) <= EM_AR_KR7))
  721. #define EM_AREG_NUM_TO_KREG(n) ((n) - EM_AR_KR0)
  722. #define EM_KREG_NUM_TO_AREG(n) ((n) + EM_AR_KR0)
  723. #define EM_IS_KREG_A_AREG(n) ((n) < 7)
  724. /* PSR user and system mask */
  725. #define EM_PSR_UM_MASK 0x3f
  726. #define EM_PSR_SM_MASK 0xffffff
  727. #define EM_PSR_MFL_MASK 0x10
  728. #define EM_PSR_MFH_MASK 0x20
  729. /* instruction and data TLB translation registers information */
  730. #define EM_TLB_MIN_DATA_TR_NUM 8
  731. #define EM_TLB_MIN_INST_TR_NUM 8
  732. #define EM_TLB_MAX_DATA_TR_NUM 256
  733. #define EM_TLB_MAX_INST_TR_NUM 256
  734. #define EM_TLB_MIN_TLB_TC_NUM 8
  735. #define EM_TLB_MAX_TLB_TC_NUM 256
  736. #define EM_TLB_DATA_TR_NUM_MASK 0xff
  737. #define EM_TLB_INST_TR_NUM_MASK 0xff
  738. /* define the special purpose application registers */
  739. typedef enum
  740. {
  741. EM_AR_KR0 = 0,
  742. EM_AR_KR1 = 1,
  743. EM_AR_KR2 = 2,
  744. EM_AR_KR3 = 3,
  745. EM_AR_KR4 = 4,
  746. EM_AR_KR5 = 5,
  747. EM_AR_KR6 = 6,
  748. EM_AR_KR7 = 7,
  749. /* ar8-15 reserved */
  750. EM_AR_RSC = 16,
  751. EM_AR_BSP = 17,
  752. EM_AR_BSPSTORE = 18,
  753. EM_AR_RNAT = 19,
  754. /* ar20 reserved */
  755. EM_AR_FCR = 21,
  756. /* ar22-23 reserved */
  757. EM_AR_EFLAG = 24,
  758. EM_AR_CSD = 25,
  759. EM_AR_SSD = 26,
  760. EM_AR_CFLG = 27,
  761. EM_AR_FSR = 28,
  762. EM_AR_FIR = 29,
  763. EM_AR_FDR = 30,
  764. /* ar31 reserved */
  765. EM_AR_CCV = 32,
  766. /* ar33-35 reserved */
  767. EM_AR_UNAT = 36,
  768. /* ar37-39 reserved */
  769. EM_AR_FPSR = 40,
  770. /* ar41-43 reserved */
  771. EM_AR_ITC = 44,
  772. /* ar45-47 reserved */
  773. /* ar48-63 ignored */
  774. EM_AR_PFS = 64,
  775. EM_AR_LC = 65,
  776. EM_AR_EC = 66,
  777. /* ar67-111 reserved */
  778. /* ar112-128 ignored */
  779. EM_AR_LAST = 128
  780. } EM_areg_num_t;
  781. /*****************************/
  782. /*** Control Registers ***/
  783. /*****************************/
  784. typedef enum
  785. {
  786. EM_CR_DCR = 0,
  787. EM_CR_ITM = 1,
  788. EM_CR_IVA = 2,
  789. /*** 3-7 reserved ***/
  790. EM_CR_PTA = 8,
  791. EM_CR_GPTA = 9,
  792. /*** 10-15 reserved ***/
  793. EM_CR_IPSR = 16,
  794. EM_CR_ISR = 17,
  795. /*** 18 reserved ***/
  796. EM_CR_IIP = 19,
  797. EM_CR_IFA = 20,
  798. EM_CR_ITIR = 21,
  799. EM_CR_IIPA = 22,
  800. EM_CR_IFS = 23,
  801. EM_CR_IIM = 24,
  802. EM_CR_IHA = 25,
  803. /*** 25-63 reserved ***/
  804. /*** SAPIC registers ***/
  805. EM_CR_LID = 64,
  806. EM_CR_IVR = 65,
  807. EM_CR_TPR = 66,
  808. EM_CR_EOI = 67,
  809. EM_CR_IRR0 = 68,
  810. EM_CR_IRR1 = 69,
  811. EM_CR_IRR2 = 70,
  812. EM_CR_IRR3 = 71,
  813. EM_CR_ITV = 72,
  814. EM_CR_PMV = 73,
  815. EM_CR_CMCV = 74,
  816. /*** 75-79 reserved ***/
  817. EM_CR_LRR0 = 80,
  818. EM_CR_LRR1 = 81,
  819. /*** 82-127 reserved ***/
  820. EM_CR_LAST = 128
  821. } EM_creg_num_t;
  822. typedef enum
  823. {
  824. EM_CPUID_VENDOR0 = 0,
  825. EM_CPUID_VENDOR1 = 1,
  826. EM_CPUID_SERIAL_NUM = 2,
  827. EM_CPUID_VERSION = 3,
  828. EM_CPUID_FEATURES = 4,
  829. EM_CPUID_LAST
  830. } EM_cpuid_num_t;
  831. typedef enum
  832. {
  833. EM_GR_BHB = 6,
  834. EM_GR_THA = 7
  835. } EM_greg_num_t;
  836. typedef struct EM_CPUID_version_s
  837. {
  838. U4byte
  839. number:8,
  840. revision:8,
  841. model:8,
  842. family:8;
  843. U4byte
  844. archrev:8,
  845. reserved1:24;
  846. } EM_CPUID_version_t;
  847. #define EM_NUM_OF_M_ROLE_APP_REGS 64
  848. #define EM_NUM_OF_I_ROLE_APP_REGS (EM_NUM_OF_AREGS - \
  849. EM_NUM_OF_M_ROLE_APP_REGS)
  850. #define EM_APP_REG_IS_I_ROLE(ar_no) ((ar_no) >= EM_NUM_OF_M_ROLE_APP_REGS)
  851. #define EM_APP_REG_IS_RESERVED(ar_no) ((((ar_no) > 7) && ((ar_no) < 16)) ||\
  852. (((ar_no) > 19) && ((ar_no) < 21)) ||\
  853. (((ar_no) > 21) && ((ar_no) < 24)) ||\
  854. (((ar_no) > 30) && ((ar_no) < 32)) ||\
  855. (((ar_no) > 32) && ((ar_no) < 36)) ||\
  856. (((ar_no) > 36) && ((ar_no) < 40)) ||\
  857. (((ar_no) > 40) && ((ar_no) < 44)) ||\
  858. (((ar_no) > 44) && ((ar_no) < 48)) ||\
  859. (((ar_no) > 66) && ((ar_no) < 112)))
  860. #define EM_APP_REG_IS_IGNORED(ar_no) ((((ar_no) > 47) && ((ar_no) < 64))||\
  861. ((ar_no) > 111))
  862. #define EM_CREG_IS_I_ROLE(cr_no) 0
  863. #define EM_CREG_IS_RESERVED(cr_no) ((((cr_no) > 2) && ((cr_no) < 8)) ||\
  864. (((cr_no) > 9) && ((cr_no) < 16)) ||\
  865. ((cr_no) == 18) ||\
  866. (((cr_no) > 25) && ((cr_no) < 64)) ||\
  867. (((cr_no) > 74) && ((cr_no) < 80)) ||\
  868. ((cr_no) > 81))
  869. #define EM_PMD_IS_IMPLEMENTED(pmd_no) ((pmd_no) > 3 && (pmd_no) < 8)
  870. #define EM_PMC_IS_IMPLEMENTED(pmc_no) ((pmc_no) < 8)
  871. /* Interruption Priorities, taken from Table 10-5 in EAS2.4. */
  872. typedef enum EM_interruption_e
  873. {
  874. EM_INTR_NONE = 0,
  875. /* Aborts: IA32, IA64 */
  876. EM_INTR_MACHINE_RESET = 1,
  877. EM_INTR_MACHINE_CHECK_ABORT = 2,
  878. /* Interrupts: IA32, IA64 */
  879. EM_INTR_PLATFORM_MANAGEMENT_INTERRUPT = 3,
  880. EM_INTR_EXTERNAL_INTERRUPT = 4,
  881. /* Faults: IA64 */
  882. EM_INTR_IR_UNIMPLEMENTED_DATA_ADDRESS_FAULT = 5,
  883. EM_INTR_IR_DATA_NESTED_TLB_FAULT = 6,
  884. EM_INTR_IR_ALT_DATA_TLB_FAULT = 7,
  885. EM_INTR_IR_VHPT_DATA_FAULT = 8,
  886. EM_INTR_IR_DATA_TLB_FAULT = 9,
  887. EM_INTR_IR_DATA_PAGE_NOT_PRESENT_FAULT = 10,
  888. EM_INTR_IR_DATA_NAT_PAGE_CONSUMPTION_FAULT = 11,
  889. EM_INTR_IR_DATA_KEY_MISS_FAULT = 12,
  890. EM_INTR_IR_DATA_KEY_PERMISSION_FAULT = 13,
  891. EM_INTR_IR_DATA_ACCESS_RIGHT_FAULT = 14,
  892. EM_INTR_IR_DATA_ACCESS_BIT_FAULT = 15,
  893. EM_INTR_IR_DATA_DEBUG_FAULT = 16,
  894. /* Faults: IA32 */
  895. EM_INTR_IA_INST_BREAKPOINT_FAULT = 17,
  896. EM_INTR_IA_CODE_FETCH_FAULT = 18,
  897. /* Faults: IA32, IA64 */
  898. EM_INTR_INST_ALT_TLB_FAULT = 19,
  899. EM_INTR_INST_VHPT_FAULT = 20,
  900. EM_INTR_INST_TLB_FAULT = 21,
  901. EM_INTR_INST_PAGE_NOT_PRESENT_FAULT = 22,
  902. EM_INTR_INST_NAT_PAGE_CONSUMPTION_FAULT = 23,
  903. EM_INTR_INST_KEY_MISS_FAULT = 24,
  904. EM_INTR_INST_KEY_PERMISSION_FAULT = 25,
  905. EM_INTR_INST_ACCESS_RIGHT_FAULT = 26,
  906. EM_INTR_INST_ACCESS_BIT_FAULT = 27,
  907. /* Faults: IA64 */
  908. EM_INTR_INST_DEBUG_FAULT = 28,
  909. /* Faults: IA32 */
  910. EM_INTR_IA_INST_LENGTH_FAULT = 29,
  911. EM_INTR_IA_INVALID_OPCODE_FAULT = 30,
  912. EM_INTR_IA_INST_INTERCEPT_FAULT = 31,
  913. /* Faults: IA64 */
  914. EM_INTR_ILLEGAL_OPERATION_FAULT = 32,
  915. EM_INTR_BREAK_INSTRUCTION_FAULT = 33,
  916. EM_INTR_PRIVILEGED_OPERATION_FAULT = 34,
  917. /* Faults: IA32, IA64 */
  918. EM_INTR_DISABLED_FP_REGISTER_FAULT = 35,
  919. EM_INTR_DISABLED_ISA_TRANSITION_FAULT = 36,
  920. /* Faults: IA32 */
  921. EM_INTR_IA_COPROCESSOR_NOT_AVAILABLE_FAULT = 37,
  922. EM_INTR_IA_FP_ERROR_FAULT = 38,
  923. /* Faults: IA32, IA64 */
  924. EM_INTR_REGISTER_NAT_CONSUMPTION_FAULT = 39,
  925. /* Faults: IA64 */
  926. EM_INTR_RESERVED_REGISTER_FIELD_FAULT = 40,
  927. EM_INTR_PRIVILEGED_REGISTER_FAULT = 41,
  928. EM_INTR_SPECULATIVE_OPERATION_FAULT = 42,
  929. /* Faults: IA32 */
  930. EM_INTR_IA_STACK_EXCEPTION_FAULT = 43,
  931. EM_INTR_IA_GENERAL_PROTECTION_FAULT = 44,
  932. /* Faults: IA32, IA64 */
  933. EM_INTR_DATA_NESTED_TLB_FAULT = 45,
  934. EM_INTR_DATA_ALT_TLB_FAULT = 46,
  935. EM_INTR_DATA_VHPT_FAULT = 47,
  936. EM_INTR_DATA_TLB_FAULT = 48,
  937. EM_INTR_DATA_PAGE_NOT_PRESENT_FAULT = 49,
  938. EM_INTR_DATA_NAT_PAGE_CONSUMPTION_FAULT = 50,
  939. EM_INTR_DATA_KEY_MISS_FAULT = 51,
  940. EM_INTR_DATA_KEY_PERMISSION_FAULT = 52,
  941. EM_INTR_DATA_ACCESS_RIGHT_FAULT = 53,
  942. EM_INTR_DATA_DIRTY_BIT_FAULT = 54,
  943. EM_INTR_DATA_ACCESS_BIT_FAULT = 55,
  944. /* Faults: IA64 */
  945. EM_INTR_DATA_DEBUG_FAULT = 56,
  946. EM_INTR_UNALIGNED_DATA_REFERENCE_FAULT = 57,
  947. /* Faults: IA32 */
  948. EM_INTR_IA_UNALIGNED_DATA_REFERENCE_FAULT = 58,
  949. EM_INTR_IA_LOCKED_DATA_REFERENCE_FAULT = 59,
  950. EM_INTR_IA_SEGMENT_NOT_PRESENT_FAULT = 60,
  951. EM_INTR_IA_DIVIDE_BY_ZERO_FAULT = 61,
  952. EM_INTR_IA_BOUND_FAULT = 62,
  953. EM_INTR_IA_KNI_NUMERIC_ERROR_FAULT = 63,
  954. /* Faults: IA64 */
  955. EM_INTR_LOCKED_DATA_REFERENCE_FAULT = 64,
  956. EM_INTR_FP_EXCEPTION_FAULT = 65,
  957. /* Traps: IA64 */
  958. EM_INTR_UNIMPLEMENTED_INST_ADDRESS_TRAP = 66,
  959. EM_INTR_FP_TRAP = 67,
  960. EM_INTR_LOWER_PRIVILEGE_TARNSFER_TRAP = 68,
  961. EM_INTR_TAKEN_BRANCH_TRAP = 69,
  962. EM_INTR_SINGLE_STEP_TRAP = 70,
  963. /* Traps: IA32 */
  964. EM_INTR_IA_SYSTEM_FLAG_INTERCEPT_TRAP = 71,
  965. EM_INTR_IA_GATE_INTERCEPT_TRAP = 72,
  966. EM_INTR_IA_INTO_TRAP = 73,
  967. EM_INTR_IA_BREAKPOINT_TRAP = 74,
  968. EM_INTR_IA_SOFTWARE_INTERRUPT_TRAP = 75,
  969. EM_INTR_IA_DATA_DEBUG_TRAP = 76,
  970. EM_INTR_IA_TAKEN_BRANCH_TRAP = 77,
  971. EM_INTR_IA_SINGLE_STEP_TRAP = 78,
  972. EM_INTR_LAST = 79
  973. } EM_interruption_t;
  974. /* Interruption Vectors, taken from Table 10-6 in EAS2.4. */
  975. typedef enum
  976. {
  977. EM_VECTOR_VHPT_TRANSLATION = 0x0000,
  978. EM_VECTOR_INST_TLB = 0x0400,
  979. EM_VECTOR_DATA_TLB = 0x0800,
  980. EM_VECTOR_INST_ALT_TLB = 0x0c00,
  981. EM_VECTOR_DATA_ALT_TLB = 0x1000,
  982. EM_VECTOR_DATA_NESTED_TLB = 0x1400,
  983. EM_VECTOR_INST_KEY_MISS = 0x1800,
  984. EM_VECTOR_DATA_KEY_MISS = 0x1C00,
  985. EM_VECTOR_DIRTY_BIT = 0x2000,
  986. EM_VECTOR_INST_ACCESS_BIT = 0x2400,
  987. EM_VECTOR_DATA_ACCESS_BIT = 0x2800,
  988. EM_VECTOR_BREAK_INSTRUCTION = 0x2C00,
  989. EM_VECTOR_EXTERNAL_INTERRUPT = 0x3000,
  990. /*** reserved: 0x3400 through 0x4c00 ***/
  991. EM_VECTOR_PAGE_NOT_PRESENT = 0x5000,
  992. EM_VECTOR_KEY_PERMISSION = 0x5100,
  993. EM_VECTOR_INST_ACCESS_RIGHT = 0x5200,
  994. EM_VECTOR_DATA_ACCESS_RIGHT = 0x5300,
  995. EM_VECTOR_GENERAL_EXCEPTION = 0x5400,
  996. EM_VECTOR_DISABLED_FP_REGISTER = 0x5500,
  997. EM_VECTOR_NAT_CONSUMPTION = 0x5600,
  998. EM_VECTOR_SPECULATION = 0x5700,
  999. /*** reserved: 0x5800 ***/
  1000. EM_VECTOR_DEBUG = 0x5900,
  1001. EM_VECTOR_UNALIGNED_REFERENCE = 0x5A00,
  1002. EM_VECTOR_LOCKED_DATA_REFERENCE = 0x5B00,
  1003. EM_VECTOR_FP_EXCEPTION = 0x5C00,
  1004. EM_VECTOR_FP_TRAP = 0x5D00,
  1005. EM_VECTOR_LOWER_PRIVILEGE_TRANSFER = 0x5E00,
  1006. EM_VECTOR_TAKEN_BRANCH = 0x5F00,
  1007. EM_VECTOR_SINGLE_STEP = 0x6000,
  1008. /*** reserved: 0x6100 through 0x6800 ***/
  1009. EM_VECTOR_IA_EXCEPTIONS = 0x6900,
  1010. EM_VECTOR_IA_INTERCEPTIONS = 0x6A00,
  1011. EM_VECTOR_IA_INTERRUPTIONS = 0x6B00
  1012. /*** reserved: 0x6c00 through 0x7f00 ***/
  1013. } EM_vector_t;
  1014. #define EM_INTR_ISR_CODE_TPA 0
  1015. #define EM_INTR_ISR_CODE_FC 1
  1016. #define EM_INTR_ISR_CODE_PROBE 2
  1017. #define EM_INTR_ISR_CODE_TAK 3
  1018. #define EM_INTR_ISR_CODE_LFETCH 4
  1019. #define EM_INTR_ISR_CODE_PROBE_FAULT 5
  1020. #define EM_ISR_CODE_ILLEGAL_OPERATION 0x0
  1021. #define EM_ISR_CODE_PRIVILEGED_OPERATION 0x10
  1022. #define EM_ISR_CODE_PRIVILEGED_REGISTER 0x20
  1023. #define EM_ISR_CODE_RESERVED_REGISTER_FIELD 0x30
  1024. #define EM_ISR_CODE_ILLEGAL_ISA_TRANSITION 0x40
  1025. #define EM_ISR_CODE_F0_F15 0
  1026. #define EM_ISR_CODE_F16_F127 1
  1027. #define EM_ISR_CODE_NAT_REGISTER_CONSUMPTION 0x10
  1028. #define EM_ISR_CODE_NAT_PAGE_CONSUMPTION 0x20
  1029. #define EM_ISR_CODE_INST_DEBUG 0
  1030. #define EM_ISR_CODE_DATA_DEBUG 1
  1031. #define EM_ISR_CODE_FP_IEEE_V 0x0001
  1032. #define EM_ISR_CODE_FP_IA_DENORMAL 0x0002
  1033. #define EM_ISR_CODE_FP_IEEE_Z 0x0004
  1034. #define EM_ISR_CODE_FP_SOFT_ASSIST 0x0008
  1035. #define EM_ISR_CODE_FP_IEEE_O 0x0800
  1036. #define EM_ISR_CODE_FP_IEEE_U 0x1000
  1037. #define EM_ISR_CODE_FP_IEEE_I 0x2000
  1038. #define EM_ISR_CODE_FP_EXPONENT 0x4000
  1039. #define EM_ISR_CODE_FP_ROUNDING_ADD_1 0x8000
  1040. #define EM_ISR_CODE_MASK_IA_TRAP 0x02
  1041. #define EM_ISR_CODE_MASK_IA_DATA_DEBUG_TRAP 0x00
  1042. #define EM_ISR_CODE_MASK_FP_TRAP 0x01
  1043. #define EM_ISR_CODE_MASK_LOWER_PRIV 0x02
  1044. #define EM_ISR_CODE_MASK_TAKEN_BRANCH 0x04
  1045. #define EM_ISR_CODE_MASK_SINGLE_STEP 0x08
  1046. #define EM_ISR_CODE_MASK_UNIMPLEMENTED_INST 0x10
  1047. #define EM_ISR_VECTOR_MASK_IA_TRAP 0x1
  1048. #define EM_ISR_VECTOR_MASK_EM_TRAP 0x0
  1049. #define EM_ISR_CODE_CHK_A_GR 0
  1050. #define EM_ISR_CODE_CHK_S_GR 1
  1051. #define EM_ISR_CODE_CHK_A_FP 2
  1052. #define EM_ISR_CODE_CHK_S_FP 3
  1053. #define EM_ISR_CODE_CHK_FCHK 4
  1054. /*** SAPIC definitions ***/
  1055. #define EM_SAPIC_SPURIOUS_VECTOR_NUM 0x0f
  1056. #define EM_SAPIC_SIZE_OF_INTERRUPT_GROUP 16
  1057. #define EM_SAPIC_NUM_OF_INTERRUPT_GROUPS 16
  1058. #define EM_SAPIC_GROUPS_IN_IRR 4
  1059. #define EM_SAPIC_GROUP(vec) \
  1060. ((vec) / EM_SAPIC_NUM_OF_INTERRUPT_GROUPS)
  1061. #define EM_SAPIC_IRR(vec) \
  1062. ((vec) / (EM_SAPIC_NUM_OF_INTERRUPT_GROUPS*EM_SAPIC_GROUPS_IN_IRR))
  1063. #define EM_SAPIC_IRR_BIT_POS(vec) \
  1064. ((vec) % (EM_SAPIC_NUM_OF_INTERRUPT_GROUPS*EM_SAPIC_GROUPS_IN_IRR))
  1065. /*** version strings at the .comment section ***/
  1066. #define EM_IAS_OBJECT_FILE_NAME "!!!!Object file name: "
  1067. #define EM_IAS_VER_NUMBER "!!!!Major Version "
  1068. #define EM_IAS_VERSION_COMMENT "!!!!EM_EAS2.6"
  1069. /*** architecture and API versions ***/
  1070. #define EM_EAS_MAJOR_VERSION 2
  1071. #define EM_EAS_MINOR_VERSION 6
  1072. #define EM_API_MAJOR_VERSION 9
  1073. #define EM_API_MINOR_VERSION 6
  1074. /*** END OF EM_H Enhanced Mode ARCHITECTURE ***/
  1075. #endif /*** EM_H ***/