HelenOS sources
#ifndef KERN_ia64_REGISTER_H_
#define KERN_ia64_REGISTER_H_
#define DCR_PP_MASK (1 << 0)
#define DCR_BE_MASK (1 << 1)
#define DCR_LC_MASK (1 << 2)
#define DCR_DM_MASK (1 << 8)
#define DCR_DP_MASK (1 << 9)
#define DCR_DK_MASK (1 << 10)
#define DCR_DX_MASK (1 << 11)
#define DCR_DR_MASK (1 << 12)
#define DCR_DA_MASK (1 << 13)
#define DCR_DD_MASK (1 << 14)
#define CR_IVR_MASK 0x0f
#define PSR_IC_MASK (1 << 13)
#define PSR_I_MASK (1 << 14)
#define PSR_PK_MASK (1 << 15)
#define PSR_DT_MASK (1 << 17)
#define PSR_DFL_MASK (1 << 18)
#define PSR_DFH_MASK (1 << 19)
#define PSR_RT_MASK (1 << 27)
#define PSR_IT_MASK (1 << 36)
#define PSR_CPL_USER 3
#define PSR_CPL_KERNEL 0
#define PSR_CPL_SHIFT 32
#define PSR_CPL_MASK_SHIFTED 3
#define PSR_RI_SHIFT 41
#define PSR_RI_LEN 2
#define PFM_MASK (~0x3fffffffff)
#define RSC_MODE_MASK 3
#define RSC_PL_MASK 12
#define FPSR_TRAPS_VD (1 << 0)
#define FPSR_TRAPS_DD (1 << 1)
#define FPSR_TRAPS_ZD (1 << 2)
#define FPSR_TRAPS_OD (1 << 3)
#define FPSR_TRAPS_UD (1 << 4)
#define FPSR_TRAPS_ID (1 << 5)
#define FPSR_TRAPS_ALL (FPSR_TRAPS_VD | FPSR_TRAPS_DD | FPSR_TRAPS_ZD | \
FPSR_TRAPS_OD | FPSR_TRAPS_UD | FPSR_TRAPS_ID)
#define FPSR_SF1_SHIFT 19
#define FPSR_CTRL_WRE (1 << 1)
#define FPSR_CTRL_PC_EXTENDED (3 << 2)
#define FPSR_CTRL_RC_NEAREST (0 << 4)
#define FPSR_CTRL_TD (1 << 6)
#define FPSR_SF1_CTRL ((FPSR_CTRL_WRE | FPSR_CTRL_PC_EXTENDED | \
FPSR_CTRL_RC_NEAREST | FPSR_CTRL_TD) << FPSR_SF1_SHIFT)
#define AR_KR0 0
#define AR_KR1 1
#define AR_KR2 2
#define AR_KR3 3
#define AR_KR4 4
#define AR_KR5 5
#define AR_KR6 6
#define AR_KR7 7
#define AR_RSC 16
#define AR_BSP 17
#define AR_BSPSTORE 18
#define AR_RNAT 19
#define AR_FCR 21
#define AR_EFLAG 24
#define AR_CSD 25
#define AR_SSD 26
#define AR_CFLG 27
#define AR_FSR 28
#define AR_FIR 29
#define AR_FDR 30
#define AR_CCV 32
#define AR_UNAT 36
#define AR_FPSR 40
#define AR_ITC 44
#define AR_PFS 64
#define AR_LC 65
#define AR_EC 66
#define CR_DCR 0
#define CR_ITM 1
#define CR_IVA 2
#define CR_PTA 8
#define CR_IPSR 16
#define CR_ISR 17
#define CR_IIP 19
#define CR_IFA 20
#define CR_ITIR 21
#define CR_IIPA 22
#define CR_IFS 23
#define CR_IIM 24
#define CR_IHA 25
#define CR_LID 64
#define CR_IVR 65
#define CR_TPR 66
#define CR_EOI 67
#define CR_IRR0 68
#define CR_IRR1 69
#define CR_IRR2 70
#define CR_IRR3 71
#define CR_ITV 72
#define CR_PMV 73
#define CR_CMCV 74
#define CR_LRR0 80
#define CR_LRR1 81
#ifndef __ASSEMBLER__
#include <stdint.h>
typedef union {
uint64_t value;
struct {
unsigned int : 1;
unsigned int be : 1;
unsigned int up : 1;
unsigned int ac : 1;
unsigned int mfl : 1;
unsigned int mfh : 1;
unsigned int : 7;
unsigned int ic : 1;
unsigned int i : 1;
unsigned int pk : 1;
unsigned int : 1;
unsigned int dt : 1;
unsigned int dfl : 1;
unsigned int dfh : 1;
unsigned int sp : 1;
unsigned int pp : 1;
unsigned int di : 1;
unsigned int si : 1;
unsigned int db : 1;
unsigned int lp : 1;
unsigned int tb : 1;
unsigned int rt : 1;
unsigned int : 4;
unsigned int cpl : 2;
unsigned int is : 1;
unsigned int mc : 1;
unsigned int it : 1;
unsigned int id : 1;
unsigned int da : 1;
unsigned int dd : 1;
unsigned int ss : 1;
unsigned int ri : 2;
unsigned int ed : 1;
unsigned int bn : 1;
unsigned int ia : 1;
} __attribute__((packed));
} psr_t;
typedef union {
uint64_t value;
struct {
unsigned int mode : 2;
unsigned int pl : 2;
unsigned int be : 1;
unsigned int : 11;
unsigned int loadrs : 14;
} __attribute__((packed));
} rsc_t;
typedef union {
uint8_t vector;
uint64_t value;
} cr_ivr_t;
typedef union {
uint64_t value;
struct {
unsigned int : 4;
unsigned int mic : 4;
unsigned int : 8;
unsigned int mmi : 1;
} __attribute__((packed));
} cr_tpr_t;
typedef union {
uint64_t value;
struct {
unsigned int vector : 8;
unsigned int : 4;
unsigned int : 1;
unsigned int : 3;
unsigned int m : 1;
} __attribute__((packed));
} cr_itv_t;
typedef union {
uint64_t value;
struct {
union {
uint16_t code;
struct {
unsigned int ge_na : 4;
unsigned int ge_code : 4;
} __attribute__((packed));
};
uint8_t vector;
unsigned int : 8;
unsigned int x : 1;
unsigned int w : 1;
unsigned int r : 1;
unsigned int na : 1;
unsigned int sp : 1;
unsigned int rs : 1;
unsigned int ir : 1;
unsigned int ni : 1;
unsigned int so : 1;
unsigned int ei : 2;
unsigned int ed : 1;
unsigned int : 20;
} __attribute__((packed));
} cr_isr_t;
typedef union {
uint64_t value;
struct {
uint8_t number;
uint8_t revision;
uint8_t model;
uint8_t family;
uint8_t archrev;
} __attribute__((packed));
} cpuid3_t;
#endif
#endif
HelenOS homepage, sources at GitHub