mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
ANDROID: KVM: arm64: s2mpu: Extract L1ENTRY_* consts
Extract the L1ENTRY_ATTR_{PRON,GRAN}_MASK constants out of macros that
create the corresponding constants. This will allow EL1 users to use the
masks to get the fields out of register values. Also extract
L1ENTRY_L2TABLE_ADDR_SHIFT for adjusting the L2 table address.
Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I45578857694ca39266fe45b3c00dbea33738167f
This commit is contained in:
@@ -94,14 +94,17 @@
|
||||
#define FAULT_INFO_LEN_MASK GENMASK(19, 16)
|
||||
#define FAULT_INFO_ID_MASK GENMASK(15, 0)
|
||||
|
||||
#define L1ENTRY_L2TABLE_ADDR(pa) ((pa) >> 4)
|
||||
#define L1ENTRY_L2TABLE_ADDR_SHIFT 4
|
||||
#define L1ENTRY_L2TABLE_ADDR(pa) ((pa) >> L1ENTRY_L2TABLE_ADDR_SHIFT)
|
||||
|
||||
#define L1ENTRY_ATTR_L2TABLE_EN BIT(0)
|
||||
#define L1ENTRY_ATTR_GRAN_4K 0x0
|
||||
#define L1ENTRY_ATTR_GRAN_64K 0x1
|
||||
#define L1ENTRY_ATTR_GRAN_2M 0x2
|
||||
#define L1ENTRY_ATTR_PROT(prot) FIELD_PREP(GENMASK(2, 1), prot)
|
||||
#define L1ENTRY_ATTR_GRAN(gran) FIELD_PREP(GENMASK(5, 4), gran)
|
||||
#define L1ENTRY_ATTR_PROT_MASK GENMASK(2, 1)
|
||||
#define L1ENTRY_ATTR_GRAN_MASK GENMASK(5, 4)
|
||||
#define L1ENTRY_ATTR_PROT(prot) FIELD_PREP(L1ENTRY_ATTR_PROT_MASK, prot)
|
||||
#define L1ENTRY_ATTR_GRAN(gran) FIELD_PREP(L1ENTRY_ATTR_GRAN_MASK, gran)
|
||||
#define L1ENTRY_ATTR_1G(prot) L1ENTRY_ATTR_PROT(prot)
|
||||
#define L1ENTRY_ATTR_L2(gran) (L1ENTRY_ATTR_GRAN(gran) | \
|
||||
L1ENTRY_ATTR_L2TABLE_EN)
|
||||
|
||||
Reference in New Issue
Block a user