UefiCpuPkg/CpuDxe: clean up PAGE_TABLE_LIB_PAGING_CONTEXT usage.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1039

Current implementation not checks system mode before using
PAGE_TABLE_LIB_PAGING_CONTEXT.ContextData.X64 or
PAGE_TABLE_LIB_PAGING_CONTEXT.ContextData.Ia32. This patch check the
mode before using the correct one.

Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Dong, Eric
2019-09-12 13:22:18 +08:00
committed by Eric Dong
parent a3596a040b
commit c70fef962e
5 changed files with 112 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
## @file
# CPU driver installs CPU Architecture Protocol and CPU MP protocol.
#
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -54,9 +54,11 @@
[Sources.IA32]
Ia32/CpuAsm.nasm
Ia32/PagingAttribute.c
[Sources.X64]
X64/CpuAsm.nasm
X64/PagingAttribute.c
[Protocols]
gEfiCpuArchProtocolGuid ## PRODUCES