diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/edk2/UefiCpuPkg/CpuDxe/Ia32 | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/edk2/UefiCpuPkg/CpuDxe/Ia32')
-rw-r--r-- | roms/edk2/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.nasm | 47 | ||||
-rw-r--r-- | roms/edk2/UefiCpuPkg/CpuDxe/Ia32/PagingAttribute.c | 34 |
2 files changed, 81 insertions, 0 deletions
diff --git a/roms/edk2/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.nasm b/roms/edk2/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.nasm new file mode 100644 index 000000000..0b99e3ec3 --- /dev/null +++ b/roms/edk2/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.nasm @@ -0,0 +1,47 @@ +;------------------------------------------------------------------------------
+;*
+;* Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+;* SPDX-License-Identifier: BSD-2-Clause-Patent
+;*
+;* CpuAsm.nasm
+;*
+;* Abstract:
+;*
+;------------------------------------------------------------------------------
+
+ SECTION .text
+
+;------------------------------------------------------------------------------
+; VOID
+; SetCodeSelector (
+; UINT16 Selector
+; );
+;------------------------------------------------------------------------------
+global ASM_PFX(SetCodeSelector)
+ASM_PFX(SetCodeSelector):
+ mov ecx, [esp+4]
+ sub esp, 0x10
+ lea eax, [setCodeSelectorLongJump]
+ mov [esp], eax
+ mov [esp+4], cx
+ jmp dword far [esp]
+setCodeSelectorLongJump:
+ add esp, 0x10
+ ret
+
+;------------------------------------------------------------------------------
+; VOID
+; SetDataSelectors (
+; UINT16 Selector
+; );
+;------------------------------------------------------------------------------
+global ASM_PFX(SetDataSelectors)
+ASM_PFX(SetDataSelectors):
+ mov ecx, [esp+4]
+o16 mov ss, cx
+o16 mov ds, cx
+o16 mov es, cx
+o16 mov fs, cx
+o16 mov gs, cx
+ ret
+
diff --git a/roms/edk2/UefiCpuPkg/CpuDxe/Ia32/PagingAttribute.c b/roms/edk2/UefiCpuPkg/CpuDxe/Ia32/PagingAttribute.c new file mode 100644 index 000000000..3325a42dd --- /dev/null +++ b/roms/edk2/UefiCpuPkg/CpuDxe/Ia32/PagingAttribute.c @@ -0,0 +1,34 @@ +/** @file
+ Return Paging attribute.
+
+ Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "CpuPageTable.h"
+
+
+/**
+ Get paging details.
+
+ @param PagingContextData The paging context.
+ @param PageTableBase Return PageTableBase field.
+ @param Attributes Return Attributes field.
+
+**/
+VOID
+GetPagingDetails (
+ IN PAGE_TABLE_LIB_PAGING_CONTEXT_DATA *PagingContextData,
+ OUT UINTN **PageTableBase OPTIONAL,
+ OUT UINT32 **Attributes OPTIONAL
+ )
+{
+ if (PageTableBase != NULL) {
+ *PageTableBase = &PagingContextData->Ia32.PageTableBase;
+ }
+ if (Attributes != NULL) {
+ *Attributes = &PagingContextData->Ia32.Attributes;
+ }
+}
+
|