\r
#define REGION_LENGTH(l) LShiftU64 (1, (l) * 9 + 3)\r
\r
+typedef enum {\r
+ Pte = 1,\r
+ Pde = 2,\r
+ Pdpte = 3,\r
+ Pml4 = 4,\r
+ Pml5 = 5\r
+} IA32_PAGE_LEVEL;\r
+\r
typedef struct {\r
UINT64 Present : 1; // 0 = Not present in memory, 1 = Present in memory\r
UINT64 ReadWrite : 1; // 0 = Read-Only, 1= Read/Write\r
IN BOOLEAN Modify,\r
IN VOID *Buffer,\r
IN OUT INTN *BufferSize,\r
- IN UINTN Level,\r
- IN UINTN MaxLeafLevel,\r
+ IN IA32_PAGE_LEVEL Level,\r
+ IN IA32_PAGE_LEVEL MaxLeafLevel,\r
IN UINT64 LinearAddress,\r
IN UINT64 Length,\r
IN UINT64 Offset,\r
IA32_PAGING_ENTRY TopPagingEntry;\r
INTN RequiredSize;\r
UINT64 MaxLinearAddress;\r
- UINTN MaxLevel;\r
- UINTN MaxLeafLevel;\r
+ IA32_PAGE_LEVEL MaxLevel;\r
+ IA32_PAGE_LEVEL MaxLeafLevel;\r
IA32_MAP_ATTRIBUTE ParentAttribute;\r
\r
if ((PagingMode == Paging32bit) || (PagingMode == PagingPae) || (PagingMode >= PagingModeMax)) {\r
return RETURN_INVALID_PARAMETER;\r
}\r
\r
- MaxLeafLevel = (UINT8)PagingMode;\r
- MaxLevel = (UINT8)(PagingMode >> 8);\r
+ MaxLeafLevel = (IA32_PAGE_LEVEL)(UINT8)PagingMode;\r
+ MaxLevel = (IA32_PAGE_LEVEL)(UINT8)(PagingMode >> 8);\r
MaxLinearAddress = LShiftU64 (1, 12 + MaxLevel * 9);\r
\r
if ((LinearAddress > MaxLinearAddress) || (Length > MaxLinearAddress - LinearAddress)) {\r