IntelFrameworkModulePkg/LegacyBios: Use macro to enable/disable page 0

Current implementation uses following two methods

    EnableNullDetection()
    DisableNullDetection()

to enable/disable page 0. These two methods will check PCD
PcdNullPointerDetectionPropertyMask to know if the page 0 is disabled or not.
This is due to the fact that old GCD service doesn't provide paging related
attributes of memory block. Since this issue has been fixed, GCD services
can be used to determine the paging status of page 0. This is also make it
possible to just use a new macro

    ACCESS_PAGE0_CODE(
      <code accessing page 0>
    );

to replace above methods to do the same job, which also makes code more
readability.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
Jian J Wang
2017-12-07 17:00:23 +08:00
committed by Star Zeng
parent 7619eed8aa
commit 2ea3576e16
7 changed files with 135 additions and 273 deletions

View File

@@ -1544,20 +1544,4 @@ LegacyBiosInstallVgaRom (
IN LEGACY_BIOS_INSTANCE *Private
);
/**
Enable NULL pointer detection.
**/
VOID
EnableNullDetection (
VOID
);
/**
Disable NULL pointer detection.
**/
VOID
DisableNullDetection (
VOID
);
#endif