Add additional constants.

- Add constants for the fields in the root-entry table address register,
  namely the root type type (RTT) and root table address (RTA) mask.
- Add macros for the bitmask of the domain ID field in the second word
  of context table entries as well as a helper macro (DMAR_CTX2_GET_DID)
  to extract the domain ID from a context table entry.

Reviewed by:	kib
MFC after:	1 month
Sponsored by:	Chelsio Communications
This commit is contained in:
John Baldwin 2016-08-09 19:02:14 +00:00
parent 10012d5309
commit 264cd10809

View File

@ -67,7 +67,9 @@ typedef struct dmar_ctx_entry {
#define DMAR_CTX2_AW_4LVL 2 /* 4-level page tables */
#define DMAR_CTX2_AW_5LVL 3 /* 5-level page tables */
#define DMAR_CTX2_AW_6LVL 4 /* 6-level page tables */
#define DMAR_CTX2_DID_MASK 0xffff0
#define DMAR_CTX2_DID(x) ((x) << 8) /* Domain Identifier */
#define DMAR_CTX2_GET_DID(ctx2) (((ctx2) & DMAR_CTX2_DID_MASK) >> 8)
typedef struct dmar_pte {
uint64_t pte;
@ -214,6 +216,8 @@ typedef struct dmar_irte {
/* Root-Entry Table Address register */
#define DMAR_RTADDR_REG 0x20
#define DMAR_RTADDR_RTT (1 << 11) /* Root Table Type */
#define DMAR_RTADDR_RTA_MASK 0xfffffffffffff000
/* Context Command register */
#define DMAR_CCMD_REG 0x28