X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=UefiCpuPkg%2FCpuDxe%2FCpuDxe.h;h=064ea05bbacec4a9556e9dbe494e1edfc90cd27c;hb=51d0100b3c711554f28ff990f484e79e053fd518;hp=4861abee76252902a940a8bc2126a1b9d6ccfa42;hpb=b1bd0d7474f6d3e4162da0dcc8a934eb743e7572;p=mirror_edk2.git diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.h b/UefiCpuPkg/CpuDxe/CpuDxe.h index 4861abee76..064ea05bba 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.h +++ b/UefiCpuPkg/CpuDxe/CpuDxe.h @@ -52,6 +52,16 @@ EFI_MEMORY_UCE \ ) +#define EFI_MEMORY_PAGETYPE_MASK (EFI_MEMORY_RP | \ + EFI_MEMORY_XP | \ + EFI_MEMORY_RO \ + ) + +#define HEAP_GUARD_NONSTOP_MODE \ + ((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT6|BIT1|BIT0)) > BIT6) + +#define NULL_DETECTION_NONSTOP_MODE \ + ((PcdGet8 (PcdNullPointerDetectionPropertyMask) & (BIT6|BIT0)) > BIT6) /** Flush CPU data cache. If the instruction cache is fully coherent @@ -261,5 +271,48 @@ SetDataSelectors ( UINT16 Selector ); +/** + Update GCD memory space attributes according to current page table setup. +**/ +VOID +RefreshGcdMemoryAttributesFromPaging ( + VOID + ); + +/** + Special handler for #DB exception, which will restore the page attributes + (not-present). It should work with #PF handler which will set pages to + 'present'. + + @param ExceptionType Exception type. + @param SystemContext Pointer to EFI_SYSTEM_CONTEXT. + +**/ +VOID +EFIAPI +DebugExceptionHandler ( + IN EFI_EXCEPTION_TYPE ExceptionType, + IN EFI_SYSTEM_CONTEXT SystemContext + ); + +/** + Special handler for #PF exception, which will set the pages which caused + #PF to be 'present'. The attribute of those pages should be restored in + the subsequent #DB handler. + + @param ExceptionType Exception type. + @param SystemContext Pointer to EFI_SYSTEM_CONTEXT. + +**/ +VOID +EFIAPI +PageFaultExceptionHandler ( + IN EFI_EXCEPTION_TYPE ExceptionType, + IN EFI_SYSTEM_CONTEXT SystemContext + ); + +extern BOOLEAN mIsAllocatingPageTable; +extern UINTN mNumberOfProcessors; + #endif