diff --git a/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj b/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj
index ce42402..3e2e1f4 100644
--- a/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj
+++ b/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj
@@ -1,37 +1,45 @@
-
- Debug
- Win32
+
+ 1507
+ x64
-
- Release
- Win32
+
+ 1511
+ x64
-
- Debug
+
+ 1607x64
-
- Release
+
+ 1703x64
-
- Debug
- ARM
+
+ 1709
+ x64
-
- Release
- ARM
+
+ 1803
+ x64
-
- Debug
- ARM64
+
+ 1809
+ x64
-
- Release
- ARM64
+
+ 1903
+ x64
+
+
+ 1909
+ x64
+
+
+ 2004
+ x64
@@ -45,32 +53,43 @@
$(LatestTargetPlatformVersion)
-
+
+ Windows10
+ false
+ WindowsKernelModeDriver10.0
+ DynamicLibrary
+ KMDF
+ Universal
+ false
+
+ Windows10
- true
+ falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
-
+ Windows10falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
-
+ Windows10
- true
+ falseWindowsKernelModeDriver10.0DynamicLibraryKMDFUniversalfalse
-
+ Windows10falseWindowsKernelModeDriver10.0
@@ -79,37 +98,50 @@
Universalfalse
-
+ Windows10
- true
+ falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
-
+ Windows10falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
-
+ Windows10
- true
+ falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
-
+ Windows10falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
+
+
+ Windows10
+ false
+ WindowsKernelModeDriver10.0
+ DynamicLibrary
+ KMDF
+ Universal
+ false
@@ -119,49 +151,161 @@
-
+ DbgengKernelDebugger
+ false
-
+ DbgengKernelDebugger
+ false
+
+
+ DbgengKernelDebugger
+ false
-
+ DbgengKernelDebuggerfalse
-
+ DbgengKernelDebuggerfalse
-
+ DbgengKernelDebugger
+ false
-
+ DbgengKernelDebugger
+ false
-
+ DbgengKernelDebugger
+ false
-
+ DbgengKernelDebugger
+ false
-
+
+ DbgengKernelDebugger
+ false
+
+
+
+ stdcpp17
+ false
+ false
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1909;
+
+
+ vmexit_handler
+
+
+
+
+ stdcpp17
+ false
+ false
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1903;
+
+
+ vmexit_handler
+
+
+
+
+ stdcpp17
+ false
+ false
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1809;
+
+
+ vmexit_handler
+
+
+
+
+ stdcpp17
+ false
+ false
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1803;
+
+
+ vmexit_handler
+
+
+
+
+ stdcpp17
+ false
+ false
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1709
+
+
+ vmexit_handler
+
+
+
+
+ stdcpp17
+ false
+ false
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1703
+
+
+ vmexit_handler
+
+
+
+
+ stdcpp17
+ false
+ false
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1607
+
+
+ vmexit_handler
+
+
+
+
+ stdcpp17
+ false
+ false
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1511;
+
+
+ vmexit_handler
+
+
+ stdcpp17falsefalsefalse
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1903;vmexit_handler
-
+ stdcpp17falsefalsefalse
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=2004;vmexit_handler
@@ -171,6 +315,7 @@
+
diff --git a/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj.filters b/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj.filters
index af9a042..664077a 100644
--- a/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj.filters
+++ b/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj.filters
@@ -14,6 +14,9 @@
Header Files
+
+ Header Files
+
diff --git a/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj.user b/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj.user
new file mode 100644
index 0000000..88a5509
--- /dev/null
+++ b/Voyager/PayLoad (AMD)/PayLoad (AMD).vcxproj.user
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/Voyager/PayLoad (AMD)/pg_table.h b/Voyager/PayLoad (AMD)/pg_table.h
new file mode 100644
index 0000000..5326cab
--- /dev/null
+++ b/Voyager/PayLoad (AMD)/pg_table.h
@@ -0,0 +1,113 @@
+#pragma once
+#include "types.h"
+
+#pragma section(".pdpt", read, write)
+#pragma section(".pd", read, write)
+#pragma section(".pt", read, write)
+
+typedef union _virt_addr_t
+{
+ void* value;
+ struct
+ {
+ u64 offset : 12;
+ u64 pt_index : 9;
+ u64 pd_index : 9;
+ u64 pdpt_index : 9;
+ u64 pml4_index : 9;
+ u64 reserved : 16;
+ };
+} virt_addr_t, * pvirt_addr_t;
+
+typedef union _pml4e
+{
+ u64 value;
+ struct
+ {
+ u64 present : 1; // Must be 1, region invalid if 0.
+ u64 ReadWrite : 1; // If 0, writes not allowed.
+ u64 user_supervisor : 1; // If 0, user-mode accesses not allowed.
+ u64 PageWriteThrough : 1; // Determines the memory type used to access PDPT.
+ u64 page_cache : 1; // Determines the memory type used to access PDPT.
+ u64 accessed : 1; // If 0, this entry has not been used for translation.
+ u64 Ignored1 : 1;
+ u64 page_size : 1; // Must be 0 for PML4E.
+ u64 Ignored2 : 4;
+ u64 pfn : 36; // The page frame number of the PDPT of this PML4E.
+ u64 Reserved : 4;
+ u64 Ignored3 : 11;
+ u64 nx : 1; // If 1, instruction fetches not allowed.
+ };
+} pml4e, * ppml4e;
+
+typedef union _pdpte
+{
+ u64 value;
+ struct
+ {
+ u64 present : 1; // Must be 1, region invalid if 0.
+ u64 rw : 1; // If 0, writes not allowed.
+ u64 user_supervisor : 1; // If 0, user-mode accesses not allowed.
+ u64 PageWriteThrough : 1; // Determines the memory type used to access PD.
+ u64 page_cache : 1; // Determines the memory type used to access PD.
+ u64 accessed : 1; // If 0, this entry has not been used for translation.
+ u64 Ignored1 : 1;
+ u64 page_size : 1; // If 1, this entry maps a 1GB page.
+ u64 Ignored2 : 4;
+ u64 pfn : 36; // The page frame number of the PD of this PDPTE.
+ u64 Reserved : 4;
+ u64 Ignored3 : 11;
+ u64 nx : 1; // If 1, instruction fetches not allowed.
+ };
+} pdpte, * ppdpte;
+
+typedef union _pde
+{
+ u64 value;
+ struct
+ {
+ u64 present : 1; // Must be 1, region invalid if 0.
+ u64 rw : 1; // If 0, writes not allowed.
+ u64 user_supervisor : 1; // If 0, user-mode accesses not allowed.
+ u64 PageWriteThrough : 1; // Determines the memory type used to access PT.
+ u64 page_cache : 1; // Determines the memory type used to access PT.
+ u64 accessed : 1; // If 0, this entry has not been used for translation.
+ u64 Ignored1 : 1;
+ u64 page_size : 1; // If 1, this entry maps a 2MB page.
+ u64 Ignored2 : 4;
+ u64 pfn : 36; // The page frame number of the PT of this PDE.
+ u64 Reserved : 4;
+ u64 Ignored3 : 11;
+ u64 nx : 1; // If 1, instruction fetches not allowed.
+ };
+} pde, * ppde;
+
+typedef union _pte
+{
+ u64 value;
+ struct
+ {
+ u64 present : 1; // Must be 1, region invalid if 0.
+ u64 rw : 1; // If 0, writes not allowed.
+ u64 user_supervisor : 1; // If 0, user-mode accesses not allowed.
+ u64 PageWriteThrough : 1; // Determines the memory type used to access the memory.
+ u64 page_cache : 1; // Determines the memory type used to access the memory.
+ u64 accessed : 1; // If 0, this entry has not been used for translation.
+ u64 Dirty : 1; // If 0, the memory backing this page has not been written to.
+ u64 PageAccessType : 1; // Determines the memory type used to access the memory.
+ u64 Global : 1; // If 1 and the PGE bit of CR4 is set, translations are global.
+ u64 Ignored2 : 3;
+ u64 pfn : 36; // The page frame number of the backing physical page.
+ u64 reserved : 4;
+ u64 Ignored3 : 7;
+ u64 ProtectionKey : 4; // If the PKE bit of CR4 is set, determines the protection key.
+ u64 nx : 1; // If 1, instruction fetches not allowed.
+ };
+} pte, * ppte;
+
+namespace pg_table
+{
+ __declspec(allocate(".pdpt")) inline pdpte pdpt[512];
+ __declspec(allocate(".pd")) inline pde pd[512];
+ __declspec(allocate(".pt")) inline pte pt[512];
+}
\ No newline at end of file
diff --git a/Voyager/PayLoad (AMD)/types.h b/Voyager/PayLoad (AMD)/types.h
index d715d67..d9abdc2 100644
--- a/Voyager/PayLoad (AMD)/types.h
+++ b/Voyager/PayLoad (AMD)/types.h
@@ -5,9 +5,7 @@
#include
#include
-#define WINVER 1507
#define VMEXIT_KEY 0xDEADBEEFDEADBEEF
-
#define PORT_NUM 0x2F8
#define DBG_PRINT(arg) \
__outbytestring(PORT_NUM, (unsigned char*)arg, sizeof arg);
diff --git a/Voyager/PayLoad (Intel)/PayLoad (Intel).vcxproj b/Voyager/PayLoad (Intel)/PayLoad (Intel).vcxproj
index d2b3fc5..92ebb40 100644
--- a/Voyager/PayLoad (Intel)/PayLoad (Intel).vcxproj
+++ b/Voyager/PayLoad (Intel)/PayLoad (Intel).vcxproj
@@ -1,37 +1,45 @@
-
- Debug
- Win32
+
+ 1507
+ x64
+
+
+ 1511
+ x64
-
- Release
- Win32
+
+ 1607
+ x64
-
- Debug
+
+ 1703x64
-
- Release
+
+ 1709x64
-
- Debug
- ARM
+
+ 1803
+ x64
-
- Release
- ARM
+
+ 1809
+ x64
-
- Debug
- ARM64
+
+ 1903
+ x64
-
- Release
- ARM64
+
+ 1909
+ x64
+
+
+ 2004
+ x64
@@ -46,31 +54,88 @@
PayLoad (Intel)
-
+
+ Windows10
+ false
+ WindowsKernelModeDriver10.0
+ DynamicLibrary
+ KMDF
+ Universal
+ false
+
+
+ Windows10
+ false
+ WindowsKernelModeDriver10.0
+ DynamicLibrary
+ KMDF
+ Universal
+ false
+
+
+ Windows10
+ false
+ WindowsKernelModeDriver10.0
+ DynamicLibrary
+ KMDF
+ Universal
+ false
+
+
+ Windows10
+ false
+ WindowsKernelModeDriver10.0
+ DynamicLibrary
+ KMDF
+ Universal
+ false
+
+
+ Windows10
+ false
+ WindowsKernelModeDriver10.0
+ DynamicLibrary
+ KMDF
+ Universal
+ false
+
+
+ Windows10
+ false
+ WindowsKernelModeDriver10.0
+ DynamicLibrary
+ KMDF
+ Universal
+ false
+
+ Windows10
- true
+ falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
-
+ Windows10falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
-
+ Windows10
- true
+ falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
-
+ Windows10falseWindowsKernelModeDriver10.0
@@ -79,37 +144,50 @@
Universalfalse
-
+ Windows10
- true
+ falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
-
+ Windows10falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
-
+ Windows10
- true
+ falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
+
+
+ Windows10
+ false
+ WindowsKernelModeDriver10.0
+ DynamicLibrary
+ KMDF
+ Universal
+ false
-
+ Windows10falseWindowsKernelModeDriver10.0
- Driver
+ DynamicLibraryKMDFUniversal
+ false
@@ -119,32 +197,441 @@
-
+
+ DbgengKernelDebugger
+ .dll
+
+ DbgengKernelDebugger
+ .dll
-
+ DbgengKernelDebugger
+ .dll
-
+ DbgengKernelDebugger
+ .dll
-
+ DbgengKernelDebugger.dll
-
+ DbgengKernelDebugger
+ .dll
-
+ DbgengKernelDebugger
+ .dll
-
+ DbgengKernelDebugger
+ .dll
-
+ DbgengKernelDebugger
+ .dll
-
+
+ DbgengKernelDebugger
+ .dll
+
+
+ DbgengKernelDebugger
+ .dll
+
+
+ DbgengKernelDebugger
+ .dll
+
+
+ DbgengKernelDebugger
+ .dll
+
+
+ DbgengKernelDebugger
+ .dll
+
+
+ DbgengKernelDebugger
+ .dll
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+ %(PreprocessorDefinitions);WINVER=1909;
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1903;
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1803;
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1709;
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1703;
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1607;
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1507;
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1607;
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+ _WIN64;_AMD64_;AMD64;%(PreprocessorDefinitions);WINVER=1607;
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+
+
+ true
+
+
+
+
+ vmexit_handler
+ true
+ Default
+ false
+ libcmt.lib;libucrt.lib;libvcruntime.lib;%(AdditionalDependencies)
+ true
+
+
+ TurnOffAllWarnings
+ false
+ false
+ stdcpp17
+ Disabled
+ Neither
+ false
+ MultiThreaded
+ false
+ true
+ false
+ %(PreprocessorDefinitions);WINVER=2004;
+
+
+ true
+
+
+ vmexit_handlertrue
@@ -165,6 +652,7 @@
falsetruefalse
+ %(PreprocessorDefinitions);WINVER=2004;true
@@ -178,6 +666,7 @@
+
diff --git a/Voyager/PayLoad (Intel)/PayLoad (Intel).vcxproj.filters b/Voyager/PayLoad (Intel)/PayLoad (Intel).vcxproj.filters
index f4c1334..2773064 100644
--- a/Voyager/PayLoad (Intel)/PayLoad (Intel).vcxproj.filters
+++ b/Voyager/PayLoad (Intel)/PayLoad (Intel).vcxproj.filters
@@ -22,5 +22,8 @@
Header Files
+
+ Header Files
+
\ No newline at end of file
diff --git a/Voyager/PayLoad (Intel)/pg_table.h b/Voyager/PayLoad (Intel)/pg_table.h
new file mode 100644
index 0000000..5326cab
--- /dev/null
+++ b/Voyager/PayLoad (Intel)/pg_table.h
@@ -0,0 +1,113 @@
+#pragma once
+#include "types.h"
+
+#pragma section(".pdpt", read, write)
+#pragma section(".pd", read, write)
+#pragma section(".pt", read, write)
+
+typedef union _virt_addr_t
+{
+ void* value;
+ struct
+ {
+ u64 offset : 12;
+ u64 pt_index : 9;
+ u64 pd_index : 9;
+ u64 pdpt_index : 9;
+ u64 pml4_index : 9;
+ u64 reserved : 16;
+ };
+} virt_addr_t, * pvirt_addr_t;
+
+typedef union _pml4e
+{
+ u64 value;
+ struct
+ {
+ u64 present : 1; // Must be 1, region invalid if 0.
+ u64 ReadWrite : 1; // If 0, writes not allowed.
+ u64 user_supervisor : 1; // If 0, user-mode accesses not allowed.
+ u64 PageWriteThrough : 1; // Determines the memory type used to access PDPT.
+ u64 page_cache : 1; // Determines the memory type used to access PDPT.
+ u64 accessed : 1; // If 0, this entry has not been used for translation.
+ u64 Ignored1 : 1;
+ u64 page_size : 1; // Must be 0 for PML4E.
+ u64 Ignored2 : 4;
+ u64 pfn : 36; // The page frame number of the PDPT of this PML4E.
+ u64 Reserved : 4;
+ u64 Ignored3 : 11;
+ u64 nx : 1; // If 1, instruction fetches not allowed.
+ };
+} pml4e, * ppml4e;
+
+typedef union _pdpte
+{
+ u64 value;
+ struct
+ {
+ u64 present : 1; // Must be 1, region invalid if 0.
+ u64 rw : 1; // If 0, writes not allowed.
+ u64 user_supervisor : 1; // If 0, user-mode accesses not allowed.
+ u64 PageWriteThrough : 1; // Determines the memory type used to access PD.
+ u64 page_cache : 1; // Determines the memory type used to access PD.
+ u64 accessed : 1; // If 0, this entry has not been used for translation.
+ u64 Ignored1 : 1;
+ u64 page_size : 1; // If 1, this entry maps a 1GB page.
+ u64 Ignored2 : 4;
+ u64 pfn : 36; // The page frame number of the PD of this PDPTE.
+ u64 Reserved : 4;
+ u64 Ignored3 : 11;
+ u64 nx : 1; // If 1, instruction fetches not allowed.
+ };
+} pdpte, * ppdpte;
+
+typedef union _pde
+{
+ u64 value;
+ struct
+ {
+ u64 present : 1; // Must be 1, region invalid if 0.
+ u64 rw : 1; // If 0, writes not allowed.
+ u64 user_supervisor : 1; // If 0, user-mode accesses not allowed.
+ u64 PageWriteThrough : 1; // Determines the memory type used to access PT.
+ u64 page_cache : 1; // Determines the memory type used to access PT.
+ u64 accessed : 1; // If 0, this entry has not been used for translation.
+ u64 Ignored1 : 1;
+ u64 page_size : 1; // If 1, this entry maps a 2MB page.
+ u64 Ignored2 : 4;
+ u64 pfn : 36; // The page frame number of the PT of this PDE.
+ u64 Reserved : 4;
+ u64 Ignored3 : 11;
+ u64 nx : 1; // If 1, instruction fetches not allowed.
+ };
+} pde, * ppde;
+
+typedef union _pte
+{
+ u64 value;
+ struct
+ {
+ u64 present : 1; // Must be 1, region invalid if 0.
+ u64 rw : 1; // If 0, writes not allowed.
+ u64 user_supervisor : 1; // If 0, user-mode accesses not allowed.
+ u64 PageWriteThrough : 1; // Determines the memory type used to access the memory.
+ u64 page_cache : 1; // Determines the memory type used to access the memory.
+ u64 accessed : 1; // If 0, this entry has not been used for translation.
+ u64 Dirty : 1; // If 0, the memory backing this page has not been written to.
+ u64 PageAccessType : 1; // Determines the memory type used to access the memory.
+ u64 Global : 1; // If 1 and the PGE bit of CR4 is set, translations are global.
+ u64 Ignored2 : 3;
+ u64 pfn : 36; // The page frame number of the backing physical page.
+ u64 reserved : 4;
+ u64 Ignored3 : 7;
+ u64 ProtectionKey : 4; // If the PKE bit of CR4 is set, determines the protection key.
+ u64 nx : 1; // If 1, instruction fetches not allowed.
+ };
+} pte, * ppte;
+
+namespace pg_table
+{
+ __declspec(allocate(".pdpt")) inline pdpte pdpt[512];
+ __declspec(allocate(".pd")) inline pde pd[512];
+ __declspec(allocate(".pt")) inline pte pt[512];
+}
\ No newline at end of file
diff --git a/Voyager/PayLoad (Intel)/types.h b/Voyager/PayLoad (Intel)/types.h
index 551e4f4..d3a2a4b 100644
--- a/Voyager/PayLoad (Intel)/types.h
+++ b/Voyager/PayLoad (Intel)/types.h
@@ -4,7 +4,6 @@
#include
#define PORT_NUM 0x2F8
-#define WINVER 1507
#define DBG_PRINT(arg) \
__outbytestring(PORT_NUM, (unsigned char*)arg, sizeof arg);
diff --git a/Voyager/Voyager.sln b/Voyager/Voyager.sln
index 4a1c8c9..1458968 100644
--- a/Voyager/Voyager.sln
+++ b/Voyager/Voyager.sln
@@ -11,76 +11,79 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PayLoad (AMD)", "PayLoad (A
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|ARM = Debug|ARM
- Debug|ARM64 = Debug|ARM64
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|ARM = Release|ARM
- Release|ARM64 = Release|ARM64
- Release|x64 = Release|x64
- Release|x86 = Release|x86
+ 1507|x64 = 1507|x64
+ 1511|x64 = 1511|x64
+ 1607|x64 = 1607|x64
+ 1703|x64 = 1703|x64
+ 1709|x64 = 1709|x64
+ 1803|x64 = 1803|x64
+ 1809|x64 = 1809|x64
+ 1903|x64 = 1903|x64
+ 1909|x64 = 1909|x64
+ 2004|x64 = 2004|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Debug|ARM.ActiveCfg = Debug|Win32
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Debug|ARM64.ActiveCfg = Debug|Win32
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Debug|x64.ActiveCfg = Debug|x64
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Debug|x64.Build.0 = Debug|x64
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Debug|x86.ActiveCfg = Debug|Win32
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Debug|x86.Build.0 = Debug|Win32
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Release|ARM.ActiveCfg = Release|Win32
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Release|ARM64.ActiveCfg = Release|Win32
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Release|x64.ActiveCfg = Release|x64
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Release|x64.Build.0 = Release|x64
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Release|x86.ActiveCfg = Release|Win32
- {540D433F-C2DF-49A6-895C-F5C74B014777}.Release|x86.Build.0 = Release|Win32
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|ARM.ActiveCfg = Debug|ARM
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|ARM.Build.0 = Debug|ARM
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|ARM.Deploy.0 = Debug|ARM
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|ARM64.Build.0 = Debug|ARM64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|ARM64.Deploy.0 = Debug|ARM64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|x64.ActiveCfg = Debug|x64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|x64.Build.0 = Debug|x64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|x64.Deploy.0 = Debug|x64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|x86.ActiveCfg = Debug|Win32
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|x86.Build.0 = Debug|Win32
- {223D1FDE-331E-4028-9083-1673A5161C99}.Debug|x86.Deploy.0 = Debug|Win32
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|ARM.ActiveCfg = Release|ARM
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|ARM.Build.0 = Release|ARM
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|ARM.Deploy.0 = Release|ARM
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|ARM64.ActiveCfg = Release|ARM64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|ARM64.Build.0 = Release|ARM64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|ARM64.Deploy.0 = Release|ARM64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|x64.ActiveCfg = Release|x64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|x64.Build.0 = Release|x64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|x64.Deploy.0 = Release|x64
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|x86.ActiveCfg = Release|Win32
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|x86.Build.0 = Release|Win32
- {223D1FDE-331E-4028-9083-1673A5161C99}.Release|x86.Deploy.0 = Release|Win32
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|ARM.ActiveCfg = Debug|ARM
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|ARM.Build.0 = Debug|ARM
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|ARM.Deploy.0 = Debug|ARM
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|ARM64.Build.0 = Debug|ARM64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|ARM64.Deploy.0 = Debug|ARM64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|x64.ActiveCfg = Debug|x64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|x64.Build.0 = Debug|x64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|x64.Deploy.0 = Debug|x64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|x86.ActiveCfg = Debug|Win32
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|x86.Build.0 = Debug|Win32
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Debug|x86.Deploy.0 = Debug|Win32
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|ARM.ActiveCfg = Release|ARM
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|ARM.Build.0 = Release|ARM
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|ARM.Deploy.0 = Release|ARM
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|ARM64.ActiveCfg = Release|ARM64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|ARM64.Build.0 = Release|ARM64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|ARM64.Deploy.0 = Release|ARM64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|x64.ActiveCfg = Release|x64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|x64.Build.0 = Release|x64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|x64.Deploy.0 = Release|x64
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|x86.ActiveCfg = Release|Win32
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|x86.Build.0 = Release|Win32
- {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.Release|x86.Deploy.0 = Release|Win32
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1507|x64.ActiveCfg = 1507|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1507|x64.Build.0 = 1507|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1511|x64.ActiveCfg = 1511|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1511|x64.Build.0 = 1511|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1607|x64.ActiveCfg = 1607|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1607|x64.Build.0 = 1607|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1703|x64.ActiveCfg = 1703|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1703|x64.Build.0 = 1703|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1709|x64.ActiveCfg = 1709|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1709|x64.Build.0 = 1709|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1803|x64.ActiveCfg = 1803|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1803|x64.Build.0 = 1803|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1809|x64.ActiveCfg = 1809|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1809|x64.Build.0 = 1809|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1903|x64.ActiveCfg = 1903|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1903|x64.Build.0 = 1903|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1909|x64.ActiveCfg = 1909|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.1909|x64.Build.0 = 1909|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.2004|x64.ActiveCfg = 2004|x64
+ {540D433F-C2DF-49A6-895C-F5C74B014777}.2004|x64.Build.0 = 2004|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1507|x64.ActiveCfg = 1507|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1507|x64.Build.0 = 1507|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1511|x64.ActiveCfg = 1607|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1511|x64.Build.0 = 1607|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1511|x64.Deploy.0 = 1607|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1607|x64.ActiveCfg = 1607|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1607|x64.Build.0 = 1607|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1703|x64.ActiveCfg = 1703|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1703|x64.Build.0 = 1703|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1709|x64.ActiveCfg = 1709|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1709|x64.Build.0 = 1709|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1803|x64.ActiveCfg = 1803|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1803|x64.Build.0 = 1803|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1809|x64.ActiveCfg = 1909|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1809|x64.Build.0 = 1909|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1903|x64.ActiveCfg = 1903|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1903|x64.Build.0 = 1903|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1909|x64.ActiveCfg = 1909|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.1909|x64.Build.0 = 1909|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.2004|x64.ActiveCfg = 2004|x64
+ {223D1FDE-331E-4028-9083-1673A5161C99}.2004|x64.Build.0 = 2004|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1507|x64.ActiveCfg = 1507|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1507|x64.Build.0 = 1507|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1511|x64.ActiveCfg = 1511|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1511|x64.Build.0 = 1511|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1607|x64.ActiveCfg = 1607|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1607|x64.Build.0 = 1607|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1703|x64.ActiveCfg = 1703|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1703|x64.Build.0 = 1703|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1709|x64.ActiveCfg = 1709|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1709|x64.Build.0 = 1709|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1803|x64.ActiveCfg = 1803|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1803|x64.Build.0 = 1803|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1809|x64.ActiveCfg = 1809|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1809|x64.Build.0 = 1809|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1903|x64.ActiveCfg = 1903|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1903|x64.Build.0 = 1903|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1909|x64.ActiveCfg = 1909|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.1909|x64.Build.0 = 1909|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.2004|x64.ActiveCfg = 2004|x64
+ {C5122D8B-DEC8-458F-9342-3A4AC3152BEF}.2004|x64.Build.0 = 2004|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Voyager/Voyager/BootMgfw.c b/Voyager/Voyager/BootMgfw.c
index f22d2e2..51db205 100644
--- a/Voyager/Voyager/BootMgfw.c
+++ b/Voyager/Voyager/BootMgfw.c
@@ -216,6 +216,14 @@ EFI_STATUS EFIAPI ArchStartBootApplicationHook(VOID* AppEntry, VOID* ImageBase,
// on 1703 and below, winload does not export any functions
if (!GetExport(ImageBase, "BlLdrLoadImage"))
{
+ VOID* HvlpTransferToHypervisor =
+ FindPattern(
+ ImageBase,
+ ImageSize,
+ TRANS_TO_HV_SIG,
+ TRANS_TO_HV_MASK
+ );
+
VOID* ImgLoadPEImageEx =
FindPattern(
ImageBase,
@@ -224,17 +232,30 @@ EFI_STATUS EFIAPI ArchStartBootApplicationHook(VOID* AppEntry, VOID* ImageBase,
LOAD_PE_IMG_MASK
);
+ MmMapPhysicalMemory = RESOLVE_RVA(
+ FindPattern(
+ ImageBase,
+ ImageSize,
+ MAP_PHYSICAL_SIG,
+ MAP_PHYSICAL_MASK
+ ), 5, 1);
+
gST->ConOut->ClearScreen(gST->ConOut);
gST->ConOut->OutputString(gST->ConOut, AsciiArt);
Print(L"\n");
Print(L"Hyper-V PayLoad Size -> 0x%x\n", PayLoadSize());
Print(L"winload.BlImgLoadPEImageEx -> 0x%p\n", RESOLVE_RVA(ImgLoadPEImageEx, 10, 6));
+ Print(L"winload.HvlpTransferToHypervisor -> 0x%p\n", RESOLVE_RVA(HvlpTransferToHypervisor, 13, 9));
+
+ MakeShitHook(&TransferControlShitHook, RESOLVE_RVA(HvlpTransferToHypervisor, 13, 9), &TransferToHyperV, TRUE);
MakeShitHook(&WinLoadImageShitHook, RESOLVE_RVA(ImgLoadPEImageEx, 10, 6), &BlImgLoadPEImageEx, TRUE);
}
else // else the installed windows version is between 2004 and 1709
{
VOID* LdrLoadImage = GetExport(ImageBase, "BlLdrLoadImage");
+ MmMapPhysicalMemory = GetExport(ImageBase, "BlMmMapPhysicalAddressEx");
+
VOID* ImgAllocateImageBuffer =
FindPattern(
ImageBase,
diff --git a/Voyager/Voyager/HvLoader.c b/Voyager/Voyager/HvLoader.c
index f0fcd06..8fac85c 100644
--- a/Voyager/Voyager/HvLoader.c
+++ b/Voyager/Voyager/HvLoader.c
@@ -3,7 +3,9 @@
SHITHOOK HvLoadImageHook;
SHITHOOK HvLoadImageBufferHook;
SHITHOOK HvLoadAllocImageHook;
+SHITHOOK TransferControlShitHook;
+MAP_PHYSICAL MmMapPhysicalMemory;
BOOLEAN HvExtendedAllocation = FALSE;
BOOLEAN HvHookedHyperV = FALSE;
@@ -225,4 +227,22 @@ UINT64 EFIAPI HvBlImgAllocateImageBuffer
EnableShitHook(&HvLoadAllocImageHook);
return Result;
+}
+
+VOID TransferToHyperV(VOID* Pml4PhysicalAddress, VOID* Unknown, VOID* AssemblyStub, VOID* Unknown2)
+{
+ // TODO setup paging tables for the payload...
+ VOID* Pml4VirtualAddress = NULL;
+ MmMapPhysicalMemory(&Pml4VirtualAddress, Pml4PhysicalAddress, 0x1000, NULL, NULL);
+ DBG_PRINT("Hyper-V Pml4PhysicalAddress -> 0x%p\n", Pml4PhysicalAddress);
+ DBG_PRINT("Hyper-V Pml4VirtualAddress -> 0x%p\n", Pml4VirtualAddress);
+
+ DisableShitHook(&TransferControlShitHook);
+ ((VOID(__fastcall*)(VOID*, VOID*, VOID*, VOID*))TransferControlShitHook.Address)
+ (
+ Pml4PhysicalAddress,
+ Unknown,
+ AssemblyStub,
+ Unknown2
+ );
}
\ No newline at end of file
diff --git a/Voyager/Voyager/HvLoader.h b/Voyager/Voyager/HvLoader.h
index 8534444..b7981ee 100644
--- a/Voyager/Voyager/HvLoader.h
+++ b/Voyager/Voyager/HvLoader.h
@@ -1,6 +1,12 @@
#pragma once
#include "PayLoad.h"
#include "Hv.h"
+#include "ShitHook.h"
+
+extern SHITHOOK HvLoadImageHook;
+extern SHITHOOK HvLoadAllocImageHook;
+extern SHITHOOK HvLoadImageBufferHook;
+extern SHITHOOK TransferControlShitHook;
#define HV_ALLOCATE_IMAGE_BUFFER_SIG "\xE8\x00\x00\x00\x00\x8B\xF8\x85\xC0\x79\x0A"
#define HV_ALLOCATE_IMAGE_BUFFER_MASK "x????xxxxxx"
@@ -14,6 +20,22 @@ static_assert(sizeof(HV_LOAD_PE_IMG_FROM_BUFFER_SIG) == sizeof(HV_LOAD_PE_IMG_FR
#define HV_LOAD_PE_IMG_MASK "xxxx?x????xxxxxxx????xxx"
static_assert(sizeof(HV_LOAD_PE_IMG_SIG) == sizeof(HV_LOAD_PE_IMG_MASK), "signature and mask do not match size...");
+#define MAP_PHYSICAL_SIG "\xE8\x00\x00\x00\x00\x85\xC0\x0F\x88\x00\x00\x00\x00\x48\x8B\xBC\x24"
+#define MAP_PHYSICAL_MASK "x????xxxx????xxxx"
+static_assert(sizeof(MAP_PHYSICAL_SIG) == sizeof(MAP_PHYSICAL_MASK), "signature and mask do not patch sizes...\n");
+
+// 1703-1511
+//
+// winload.HvlpTransferToHypervisor is used to transfer control to hyper-v...
+// on 2004-1709, this function is going to be inside of hvloader.dll...
+#define TRANS_TO_HV_SIG "\x48\x8B\x51\x10\x48\x8B\x49\x18\xE8"
+#define TRANS_TO_HV_MASK "xxxxxxxxx"
+static_assert(sizeof(TRANS_TO_HV_SIG) == sizeof(TRANS_TO_HV_MASK), "signature and mask do not match size...");
+
+typedef EFI_STATUS(EFIAPI* MAP_PHYSICAL)(VOID** VirtualAddress, VOID* PhysicalAddress, UINTN Size,
+ VOID* Unknown1, VOID* Unknown2);
+
+extern MAP_PHYSICAL MmMapPhysicalMemory;
typedef EFI_STATUS(EFIAPI* ALLOCATE_IMAGE_BUFFER)(VOID** imageBuffer, UINTN imageSize, UINT32 memoryType,
UINT32 attributes, VOID* unused, UINT32 flags);
@@ -119,6 +141,16 @@ EFI_STATUS EFIAPI HvBlImgLoadPEImageFromSourceBuffer
VOID* a15
);
-extern SHITHOOK HvLoadImageHook;
-extern SHITHOOK HvLoadAllocImageHook;
-extern SHITHOOK HvLoadImageBufferHook;
\ No newline at end of file
+///
+/// called when the hypervisor is started...
+///
+/// the physical address of hyper-v's pml4...
+///
+/// assembly stub to set CR3...
+VOID TransferToHyperV
+(
+ VOID* Pml4PhysicalAddress,
+ VOID* Unknown,
+ VOID* AssemblyStub,
+ VOID* Unknown2
+);
\ No newline at end of file
diff --git a/Voyager/Voyager/ShitHook.c b/Voyager/Voyager/ShitHook.c
index 5b3546b..6d1ff4c 100644
--- a/Voyager/Voyager/ShitHook.c
+++ b/Voyager/Voyager/ShitHook.c
@@ -14,20 +14,20 @@ VOID MakeShitHook(PSHITHOOK Hook, VOID* HookFrom, VOID* HookTo, BOOLEAN Install)
// save original bytes, and hook related addresses....
Hook->Address = HookFrom;
Hook->HookAddress = HookTo;
- gBS->CopyMem(Hook->Code, HookFrom, sizeof Hook->Code);
+ MemCopy(Hook->Code, HookFrom, sizeof Hook->Code);
// setup hook...
- gBS->CopyMem(JmpCode + 6, &HookTo, sizeof HookTo);
- gBS->CopyMem(Hook->JmpCode, JmpCode, sizeof JmpCode);
+ MemCopy(JmpCode + 6, &HookTo, sizeof HookTo);
+ MemCopy(Hook->JmpCode, JmpCode, sizeof JmpCode);
if (Install) EnableShitHook(Hook);
}
VOID EnableShitHook(PSHITHOOK Hook)
{
- gBS->CopyMem(Hook->Address, Hook->JmpCode, sizeof Hook->JmpCode);
+ MemCopy(Hook->Address, Hook->JmpCode, sizeof Hook->JmpCode);
}
VOID DisableShitHook(PSHITHOOK Hook)
{
- gBS->CopyMem(Hook->Address, Hook->Code, sizeof Hook->Code);
+ MemCopy(Hook->Address, Hook->Code, sizeof Hook->Code);
}
\ No newline at end of file
diff --git a/Voyager/Voyager/ShitHook.h b/Voyager/Voyager/ShitHook.h
index 20fc34e..2ae77e2 100644
--- a/Voyager/Voyager/ShitHook.h
+++ b/Voyager/Voyager/ShitHook.h
@@ -1,16 +1,5 @@
#pragma once
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include "Utils.h"
typedef struct _SHITHOOK
{
diff --git a/Voyager/Voyager/Utils.h b/Voyager/Voyager/Utils.h
index 9037f58..969cee6 100644
--- a/Voyager/Voyager/Utils.h
+++ b/Voyager/Voyager/Utils.h
@@ -1,7 +1,17 @@
#pragma once
-#include "ShitHook.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
-#define WINVER 1507
#define PORT_NUM 0x2F8
#define BL_MEMORY_ATTRIBUTE_RWX 0x424000
#define SEC_TO_MS(seconds) seconds * 1000000
diff --git a/Voyager/Voyager/Voyager.vcxproj b/Voyager/Voyager/Voyager.vcxproj
index b2f7854..1c7a014 100644
--- a/Voyager/Voyager/Voyager.vcxproj
+++ b/Voyager/Voyager/Voyager.vcxproj
@@ -1,20 +1,44 @@
-
- Debug
- Win32
+
+ 1507
+ x64
+
+
+ 1511
+ x64
-
- Release
- Win32
+
+ 1607
+ x64
+
+
+ 1703
+ x64
-
- Debug
+
+ 1709x64
-
- Release
+
+ 1803
+ x64
+
+
+ 1809
+ x64
+
+
+ 1903
+ x64
+
+
+ 1909
+ x64
+
+
+ 2004x64
@@ -27,27 +51,79 @@
Voyager
-
+
+ Application
+ false
+ v142
+ true
+ Unicode
+ x86
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+ x86
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+ x86
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+ x86
+
+ Application
- true
+ falsev142
+ trueUnicode
+ x86
-
+ Applicationfalsev142trueUnicode
+ x86
-
+ Applicationfalsev142
+ trueUnicodex86
-
+
+ Application
+ false
+ v142
+ true
+ Unicode
+ x86
+
+
+ Application
+ false
+ v142
+ true
+ Unicode
+ x86
+
+ Applicationfalsev142
@@ -60,34 +136,70 @@
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- true
+
+ false
+ $(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include;$(ProjectDir)edk2\StdLib\Include;$(ProjectDir)
+ $(ProjectDir)edk2
+ false
+ .efi
+ $(ProjectDir)
-
+ false
+ $(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include;$(ProjectDir)edk2\StdLib\Include;$(ProjectDir)
+ $(ProjectDir)edk2
+ false
+ .efi
+ $(ProjectDir)
-
- true
- $(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include
+
+ false
+ $(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include;$(ProjectDir)edk2\StdLib\Include;$(ProjectDir)
+ $(ProjectDir)edk2
+ false
+ .efi
+ $(ProjectDir)
+
+
+ false
+ $(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include;$(ProjectDir)edk2\StdLib\Include;$(ProjectDir)$(ProjectDir)edk2false.efi$(ProjectDir)
-
+ false$(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include;$(ProjectDir)edk2\StdLib\Include;$(ProjectDir)$(ProjectDir)edk2
@@ -95,39 +207,111 @@
.efi$(ProjectDir)
-
+
+ false
+ $(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include;$(ProjectDir)edk2\StdLib\Include;$(ProjectDir)
+ $(ProjectDir)edk2
+ false
+ .efi
+ $(ProjectDir)
+
+
+ false
+ $(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include;$(ProjectDir)edk2\StdLib\Include;$(ProjectDir)
+ $(ProjectDir)edk2
+ false
+ .efi
+ $(ProjectDir)
+
+
+ false
+ $(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include;$(ProjectDir)edk2\StdLib\Include;$(ProjectDir)
+ $(ProjectDir)edk2
+ false
+ .efi
+ $(ProjectDir)
+
+
+ false
+ $(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include;$(ProjectDir)edk2\StdLib\Include;$(ProjectDir)
+ $(ProjectDir)edk2
+ false
+ .efi
+ $(ProjectDir)
+
+
+ false
+ $(ProjectDir)edk2\CryptoPkg\Include;$(ProjectDir)edk2\ShellPkg\Include;$(ProjectDir)edk2\MdePkg\Include\X64;$(ProjectDir)edk2\MdePkg\Include;$(ProjectDir)edk2\StdLib\Include;$(ProjectDir)
+ $(ProjectDir)edk2
+ false
+ .efi
+ $(ProjectDir)
+
+ Level3
+ true
+ falsetrue
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ NDEBUG;_CONSOLE;WINVER=1909;%(PreprocessorDefinitions)true
+ true
+ SyncCThrow
+ false
+ Disabled
+ DisabledEFI Application
+ true
+ truetrue
+ false
+ false
+ UefiHiiLib.lib;UefiHiiServicesLib.lib;UefiSortLib.lib;UefiShellLib.lib;GlueLib.lib;BaseLib.lib;BaseDebugPrintErrorLevelLib.lib;BasePrintLib.lib;UefiLib.lib;UefiBootServicesTableLib.lib;UefiRuntimeServicesTableLib.lib;UefiDevicePathLibDevicePathProtocol.lib;UefiDebugLibConOut.lib;UefiMemoryLib.lib;UefiMemoryAllocationLib.lib;BaseSynchronizationLib.lib;UefiFileHandleLib.lib;UefiApplicationEntryPoint.lib
+ true
+ EfiMain
+
+ true
+
-
+ Level3true
- true
+ falsetrue
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ NDEBUG;_CONSOLE;WINVER=1903;%(PreprocessorDefinitions)true
+ true
+ SyncCThrow
+ false
+ Disabled
+ DisabledEFI Applicationtruetruetrue
+ false
+ false
+ UefiHiiLib.lib;UefiHiiServicesLib.lib;UefiSortLib.lib;UefiShellLib.lib;GlueLib.lib;BaseLib.lib;BaseDebugPrintErrorLevelLib.lib;BasePrintLib.lib;UefiLib.lib;UefiBootServicesTableLib.lib;UefiRuntimeServicesTableLib.lib;UefiDevicePathLibDevicePathProtocol.lib;UefiDebugLibConOut.lib;UefiMemoryLib.lib;UefiMemoryAllocationLib.lib;BaseSynchronizationLib.lib;UefiFileHandleLib.lib;UefiApplicationEntryPoint.lib
+ true
+ EfiMain
+
+ true
+
-
+ Level3
+ true
+ falsetrue
- _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ NDEBUG;_CONSOLE;WINVER=1809;%(PreprocessorDefinitions)truetrueSyncCThrow
@@ -137,6 +321,182 @@
EFI Application
+ true
+ true
+ true
+ false
+ false
+ UefiHiiLib.lib;UefiHiiServicesLib.lib;UefiSortLib.lib;UefiShellLib.lib;GlueLib.lib;BaseLib.lib;BaseDebugPrintErrorLevelLib.lib;BasePrintLib.lib;UefiLib.lib;UefiBootServicesTableLib.lib;UefiRuntimeServicesTableLib.lib;UefiDevicePathLibDevicePathProtocol.lib;UefiDebugLibConOut.lib;UefiMemoryLib.lib;UefiMemoryAllocationLib.lib;BaseSynchronizationLib.lib;UefiFileHandleLib.lib;UefiApplicationEntryPoint.lib
+ true
+ EfiMain
+
+
+ true
+
+
+
+
+ Level3
+ true
+ false
+ true
+ NDEBUG;_CONSOLE;WINVER=1803;%(PreprocessorDefinitions)
+ true
+ true
+ SyncCThrow
+ false
+ Disabled
+ Disabled
+
+
+ EFI Application
+ true
+ true
+ true
+ false
+ false
+ UefiHiiLib.lib;UefiHiiServicesLib.lib;UefiSortLib.lib;UefiShellLib.lib;GlueLib.lib;BaseLib.lib;BaseDebugPrintErrorLevelLib.lib;BasePrintLib.lib;UefiLib.lib;UefiBootServicesTableLib.lib;UefiRuntimeServicesTableLib.lib;UefiDevicePathLibDevicePathProtocol.lib;UefiDebugLibConOut.lib;UefiMemoryLib.lib;UefiMemoryAllocationLib.lib;BaseSynchronizationLib.lib;UefiFileHandleLib.lib;UefiApplicationEntryPoint.lib
+ true
+ EfiMain
+
+
+ true
+
+
+
+
+ Level3
+ true
+ false
+ true
+ NDEBUG;_CONSOLE;WINVER=1709;%(PreprocessorDefinitions)
+ true
+ true
+ SyncCThrow
+ false
+ Disabled
+ Disabled
+
+
+ EFI Application
+ true
+ true
+ true
+ false
+ false
+ UefiHiiLib.lib;UefiHiiServicesLib.lib;UefiSortLib.lib;UefiShellLib.lib;GlueLib.lib;BaseLib.lib;BaseDebugPrintErrorLevelLib.lib;BasePrintLib.lib;UefiLib.lib;UefiBootServicesTableLib.lib;UefiRuntimeServicesTableLib.lib;UefiDevicePathLibDevicePathProtocol.lib;UefiDebugLibConOut.lib;UefiMemoryLib.lib;UefiMemoryAllocationLib.lib;BaseSynchronizationLib.lib;UefiFileHandleLib.lib;UefiApplicationEntryPoint.lib
+ true
+ EfiMain
+
+
+ true
+
+
+
+
+ Level3
+ true
+ false
+ true
+ NDEBUG;_CONSOLE;WINVER=1703;%(PreprocessorDefinitions)
+ true
+ true
+ SyncCThrow
+ false
+ Disabled
+ Disabled
+
+
+ EFI Application
+ true
+ true
+ true
+ false
+ false
+ UefiHiiLib.lib;UefiHiiServicesLib.lib;UefiSortLib.lib;UefiShellLib.lib;GlueLib.lib;BaseLib.lib;BaseDebugPrintErrorLevelLib.lib;BasePrintLib.lib;UefiLib.lib;UefiBootServicesTableLib.lib;UefiRuntimeServicesTableLib.lib;UefiDevicePathLibDevicePathProtocol.lib;UefiDebugLibConOut.lib;UefiMemoryLib.lib;UefiMemoryAllocationLib.lib;BaseSynchronizationLib.lib;UefiFileHandleLib.lib;UefiApplicationEntryPoint.lib
+ true
+ EfiMain
+
+
+ true
+
+
+
+
+ Level3
+ true
+ false
+ true
+ NDEBUG;_CONSOLE;WINVER=1607;%(PreprocessorDefinitions)
+ true
+ true
+ SyncCThrow
+ false
+ Disabled
+ Disabled
+
+
+ EFI Application
+ true
+ true
+ true
+ false
+ false
+ UefiHiiLib.lib;UefiHiiServicesLib.lib;UefiSortLib.lib;UefiShellLib.lib;GlueLib.lib;BaseLib.lib;BaseDebugPrintErrorLevelLib.lib;BasePrintLib.lib;UefiLib.lib;UefiBootServicesTableLib.lib;UefiRuntimeServicesTableLib.lib;UefiDevicePathLibDevicePathProtocol.lib;UefiDebugLibConOut.lib;UefiMemoryLib.lib;UefiMemoryAllocationLib.lib;BaseSynchronizationLib.lib;UefiFileHandleLib.lib;UefiApplicationEntryPoint.lib
+ true
+ EfiMain
+
+
+ true
+
+
+
+
+ Level3
+ true
+ false
+ true
+ NDEBUG;_CONSOLE;WINVER=1511;%(PreprocessorDefinitions)
+ true
+ true
+ SyncCThrow
+ false
+ Disabled
+ Disabled
+
+
+ EFI Application
+ true
+ true
+ true
+ false
+ false
+ UefiHiiLib.lib;UefiHiiServicesLib.lib;UefiSortLib.lib;UefiShellLib.lib;GlueLib.lib;BaseLib.lib;BaseDebugPrintErrorLevelLib.lib;BasePrintLib.lib;UefiLib.lib;UefiBootServicesTableLib.lib;UefiRuntimeServicesTableLib.lib;UefiDevicePathLibDevicePathProtocol.lib;UefiDebugLibConOut.lib;UefiMemoryLib.lib;UefiMemoryAllocationLib.lib;BaseSynchronizationLib.lib;UefiFileHandleLib.lib;UefiApplicationEntryPoint.lib
+ true
+ EfiMain
+
+
+ true
+
+
+
+
+ Level3
+ true
+ false
+ true
+ NDEBUG;_CONSOLE;WINVER=1507;%(PreprocessorDefinitions)
+ true
+ true
+ SyncCThrow
+ false
+ Disabled
+ Disabled
+
+
+ EFI Application
+ true
+ truetruefalsefalse
@@ -148,13 +508,13 @@
true
-
+ Level3truefalsetrue
- NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ NDEBUG;_CONSOLE;WINVER=2004;%(PreprocessorDefinitions)truetrueSyncCThrow
diff --git a/Voyager/Voyager/WinLoad.c b/Voyager/Voyager/WinLoad.c
index b419f71..8217419 100644
--- a/Voyager/Voyager/WinLoad.c
+++ b/Voyager/Voyager/WinLoad.c
@@ -59,6 +59,26 @@ EFI_STATUS EFIAPI BlLdrLoadImage
if (!HookedHyperV)
EnableShitHook(&WinLoadImageShitHook);
+ if (StrStr(ModulePath, L"hvloader.dll"))
+ {
+ PLDR_DATA_TABLE_ENTRY TableEntry = *lplpTableEntry;
+ VOID* HvlpTransferToHypervisor =
+ FindPattern(
+ TableEntry->ModuleBase,
+ TableEntry->SizeOfImage,
+ TRANS_TO_HV_SIG,
+ TRANS_TO_HV_MASK
+ );
+
+ MakeShitHook
+ (
+ &TransferControlShitHook,
+ RESOLVE_RVA(HvlpTransferToHypervisor, 13, 9),
+ &TransferToHyperV,
+ TRUE
+ );
+ }
+
if (!StrCmp(ModuleName, L"hv.exe"))
{
HookedHyperV = TRUE;
@@ -161,6 +181,7 @@ EFI_STATUS EFIAPI BlImgLoadPEImageEx
HV_LOAD_PE_IMG_FROM_BUFFER_SIG,
HV_LOAD_PE_IMG_FROM_BUFFER_MASK
);
+
#elif WINVER <= 1607
VOID* LoadImage =
FindPattern(
@@ -169,6 +190,7 @@ EFI_STATUS EFIAPI BlImgLoadPEImageEx
HV_LOAD_PE_IMG_SIG,
HV_LOAD_PE_IMG_MASK
);
+
#endif
VOID* AllocImage =
FindPattern(
diff --git a/Voyager/Voyager/WinLoad.h b/Voyager/Voyager/WinLoad.h
index 2bdb695..81f9f37 100644
--- a/Voyager/Voyager/WinLoad.h
+++ b/Voyager/Voyager/WinLoad.h
@@ -16,7 +16,14 @@ extern SHITHOOK WinLoadAllocateImageHook;
#define LOAD_PE_IMG_SIG "\x48\x89\x44\x24\x00\xE8\x00\x00\x00\x00\x44\x8B\xF0\x85\xC0\x79\x11"
#define LOAD_PE_IMG_MASK "xxxx?x????xxxxxxx"
+// 1703-1511
+//
+// winload.HvlpTransferToHypervisor is used to transfer control to hyper-v...
+// on 2004-1709, this function is going to be inside of hvloader.dll...
+#define TRANS_TO_HV_SIG "\x48\x8B\x51\x10\x48\x8B\x49\x18\xE8"
+#define TRANS_TO_HV_MASK "xxxxxxxxx"
static_assert(sizeof(ALLOCATE_IMAGE_BUFFER_SIG) == sizeof(ALLOCATE_IMAGE_BUFFER_MASK), "signature and mask do not match size!");
+
typedef UINT64 (EFIAPI* ALLOCATE_IMAGE_BUFFER)(VOID** imageBuffer, UINTN imageSize, UINT32 memoryType,
UINT32 attributes, VOID* unused, UINT32 flags);
diff --git a/Voyager/Voyager/edk2/CryptoPkg/CryptoPkg.dec b/Voyager/Voyager/edk2/CryptoPkg/CryptoPkg.dec
deleted file mode 100644
index 2fa8f26..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/CryptoPkg.dec
+++ /dev/null
@@ -1,43 +0,0 @@
-## @file
-# Package for cryptography modules.
-#
-# This Package provides cryptographic-related libraries for UEFI security modules.
-# It also provides a test application to test libraries.
-#
-# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- DEC_SPECIFICATION = 0x00010005
- PACKAGE_NAME = CryptoPkg
- PACKAGE_UNI_FILE = CryptoPkg.uni
- PACKAGE_GUID = 36470E80-36F2-4ba0-8CC8-937C7D9FF888
- PACKAGE_VERSION = 0.98
-
-[Includes]
- Include
-
-[Includes.Common.Private]
- Library/Include
- Library/OpensslLib/openssl/include
- Library/OpensslLib/openssl/crypto/include
-
-[LibraryClasses]
- ## @libraryclass Provides basic library functions for cryptographic primitives.
- ##
- BaseCryptLib|Include/Library/BaseCryptLib.h
-
- ## @libraryclass Provides TLS library functions for EFI TLS protocol.
- ##
- TlsLib|Include/Library/TlsLib.h
-
-[UserExtensions.TianoCore."ExtraFiles"]
- CryptoPkgExtra.uni
diff --git a/Voyager/Voyager/edk2/CryptoPkg/CryptoPkg.dsc b/Voyager/Voyager/edk2/CryptoPkg/CryptoPkg.dsc
deleted file mode 100644
index 0142f64..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/CryptoPkg.dsc
+++ /dev/null
@@ -1,130 +0,0 @@
-## @file
-# Cryptographic Library Package for UEFI Security Implementation.
-#
-# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-################################################################################
-#
-# Defines Section - statements that will be processed to create a Makefile.
-#
-################################################################################
-[Defines]
- PLATFORM_NAME = CryptoPkg
- PLATFORM_GUID = E1063286-6C8C-4c25-AEF0-67A9A5B6E6B6
- PLATFORM_VERSION = 0.98
- DSC_SPECIFICATION = 0x00010005
- OUTPUT_DIRECTORY = Build/CryptoPkg
- SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64
- BUILD_TARGETS = DEBUG|RELEASE|NOOPT
- SKUID_IDENTIFIER = DEFAULT
-
-################################################################################
-#
-# Library Class section - list of all Library Classes needed by this Platform.
-#
-################################################################################
-[LibraryClasses]
- BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
- DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
- UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
- UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
- UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
-
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
- OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
-
-[LibraryClasses.ARM, LibraryClasses.AARCH64]
- #
- # It is not possible to prevent the ARM compiler for generic intrinsic functions.
- # This library provides the instrinsic functions generate by a given compiler.
- # [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this library
- # into all ARM and AARCH64 images.
- #
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
-
- # Add support for stack protector
- NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
-
-[LibraryClasses.ARM]
- ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
-
-[LibraryClasses.common.PEIM]
- BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
-
-[LibraryClasses.common.DXE_DRIVER]
- BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
-
-[LibraryClasses.common.DXE_RUNTIME_DRIVER]
- BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
-
-[LibraryClasses.common.DXE_SMM_DRIVER]
- BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
-
-[LibraryClasses.common.UEFI_DRIVER]
- BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
-
-[LibraryClasses.common.UEFI_APPLICATION]
- BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
-
-################################################################################
-#
-# Pcd Section - list of all EDK II PCD Entries defined by this Platform
-#
-################################################################################
-[PcdsFeatureFlag]
- gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE
-
-[PcdsFixedAtBuild]
- gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
- gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
- gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06
-
-###################################################################################################
-#
-# Components Section - list of the modules and components that will be processed by compilation
-# tools and the EDK II tools to generate PE32/PE32+/Coff image files.
-#
-# Note: The EDK II DSC file is not used to specify how compiled binary images get placed
-# into firmware volume images. This section is just a list of modules to compile from
-# source into UEFI-compliant binaries.
-# It is the FDF file that contains information on combining binary files into firmware
-# volume images, whose concept is beyond UEFI and is described in PI specification.
-# Binary modules do not need to be listed in this section, as they should be
-# specified in the FDF file. For example: Shell binary (Shell_Full.efi), FAT binary (Fat.efi),
-# Logo (Logo.bmp), and etc.
-# There may also be modules listed in this section that are not required in the FDF file,
-# When a module listed here is excluded from FDF file, then UEFI-compliant binary will be
-# generated for it, but the binary will not be put into any firmware volume.
-#
-###################################################################################################
-[Components]
- CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
- CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
- CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
- CryptoPkg/Library/TlsLib/TlsLib.inf
- CryptoPkg/Library/OpensslLib/OpensslLib.inf
-
-[Components.IA32, Components.X64]
- CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
-
-[BuildOptions]
- *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
diff --git a/Voyager/Voyager/edk2/CryptoPkg/CryptoPkg.uni b/Voyager/Voyager/edk2/CryptoPkg/CryptoPkg.uni
deleted file mode 100644
index 67bb1b4..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/CryptoPkg.uni
+++ /dev/null
@@ -1,25 +0,0 @@
-// /** @file
-// Package for cryptography modules.
-//
-// This Package provides cryptographic-related libraries for UEFI security modules.
-// It also provides a test application to test libraries.
-//
-// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_PACKAGE_ABSTRACT #language en-US "Provides cryptographic-related libraries for UEFI security modules"
-
-#string STR_PACKAGE_DESCRIPTION #language en-US "This Package provides cryptographic-related libraries for UEFI security modules."
-
-
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/CryptoPkgExtra.uni b/Voyager/Voyager/edk2/CryptoPkg/CryptoPkgExtra.uni
deleted file mode 100644
index 30694d3..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/CryptoPkgExtra.uni
+++ /dev/null
@@ -1,20 +0,0 @@
-// /** @file
-// Crypto Package Localized Strings and Content.
-//
-// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-#string STR_PROPERTIES_PACKAGE_NAME
-#language en-US
-"Crypto package"
-
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
deleted file mode 100644
index 45b94d0..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+++ /dev/null
@@ -1,102 +0,0 @@
-## @file
-# Cryptographic Library Instance for DXE_DRIVER.
-#
-# Caution: This module requires additional review when modified.
-# This library will have external input - signature.
-# This external input must be validated carefully to avoid security issues such as
-# buffer overflow or integer overflow.
-#
-# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseCryptLib
- MODULE_UNI_FILE = BaseCryptLib.uni
- FILE_GUID = be3bb803-91b6-4da0-bd91-a8b21c18ca5d
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = BaseCryptLib|DXE_DRIVER DXE_CORE UEFI_APPLICATION UEFI_DRIVER
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
-#
-
-[Sources]
- InternalCryptLib.h
- Hash/CryptMd4.c
- Hash/CryptMd5.c
- Hash/CryptSha1.c
- Hash/CryptSha256.c
- Hash/CryptSha512.c
- Hmac/CryptHmacMd5.c
- Hmac/CryptHmacSha1.c
- Hmac/CryptHmacSha256.c
- Cipher/CryptAes.c
- Cipher/CryptTdes.c
- Cipher/CryptArc4.c
- Pk/CryptRsaBasic.c
- Pk/CryptRsaExt.c
- Pk/CryptPkcs5Pbkdf2.c
- Pk/CryptPkcs7Sign.c
- Pk/CryptPkcs7VerifyCommon.c
- Pk/CryptPkcs7VerifyBase.c
- Pk/CryptDh.c
- Pk/CryptX509.c
- Pk/CryptAuthenticode.c
- Pk/CryptTs.c
- Pem/CryptPem.c
-
- SysCall/CrtWrapper.c
- SysCall/TimerWrapper.c
- SysCall/BaseMemAllocation.c
-
-[Sources.Ia32]
- Rand/CryptRandTsc.c
-
-[Sources.X64]
- Rand/CryptRandTsc.c
-
-[Sources.ARM]
- Rand/CryptRand.c
-
-[Sources.AARCH64]
- Rand/CryptRand.c
-
-[Packages]
- MdePkg/MdePkg.dec
- CryptoPkg/CryptoPkg.dec
-
-[LibraryClasses]
- BaseLib
- BaseMemoryLib
- MemoryAllocationLib
- UefiRuntimeServicesTableLib
- DebugLib
- OpensslLib
- IntrinsicLib
- PrintLib
-
-#
-# Remove these [BuildOptions] after this library is cleaned up
-#
-[BuildOptions]
- #
- # suppress the following warnings so we do not break the build with warnings-as-errors:
- # C4090: 'function' : different 'const' qualifiers
- #
- MSFT:*_*_*_CC_FLAGS = /wd4090
-
- # -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT
- # --diag_remark=1 : Reduce severity of "#1-D: last line of file ends without a newline"
- RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.uni b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.uni
deleted file mode 100644
index 33819b3..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.uni
+++ /dev/null
@@ -1,25 +0,0 @@
-// /** @file
-// Cryptographic Library Instance for DXE_DRIVER.
-//
-// Caution: This module requires additional review when modified.
-// This library will have external input - signature.
-// This external input must be validated carefully to avoid security issues such as
-// buffer overflow or integer overflow.
-//
-// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Cryptographic Library Instance for DXE_DRIVER"
-
-#string STR_MODULE_DESCRIPTION #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow."
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAes.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAes.c
deleted file mode 100644
index 88eca0a..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAes.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/** @file
- AES Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-/**
- Retrieves the size, in bytes, of the context buffer required for AES operations.
-
- @return The size, in bytes, of the context buffer required for AES operations.
-
-**/
-UINTN
-EFIAPI
-AesGetContextSize (
- VOID
- )
-{
- //
- // AES uses different key contexts for encryption and decryption, so here memory
- // for 2 copies of AES_KEY is allocated.
- //
- return (UINTN) (2 * sizeof (AES_KEY));
-}
-
-/**
- Initializes user-supplied memory as AES context for subsequent use.
-
- This function initializes user-supplied memory pointed by AesContext as AES context.
- In addition, it sets up all AES key materials for subsequent encryption and decryption
- operations.
- There are 3 options for key length, 128 bits, 192 bits, and 256 bits.
-
- If AesContext is NULL, then return FALSE.
- If Key is NULL, then return FALSE.
- If KeyLength is not valid, then return FALSE.
-
- @param[out] AesContext Pointer to AES context being initialized.
- @param[in] Key Pointer to the user-supplied AES key.
- @param[in] KeyLength Length of AES key in bits.
-
- @retval TRUE AES context initialization succeeded.
- @retval FALSE AES context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-AesInit (
- OUT VOID *AesContext,
- IN CONST UINT8 *Key,
- IN UINTN KeyLength
- )
-{
- AES_KEY *AesKey;
-
- //
- // Check input parameters.
- //
- if (AesContext == NULL || Key == NULL || (KeyLength != 128 && KeyLength != 192 && KeyLength != 256)) {
- return FALSE;
- }
-
- //
- // Initialize AES encryption & decryption key schedule.
- //
- AesKey = (AES_KEY *) AesContext;
- if (AES_set_encrypt_key (Key, (UINT32) KeyLength, AesKey) != 0) {
- return FALSE;
- }
- if (AES_set_decrypt_key (Key, (UINT32) KeyLength, AesKey + 1) != 0) {
- return FALSE;
- }
- return TRUE;
-}
-
-/**
- Performs AES encryption on a data buffer of the specified size in ECB mode.
-
- This function performs AES encryption on data buffer pointed by Input, of specified
- size of InputSize, in ECB mode.
- InputSize must be multiple of block size (16 bytes). This function does not perform
- padding. Caller must perform padding, if necessary, to ensure valid input data size.
- AesContext should be already correctly initialized by AesInit(). Behavior with
- invalid AES context is undefined.
-
- If AesContext is NULL, then return FALSE.
- If Input is NULL, then return FALSE.
- If InputSize is not multiple of block size (16 bytes), then return FALSE.
- If Output is NULL, then return FALSE.
-
- @param[in] AesContext Pointer to the AES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the AES encryption output.
-
- @retval TRUE AES encryption succeeded.
- @retval FALSE AES encryption failed.
-
-**/
-BOOLEAN
-EFIAPI
-AesEcbEncrypt (
- IN VOID *AesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- AES_KEY *AesKey;
-
- //
- // Check input parameters.
- //
- if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0 || Output == NULL) {
- return FALSE;
- }
-
- AesKey = (AES_KEY *) AesContext;
-
- //
- // Perform AES data encryption with ECB mode (block-by-block)
- //
- while (InputSize > 0) {
- AES_ecb_encrypt (Input, Output, AesKey, AES_ENCRYPT);
- Input += AES_BLOCK_SIZE;
- Output += AES_BLOCK_SIZE;
- InputSize -= AES_BLOCK_SIZE;
- }
-
- return TRUE;
-}
-
-/**
- Performs AES decryption on a data buffer of the specified size in ECB mode.
-
- This function performs AES decryption on data buffer pointed by Input, of specified
- size of InputSize, in ECB mode.
- InputSize must be multiple of block size (16 bytes). This function does not perform
- padding. Caller must perform padding, if necessary, to ensure valid input data size.
- AesContext should be already correctly initialized by AesInit(). Behavior with
- invalid AES context is undefined.
-
- If AesContext is NULL, then return FALSE.
- If Input is NULL, then return FALSE.
- If InputSize is not multiple of block size (16 bytes), then return FALSE.
- If Output is NULL, then return FALSE.
-
- @param[in] AesContext Pointer to the AES context.
- @param[in] Input Pointer to the buffer containing the data to be decrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the AES decryption output.
-
- @retval TRUE AES decryption succeeded.
- @retval FALSE AES decryption failed.
-
-**/
-BOOLEAN
-EFIAPI
-AesEcbDecrypt (
- IN VOID *AesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- AES_KEY *AesKey;
-
- //
- // Check input parameters.
- //
- if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0 || Output == NULL) {
- return FALSE;
- }
-
- AesKey = (AES_KEY *) AesContext;
-
- //
- // Perform AES data decryption with ECB mode (block-by-block)
- //
- while (InputSize > 0) {
- AES_ecb_encrypt (Input, Output, AesKey + 1, AES_DECRYPT);
- Input += AES_BLOCK_SIZE;
- Output += AES_BLOCK_SIZE;
- InputSize -= AES_BLOCK_SIZE;
- }
-
- return TRUE;
-}
-
-/**
- Performs AES encryption on a data buffer of the specified size in CBC mode.
-
- This function performs AES encryption on data buffer pointed by Input, of specified
- size of InputSize, in CBC mode.
- InputSize must be multiple of block size (16 bytes). This function does not perform
- padding. Caller must perform padding, if necessary, to ensure valid input data size.
- Initialization vector should be one block size (16 bytes).
- AesContext should be already correctly initialized by AesInit(). Behavior with
- invalid AES context is undefined.
-
- If AesContext is NULL, then return FALSE.
- If Input is NULL, then return FALSE.
- If InputSize is not multiple of block size (16 bytes), then return FALSE.
- If Ivec is NULL, then return FALSE.
- If Output is NULL, then return FALSE.
-
- @param[in] AesContext Pointer to the AES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[in] Ivec Pointer to initialization vector.
- @param[out] Output Pointer to a buffer that receives the AES encryption output.
-
- @retval TRUE AES encryption succeeded.
- @retval FALSE AES encryption failed.
-
-**/
-BOOLEAN
-EFIAPI
-AesCbcEncrypt (
- IN VOID *AesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- IN CONST UINT8 *Ivec,
- OUT UINT8 *Output
- )
-{
- AES_KEY *AesKey;
- UINT8 IvecBuffer[AES_BLOCK_SIZE];
-
- //
- // Check input parameters.
- //
- if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0) {
- return FALSE;
- }
-
- if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {
- return FALSE;
- }
-
- AesKey = (AES_KEY *) AesContext;
- CopyMem (IvecBuffer, Ivec, AES_BLOCK_SIZE);
-
- //
- // Perform AES data encryption with CBC mode
- //
- AES_cbc_encrypt (Input, Output, (UINT32) InputSize, AesKey, IvecBuffer, AES_ENCRYPT);
-
- return TRUE;
-}
-
-/**
- Performs AES decryption on a data buffer of the specified size in CBC mode.
-
- This function performs AES decryption on data buffer pointed by Input, of specified
- size of InputSize, in CBC mode.
- InputSize must be multiple of block size (16 bytes). This function does not perform
- padding. Caller must perform padding, if necessary, to ensure valid input data size.
- Initialization vector should be one block size (16 bytes).
- AesContext should be already correctly initialized by AesInit(). Behavior with
- invalid AES context is undefined.
-
- If AesContext is NULL, then return FALSE.
- If Input is NULL, then return FALSE.
- If InputSize is not multiple of block size (16 bytes), then return FALSE.
- If Ivec is NULL, then return FALSE.
- If Output is NULL, then return FALSE.
-
- @param[in] AesContext Pointer to the AES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[in] Ivec Pointer to initialization vector.
- @param[out] Output Pointer to a buffer that receives the AES encryption output.
-
- @retval TRUE AES decryption succeeded.
- @retval FALSE AES decryption failed.
-
-**/
-BOOLEAN
-EFIAPI
-AesCbcDecrypt (
- IN VOID *AesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- IN CONST UINT8 *Ivec,
- OUT UINT8 *Output
- )
-{
- AES_KEY *AesKey;
- UINT8 IvecBuffer[AES_BLOCK_SIZE];
-
- //
- // Check input parameters.
- //
- if (AesContext == NULL || Input == NULL || (InputSize % AES_BLOCK_SIZE) != 0) {
- return FALSE;
- }
-
- if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {
- return FALSE;
- }
-
- AesKey = (AES_KEY *) AesContext;
- CopyMem (IvecBuffer, Ivec, AES_BLOCK_SIZE);
-
- //
- // Perform AES data decryption with CBC mode
- //
- AES_cbc_encrypt (Input, Output, (UINT32) InputSize, AesKey + 1, IvecBuffer, AES_DECRYPT);
-
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesNull.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesNull.c
deleted file mode 100644
index 66d014b..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesNull.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/** @file
- AES Wrapper Implementation which does not provide real capabilities.
-
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Retrieves the size, in bytes, of the context buffer required for AES operations.
-
- Return zero to indicate this interface is not supported.
-
- @retval 0 This interface is not supported.
-
-**/
-UINTN
-EFIAPI
-AesGetContextSize (
- VOID
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Initializes user-supplied memory as AES context for subsequent use.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[out] AesContext Pointer to AES context being initialized.
- @param[in] Key Pointer to the user-supplied AES key.
- @param[in] KeyLength Length of AES key in bits.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-AesInit (
- OUT VOID *AesContext,
- IN CONST UINT8 *Key,
- IN UINTN KeyLength
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Performs AES encryption on a data buffer of the specified size in ECB mode.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] AesContext Pointer to the AES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the AES encryption output.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-AesEcbEncrypt (
- IN VOID *AesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Performs AES decryption on a data buffer of the specified size in ECB mode.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] AesContext Pointer to the AES context.
- @param[in] Input Pointer to the buffer containing the data to be decrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the AES decryption output.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-AesEcbDecrypt (
- IN VOID *AesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Performs AES encryption on a data buffer of the specified size in CBC mode.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] AesContext Pointer to the AES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[in] Ivec Pointer to initialization vector.
- @param[out] Output Pointer to a buffer that receives the AES encryption output.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-AesCbcEncrypt (
- IN VOID *AesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- IN CONST UINT8 *Ivec,
- OUT UINT8 *Output
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Performs AES decryption on a data buffer of the specified size in CBC mode.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] AesContext Pointer to the AES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[in] Ivec Pointer to initialization vector.
- @param[out] Output Pointer to a buffer that receives the AES encryption output.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-AesCbcDecrypt (
- IN VOID *AesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- IN CONST UINT8 *Ivec,
- OUT UINT8 *Output
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4.c
deleted file mode 100644
index cceede8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/** @file
- ARC4 Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-/**
- Retrieves the size, in bytes, of the context buffer required for ARC4 operations.
-
- @return The size, in bytes, of the context buffer required for ARC4 operations.
-
-**/
-UINTN
-EFIAPI
-Arc4GetContextSize (
- VOID
- )
-{
- //
- // Memory for 2 copies of RC4_KEY is allocated, one for working copy, and the other
- // for backup copy. When Arc4Reset() is called, we can use the backup copy to restore
- // the working copy to the initial state.
- //
- return (UINTN) (2 * sizeof (RC4_KEY));
-}
-
-/**
- Initializes user-supplied memory as ARC4 context for subsequent use.
-
- This function initializes user-supplied memory pointed by Arc4Context as ARC4 context.
- In addition, it sets up all ARC4 key materials for subsequent encryption and decryption
- operations.
-
- If Arc4Context is NULL, then return FALSE.
- If Key is NULL, then return FALSE.
- If KeySize does not in the range of [5, 256] bytes, then return FALSE.
-
- @param[out] Arc4Context Pointer to ARC4 context being initialized.
- @param[in] Key Pointer to the user-supplied ARC4 key.
- @param[in] KeySize Size of ARC4 key in bytes.
-
- @retval TRUE ARC4 context initialization succeeded.
- @retval FALSE ARC4 context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-Arc4Init (
- OUT VOID *Arc4Context,
- IN CONST UINT8 *Key,
- IN UINTN KeySize
- )
-{
- RC4_KEY *Rc4Key;
-
- //
- // Check input parameters.
- //
- if (Arc4Context == NULL || Key == NULL || (KeySize < 5 || KeySize > 256)) {
- return FALSE;
- }
-
- Rc4Key = (RC4_KEY *) Arc4Context;
-
- RC4_set_key (Rc4Key, (UINT32) KeySize, Key);
-
- CopyMem (Rc4Key + 1, Rc4Key, sizeof (RC4_KEY));
-
- return TRUE;
-}
-
-/**
- Performs ARC4 encryption on a data buffer of the specified size.
-
- This function performs ARC4 encryption on data buffer pointed by Input, of specified
- size of InputSize.
- Arc4Context should be already correctly initialized by Arc4Init(). Behavior with
- invalid ARC4 context is undefined.
-
- If Arc4Context is NULL, then return FALSE.
- If Input is NULL, then return FALSE.
- If Output is NULL, then return FALSE.
-
- @param[in, out] Arc4Context Pointer to the ARC4 context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the ARC4 encryption output.
-
- @retval TRUE ARC4 encryption succeeded.
- @retval FALSE ARC4 encryption failed.
-
-**/
-BOOLEAN
-EFIAPI
-Arc4Encrypt (
- IN OUT VOID *Arc4Context,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- RC4_KEY *Rc4Key;
-
- //
- // Check input parameters.
- //
- if (Arc4Context == NULL || Input == NULL || Output == NULL || InputSize > INT_MAX) {
- return FALSE;
- }
-
- Rc4Key = (RC4_KEY *) Arc4Context;
-
- RC4 (Rc4Key, (UINT32) InputSize, Input, Output);
-
- return TRUE;
-}
-
-/**
- Performs ARC4 decryption on a data buffer of the specified size.
-
- This function performs ARC4 decryption on data buffer pointed by Input, of specified
- size of InputSize.
- Arc4Context should be already correctly initialized by Arc4Init(). Behavior with
- invalid ARC4 context is undefined.
-
- If Arc4Context is NULL, then return FALSE.
- If Input is NULL, then return FALSE.
- If Output is NULL, then return FALSE.
-
- @param[in, out] Arc4Context Pointer to the ARC4 context.
- @param[in] Input Pointer to the buffer containing the data to be decrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the ARC4 decryption output.
-
- @retval TRUE ARC4 decryption succeeded.
- @retval FALSE ARC4 decryption failed.
-
-**/
-BOOLEAN
-EFIAPI
-Arc4Decrypt (
- IN OUT VOID *Arc4Context,
- IN UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- RC4_KEY *Rc4Key;
-
- //
- // Check input parameters.
- //
- if (Arc4Context == NULL || Input == NULL || Output == NULL || InputSize > INT_MAX) {
- return FALSE;
- }
-
- Rc4Key = (RC4_KEY *) Arc4Context;
-
- RC4 (Rc4Key, (UINT32) InputSize, Input, Output);
-
- return TRUE;
-}
-
-/**
- Resets the ARC4 context to the initial state.
-
- The function resets the ARC4 context to the state it had immediately after the
- ARC4Init() function call.
- Contrary to ARC4Init(), Arc4Reset() requires no secret key as input, but ARC4 context
- should be already correctly initialized by ARC4Init().
-
- If Arc4Context is NULL, then return FALSE.
-
- @param[in, out] Arc4Context Pointer to the ARC4 context.
-
- @retval TRUE ARC4 reset succeeded.
- @retval FALSE ARC4 reset failed.
-
-**/
-BOOLEAN
-EFIAPI
-Arc4Reset (
- IN OUT VOID *Arc4Context
- )
-{
- RC4_KEY *Rc4Key;
-
- //
- // Check input parameters.
- //
- if (Arc4Context == NULL) {
- return FALSE;
- }
-
- Rc4Key = (RC4_KEY *) Arc4Context;
-
- CopyMem (Rc4Key, Rc4Key + 1, sizeof (RC4_KEY));
-
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4Null.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4Null.c
deleted file mode 100644
index 6e100e2..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4Null.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/** @file
- ARC4 Wrapper Implementation which does not provide real capabilities.
-
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Retrieves the size, in bytes, of the context buffer required for ARC4 operations.
-
- Return zero to indicate this interface is not supported.
-
- @retval 0 This interface is not supported.
-
-
-**/
-UINTN
-EFIAPI
-Arc4GetContextSize (
- VOID
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Initializes user-supplied memory as ARC4 context for subsequent use.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[out] Arc4Context Pointer to ARC4 context being initialized.
- @param[in] Key Pointer to the user-supplied ARC4 key.
- @param[in] KeySize Size of ARC4 key in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Arc4Init (
- OUT VOID *Arc4Context,
- IN CONST UINT8 *Key,
- IN UINTN KeySize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Performs ARC4 encryption on a data buffer of the specified size.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] Arc4Context Pointer to the ARC4 context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the ARC4 encryption output.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Arc4Encrypt (
- IN OUT VOID *Arc4Context,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Performs ARC4 decryption on a data buffer of the specified size.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] Arc4Context Pointer to the ARC4 context.
- @param[in] Input Pointer to the buffer containing the data to be decrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the ARC4 decryption output.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Arc4Decrypt (
- IN OUT VOID *Arc4Context,
- IN UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Resets the ARC4 context to the initial state.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] Arc4Context Pointer to the ARC4 context.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Arc4Reset (
- IN OUT VOID *Arc4Context
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdes.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdes.c
deleted file mode 100644
index 68c57d3..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdes.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/** @file
- TDES Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-/**
- Retrieves the size, in bytes, of the context buffer required for TDES operations.
-
- @return The size, in bytes, of the context buffer required for TDES operations.
-
-**/
-UINTN
-EFIAPI
-TdesGetContextSize (
- VOID
- )
-{
- //
- // Memory for 3 copies of DES_key_schedule is allocated, for K1, K2 and K3 each.
- //
- return (UINTN) (3 * sizeof (DES_key_schedule));
-}
-
-/**
- Initializes user-supplied memory as TDES context for subsequent use.
-
- This function initializes user-supplied memory pointed by TdesContext as TDES context.
- In addition, it sets up all TDES key materials for subsequent encryption and decryption
- operations.
- There are 3 key options as follows:
- KeyLength = 64, Keying option 1: K1 == K2 == K3 (Backward compatibility with DES)
- KeyLength = 128, Keying option 2: K1 != K2 and K3 = K1 (Less Security)
- KeyLength = 192 Keying option 3: K1 != K2 != K3 (Strongest)
-
- If TdesContext is NULL, then return FALSE.
- If Key is NULL, then return FALSE.
- If KeyLength is not valid, then return FALSE.
-
- @param[out] TdesContext Pointer to TDES context being initialized.
- @param[in] Key Pointer to the user-supplied TDES key.
- @param[in] KeyLength Length of TDES key in bits.
-
- @retval TRUE TDES context initialization succeeded.
- @retval FALSE TDES context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-TdesInit (
- OUT VOID *TdesContext,
- IN CONST UINT8 *Key,
- IN UINTN KeyLength
- )
-{
- DES_key_schedule *KeySchedule;
-
- //
- // Check input parameters.
- //
- if (TdesContext == NULL || Key == NULL || (KeyLength != 64 && KeyLength != 128 && KeyLength != 192)) {
- return FALSE;
- }
-
- KeySchedule = (DES_key_schedule *) TdesContext;
-
- //
- // If input Key is a weak key, return error.
- //
- if (DES_is_weak_key ((const_DES_cblock *) Key) == 1) {
- return FALSE;
- }
-
- DES_set_key_unchecked ((const_DES_cblock *) Key, KeySchedule);
-
- if (KeyLength == 64) {
- CopyMem (KeySchedule + 1, KeySchedule, sizeof (DES_key_schedule));
- CopyMem (KeySchedule + 2, KeySchedule, sizeof (DES_key_schedule));
- return TRUE;
- }
-
- if (DES_is_weak_key ((const_DES_cblock *) (Key + 8)) == 1) {
- return FALSE;
- }
-
- DES_set_key_unchecked ((const_DES_cblock *) (Key + 8), KeySchedule + 1);
-
- if (KeyLength == 128) {
- CopyMem (KeySchedule + 2, KeySchedule, sizeof (DES_key_schedule));
- return TRUE;
- }
-
- if (DES_is_weak_key ((const_DES_cblock *) (Key + 16)) == 1) {
- return FALSE;
- }
-
- DES_set_key_unchecked ((const_DES_cblock *) (Key + 16), KeySchedule + 2);
-
- return TRUE;
-}
-
-/**
- Performs TDES encryption on a data buffer of the specified size in ECB mode.
-
- This function performs TDES encryption on data buffer pointed by Input, of specified
- size of InputSize, in ECB mode.
- InputSize must be multiple of block size (8 bytes). This function does not perform
- padding. Caller must perform padding, if necessary, to ensure valid input data size.
- TdesContext should be already correctly initialized by TdesInit(). Behavior with
- invalid TDES context is undefined.
-
- If TdesContext is NULL, then return FALSE.
- If Input is NULL, then return FALSE.
- If InputSize is not multiple of block size (8 bytes), then return FALSE.
- If Output is NULL, then return FALSE.
-
- @param[in] TdesContext Pointer to the TDES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.
-
- @retval TRUE TDES encryption succeeded.
- @retval FALSE TDES encryption failed.
-
-**/
-BOOLEAN
-EFIAPI
-TdesEcbEncrypt (
- IN VOID *TdesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- DES_key_schedule *KeySchedule;
-
- //
- // Check input parameters.
- //
- if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0 || Output == NULL) {
- return FALSE;
- }
-
- KeySchedule = (DES_key_schedule *) TdesContext;
-
- while (InputSize > 0) {
- DES_ecb3_encrypt (
- (const_DES_cblock *) Input,
- (DES_cblock *) Output,
- KeySchedule,
- KeySchedule + 1,
- KeySchedule + 2,
- DES_ENCRYPT
- );
- Input += TDES_BLOCK_SIZE;
- Output += TDES_BLOCK_SIZE;
- InputSize -= TDES_BLOCK_SIZE;
- }
-
- return TRUE;
-}
-
-/**
- Performs TDES decryption on a data buffer of the specified size in ECB mode.
-
- This function performs TDES decryption on data buffer pointed by Input, of specified
- size of InputSize, in ECB mode.
- InputSize must be multiple of block size (8 bytes). This function does not perform
- padding. Caller must perform padding, if necessary, to ensure valid input data size.
- TdesContext should be already correctly initialized by TdesInit(). Behavior with
- invalid TDES context is undefined.
-
- If TdesContext is NULL, then return FALSE.
- If Input is NULL, then return FALSE.
- If InputSize is not multiple of block size (8 bytes), then return FALSE.
- If Output is NULL, then return FALSE.
-
- @param[in] TdesContext Pointer to the TDES context.
- @param[in] Input Pointer to the buffer containing the data to be decrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the TDES decryption output.
-
- @retval TRUE TDES decryption succeeded.
- @retval FALSE TDES decryption failed.
-
-**/
-BOOLEAN
-EFIAPI
-TdesEcbDecrypt (
- IN VOID *TdesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- DES_key_schedule *KeySchedule;
-
- //
- // Check input parameters.
- //
- if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0 || Output == NULL) {
- return FALSE;
- }
-
- KeySchedule = (DES_key_schedule *) TdesContext;
-
- while (InputSize > 0) {
- DES_ecb3_encrypt (
- (const_DES_cblock *) Input,
- (DES_cblock *) Output,
- KeySchedule,
- KeySchedule + 1,
- KeySchedule + 2,
- DES_DECRYPT
- );
- Input += TDES_BLOCK_SIZE;
- Output += TDES_BLOCK_SIZE;
- InputSize -= TDES_BLOCK_SIZE;
- }
-
- return TRUE;
-}
-
-/**
- Performs TDES encryption on a data buffer of the specified size in CBC mode.
-
- This function performs TDES encryption on data buffer pointed by Input, of specified
- size of InputSize, in CBC mode.
- InputSize must be multiple of block size (8 bytes). This function does not perform
- padding. Caller must perform padding, if necessary, to ensure valid input data size.
- Initialization vector should be one block size (8 bytes).
- TdesContext should be already correctly initialized by TdesInit(). Behavior with
- invalid TDES context is undefined.
-
- If TdesContext is NULL, then return FALSE.
- If Input is NULL, then return FALSE.
- If InputSize is not multiple of block size (8 bytes), then return FALSE.
- If Ivec is NULL, then return FALSE.
- If Output is NULL, then return FALSE.
-
- @param[in] TdesContext Pointer to the TDES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[in] Ivec Pointer to initialization vector.
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.
-
- @retval TRUE TDES encryption succeeded.
- @retval FALSE TDES encryption failed.
-
-**/
-BOOLEAN
-EFIAPI
-TdesCbcEncrypt (
- IN VOID *TdesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- IN CONST UINT8 *Ivec,
- OUT UINT8 *Output
- )
-{
- DES_key_schedule *KeySchedule;
- UINT8 IvecBuffer[TDES_BLOCK_SIZE];
-
- //
- // Check input parameters.
- //
- if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0) {
- return FALSE;
- }
-
- if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {
- return FALSE;
- }
-
- KeySchedule = (DES_key_schedule *) TdesContext;
- CopyMem (IvecBuffer, Ivec, TDES_BLOCK_SIZE);
-
- DES_ede3_cbc_encrypt (
- Input,
- Output,
- (UINT32) InputSize,
- KeySchedule,
- KeySchedule + 1,
- KeySchedule + 2,
- (DES_cblock *) IvecBuffer,
- DES_ENCRYPT
- );
-
- return TRUE;
-}
-
-/**
- Performs TDES decryption on a data buffer of the specified size in CBC mode.
-
- This function performs TDES decryption on data buffer pointed by Input, of specified
- size of InputSize, in CBC mode.
- InputSize must be multiple of block size (8 bytes). This function does not perform
- padding. Caller must perform padding, if necessary, to ensure valid input data size.
- Initialization vector should be one block size (8 bytes).
- TdesContext should be already correctly initialized by TdesInit(). Behavior with
- invalid TDES context is undefined.
-
- If TdesContext is NULL, then return FALSE.
- If Input is NULL, then return FALSE.
- If InputSize is not multiple of block size (8 bytes), then return FALSE.
- If Ivec is NULL, then return FALSE.
- If Output is NULL, then return FALSE.
-
- @param[in] TdesContext Pointer to the TDES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[in] Ivec Pointer to initialization vector.
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.
-
- @retval TRUE TDES decryption succeeded.
- @retval FALSE TDES decryption failed.
-
-**/
-BOOLEAN
-EFIAPI
-TdesCbcDecrypt (
- IN VOID *TdesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- IN CONST UINT8 *Ivec,
- OUT UINT8 *Output
- )
-{
- DES_key_schedule *KeySchedule;
- UINT8 IvecBuffer[TDES_BLOCK_SIZE];
-
- //
- // Check input parameters.
- //
- if (TdesContext == NULL || Input == NULL || (InputSize % TDES_BLOCK_SIZE) != 0) {
- return FALSE;
- }
-
- if (Ivec == NULL || Output == NULL || InputSize > INT_MAX) {
- return FALSE;
- }
-
- KeySchedule = (DES_key_schedule *) TdesContext;
- CopyMem (IvecBuffer, Ivec, TDES_BLOCK_SIZE);
-
- DES_ede3_cbc_encrypt (
- Input,
- Output,
- (UINT32) InputSize,
- KeySchedule,
- KeySchedule + 1,
- KeySchedule + 2,
- (DES_cblock *) IvecBuffer,
- DES_DECRYPT
- );
-
- return TRUE;
-}
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdesNull.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdesNull.c
deleted file mode 100644
index 06ba4cf..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Cipher/CryptTdesNull.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/** @file
- TDES Wrapper Implementation which does not provide real capabilities.
-
-Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Retrieves the size, in bytes, of the context buffer required for TDES operations.
-
- Return zero to indicate this interface is not supported.
-
- @retval 0 This interface is not supported.
-
-**/
-UINTN
-EFIAPI
-TdesGetContextSize (
- VOID
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Initializes user-supplied memory as TDES context for subsequent use.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[out] TdesContext Pointer to TDES context being initialized.
- @param[in] Key Pointer to the user-supplied TDES key.
- @param[in] KeyLength Length of TDES key in bits.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-TdesInit (
- OUT VOID *TdesContext,
- IN CONST UINT8 *Key,
- IN UINTN KeyLength
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Performs TDES encryption on a data buffer of the specified size in ECB mode.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] TdesContext Pointer to the TDES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-TdesEcbEncrypt (
- IN VOID *TdesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Performs TDES decryption on a data buffer of the specified size in ECB mode.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] TdesContext Pointer to the TDES context.
- @param[in] Input Pointer to the buffer containing the data to be decrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[out] Output Pointer to a buffer that receives the TDES decryption output.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-TdesEcbDecrypt (
- IN VOID *TdesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- OUT UINT8 *Output
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Performs TDES encryption on a data buffer of the specified size in CBC mode.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] TdesContext Pointer to the TDES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[in] Ivec Pointer to initialization vector.
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-TdesCbcEncrypt (
- IN VOID *TdesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- IN CONST UINT8 *Ivec,
- OUT UINT8 *Output
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Performs TDES decryption on a data buffer of the specified size in CBC mode.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] TdesContext Pointer to the TDES context.
- @param[in] Input Pointer to the buffer containing the data to be encrypted.
- @param[in] InputSize Size of the Input buffer in bytes.
- @param[in] Ivec Pointer to initialization vector.
- @param[out] Output Pointer to a buffer that receives the TDES encryption output.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-TdesCbcDecrypt (
- IN VOID *TdesContext,
- IN CONST UINT8 *Input,
- IN UINTN InputSize,
- IN CONST UINT8 *Ivec,
- OUT UINT8 *Output
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd4.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd4.c
deleted file mode 100644
index 518bee4..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd4.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/** @file
- MD4 Digest Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-/**
- Retrieves the size, in bytes, of the context buffer required for MD4 hash operations.
-
- @return The size, in bytes, of the context buffer required for MD4 hash operations.
-
-**/
-UINTN
-EFIAPI
-Md4GetContextSize (
- VOID
- )
-{
- //
- // Retrieves the OpenSSL MD4 Context Size
- //
- return (UINTN) (sizeof (MD4_CTX));
-}
-
-/**
- Initializes user-supplied memory pointed by Md4Context as MD4 hash context for
- subsequent use.
-
- If Md4Context is NULL, then return FALSE.
-
- @param[out] Md4Context Pointer to MD4 context being initialized.
-
- @retval TRUE MD4 context initialization succeeded.
- @retval FALSE MD4 context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-Md4Init (
- OUT VOID *Md4Context
- )
-{
- //
- // Check input parameters.
- //
- if (Md4Context == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL MD4 Context Initialization
- //
- return (BOOLEAN) (MD4_Init ((MD4_CTX *) Md4Context));
-}
-
-/**
- Makes a copy of an existing MD4 context.
-
- If Md4Context is NULL, then return FALSE.
- If NewMd4Context is NULL, then return FALSE.
-
- @param[in] Md4Context Pointer to MD4 context being copied.
- @param[out] NewMd4Context Pointer to new MD4 context.
-
- @retval TRUE MD4 context copy succeeded.
- @retval FALSE MD4 context copy failed.
-
-**/
-BOOLEAN
-EFIAPI
-Md4Duplicate (
- IN CONST VOID *Md4Context,
- OUT VOID *NewMd4Context
- )
-{
- //
- // Check input parameters.
- //
- if (Md4Context == NULL || NewMd4Context == NULL) {
- return FALSE;
- }
-
- CopyMem (NewMd4Context, Md4Context, sizeof (MD4_CTX));
-
- return TRUE;
-}
-
-/**
- Digests the input data and updates MD4 context.
-
- This function performs MD4 digest on a data buffer of the specified size.
- It can be called multiple times to compute the digest of long or discontinuous data streams.
- MD4 context should be already correctly initialized by Md4Init(), and should not be finalized
- by Md4Final(). Behavior with invalid context is undefined.
-
- If Md4Context is NULL, then return FALSE.
-
- @param[in, out] Md4Context Pointer to the MD4 context.
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval TRUE MD4 data digest succeeded.
- @retval FALSE MD4 data digest failed.
-
-**/
-BOOLEAN
-EFIAPI
-Md4Update (
- IN OUT VOID *Md4Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- //
- // Check input parameters.
- //
- if (Md4Context == NULL) {
- return FALSE;
- }
-
- //
- // Check invalid parameters, in case that only DataLength was checked in OpenSSL
- //
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL MD4 Hash Update
- //
- return (BOOLEAN) (MD4_Update ((MD4_CTX *) Md4Context, Data, DataSize));
-}
-
-/**
- Completes computation of the MD4 digest value.
-
- This function completes MD4 hash computation and retrieves the digest value into
- the specified memory. After this function has been called, the MD4 context cannot
- be used again.
- MD4 context should be already correctly initialized by Md4Init(), and should not be
- finalized by Md4Final(). Behavior with invalid MD4 context is undefined.
-
- If Md4Context is NULL, then return FALSE.
- If HashValue is NULL, then return FALSE.
-
- @param[in, out] Md4Context Pointer to the MD4 context.
- @param[out] HashValue Pointer to a buffer that receives the MD4 digest
- value (16 bytes).
-
- @retval TRUE MD4 digest computation succeeded.
- @retval FALSE MD4 digest computation failed.
-
-**/
-BOOLEAN
-EFIAPI
-Md4Final (
- IN OUT VOID *Md4Context,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (Md4Context == NULL || HashValue == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL MD4 Hash Finalization
- //
- return (BOOLEAN) (MD4_Final (HashValue, (MD4_CTX *) Md4Context));
-}
-
-/**
- Computes the MD4 message digest of a input data buffer.
-
- This function performs the MD4 message digest of a given data buffer, and places
- the digest value into the specified memory.
-
- If this interface is not supported, then return FALSE.
-
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
- @param[out] HashValue Pointer to a buffer that receives the MD4 digest
- value (16 bytes).
-
- @retval TRUE MD4 digest computation succeeded.
- @retval FALSE MD4 digest computation failed.
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Md4HashAll (
- IN CONST VOID *Data,
- IN UINTN DataSize,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (HashValue == NULL) {
- return FALSE;
- }
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL MD4 Hash Computation.
- //
- if (MD4 (Data, DataSize, HashValue) == NULL) {
- return FALSE;
- } else {
- return TRUE;
- }
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd4Null.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd4Null.c
deleted file mode 100644
index b8435b0..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd4Null.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/** @file
- MD4 Digest Wrapper Implementation which does not provide real capabilities.
-
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Retrieves the size, in bytes, of the context buffer required for MD4 hash
- operations.
-
- Return zero to indicate this interface is not supported.
-
- @retval 0 This interface is not supported.
-
-**/
-UINTN
-EFIAPI
-Md4GetContextSize (
- VOID
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Initializes user-supplied memory pointed by Md4Context as MD4 hash context for
- subsequent use.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[out] Md4Context Pointer to MD4 context being initialized.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Md4Init (
- OUT VOID *Md4Context
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Makes a copy of an existing MD4 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Md4Context Pointer to MD4 context being copied.
- @param[out] NewMd4Context Pointer to new MD4 context.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Md4Duplicate (
- IN CONST VOID *Md4Context,
- OUT VOID *NewMd4Context
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Digests the input data and updates MD4 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] Md4Context Pointer to the MD4 context.
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Md4Update (
- IN OUT VOID *Md4Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Completes computation of the MD4 digest value.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] Md4Context Pointer to the MD4 context.
- @param[out] HashValue Pointer to a buffer that receives the MD4 digest
- value (16 bytes).
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Md4Final (
- IN OUT VOID *Md4Context,
- OUT UINT8 *HashValue
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Computes the MD4 message digest of a input data buffer.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
- @param[out] HashValue Pointer to a buffer that receives the MD4 digest
- value (16 bytes).
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Md4HashAll (
- IN CONST VOID *Data,
- IN UINTN DataSize,
- OUT UINT8 *HashValue
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd5.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd5.c
deleted file mode 100644
index 837ee3c..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd5.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/** @file
- MD5 Digest Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-
-/**
- Retrieves the size, in bytes, of the context buffer required for MD5 hash operations.
-
- @return The size, in bytes, of the context buffer required for MD5 hash operations.
-
-**/
-UINTN
-EFIAPI
-Md5GetContextSize (
- VOID
- )
-{
- //
- // Retrieves the OpenSSL MD5 Context Size
- //
- return (UINTN) (sizeof (MD5_CTX));
-}
-
-
-/**
- Initializes user-supplied memory pointed by Md5Context as MD5 hash context for
- subsequent use.
-
- If Md5Context is NULL, then return FALSE.
-
- @param[out] Md5Context Pointer to MD5 context being initialized.
-
- @retval TRUE MD5 context initialization succeeded.
- @retval FALSE MD5 context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-Md5Init (
- OUT VOID *Md5Context
- )
-{
- //
- // Check input parameters.
- //
- if (Md5Context == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL MD5 Context Initialization
- //
- return (BOOLEAN) (MD5_Init ((MD5_CTX *) Md5Context));
-}
-
-/**
- Makes a copy of an existing MD5 context.
-
- If Md5Context is NULL, then return FALSE.
- If NewMd5Context is NULL, then return FALSE.
-
- @param[in] Md5Context Pointer to MD5 context being copied.
- @param[out] NewMd5Context Pointer to new MD5 context.
-
- @retval TRUE MD5 context copy succeeded.
- @retval FALSE MD5 context copy failed.
-
-**/
-BOOLEAN
-EFIAPI
-Md5Duplicate (
- IN CONST VOID *Md5Context,
- OUT VOID *NewMd5Context
- )
-{
- //
- // Check input parameters.
- //
- if (Md5Context == NULL || NewMd5Context == NULL) {
- return FALSE;
- }
-
- CopyMem (NewMd5Context, Md5Context, sizeof (MD5_CTX));
-
- return TRUE;
-}
-
-/**
- Digests the input data and updates MD5 context.
-
- This function performs MD5 digest on a data buffer of the specified size.
- It can be called multiple times to compute the digest of long or discontinuous data streams.
- MD5 context should be already correctly initialized by Md5Init(), and should not be finalized
- by Md5Final(). Behavior with invalid context is undefined.
-
- If Md5Context is NULL, then return FALSE.
-
- @param[in, out] Md5Context Pointer to the MD5 context.
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval TRUE MD5 data digest succeeded.
- @retval FALSE MD5 data digest failed.
-
-**/
-BOOLEAN
-EFIAPI
-Md5Update (
- IN OUT VOID *Md5Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- //
- // Check input parameters.
- //
- if (Md5Context == NULL) {
- return FALSE;
- }
-
- //
- // Check invalid parameters, in case that only DataLength was checked in OpenSSL
- //
- if (Data == NULL && (DataSize != 0)) {
- return FALSE;
- }
-
- //
- // OpenSSL MD5 Hash Update
- //
- return (BOOLEAN) (MD5_Update ((MD5_CTX *) Md5Context, Data, DataSize));
-}
-
-/**
- Completes computation of the MD5 digest value.
-
- This function completes MD5 hash computation and retrieves the digest value into
- the specified memory. After this function has been called, the MD5 context cannot
- be used again.
- MD5 context should be already correctly initialized by Md5Init(), and should not be
- finalized by Md5Final(). Behavior with invalid MD5 context is undefined.
-
- If Md5Context is NULL, then return FALSE.
- If HashValue is NULL, then return FALSE.
-
- @param[in, out] Md5Context Pointer to the MD5 context.
- @param[out] HashValue Pointer to a buffer that receives the MD5 digest
- value (16 bytes).
-
- @retval TRUE MD5 digest computation succeeded.
- @retval FALSE MD5 digest computation failed.
-
-**/
-BOOLEAN
-EFIAPI
-Md5Final (
- IN OUT VOID *Md5Context,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (Md5Context == NULL || HashValue == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL MD5 Hash Finalization
- //
- return (BOOLEAN) (MD5_Final (HashValue, (MD5_CTX *) Md5Context));
-}
-
-/**
- Computes the MD5 message digest of a input data buffer.
-
- This function performs the MD5 message digest of a given data buffer, and places
- the digest value into the specified memory.
-
- If this interface is not supported, then return FALSE.
-
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
- @param[out] HashValue Pointer to a buffer that receives the MD5 digest
- value (16 bytes).
-
- @retval TRUE MD5 digest computation succeeded.
- @retval FALSE MD5 digest computation failed.
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Md5HashAll (
- IN CONST VOID *Data,
- IN UINTN DataSize,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (HashValue == NULL) {
- return FALSE;
- }
- if (Data == NULL && (DataSize != 0)) {
- return FALSE;
- }
-
- //
- // OpenSSL MD5 Hash Computation.
- //
- if (MD5 (Data, DataSize, HashValue) == NULL) {
- return FALSE;
- } else {
- return TRUE;
- }
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha1.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha1.c
deleted file mode 100644
index 9fea08f..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha1.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/** @file
- SHA-1 Digest Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-
-/**
- Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.
-
- @return The size, in bytes, of the context buffer required for SHA-1 hash operations.
-
-**/
-UINTN
-EFIAPI
-Sha1GetContextSize (
- VOID
- )
-{
- //
- // Retrieves OpenSSL SHA Context Size
- //
- return (UINTN) (sizeof (SHA_CTX));
-}
-
-/**
- Initializes user-supplied memory pointed by Sha1Context as SHA-1 hash context for
- subsequent use.
-
- If Sha1Context is NULL, then return FALSE.
-
- @param[out] Sha1Context Pointer to SHA-1 context being initialized.
-
- @retval TRUE SHA-1 context initialization succeeded.
- @retval FALSE SHA-1 context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha1Init (
- OUT VOID *Sha1Context
- )
-{
- //
- // Check input parameters.
- //
- if (Sha1Context == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-1 Context Initialization
- //
- return (BOOLEAN) (SHA1_Init ((SHA_CTX *) Sha1Context));
-}
-
-/**
- Makes a copy of an existing SHA-1 context.
-
- If Sha1Context is NULL, then return FALSE.
- If NewSha1Context is NULL, then return FALSE.
-
- @param[in] Sha1Context Pointer to SHA-1 context being copied.
- @param[out] NewSha1Context Pointer to new SHA-1 context.
-
- @retval TRUE SHA-1 context copy succeeded.
- @retval FALSE SHA-1 context copy failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha1Duplicate (
- IN CONST VOID *Sha1Context,
- OUT VOID *NewSha1Context
- )
-{
- //
- // Check input parameters.
- //
- if (Sha1Context == NULL || NewSha1Context == NULL) {
- return FALSE;
- }
-
- CopyMem (NewSha1Context, Sha1Context, sizeof (SHA_CTX));
-
- return TRUE;
-}
-
-/**
- Digests the input data and updates SHA-1 context.
-
- This function performs SHA-1 digest on a data buffer of the specified size.
- It can be called multiple times to compute the digest of long or discontinuous data streams.
- SHA-1 context should be already correctly initialized by Sha1Init(), and should not be finalized
- by Sha1Final(). Behavior with invalid context is undefined.
-
- If Sha1Context is NULL, then return FALSE.
-
- @param[in, out] Sha1Context Pointer to the SHA-1 context.
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval TRUE SHA-1 data digest succeeded.
- @retval FALSE SHA-1 data digest failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha1Update (
- IN OUT VOID *Sha1Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- //
- // Check input parameters.
- //
- if (Sha1Context == NULL) {
- return FALSE;
- }
-
- //
- // Check invalid parameters, in case that only DataLength was checked in OpenSSL
- //
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-1 Hash Update
- //
- return (BOOLEAN) (SHA1_Update ((SHA_CTX *) Sha1Context, Data, DataSize));
-}
-
-/**
- Completes computation of the SHA-1 digest value.
-
- This function completes SHA-1 hash computation and retrieves the digest value into
- the specified memory. After this function has been called, the SHA-1 context cannot
- be used again.
- SHA-1 context should be already correctly initialized by Sha1Init(), and should not be
- finalized by Sha1Final(). Behavior with invalid SHA-1 context is undefined.
-
- If Sha1Context is NULL, then return FALSE.
- If HashValue is NULL, then return FALSE.
-
- @param[in, out] Sha1Context Pointer to the SHA-1 context.
- @param[out] HashValue Pointer to a buffer that receives the SHA-1 digest
- value (20 bytes).
-
- @retval TRUE SHA-1 digest computation succeeded.
- @retval FALSE SHA-1 digest computation failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha1Final (
- IN OUT VOID *Sha1Context,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (Sha1Context == NULL || HashValue == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-1 Hash Finalization
- //
- return (BOOLEAN) (SHA1_Final (HashValue, (SHA_CTX *) Sha1Context));
-}
-
-/**
- Computes the SHA-1 message digest of a input data buffer.
-
- This function performs the SHA-1 message digest of a given data buffer, and places
- the digest value into the specified memory.
-
- If this interface is not supported, then return FALSE.
-
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
- @param[out] HashValue Pointer to a buffer that receives the SHA-1 digest
- value (20 bytes).
-
- @retval TRUE SHA-1 digest computation succeeded.
- @retval FALSE SHA-1 digest computation failed.
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha1HashAll (
- IN CONST VOID *Data,
- IN UINTN DataSize,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (HashValue == NULL) {
- return FALSE;
- }
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-1 Hash Computation.
- //
- if (SHA1 (Data, DataSize, HashValue) == NULL) {
- return FALSE;
- } else {
- return TRUE;
- }
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c
deleted file mode 100644
index 3a04291..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/** @file
- SHA-256 Digest Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-/**
- Retrieves the size, in bytes, of the context buffer required for SHA-256 hash operations.
-
- @return The size, in bytes, of the context buffer required for SHA-256 hash operations.
-
-**/
-UINTN
-EFIAPI
-Sha256GetContextSize (
- VOID
- )
-{
- //
- // Retrieves OpenSSL SHA-256 Context Size
- //
- return (UINTN) (sizeof (SHA256_CTX));
-}
-
-/**
- Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for
- subsequent use.
-
- If Sha256Context is NULL, then return FALSE.
-
- @param[out] Sha256Context Pointer to SHA-256 context being initialized.
-
- @retval TRUE SHA-256 context initialization succeeded.
- @retval FALSE SHA-256 context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha256Init (
- OUT VOID *Sha256Context
- )
-{
- //
- // Check input parameters.
- //
- if (Sha256Context == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-256 Context Initialization
- //
- return (BOOLEAN) (SHA256_Init ((SHA256_CTX *) Sha256Context));
-}
-
-/**
- Makes a copy of an existing SHA-256 context.
-
- If Sha256Context is NULL, then return FALSE.
- If NewSha256Context is NULL, then return FALSE.
-
- @param[in] Sha256Context Pointer to SHA-256 context being copied.
- @param[out] NewSha256Context Pointer to new SHA-256 context.
-
- @retval TRUE SHA-256 context copy succeeded.
- @retval FALSE SHA-256 context copy failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha256Duplicate (
- IN CONST VOID *Sha256Context,
- OUT VOID *NewSha256Context
- )
-{
- //
- // Check input parameters.
- //
- if (Sha256Context == NULL || NewSha256Context == NULL) {
- return FALSE;
- }
-
- CopyMem (NewSha256Context, Sha256Context, sizeof (SHA256_CTX));
-
- return TRUE;
-}
-
-/**
- Digests the input data and updates SHA-256 context.
-
- This function performs SHA-256 digest on a data buffer of the specified size.
- It can be called multiple times to compute the digest of long or discontinuous data streams.
- SHA-256 context should be already correctly initialized by Sha256Init(), and should not be finalized
- by Sha256Final(). Behavior with invalid context is undefined.
-
- If Sha256Context is NULL, then return FALSE.
-
- @param[in, out] Sha256Context Pointer to the SHA-256 context.
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval TRUE SHA-256 data digest succeeded.
- @retval FALSE SHA-256 data digest failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha256Update (
- IN OUT VOID *Sha256Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- //
- // Check input parameters.
- //
- if (Sha256Context == NULL) {
- return FALSE;
- }
-
- //
- // Check invalid parameters, in case that only DataLength was checked in OpenSSL
- //
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-256 Hash Update
- //
- return (BOOLEAN) (SHA256_Update ((SHA256_CTX *) Sha256Context, Data, DataSize));
-}
-
-/**
- Completes computation of the SHA-256 digest value.
-
- This function completes SHA-256 hash computation and retrieves the digest value into
- the specified memory. After this function has been called, the SHA-256 context cannot
- be used again.
- SHA-256 context should be already correctly initialized by Sha256Init(), and should not be
- finalized by Sha256Final(). Behavior with invalid SHA-256 context is undefined.
-
- If Sha256Context is NULL, then return FALSE.
- If HashValue is NULL, then return FALSE.
-
- @param[in, out] Sha256Context Pointer to the SHA-256 context.
- @param[out] HashValue Pointer to a buffer that receives the SHA-256 digest
- value (32 bytes).
-
- @retval TRUE SHA-256 digest computation succeeded.
- @retval FALSE SHA-256 digest computation failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha256Final (
- IN OUT VOID *Sha256Context,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (Sha256Context == NULL || HashValue == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-256 Hash Finalization
- //
- return (BOOLEAN) (SHA256_Final (HashValue, (SHA256_CTX *) Sha256Context));
-}
-
-/**
- Computes the SHA-256 message digest of a input data buffer.
-
- This function performs the SHA-256 message digest of a given data buffer, and places
- the digest value into the specified memory.
-
- If this interface is not supported, then return FALSE.
-
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
- @param[out] HashValue Pointer to a buffer that receives the SHA-256 digest
- value (32 bytes).
-
- @retval TRUE SHA-256 digest computation succeeded.
- @retval FALSE SHA-256 digest computation failed.
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha256HashAll (
- IN CONST VOID *Data,
- IN UINTN DataSize,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (HashValue == NULL) {
- return FALSE;
- }
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-256 Hash Computation.
- //
- if (SHA256 (Data, DataSize, HashValue) == NULL) {
- return FALSE;
- } else {
- return TRUE;
- }
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c
deleted file mode 100644
index b1843e8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/** @file
- SHA-384 and SHA-512 Digest Wrapper Implementations over OpenSSL.
-
-Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-/**
- Retrieves the size, in bytes, of the context buffer required for SHA-384 hash operations.
-
- @return The size, in bytes, of the context buffer required for SHA-384 hash operations.
-
-**/
-UINTN
-EFIAPI
-Sha384GetContextSize (
- VOID
- )
-{
- //
- // Retrieves OpenSSL SHA-384 Context Size
- //
- return (UINTN) (sizeof (SHA512_CTX));
-}
-
-/**
- Initializes user-supplied memory pointed by Sha384Context as SHA-384 hash context for
- subsequent use.
-
- If Sha384Context is NULL, then return FALSE.
-
- @param[out] Sha384Context Pointer to SHA-384 context being initialized.
-
- @retval TRUE SHA-384 context initialization succeeded.
- @retval FALSE SHA-384 context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha384Init (
- OUT VOID *Sha384Context
- )
-{
- //
- // Check input parameters.
- //
- if (Sha384Context == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-384 Context Initialization
- //
- return (BOOLEAN) (SHA384_Init ((SHA512_CTX *) Sha384Context));
-}
-
-/**
- Makes a copy of an existing SHA-384 context.
-
- If Sha384Context is NULL, then return FALSE.
- If NewSha384Context is NULL, then return FALSE.
- If this interface is not supported, then return FALSE.
-
- @param[in] Sha384Context Pointer to SHA-384 context being copied.
- @param[out] NewSha384Context Pointer to new SHA-384 context.
-
- @retval TRUE SHA-384 context copy succeeded.
- @retval FALSE SHA-384 context copy failed.
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha384Duplicate (
- IN CONST VOID *Sha384Context,
- OUT VOID *NewSha384Context
- )
-{
- //
- // Check input parameters.
- //
- if (Sha384Context == NULL || NewSha384Context == NULL) {
- return FALSE;
- }
-
- CopyMem (NewSha384Context, Sha384Context, sizeof (SHA512_CTX));
-
- return TRUE;
-}
-
-/**
- Digests the input data and updates SHA-384 context.
-
- This function performs SHA-384 digest on a data buffer of the specified size.
- It can be called multiple times to compute the digest of long or discontinuous data streams.
- SHA-384 context should be already correctly initialized by Sha384Init(), and should not be finalized
- by Sha384Final(). Behavior with invalid context is undefined.
-
- If Sha384Context is NULL, then return FALSE.
-
- @param[in, out] Sha384Context Pointer to the SHA-384 context.
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval TRUE SHA-384 data digest succeeded.
- @retval FALSE SHA-384 data digest failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha384Update (
- IN OUT VOID *Sha384Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- //
- // Check input parameters.
- //
- if (Sha384Context == NULL) {
- return FALSE;
- }
-
- //
- // Check invalid parameters, in case that only DataLength was checked in OpenSSL
- //
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-384 Hash Update
- //
- return (BOOLEAN) (SHA384_Update ((SHA512_CTX *) Sha384Context, Data, DataSize));
-}
-
-/**
- Completes computation of the SHA-384 digest value.
-
- This function completes SHA-384 hash computation and retrieves the digest value into
- the specified memory. After this function has been called, the SHA-384 context cannot
- be used again.
- SHA-384 context should be already correctly initialized by Sha384Init(), and should not be
- finalized by Sha384Final(). Behavior with invalid SHA-384 context is undefined.
-
- If Sha384Context is NULL, then return FALSE.
- If HashValue is NULL, then return FALSE.
-
- @param[in, out] Sha384Context Pointer to the SHA-384 context.
- @param[out] HashValue Pointer to a buffer that receives the SHA-384 digest
- value (48 bytes).
-
- @retval TRUE SHA-384 digest computation succeeded.
- @retval FALSE SHA-384 digest computation failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha384Final (
- IN OUT VOID *Sha384Context,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (Sha384Context == NULL || HashValue == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-384 Hash Finalization
- //
- return (BOOLEAN) (SHA384_Final (HashValue, (SHA512_CTX *) Sha384Context));
-}
-
-/**
- Computes the SHA-384 message digest of a input data buffer.
-
- This function performs the SHA-384 message digest of a given data buffer, and places
- the digest value into the specified memory.
-
- If this interface is not supported, then return FALSE.
-
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
- @param[out] HashValue Pointer to a buffer that receives the SHA-384 digest
- value (48 bytes).
-
- @retval TRUE SHA-384 digest computation succeeded.
- @retval FALSE SHA-384 digest computation failed.
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha384HashAll (
- IN CONST VOID *Data,
- IN UINTN DataSize,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (HashValue == NULL) {
- return FALSE;
- }
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-384 Hash Computation.
- //
- if (SHA384 (Data, DataSize, HashValue) == NULL) {
- return FALSE;
- } else {
- return TRUE;
- }
-}
-
-/**
- Retrieves the size, in bytes, of the context buffer required for SHA-512 hash operations.
-
- @return The size, in bytes, of the context buffer required for SHA-512 hash operations.
-
-**/
-UINTN
-EFIAPI
-Sha512GetContextSize (
- VOID
- )
-{
- //
- // Retrieves OpenSSL SHA-512 Context Size
- //
- return (UINTN) (sizeof (SHA512_CTX));
-}
-
-/**
- Initializes user-supplied memory pointed by Sha512Context as SHA-512 hash context for
- subsequent use.
-
- If Sha512Context is NULL, then return FALSE.
-
- @param[out] Sha512Context Pointer to SHA-512 context being initialized.
-
- @retval TRUE SHA-512 context initialization succeeded.
- @retval FALSE SHA-512 context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha512Init (
- OUT VOID *Sha512Context
- )
-{
- //
- // Check input parameters.
- //
- if (Sha512Context == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-512 Context Initialization
- //
- return (BOOLEAN) (SHA512_Init ((SHA512_CTX *) Sha512Context));
-}
-
-/**
- Makes a copy of an existing SHA-512 context.
-
- If Sha512Context is NULL, then return FALSE.
- If NewSha512Context is NULL, then return FALSE.
- If this interface is not supported, then return FALSE.
-
- @param[in] Sha512Context Pointer to SHA-512 context being copied.
- @param[out] NewSha512Context Pointer to new SHA-512 context.
-
- @retval TRUE SHA-512 context copy succeeded.
- @retval FALSE SHA-512 context copy failed.
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha512Duplicate (
- IN CONST VOID *Sha512Context,
- OUT VOID *NewSha512Context
- )
-{
- //
- // Check input parameters.
- //
- if (Sha512Context == NULL || NewSha512Context == NULL) {
- return FALSE;
- }
-
- CopyMem (NewSha512Context, Sha512Context, sizeof (SHA512_CTX));
-
- return TRUE;
-}
-
-/**
- Digests the input data and updates SHA-512 context.
-
- This function performs SHA-512 digest on a data buffer of the specified size.
- It can be called multiple times to compute the digest of long or discontinuous data streams.
- SHA-512 context should be already correctly initialized by Sha512Init(), and should not be finalized
- by Sha512Final(). Behavior with invalid context is undefined.
-
- If Sha512Context is NULL, then return FALSE.
-
- @param[in, out] Sha512Context Pointer to the SHA-512 context.
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval TRUE SHA-512 data digest succeeded.
- @retval FALSE SHA-512 data digest failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha512Update (
- IN OUT VOID *Sha512Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- //
- // Check input parameters.
- //
- if (Sha512Context == NULL) {
- return FALSE;
- }
-
- //
- // Check invalid parameters, in case that only DataLength was checked in OpenSSL
- //
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-512 Hash Update
- //
- return (BOOLEAN) (SHA512_Update ((SHA512_CTX *) Sha512Context, Data, DataSize));
-}
-
-/**
- Completes computation of the SHA-512 digest value.
-
- This function completes SHA-512 hash computation and retrieves the digest value into
- the specified memory. After this function has been called, the SHA-512 context cannot
- be used again.
- SHA-512 context should be already correctly initialized by Sha512Init(), and should not be
- finalized by Sha512Final(). Behavior with invalid SHA-512 context is undefined.
-
- If Sha512Context is NULL, then return FALSE.
- If HashValue is NULL, then return FALSE.
-
- @param[in, out] Sha512Context Pointer to the SHA-512 context.
- @param[out] HashValue Pointer to a buffer that receives the SHA-512 digest
- value (64 bytes).
-
- @retval TRUE SHA-512 digest computation succeeded.
- @retval FALSE SHA-512 digest computation failed.
-
-**/
-BOOLEAN
-EFIAPI
-Sha512Final (
- IN OUT VOID *Sha512Context,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (Sha512Context == NULL || HashValue == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-512 Hash Finalization
- //
- return (BOOLEAN) (SHA384_Final (HashValue, (SHA512_CTX *) Sha512Context));
-}
-
-/**
- Computes the SHA-512 message digest of a input data buffer.
-
- This function performs the SHA-512 message digest of a given data buffer, and places
- the digest value into the specified memory.
-
- If this interface is not supported, then return FALSE.
-
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
- @param[out] HashValue Pointer to a buffer that receives the SHA-512 digest
- value (64 bytes).
-
- @retval TRUE SHA-512 digest computation succeeded.
- @retval FALSE SHA-512 digest computation failed.
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha512HashAll (
- IN CONST VOID *Data,
- IN UINTN DataSize,
- OUT UINT8 *HashValue
- )
-{
- //
- // Check input parameters.
- //
- if (HashValue == NULL) {
- return FALSE;
- }
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL SHA-512 Hash Computation.
- //
- if (SHA512 (Data, DataSize, HashValue) == NULL) {
- return FALSE;
- } else {
- return TRUE;
- }
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512Null.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512Null.c
deleted file mode 100644
index 4a3bcfc..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512Null.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/** @file
- SHA-384 and SHA-512 Digest Wrapper Implementations which does not provide real capabilities.
-
-Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Retrieves the size, in bytes, of the context buffer required for SHA-384 hash operations.
-
- Return zero to indicate this interface is not supported.
-
- @retval 0 This interface is not supported.
-
-**/
-UINTN
-EFIAPI
-Sha384GetContextSize (
- VOID
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Initializes user-supplied memory pointed by Sha384Context as SHA-384 hash context for
- subsequent use.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[out] Sha384Context Pointer to SHA-384 context being initialized.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha384Init (
- OUT VOID *Sha384Context
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Makes a copy of an existing SHA-384 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Sha384Context Pointer to SHA-384 context being copied.
- @param[out] NewSha384Context Pointer to new SHA-384 context.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha384Duplicate (
- IN CONST VOID *Sha384Context,
- OUT VOID *NewSha384Context
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Digests the input data and updates SHA-384 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] Sha384Context Pointer to the SHA-384 context.
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha384Update (
- IN OUT VOID *Sha384Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Completes computation of the SHA-384 digest value.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] Sha384Context Pointer to the SHA-384 context.
- @param[out] HashValue Pointer to a buffer that receives the SHA-384 digest
- value (48 bytes).
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha384Final (
- IN OUT VOID *Sha384Context,
- OUT UINT8 *HashValue
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Computes the SHA-384 message digest of a input data buffer.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
- @param[out] HashValue Pointer to a buffer that receives the SHA-384 digest
- value (48 bytes).
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha384HashAll (
- IN CONST VOID *Data,
- IN UINTN DataSize,
- OUT UINT8 *HashValue
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Retrieves the size, in bytes, of the context buffer required for SHA-512 hash operations.
-
- Return zero to indicate this interface is not supported.
-
- @retval 0 This interface is not supported.
-
-**/
-UINTN
-EFIAPI
-Sha512GetContextSize (
- VOID
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Initializes user-supplied memory pointed by Sha512Context as SHA-512 hash context for
- subsequent use.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[out] Sha512Context Pointer to SHA-512 context being initialized.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha512Init (
- OUT VOID *Sha512Context
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Makes a copy of an existing SHA-512 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Sha512Context Pointer to SHA-512 context being copied.
- @param[out] NewSha512Context Pointer to new SHA-512 context.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha512Duplicate (
- IN CONST VOID *Sha512Context,
- OUT VOID *NewSha512Context
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Digests the input data and updates SHA-512 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] Sha512Context Pointer to the SHA-512 context.
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha512Update (
- IN OUT VOID *Sha512Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Completes computation of the SHA-512 digest value.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] Sha512Context Pointer to the SHA-512 context.
- @param[out] HashValue Pointer to a buffer that receives the SHA-512 digest
- value (64 bytes).
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha512Final (
- IN OUT VOID *Sha512Context,
- OUT UINT8 *HashValue
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Computes the SHA-512 message digest of a input data buffer.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Data Pointer to the buffer containing the data to be hashed.
- @param[in] DataSize Size of Data buffer in bytes.
- @param[out] HashValue Pointer to a buffer that receives the SHA-512 digest
- value (64 bytes).
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Sha512HashAll (
- IN CONST VOID *Data,
- IN UINTN DataSize,
- OUT UINT8 *HashValue
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5.c
deleted file mode 100644
index 9688cd5..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/** @file
- HMAC-MD5 Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-#define HMAC_MD5_CTX_SIZE sizeof(void *) * 4 + sizeof(unsigned int) + \
- sizeof(unsigned char) * HMAC_MAX_MD_CBLOCK
-
-/**
- Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations.
- (NOTE: This API is deprecated.
- Use HmacMd5New() / HmacMd5Free() for HMAC-MD5 Context operations.)
-
- @return The size, in bytes, of the context buffer required for HMAC-MD5 operations.
-
-**/
-UINTN
-EFIAPI
-HmacMd5GetContextSize (
- VOID
- )
-{
- //
- // Retrieves the OpenSSL HMAC-MD5 Context Size
- // NOTE: HMAC_CTX object was made opaque in openssl-1.1.x, here we just use the
- // fixed size as a workaround to make this API work for compatibility.
- // We should retire HmacMd5GetContextSize() in future, and use HmacMd5New()
- // and HmacMd5Free() for context allocation and release.
- //
- return (UINTN) HMAC_MD5_CTX_SIZE;
-}
-
-/**
- Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
-
- @return Pointer to the HMAC_CTX context that has been initialized.
- If the allocations fails, HmacMd5New() returns NULL.
-
-**/
-VOID *
-EFIAPI
-HmacMd5New (
- VOID
- )
-{
- //
- // Allocates & Initializes HMAC_CTX Context by OpenSSL HMAC_CTX_new()
- //
- return (VOID *) HMAC_CTX_new ();
-}
-
-/**
- Release the specified HMAC_CTX context.
-
- @param[in] HmacMd5Ctx Pointer to the HMAC_CTX context to be released.
-
-**/
-VOID
-EFIAPI
-HmacMd5Free (
- IN VOID *HmacMd5Ctx
- )
-{
- //
- // Free OpenSSL HMAC_CTX Context
- //
- HMAC_CTX_free ((HMAC_CTX *)HmacMd5Ctx);
-}
-
-/**
- Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for
- subsequent use.
-
- If HmacMd5Context is NULL, then return FALSE.
-
- @param[out] HmacMd5Context Pointer to HMAC-MD5 context being initialized.
- @param[in] Key Pointer to the user-supplied key.
- @param[in] KeySize Key size in bytes.
-
- @retval TRUE HMAC-MD5 context initialization succeeded.
- @retval FALSE HMAC-MD5 context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacMd5Init (
- OUT VOID *HmacMd5Context,
- IN CONST UINT8 *Key,
- IN UINTN KeySize
- )
-{
- //
- // Check input parameters.
- //
- if (HmacMd5Context == NULL || KeySize > INT_MAX) {
- return FALSE;
- }
-
- //
- // OpenSSL HMAC-MD5 Context Initialization
- //
- memset(HmacMd5Context, 0, HMAC_MD5_CTX_SIZE);
- if (HMAC_CTX_reset ((HMAC_CTX *)HmacMd5Context) != 1) {
- return FALSE;
- }
- if (HMAC_Init_ex ((HMAC_CTX *)HmacMd5Context, Key, (UINT32) KeySize, EVP_md5(), NULL) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Makes a copy of an existing HMAC-MD5 context.
-
- If HmacMd5Context is NULL, then return FALSE.
- If NewHmacMd5Context is NULL, then return FALSE.
-
- @param[in] HmacMd5Context Pointer to HMAC-MD5 context being copied.
- @param[out] NewHmacMd5Context Pointer to new HMAC-MD5 context.
-
- @retval TRUE HMAC-MD5 context copy succeeded.
- @retval FALSE HMAC-MD5 context copy failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacMd5Duplicate (
- IN CONST VOID *HmacMd5Context,
- OUT VOID *NewHmacMd5Context
- )
-{
- //
- // Check input parameters.
- //
- if (HmacMd5Context == NULL || NewHmacMd5Context == NULL) {
- return FALSE;
- }
-
- if (HMAC_CTX_copy ((HMAC_CTX *)NewHmacMd5Context, (HMAC_CTX *)HmacMd5Context) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Digests the input data and updates HMAC-MD5 context.
-
- This function performs HMAC-MD5 digest on a data buffer of the specified size.
- It can be called multiple times to compute the digest of long or discontinuous data streams.
- HMAC-MD5 context should be already correctly initialized by HmacMd5Init(), and should not be
- finalized by HmacMd5Final(). Behavior with invalid context is undefined.
-
- If HmacMd5Context is NULL, then return FALSE.
-
- @param[in, out] HmacMd5Context Pointer to the HMAC-MD5 context.
- @param[in] Data Pointer to the buffer containing the data to be digested.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval TRUE HMAC-MD5 data digest succeeded.
- @retval FALSE HMAC-MD5 data digest failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacMd5Update (
- IN OUT VOID *HmacMd5Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- //
- // Check input parameters.
- //
- if (HmacMd5Context == NULL) {
- return FALSE;
- }
-
- //
- // Check invalid parameters, in case that only DataLength was checked in OpenSSL
- //
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL HMAC-MD5 digest update
- //
- if (HMAC_Update ((HMAC_CTX *)HmacMd5Context, Data, DataSize) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Completes computation of the HMAC-MD5 digest value.
-
- This function completes HMAC-MD5 digest computation and retrieves the digest value into
- the specified memory. After this function has been called, the HMAC-MD5 context cannot
- be used again.
- HMAC-MD5 context should be already correctly initialized by HmacMd5Init(), and should not be
- finalized by HmacMd5Final(). Behavior with invalid HMAC-MD5 context is undefined.
-
- If HmacMd5Context is NULL, then return FALSE.
- If HmacValue is NULL, then return FALSE.
-
- @param[in, out] HmacMd5Context Pointer to the HMAC-MD5 context.
- @param[out] HmacValue Pointer to a buffer that receives the HMAC-MD5 digest
- value (16 bytes).
-
- @retval TRUE HMAC-MD5 digest computation succeeded.
- @retval FALSE HMAC-MD5 digest computation failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacMd5Final (
- IN OUT VOID *HmacMd5Context,
- OUT UINT8 *HmacValue
- )
-{
- UINT32 Length;
-
- //
- // Check input parameters.
- //
- if (HmacMd5Context == NULL || HmacValue == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL HMAC-MD5 digest finalization
- //
- if (HMAC_Final ((HMAC_CTX *)HmacMd5Context, HmacValue, &Length) != 1) {
- return FALSE;
- }
- if (HMAC_CTX_reset ((HMAC_CTX *)HmacMd5Context) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5Null.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5Null.c
deleted file mode 100644
index 8e94e1a..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5Null.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/** @file
- HMAC-MD5 Wrapper Implementation which does not provide real capabilities.
-
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations.
- (NOTE: This API is deprecated.
- Use HmacMd5New() / HmacMd5Free() for HMAC-MD5 Context operations.)
-
- Return zero to indicate this interface is not supported.
-
- @retval 0 This interface is not supported.
-
-**/
-UINTN
-EFIAPI
-HmacMd5GetContextSize (
- VOID
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use.
-
- Return NULL to indicate this interface is not supported.
-
- @retval NULL This interface is not supported.
-
-**/
-VOID *
-EFIAPI
-HmacMd5New (
- VOID
- )
-{
- ASSERT (FALSE);
- return NULL;
-}
-
-/**
- Release the specified HMAC_CTX context.
-
- This function will do nothing.
-
- @param[in] HmacMd5Ctx Pointer to the HMAC_CTX context to be released.
-
-**/
-VOID
-EFIAPI
-HmacMd5Free (
- IN VOID *HmacMd5Ctx
- )
-{
- ASSERT (FALSE);
- return;
-}
-
-/**
- Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for
- subsequent use.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[out] HmacMd5Context Pointer to HMAC-MD5 context being initialized.
- @param[in] Key Pointer to the user-supplied key.
- @param[in] KeySize Key size in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacMd5Init (
- OUT VOID *HmacMd5Context,
- IN CONST UINT8 *Key,
- IN UINTN KeySize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Makes a copy of an existing HMAC-MD5 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] HmacMd5Context Pointer to HMAC-MD5 context being copied.
- @param[out] NewHmacMd5Context Pointer to new HMAC-MD5 context.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacMd5Duplicate (
- IN CONST VOID *HmacMd5Context,
- OUT VOID *NewHmacMd5Context
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Digests the input data and updates HMAC-MD5 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] HmacMd5Context Pointer to the HMAC-MD5 context.
- @param[in] Data Pointer to the buffer containing the data to be digested.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacMd5Update (
- IN OUT VOID *HmacMd5Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Completes computation of the HMAC-MD5 digest value.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] HmacMd5Context Pointer to the HMAC-MD5 context.
- @param[out] HmacValue Pointer to a buffer that receives the HMAC-MD5 digest
- value (16 bytes).
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacMd5Final (
- IN OUT VOID *HmacMd5Context,
- OUT UINT8 *HmacValue
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1.c
deleted file mode 100644
index d82e648..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/** @file
- HMAC-SHA1 Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-#define HMAC_SHA1_CTX_SIZE sizeof(void *) * 4 + sizeof(unsigned int) + \
- sizeof(unsigned char) * HMAC_MAX_MD_CBLOCK
-
-/**
- Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations.
- (NOTE: This API is deprecated.
- Use HmacSha1New() / HmacSha1Free() for HMAC-SHA1 Context operations.)
-
- @return The size, in bytes, of the context buffer required for HMAC-SHA1 operations.
-
-**/
-UINTN
-EFIAPI
-HmacSha1GetContextSize (
- VOID
- )
-{
- //
- // Retrieves the OpenSSL HMAC-SHA1 Context Size
- // NOTE: HMAC_CTX object was made opaque in openssl-1.1.x, here we just use the
- // fixed size as a workaround to make this API work for compatibility.
- // We should retire HmacSha15GetContextSize() in future, and use HmacSha1New()
- // and HmacSha1Free() for context allocation and release.
- //
- return (UINTN) HMAC_SHA1_CTX_SIZE;
-}
-
-/**
- Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
-
- @return Pointer to the HMAC_CTX context that has been initialized.
- If the allocations fails, HmacSha1New() returns NULL.
-
-**/
-VOID *
-EFIAPI
-HmacSha1New (
- VOID
- )
-{
- //
- // Allocates & Initializes HMAC_CTX Context by OpenSSL HMAC_CTX_new()
- //
- return (VOID *) HMAC_CTX_new ();
-}
-
-/**
- Release the specified HMAC_CTX context.
-
- @param[in] HmacSha1Ctx Pointer to the HMAC_CTX context to be released.
-
-**/
-VOID
-EFIAPI
-HmacSha1Free (
- IN VOID *HmacSha1Ctx
- )
-{
- //
- // Free OpenSSL HMAC_CTX Context
- //
- HMAC_CTX_free ((HMAC_CTX *)HmacSha1Ctx);
-}
-
-/**
- Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for
- subsequent use.
-
- If HmacSha1Context is NULL, then return FALSE.
-
- @param[out] HmacSha1Context Pointer to HMAC-SHA1 context being initialized.
- @param[in] Key Pointer to the user-supplied key.
- @param[in] KeySize Key size in bytes.
-
- @retval TRUE HMAC-SHA1 context initialization succeeded.
- @retval FALSE HMAC-SHA1 context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha1Init (
- OUT VOID *HmacSha1Context,
- IN CONST UINT8 *Key,
- IN UINTN KeySize
- )
-{
- //
- // Check input parameters.
- //
- if (HmacSha1Context == NULL || KeySize > INT_MAX) {
- return FALSE;
- }
-
- //
- // OpenSSL HMAC-SHA1 Context Initialization
- //
- memset(HmacSha1Context, 0, HMAC_SHA1_CTX_SIZE);
- if (HMAC_CTX_reset ((HMAC_CTX *)HmacSha1Context) != 1) {
- return FALSE;
- }
- if (HMAC_Init_ex ((HMAC_CTX *)HmacSha1Context, Key, (UINT32) KeySize, EVP_sha1(), NULL) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Makes a copy of an existing HMAC-SHA1 context.
-
- If HmacSha1Context is NULL, then return FALSE.
- If NewHmacSha1Context is NULL, then return FALSE.
-
- @param[in] HmacSha1Context Pointer to HMAC-SHA1 context being copied.
- @param[out] NewHmacSha1Context Pointer to new HMAC-SHA1 context.
-
- @retval TRUE HMAC-SHA1 context copy succeeded.
- @retval FALSE HMAC-SHA1 context copy failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha1Duplicate (
- IN CONST VOID *HmacSha1Context,
- OUT VOID *NewHmacSha1Context
- )
-{
- //
- // Check input parameters.
- //
- if (HmacSha1Context == NULL || NewHmacSha1Context == NULL) {
- return FALSE;
- }
-
- if (HMAC_CTX_copy ((HMAC_CTX *)NewHmacSha1Context, (HMAC_CTX *)HmacSha1Context) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Digests the input data and updates HMAC-SHA1 context.
-
- This function performs HMAC-SHA1 digest on a data buffer of the specified size.
- It can be called multiple times to compute the digest of long or discontinuous data streams.
- HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should not
- be finalized by HmacSha1Final(). Behavior with invalid context is undefined.
-
- If HmacSha1Context is NULL, then return FALSE.
-
- @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context.
- @param[in] Data Pointer to the buffer containing the data to be digested.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval TRUE HMAC-SHA1 data digest succeeded.
- @retval FALSE HMAC-SHA1 data digest failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha1Update (
- IN OUT VOID *HmacSha1Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- //
- // Check input parameters.
- //
- if (HmacSha1Context == NULL) {
- return FALSE;
- }
-
- //
- // Check invalid parameters, in case that only DataLength was checked in OpenSSL
- //
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL HMAC-SHA1 digest update
- //
- if (HMAC_Update ((HMAC_CTX *)HmacSha1Context, Data, DataSize) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Completes computation of the HMAC-SHA1 digest value.
-
- This function completes HMAC-SHA1 digest computation and retrieves the digest value into
- the specified memory. After this function has been called, the HMAC-SHA1 context cannot
- be used again.
- HMAC-SHA1 context should be already correctly initialized by HmacSha1Init(), and should
- not be finalized by HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined.
-
- If HmacSha1Context is NULL, then return FALSE.
- If HmacValue is NULL, then return FALSE.
-
- @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context.
- @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA1 digest
- value (20 bytes).
-
- @retval TRUE HMAC-SHA1 digest computation succeeded.
- @retval FALSE HMAC-SHA1 digest computation failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha1Final (
- IN OUT VOID *HmacSha1Context,
- OUT UINT8 *HmacValue
- )
-{
- UINT32 Length;
-
- //
- // Check input parameters.
- //
- if (HmacSha1Context == NULL || HmacValue == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL HMAC-SHA1 digest finalization
- //
- if (HMAC_Final ((HMAC_CTX *)HmacSha1Context, HmacValue, &Length) != 1) {
- return FALSE;
- }
- if (HMAC_CTX_reset ((HMAC_CTX *)HmacSha1Context) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1Null.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1Null.c
deleted file mode 100644
index f3dcda4..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1Null.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/** @file
- HMAC-SHA1 Wrapper Implementation which does not provide real capabilities.
-
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations.
- (NOTE: This API is deprecated.
- Use HmacSha1New() / HmacSha1Free() for HMAC-SHA1 Context operations.)
-
- Return zero to indicate this interface is not supported.
-
- @retval 0 This interface is not supported.
-
-**/
-UINTN
-EFIAPI
-HmacSha1GetContextSize (
- VOID
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA1 use.
-
- Return NULL to indicate this interface is not supported.
-
- @return NULL This interface is not supported..
-
-**/
-VOID *
-EFIAPI
-HmacSha1New (
- VOID
- )
-{
- ASSERT (FALSE);
- return NULL;
-}
-
-/**
- Release the specified HMAC_CTX context.
-
- This function will do nothing.
-
- @param[in] HmacSha1Ctx Pointer to the HMAC_CTX context to be released.
-
-**/
-VOID
-EFIAPI
-HmacSha1Free (
- IN VOID *HmacSha1Ctx
- )
-{
- ASSERT (FALSE);
- return;
-}
-
-/**
- Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for
- subsequent use.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[out] HmacSha1Context Pointer to HMAC-SHA1 context being initialized.
- @param[in] Key Pointer to the user-supplied key.
- @param[in] KeySize Key size in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha1Init (
- OUT VOID *HmacSha1Context,
- IN CONST UINT8 *Key,
- IN UINTN KeySize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Makes a copy of an existing HMAC-SHA1 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] HmacSha1Context Pointer to HMAC-SHA1 context being copied.
- @param[out] NewHmacSha1Context Pointer to new HMAC-SHA1 context.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha1Duplicate (
- IN CONST VOID *HmacSha1Context,
- OUT VOID *NewHmacSha1Context
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Digests the input data and updates HMAC-SHA1 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context.
- @param[in] Data Pointer to the buffer containing the data to be digested.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha1Update (
- IN OUT VOID *HmacSha1Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Completes computation of the HMAC-SHA1 digest value.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context.
- @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA1 digest
- value (20 bytes).
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha1Final (
- IN OUT VOID *HmacSha1Context,
- OUT UINT8 *HmacValue
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c
deleted file mode 100644
index 03d550e..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/** @file
- HMAC-SHA256 Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-#define HMAC_SHA256_CTX_SIZE sizeof(void *) * 4 + sizeof(unsigned int) + \
- sizeof(unsigned char) * HMAC_MAX_MD_CBLOCK
-
-/**
- Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
- (NOTE: This API is deprecated.
- Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
-
- @return The size, in bytes, of the context buffer required for HMAC-SHA256 operations.
-
-**/
-UINTN
-EFIAPI
-HmacSha256GetContextSize (
- VOID
- )
-{
- //
- // Retrieves the OpenSSL HMAC-SHA256 Context Size
- // NOTE: HMAC_CTX object was made opaque in openssl-1.1.x, here we just use the
- // fixed size as a workaround to make this API work for compatibility.
- // We should retire HmacSha256GetContextSize() in future, and use HmacSha256New()
- // and HmacSha256Free() for context allocation and release.
- //
- return (UINTN)HMAC_SHA256_CTX_SIZE;
-}
-
-/**
- Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
-
- @return Pointer to the HMAC_CTX context that has been initialized.
- If the allocations fails, HmacSha256New() returns NULL.
-
-**/
-VOID *
-EFIAPI
-HmacSha256New (
- VOID
- )
-{
- //
- // Allocates & Initializes HMAC_CTX Context by OpenSSL HMAC_CTX_new()
- //
- return (VOID *) HMAC_CTX_new ();
-}
-
-/**
- Release the specified HMAC_CTX context.
-
- @param[in] HmacSha256Ctx Pointer to the HMAC_CTX context to be released.
-
-**/
-VOID
-EFIAPI
-HmacSha256Free (
- IN VOID *HmacSha256Ctx
- )
-{
- //
- // Free OpenSSL HMAC_CTX Context
- //
- HMAC_CTX_free ((HMAC_CTX *)HmacSha256Ctx);
-}
-
-/**
- Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
- subsequent use.
-
- If HmacSha256Context is NULL, then return FALSE.
-
- @param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.
- @param[in] Key Pointer to the user-supplied key.
- @param[in] KeySize Key size in bytes.
-
- @retval TRUE HMAC-SHA256 context initialization succeeded.
- @retval FALSE HMAC-SHA256 context initialization failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha256Init (
- OUT VOID *HmacSha256Context,
- IN CONST UINT8 *Key,
- IN UINTN KeySize
- )
-{
- //
- // Check input parameters.
- //
- if (HmacSha256Context == NULL || KeySize > INT_MAX) {
- return FALSE;
- }
-
- //
- // OpenSSL HMAC-SHA256 Context Initialization
- //
- memset(HmacSha256Context, 0, HMAC_SHA256_CTX_SIZE);
- if (HMAC_CTX_reset ((HMAC_CTX *)HmacSha256Context) != 1) {
- return FALSE;
- }
- if (HMAC_Init_ex ((HMAC_CTX *)HmacSha256Context, Key, (UINT32) KeySize, EVP_sha256(), NULL) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Makes a copy of an existing HMAC-SHA256 context.
-
- If HmacSha256Context is NULL, then return FALSE.
- If NewHmacSha256Context is NULL, then return FALSE.
-
- @param[in] HmacSha256Context Pointer to HMAC-SHA256 context being copied.
- @param[out] NewHmacSha256Context Pointer to new HMAC-SHA256 context.
-
- @retval TRUE HMAC-SHA256 context copy succeeded.
- @retval FALSE HMAC-SHA256 context copy failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha256Duplicate (
- IN CONST VOID *HmacSha256Context,
- OUT VOID *NewHmacSha256Context
- )
-{
- //
- // Check input parameters.
- //
- if (HmacSha256Context == NULL || NewHmacSha256Context == NULL) {
- return FALSE;
- }
-
- if (HMAC_CTX_copy ((HMAC_CTX *)NewHmacSha256Context, (HMAC_CTX *)HmacSha256Context) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Digests the input data and updates HMAC-SHA256 context.
-
- This function performs HMAC-SHA256 digest on a data buffer of the specified size.
- It can be called multiple times to compute the digest of long or discontinuous data streams.
- HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should not
- be finalized by HmacSha256Final(). Behavior with invalid context is undefined.
-
- If HmacSha256Context is NULL, then return FALSE.
-
- @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.
- @param[in] Data Pointer to the buffer containing the data to be digested.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval TRUE HMAC-SHA256 data digest succeeded.
- @retval FALSE HMAC-SHA256 data digest failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha256Update (
- IN OUT VOID *HmacSha256Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- //
- // Check input parameters.
- //
- if (HmacSha256Context == NULL) {
- return FALSE;
- }
-
- //
- // Check invalid parameters, in case that only DataLength was checked in OpenSSL
- //
- if (Data == NULL && DataSize != 0) {
- return FALSE;
- }
-
- //
- // OpenSSL HMAC-SHA256 digest update
- //
- if (HMAC_Update ((HMAC_CTX *)HmacSha256Context, Data, DataSize) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Completes computation of the HMAC-SHA256 digest value.
-
- This function completes HMAC-SHA256 hash computation and retrieves the digest value into
- the specified memory. After this function has been called, the HMAC-SHA256 context cannot
- be used again.
- HMAC-SHA256 context should be already correctly initialized by HmacSha256Init(), and should
- not be finalized by HmacSha256Final(). Behavior with invalid HMAC-SHA256 context is undefined.
-
- If HmacSha256Context is NULL, then return FALSE.
- If HmacValue is NULL, then return FALSE.
-
- @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.
- @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA256 digest
- value (32 bytes).
-
- @retval TRUE HMAC-SHA256 digest computation succeeded.
- @retval FALSE HMAC-SHA256 digest computation failed.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha256Final (
- IN OUT VOID *HmacSha256Context,
- OUT UINT8 *HmacValue
- )
-{
- UINT32 Length;
-
- //
- // Check input parameters.
- //
- if (HmacSha256Context == NULL || HmacValue == NULL) {
- return FALSE;
- }
-
- //
- // OpenSSL HMAC-SHA256 digest finalization
- //
- if (HMAC_Final ((HMAC_CTX *)HmacSha256Context, HmacValue, &Length) != 1) {
- return FALSE;
- }
- if (HMAC_CTX_reset ((HMAC_CTX *)HmacSha256Context) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
deleted file mode 100644
index fcc45b7..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha256Null.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/** @file
- HMAC-SHA256 Wrapper Implementation which does not provide real capabilities.
-
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations.
- (NOTE: This API is deprecated.
- Use HmacSha256New() / HmacSha256Free() for HMAC-SHA256 Context operations.)
-
- Return zero to indicate this interface is not supported.
-
- @retval 0 This interface is not supported.
-
-**/
-UINTN
-EFIAPI
-HmacSha256GetContextSize (
- VOID
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Allocates and initializes one HMAC_CTX context for subsequent HMAC-SHA256 use.
-
- Return NULL to indicate this interface is not supported.
-
- @return NULL This interface is not supported..
-
-**/
-VOID *
-EFIAPI
-HmacSha256New (
- VOID
- )
-{
- ASSERT (FALSE);
- return NULL;
-}
-
-/**
- Release the specified HMAC_CTX context.
-
- This function will do nothing.
-
- @param[in] HmacSha256Ctx Pointer to the HMAC_CTX context to be released.
-
-**/
-VOID
-EFIAPI
-HmacSha256Free (
- IN VOID *HmacSha256Ctx
- )
-{
- ASSERT (FALSE);
- return;
-}
-
-/**
- Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for
- subsequent use.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized.
- @param[in] Key Pointer to the user-supplied key.
- @param[in] KeySize Key size in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha256Init (
- OUT VOID *HmacSha256Context,
- IN CONST UINT8 *Key,
- IN UINTN KeySize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Makes a copy of an existing HMAC-SHA256 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] HmacSha256Context Pointer to HMAC-SHA256 context being copied.
- @param[out] NewHmacSha256Context Pointer to new HMAC-SHA256 context.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha256Duplicate (
- IN CONST VOID *HmacSha256Context,
- OUT VOID *NewHmacSha256Context
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Digests the input data and updates HMAC-SHA256 context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.
- @param[in] Data Pointer to the buffer containing the data to be digested.
- @param[in] DataSize Size of Data buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha256Update (
- IN OUT VOID *HmacSha256Context,
- IN CONST VOID *Data,
- IN UINTN DataSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Completes computation of the HMAC-SHA256 digest value.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context.
- @param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA256 digest
- value (32 bytes).
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-HmacSha256Final (
- IN OUT VOID *HmacSha256Context,
- OUT UINT8 *HmacValue
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h
deleted file mode 100644
index b34b052..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/** @file
- Internal include file for BaseCryptLib.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __INTERNAL_CRYPT_LIB_H__
-#define __INTERNAL_CRYPT_LIB_H__
-
-#undef _WIN32
-#undef _WIN64
-
-#include
-#include
-#include
-#include
-#include
-
-#include "CrtLibSupport.h"
-
-#include
-
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
-#define OBJ_get0_data(o) ((o)->data)
-#define OBJ_length(o) ((o)->length)
-#endif
-
-/**
- Check input P7Data is a wrapped ContentInfo structure or not. If not construct
- a new structure to wrap P7Data.
-
- Caution: This function may receive untrusted input.
- UEFI Authenticated Variable is external input, so this function will do basic
- check for PKCS#7 data structure.
-
- @param[in] P7Data Pointer to the PKCS#7 message to verify.
- @param[in] P7Length Length of the PKCS#7 message in bytes.
- @param[out] WrapFlag If TRUE P7Data is a ContentInfo structure, otherwise
- return FALSE.
- @param[out] WrapData If return status of this function is TRUE:
- 1) when WrapFlag is TRUE, pointer to P7Data.
- 2) when WrapFlag is FALSE, pointer to a new ContentInfo
- structure. It's caller's responsibility to free this
- buffer.
- @param[out] WrapDataSize Length of ContentInfo structure in bytes.
-
- @retval TRUE The operation is finished successfully.
- @retval FALSE The operation is failed due to lack of resources.
-
-**/
-BOOLEAN
-WrapPkcs7Data (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- OUT BOOLEAN *WrapFlag,
- OUT UINT8 **WrapData,
- OUT UINTN *WrapDataSize
- );
-
-#endif
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
deleted file mode 100644
index e918fad..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ /dev/null
@@ -1,99 +0,0 @@
-## @file
-# Cryptographic Library Instance for PEIM.
-#
-# Caution: This module requires additional review when modified.
-# This library will have external input - signature.
-# This external input must be validated carefully to avoid security issues such as
-# buffer overflow or integer overflow.
-#
-# Note: MD4 Digest functions,
-# HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES/ARC4 functions, RSA external
-# functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509
-# certificate handler functions, authenticode signature verification functions,
-# PEM handler functions, and pseudorandom number generator functions are not
-# supported in this instance.
-#
-# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = PeiCryptLib
- MODULE_UNI_FILE = PeiCryptLib.uni
- FILE_GUID = 9a2a4375-194c-4e97-9f67-547ec98d96ca
- MODULE_TYPE = PEIM
- VERSION_STRING = 1.0
- LIBRARY_CLASS = BaseCryptLib|PEIM PEI_CORE
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64
-#
-
-[Sources]
- Hash/CryptMd4Null.c
- Hash/CryptMd5.c
- Hash/CryptSha1.c
- Hash/CryptSha256.c
- Hash/CryptSha512.c
- Hmac/CryptHmacMd5Null.c
- Hmac/CryptHmacSha1Null.c
- Hmac/CryptHmacSha256Null.c
- Cipher/CryptAesNull.c
- Cipher/CryptTdesNull.c
- Cipher/CryptArc4Null.c
-
- Pk/CryptRsaBasic.c
- Pk/CryptRsaExtNull.c
- Pk/CryptPkcs5Pbkdf2Null.c
- Pk/CryptPkcs7SignNull.c
- Pk/CryptPkcs7VerifyCommon.c
- Pk/CryptPkcs7VerifyBase.c
-
- Pk/CryptDhNull.c
- Pk/CryptX509Null.c
- Pk/CryptAuthenticodeNull.c
- Pk/CryptTsNull.c
- Pem/CryptPemNull.c
-
- Rand/CryptRandNull.c
-
- SysCall/CrtWrapper.c
- SysCall/ConstantTimeClock.c
- SysCall/BaseMemAllocation.c
-
-[Packages]
- MdePkg/MdePkg.dec
- CryptoPkg/CryptoPkg.dec
-
-[LibraryClasses]
- BaseLib
- BaseMemoryLib
- MemoryAllocationLib
- DebugLib
- OpensslLib
- IntrinsicLib
-
-#
-# Remove these [BuildOptions] after this library is cleaned up
-#
-[BuildOptions]
- #
- # suppress the following warnings so we do not break the build with warnings-as-errors:
- # C4090: 'function' : different 'const' qualifiers
- # C4718: 'function call' : recursive call has no side effects, deleting
- #
- MSFT:*_*_*_CC_FLAGS = /wd4090 /wd4718
-
- # -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT
- # --diag_remark=1 : Reduce severity of "#1-D: last line of file ends without a newline"
- RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.uni b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.uni
deleted file mode 100644
index b8b09b6..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.uni
+++ /dev/null
@@ -1,31 +0,0 @@
-// /** @file
-// Cryptographic Library Instance for PEIM.
-//
-// Caution: This module requires additional review when modified.
-// This library will have external input - signature.
-// This external input must be validated carefully to avoid security issues such as
-// buffer overflow or integer overflow.
-//
-// Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/
-// TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions,
-// Diffie-Hellman functions, X.509 certificate handler functions, authenticode
-// signature verification functions, PEM handler functions, and pseudorandom number
-// generator functions are not supported in this instance.
-//
-// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Cryptographic Library Instance for PEIM"
-
-#string STR_MODULE_DESCRIPTION #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/ TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509 certificate handler functions, authenticode signature verification functions, PEM handler functions, and pseudorandom number generator functions are not supported in this instance."
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c
deleted file mode 100644
index e3edc34..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/** @file
- PEM (Privacy Enhanced Mail) Format Handler Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-
-/**
- Callback function for password phrase conversion used for retrieving the encrypted PEM.
-
- @param[out] Buf Pointer to the buffer to write the passphrase to.
- @param[in] Size Maximum length of the passphrase (i.e. the size of Buf).
- @param[in] Flag A flag which is set to 0 when reading and 1 when writing.
- @param[in] Key Key data to be passed to the callback routine.
-
- @retval The number of characters in the passphrase or 0 if an error occurred.
-
-**/
-INTN
-PasswordCallback (
- OUT CHAR8 *Buf,
- IN INTN Size,
- IN INTN Flag,
- IN VOID *Key
- )
-{
- INTN KeyLength;
-
- ZeroMem ((VOID *) Buf, (UINTN) Size);
- if (Key != NULL) {
- //
- // Duplicate key phrase directly.
- //
- KeyLength = (INTN) AsciiStrLen ((CHAR8 *)Key);
- KeyLength = (KeyLength > Size ) ? Size : KeyLength;
- CopyMem (Buf, Key, (UINTN) KeyLength);
- return KeyLength;
- } else {
- return 0;
- }
-}
-
-/**
- Retrieve the RSA Private Key from the password-protected PEM key data.
-
- @param[in] PemData Pointer to the PEM-encoded key data to be retrieved.
- @param[in] PemSize Size of the PEM key data in bytes.
- @param[in] Password NULL-terminated passphrase used for encrypted PEM key data.
- @param[out] RsaContext Pointer to new-generated RSA context which contain the retrieved
- RSA private key component. Use RsaFree() function to free the
- resource.
-
- If PemData is NULL, then return FALSE.
- If RsaContext is NULL, then return FALSE.
-
- @retval TRUE RSA Private Key was retrieved successfully.
- @retval FALSE Invalid PEM key data or incorrect password.
-
-**/
-BOOLEAN
-EFIAPI
-RsaGetPrivateKeyFromPem (
- IN CONST UINT8 *PemData,
- IN UINTN PemSize,
- IN CONST CHAR8 *Password,
- OUT VOID **RsaContext
- )
-{
- BOOLEAN Status;
- BIO *PemBio;
-
- //
- // Check input parameters.
- //
- if (PemData == NULL || RsaContext == NULL || PemSize > INT_MAX) {
- return FALSE;
- }
-
- //
- // Add possible block-cipher descriptor for PEM data decryption.
- // NOTE: Only support most popular ciphers (3DES, AES) for the encrypted PEM.
- //
- if (EVP_add_cipher (EVP_des_ede3_cbc ()) == 0) {
- return FALSE;
- }
- if (EVP_add_cipher (EVP_aes_128_cbc ()) == 0) {
- return FALSE;
- }
- if (EVP_add_cipher (EVP_aes_192_cbc ()) == 0) {
- return FALSE;
- }
- if (EVP_add_cipher (EVP_aes_256_cbc ()) == 0) {
- return FALSE;
- }
-
- Status = FALSE;
-
- //
- // Read encrypted PEM Data.
- //
- PemBio = BIO_new (BIO_s_mem ());
- if (PemBio == NULL) {
- goto _Exit;
- }
-
- if (BIO_write (PemBio, PemData, (int) PemSize) <= 0) {
- goto _Exit;
- }
-
- //
- // Retrieve RSA Private Key from encrypted PEM data.
- //
- *RsaContext = PEM_read_bio_RSAPrivateKey (PemBio, NULL, (pem_password_cb *) &PasswordCallback, (void *) Password);
- if (*RsaContext != NULL) {
- Status = TRUE;
- }
-
-_Exit:
- //
- // Release Resources.
- //
- BIO_free (PemBio);
-
- return Status;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pem/CryptPemNull.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pem/CryptPemNull.c
deleted file mode 100644
index db8f43e..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pem/CryptPemNull.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @file
- PEM (Privacy Enhanced Mail) Format Handler Wrapper Implementation which does
- not provide real capabilities.
-
-Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Retrieve the RSA Private Key from the password-protected PEM key data.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] PemData Pointer to the PEM-encoded key data to be retrieved.
- @param[in] PemSize Size of the PEM key data in bytes.
- @param[in] Password NULL-terminated passphrase used for encrypted PEM key data.
- @param[out] RsaContext Pointer to new-generated RSA context which contain the retrieved
- RSA private key component. Use RsaFree() function to free the
- resource.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-RsaGetPrivateKeyFromPem (
- IN CONST UINT8 *PemData,
- IN UINTN PemSize,
- IN CONST CHAR8 *Password,
- OUT VOID **RsaContext
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticode.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticode.c
deleted file mode 100644
index a451f32..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticode.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/** @file
- Authenticode Portable Executable Signature Verification over OpenSSL.
-
- Caution: This module requires additional review when modified.
- This library will have external input - signature (e.g. PE/COFF Authenticode).
- This external input must be validated carefully to avoid security issue like
- buffer overflow, integer overflow.
-
- AuthenticodeVerify() will get PE/COFF Authenticode and will do basic check for
- data structure.
-
-Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-#include
-#include
-#include
-
-//
-// OID ASN.1 Value for SPC_INDIRECT_DATA_OBJID
-//
-UINT8 mSpcIndirectOidValue[] = {
- 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x04
- };
-
-/**
- Verifies the validity of a PE/COFF Authenticode Signature as described in "Windows
- Authenticode Portable Executable Signature Format".
-
- If AuthData is NULL, then return FALSE.
- If ImageHash is NULL, then return FALSE.
-
- Caution: This function may receive untrusted input.
- PE/COFF Authenticode is external input, so this function will do basic check for
- Authenticode data structure.
-
- @param[in] AuthData Pointer to the Authenticode Signature retrieved from signed
- PE/COFF image to be verified.
- @param[in] DataSize Size of the Authenticode Signature in bytes.
- @param[in] TrustedCert Pointer to a trusted/root certificate encoded in DER, which
- is used for certificate chain verification.
- @param[in] CertSize Size of the trusted certificate in bytes.
- @param[in] ImageHash Pointer to the original image file hash value. The procedure
- for calculating the image hash value is described in Authenticode
- specification.
- @param[in] HashSize Size of Image hash value in bytes.
-
- @retval TRUE The specified Authenticode Signature is valid.
- @retval FALSE Invalid Authenticode Signature.
-
-**/
-BOOLEAN
-EFIAPI
-AuthenticodeVerify (
- IN CONST UINT8 *AuthData,
- IN UINTN DataSize,
- IN CONST UINT8 *TrustedCert,
- IN UINTN CertSize,
- IN CONST UINT8 *ImageHash,
- IN UINTN HashSize
- )
-{
- BOOLEAN Status;
- PKCS7 *Pkcs7;
- CONST UINT8 *Temp;
- CONST UINT8 *OrigAuthData;
- UINT8 *SpcIndirectDataContent;
- UINT8 Asn1Byte;
- UINTN ContentSize;
- CONST UINT8 *SpcIndirectDataOid;
-
- //
- // Check input parameters.
- //
- if ((AuthData == NULL) || (TrustedCert == NULL) || (ImageHash == NULL)) {
- return FALSE;
- }
-
- if ((DataSize > INT_MAX) || (CertSize > INT_MAX) || (HashSize > INT_MAX)) {
- return FALSE;
- }
-
- Status = FALSE;
- Pkcs7 = NULL;
- OrigAuthData = AuthData;
-
- //
- // Retrieve & Parse PKCS#7 Data (DER encoding) from Authenticode Signature
- //
- Temp = AuthData;
- Pkcs7 = d2i_PKCS7 (NULL, &Temp, (int)DataSize);
- if (Pkcs7 == NULL) {
- goto _Exit;
- }
-
- //
- // Check if it's PKCS#7 Signed Data (for Authenticode Scenario)
- //
- if (!PKCS7_type_is_signed (Pkcs7)) {
- goto _Exit;
- }
-
- //
- // NOTE: OpenSSL PKCS7 Decoder didn't work for Authenticode-format signed data due to
- // some authenticode-specific structure. Use opaque ASN.1 string to retrieve
- // PKCS#7 ContentInfo here.
- //
- SpcIndirectDataOid = OBJ_get0_data(Pkcs7->d.sign->contents->type);
- if (OBJ_length(Pkcs7->d.sign->contents->type) != sizeof(mSpcIndirectOidValue) ||
- CompareMem (
- SpcIndirectDataOid,
- mSpcIndirectOidValue,
- sizeof (mSpcIndirectOidValue)
- ) != 0) {
- //
- // Un-matched SPC_INDIRECT_DATA_OBJID.
- //
- goto _Exit;
- }
-
-
- SpcIndirectDataContent = (UINT8 *)(Pkcs7->d.sign->contents->d.other->value.asn1_string->data);
-
- //
- // Retrieve the SEQUENCE data size from ASN.1-encoded SpcIndirectDataContent.
- //
- Asn1Byte = *(SpcIndirectDataContent + 1);
-
- if ((Asn1Byte & 0x80) == 0) {
- //
- // Short Form of Length Encoding (Length < 128)
- //
- ContentSize = (UINTN) (Asn1Byte & 0x7F);
- //
- // Skip the SEQUENCE Tag;
- //
- SpcIndirectDataContent += 2;
-
- } else if ((Asn1Byte & 0x81) == 0x81) {
- //
- // Long Form of Length Encoding (128 <= Length < 255, Single Octet)
- //
- ContentSize = (UINTN) (*(UINT8 *)(SpcIndirectDataContent + 2));
- //
- // Skip the SEQUENCE Tag;
- //
- SpcIndirectDataContent += 3;
-
- } else if ((Asn1Byte & 0x82) == 0x82) {
- //
- // Long Form of Length Encoding (Length > 255, Two Octet)
- //
- ContentSize = (UINTN) (*(UINT8 *)(SpcIndirectDataContent + 2));
- ContentSize = (ContentSize << 8) + (UINTN)(*(UINT8 *)(SpcIndirectDataContent + 3));
- //
- // Skip the SEQUENCE Tag;
- //
- SpcIndirectDataContent += 4;
-
- } else {
- goto _Exit;
- }
-
- //
- // Compare the original file hash value to the digest retrieve from SpcIndirectDataContent
- // defined in Authenticode
- // NOTE: Need to double-check HashLength here!
- //
- if (CompareMem (SpcIndirectDataContent + ContentSize - HashSize, ImageHash, HashSize) != 0) {
- //
- // Un-matched PE/COFF Hash Value
- //
- goto _Exit;
- }
-
- //
- // Verifies the PKCS#7 Signed Data in PE/COFF Authenticode Signature
- //
- Status = (BOOLEAN) Pkcs7Verify (OrigAuthData, DataSize, TrustedCert, CertSize, SpcIndirectDataContent, ContentSize);
-
-_Exit:
- //
- // Release Resources
- //
- PKCS7_free (Pkcs7);
-
- return Status;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticodeNull.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticodeNull.c
deleted file mode 100644
index d0f3440..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptAuthenticodeNull.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/** @file
- Authenticode Portable Executable Signature Verification which does not provide
- real capabilities.
-
-Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Verifies the validity of a PE/COFF Authenticode Signature as described in "Windows
- Authenticode Portable Executable Signature Format".
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] AuthData Pointer to the Authenticode Signature retrieved from signed
- PE/COFF image to be verified.
- @param[in] DataSize Size of the Authenticode Signature in bytes.
- @param[in] TrustedCert Pointer to a trusted/root certificate encoded in DER, which
- is used for certificate chain verification.
- @param[in] CertSize Size of the trusted certificate in bytes.
- @param[in] ImageHash Pointer to the original image file hash value. The procedure
- for calculating the image hash value is described in Authenticode
- specification.
- @param[in] HashSize Size of Image hash value in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-AuthenticodeVerify (
- IN CONST UINT8 *AuthData,
- IN UINTN DataSize,
- IN CONST UINT8 *TrustedCert,
- IN UINTN CertSize,
- IN CONST UINT8 *ImageHash,
- IN UINTN HashSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptDh.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptDh.c
deleted file mode 100644
index 7f17388..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptDh.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/** @file
- Diffie-Hellman Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-#include
-
-/**
- Allocates and Initializes one Diffie-Hellman Context for subsequent use.
-
- @return Pointer to the Diffie-Hellman Context that has been initialized.
- If the allocations fails, DhNew() returns NULL.
-
-**/
-VOID *
-EFIAPI
-DhNew (
- VOID
- )
-{
- //
- // Allocates & Initializes DH Context by OpenSSL DH_new()
- //
- return (VOID *) DH_new ();
-}
-
-/**
- Release the specified DH context.
-
- If DhContext is NULL, then return FALSE.
-
- @param[in] DhContext Pointer to the DH context to be released.
-
-**/
-VOID
-EFIAPI
-DhFree (
- IN VOID *DhContext
- )
-{
- //
- // Free OpenSSL DH Context
- //
- DH_free ((DH *) DhContext);
-}
-
-/**
- Generates DH parameter.
-
- Given generator g, and length of prime number p in bits, this function generates p,
- and sets DH context according to value of g and p.
-
- Before this function can be invoked, pseudorandom number generator must be correctly
- initialized by RandomSeed().
-
- If DhContext is NULL, then return FALSE.
- If Prime is NULL, then return FALSE.
-
- @param[in, out] DhContext Pointer to the DH context.
- @param[in] Generator Value of generator.
- @param[in] PrimeLength Length in bits of prime to be generated.
- @param[out] Prime Pointer to the buffer to receive the generated prime number.
-
- @retval TRUE DH parameter generation succeeded.
- @retval FALSE Value of Generator is not supported.
- @retval FALSE PRNG fails to generate random prime number with PrimeLength.
-
-**/
-BOOLEAN
-EFIAPI
-DhGenerateParameter (
- IN OUT VOID *DhContext,
- IN UINTN Generator,
- IN UINTN PrimeLength,
- OUT UINT8 *Prime
- )
-{
- BOOLEAN RetVal;
- BIGNUM *BnP;
-
- //
- // Check input parameters.
- //
- if (DhContext == NULL || Prime == NULL || PrimeLength > INT_MAX) {
- return FALSE;
- }
-
- if (Generator != DH_GENERATOR_2 && Generator != DH_GENERATOR_5) {
- return FALSE;
- }
-
- RetVal = (BOOLEAN) DH_generate_parameters_ex (DhContext, (UINT32) PrimeLength, (UINT32) Generator, NULL);
- if (!RetVal) {
- return FALSE;
- }
-
- DH_get0_pqg (DhContext, (const BIGNUM **)&BnP, NULL, NULL);
- BN_bn2bin (BnP, Prime);
-
- return TRUE;
-}
-
-/**
- Sets generator and prime parameters for DH.
-
- Given generator g, and prime number p, this function and sets DH
- context accordingly.
-
- If DhContext is NULL, then return FALSE.
- If Prime is NULL, then return FALSE.
-
- @param[in, out] DhContext Pointer to the DH context.
- @param[in] Generator Value of generator.
- @param[in] PrimeLength Length in bits of prime to be generated.
- @param[in] Prime Pointer to the prime number.
-
- @retval TRUE DH parameter setting succeeded.
- @retval FALSE Value of Generator is not supported.
- @retval FALSE Value of Generator is not suitable for the Prime.
- @retval FALSE Value of Prime is not a prime number.
- @retval FALSE Value of Prime is not a safe prime number.
-
-**/
-BOOLEAN
-EFIAPI
-DhSetParameter (
- IN OUT VOID *DhContext,
- IN UINTN Generator,
- IN UINTN PrimeLength,
- IN CONST UINT8 *Prime
- )
-{
- DH *Dh;
- BIGNUM *BnP;
- BIGNUM *BnG;
-
- //
- // Check input parameters.
- //
- if (DhContext == NULL || Prime == NULL || PrimeLength > INT_MAX) {
- return FALSE;
- }
-
- if (Generator != DH_GENERATOR_2 && Generator != DH_GENERATOR_5) {
- return FALSE;
- }
-
- //
- // Set the generator and prime parameters for DH object.
- //
- Dh = (DH *)DhContext;
- BnP = BN_bin2bn ((const unsigned char *)Prime, (int)(PrimeLength / 8), NULL);
- BnG = BN_bin2bn ((const unsigned char *)&Generator, 1, NULL);
- if ((BnP == NULL) || (BnG == NULL) || !DH_set0_pqg (Dh, BnP, NULL, BnG)) {
- goto Error;
- }
-
- return TRUE;
-
-Error:
- BN_free (BnP);
- BN_free (BnG);
-
- return FALSE;
-}
-
-/**
- Generates DH public key.
-
- This function generates random secret exponent, and computes the public key, which is
- returned via parameter PublicKey and PublicKeySize. DH context is updated accordingly.
- If the PublicKey buffer is too small to hold the public key, FALSE is returned and
- PublicKeySize is set to the required buffer size to obtain the public key.
-
- If DhContext is NULL, then return FALSE.
- If PublicKeySize is NULL, then return FALSE.
- If PublicKeySize is large enough but PublicKey is NULL, then return FALSE.
-
- @param[in, out] DhContext Pointer to the DH context.
- @param[out] PublicKey Pointer to the buffer to receive generated public key.
- @param[in, out] PublicKeySize On input, the size of PublicKey buffer in bytes.
- On output, the size of data returned in PublicKey buffer in bytes.
-
- @retval TRUE DH public key generation succeeded.
- @retval FALSE DH public key generation failed.
- @retval FALSE PublicKeySize is not large enough.
-
-**/
-BOOLEAN
-EFIAPI
-DhGenerateKey (
- IN OUT VOID *DhContext,
- OUT UINT8 *PublicKey,
- IN OUT UINTN *PublicKeySize
- )
-{
- BOOLEAN RetVal;
- DH *Dh;
- BIGNUM *DhPubKey;
- INTN Size;
-
- //
- // Check input parameters.
- //
- if (DhContext == NULL || PublicKeySize == NULL) {
- return FALSE;
- }
-
- if (PublicKey == NULL && *PublicKeySize != 0) {
- return FALSE;
- }
-
- Dh = (DH *) DhContext;
-
- RetVal = (BOOLEAN) DH_generate_key (DhContext);
- if (RetVal) {
- DH_get0_key (Dh, (const BIGNUM **)&DhPubKey, NULL);
- Size = BN_num_bytes (DhPubKey);
- if ((Size > 0) && (*PublicKeySize < (UINTN) Size)) {
- *PublicKeySize = Size;
- return FALSE;
- }
-
- if (PublicKey != NULL) {
- BN_bn2bin (DhPubKey, PublicKey);
- }
- *PublicKeySize = Size;
- }
-
- return RetVal;
-}
-
-/**
- Computes exchanged common key.
-
- Given peer's public key, this function computes the exchanged common key, based on its own
- context including value of prime modulus and random secret exponent.
-
- If DhContext is NULL, then return FALSE.
- If PeerPublicKey is NULL, then return FALSE.
- If KeySize is NULL, then return FALSE.
- If Key is NULL, then return FALSE.
- If KeySize is not large enough, then return FALSE.
-
- @param[in, out] DhContext Pointer to the DH context.
- @param[in] PeerPublicKey Pointer to the peer's public key.
- @param[in] PeerPublicKeySize Size of peer's public key in bytes.
- @param[out] Key Pointer to the buffer to receive generated key.
- @param[in, out] KeySize On input, the size of Key buffer in bytes.
- On output, the size of data returned in Key buffer in bytes.
-
- @retval TRUE DH exchanged key generation succeeded.
- @retval FALSE DH exchanged key generation failed.
- @retval FALSE KeySize is not large enough.
-
-**/
-BOOLEAN
-EFIAPI
-DhComputeKey (
- IN OUT VOID *DhContext,
- IN CONST UINT8 *PeerPublicKey,
- IN UINTN PeerPublicKeySize,
- OUT UINT8 *Key,
- IN OUT UINTN *KeySize
- )
-{
- BIGNUM *Bn;
- INTN Size;
-
- //
- // Check input parameters.
- //
- if (DhContext == NULL || PeerPublicKey == NULL || KeySize == NULL || Key == NULL) {
- return FALSE;
- }
-
- if (PeerPublicKeySize > INT_MAX) {
- return FALSE;
- }
-
- Bn = BN_bin2bn (PeerPublicKey, (UINT32) PeerPublicKeySize, NULL);
- if (Bn == NULL) {
- return FALSE;
- }
-
- Size = DH_compute_key (Key, Bn, DhContext);
- if (Size < 0) {
- BN_free (Bn);
- return FALSE;
- }
-
- if (*KeySize < (UINTN) Size) {
- *KeySize = Size;
- BN_free (Bn);
- return FALSE;
- }
-
- *KeySize = Size;
- BN_free (Bn);
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptDhNull.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptDhNull.c
deleted file mode 100644
index d577cca..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptDhNull.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/** @file
- Diffie-Hellman Wrapper Implementation which does not provide
- real capabilities.
-
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Allocates and Initializes one Diffie-Hellman Context for subsequent use.
-
- @return Pointer to the Diffie-Hellman Context that has been initialized.
- If the interface is not supported, DhNew() returns NULL.
-
-**/
-VOID *
-EFIAPI
-DhNew (
- VOID
- )
-{
- ASSERT (FALSE);
- return NULL;
-}
-
-/**
- Release the specified DH context.
-
- If the interface is not supported, then ASSERT().
-
- @param[in] DhContext Pointer to the DH context to be released.
-
-**/
-VOID
-EFIAPI
-DhFree (
- IN VOID *DhContext
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Generates DH parameter.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] DhContext Pointer to the DH context.
- @param[in] Generator Value of generator.
- @param[in] PrimeLength Length in bits of prime to be generated.
- @param[out] Prime Pointer to the buffer to receive the generated prime number.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DhGenerateParameter (
- IN OUT VOID *DhContext,
- IN UINTN Generator,
- IN UINTN PrimeLength,
- OUT UINT8 *Prime
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Sets generator and prime parameters for DH.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] DhContext Pointer to the DH context.
- @param[in] Generator Value of generator.
- @param[in] PrimeLength Length in bits of prime to be generated.
- @param[in] Prime Pointer to the prime number.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DhSetParameter (
- IN OUT VOID *DhContext,
- IN UINTN Generator,
- IN UINTN PrimeLength,
- IN CONST UINT8 *Prime
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Generates DH public key.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] DhContext Pointer to the DH context.
- @param[out] PublicKey Pointer to the buffer to receive generated public key.
- @param[in, out] PublicKeySize On input, the size of PublicKey buffer in bytes.
- On output, the size of data returned in PublicKey buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DhGenerateKey (
- IN OUT VOID *DhContext,
- OUT UINT8 *PublicKey,
- IN OUT UINTN *PublicKeySize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Computes exchanged common key.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] DhContext Pointer to the DH context.
- @param[in] PeerPublicKey Pointer to the peer's public key.
- @param[in] PeerPublicKeySize Size of peer's public key in bytes.
- @param[out] Key Pointer to the buffer to receive generated key.
- @param[in, out] KeySize On input, the size of Key buffer in bytes.
- On output, the size of data returned in Key buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DhComputeKey (
- IN OUT VOID *DhContext,
- IN CONST UINT8 *PeerPublicKey,
- IN UINTN PeerPublicKeySize,
- OUT UINT8 *Key,
- IN OUT UINTN *KeySize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs5Pbkdf2.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs5Pbkdf2.c
deleted file mode 100644
index ffe0cea..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs5Pbkdf2.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/** @file
- PBKDF2 Key Derivation Function Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2016, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-#include
-
-/**
- Derives a key from a password using a salt and iteration count, based on PKCS#5 v2.0
- password based encryption key derivation function PBKDF2, as specified in RFC 2898.
-
- If Password or Salt or OutKey is NULL, then return FALSE.
- If the hash algorithm could not be determined, then return FALSE.
-
- @param[in] PasswordLength Length of input password in bytes.
- @param[in] Password Pointer to the array for the password.
- @param[in] SaltLength Size of the Salt in bytes.
- @param[in] Salt Pointer to the Salt.
- @param[in] IterationCount Number of iterations to perform. Its value should be
- greater than or equal to 1.
- @param[in] DigestSize Size of the message digest to be used (eg. SHA256_DIGEST_SIZE).
- NOTE: DigestSize will be used to determine the hash algorithm.
- Only SHA1_DIGEST_SIZE or SHA256_DIGEST_SIZE is supported.
- @param[in] KeyLength Size of the derived key buffer in bytes.
- @param[out] OutKey Pointer to the output derived key buffer.
-
- @retval TRUE A key was derived successfully.
- @retval FALSE One of the pointers was NULL or one of the sizes was too large.
- @retval FALSE The hash algorithm could not be determined from the digest size.
- @retval FALSE The key derivation operation failed.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs5HashPassword (
- IN UINTN PasswordLength,
- IN CONST CHAR8 *Password,
- IN UINTN SaltLength,
- IN CONST UINT8 *Salt,
- IN UINTN IterationCount,
- IN UINTN DigestSize,
- IN UINTN KeyLength,
- OUT UINT8 *OutKey
- )
-{
- CONST EVP_MD *HashAlg;
-
- HashAlg = NULL;
-
- //
- // Parameter Checking.
- //
- if ((Password == NULL) || (Salt == NULL) || (OutKey == NULL)) {
- return FALSE;
- }
- if ((PasswordLength == 0) || (PasswordLength > INT_MAX) ||
- (SaltLength == 0) || (SaltLength > INT_MAX) ||
- (KeyLength == 0) || (KeyLength > INT_MAX) ||
- (IterationCount < 1) || (IterationCount > INT_MAX)) {
- return FALSE;
- }
- //
- // Make sure the digest algorithm is supported.
- //
- switch (DigestSize) {
- case SHA1_DIGEST_SIZE:
- HashAlg = EVP_sha1();
- break;
- case SHA256_DIGEST_SIZE:
- HashAlg = EVP_sha256();
- break;
- default:
- return FALSE;
- break;
- }
-
- //
- // Perform password-based key derivation routines.
- //
- return (BOOLEAN)PKCS5_PBKDF2_HMAC (
- (const char *)Password,
- (int)PasswordLength,
- (const unsigned char *)Salt,
- (int)SaltLength,
- (int)IterationCount,
- HashAlg,
- (int)KeyLength,
- (unsigned char *)OutKey
- );
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs5Pbkdf2Null.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs5Pbkdf2Null.c
deleted file mode 100644
index 502dd3c..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs5Pbkdf2Null.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/** @file
- PBKDF2 Key Derivation Function Wrapper Implementation which does not provide real
- capabilities.
-
-Copyright (c) 2016, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-#include
-
-/**
- Derives a key from a password using a salt and iteration count, based on PKCS#5 v2.0
- password based encryption key derivation function PBKDF2, as specified in RFC 2898.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] PasswordLength Length of input password in bytes.
- @param[in] Password Pointer to the array for the password.
- @param[in] SaltLength Size of the Salt in bytes.
- @param[in] Salt Pointer to the Salt.
- @param[in] IterationCount Number of iterations to perform. Its value should be
- greater than or equal to 1.
- @param[in] DigestSize Size of the message digest to be used (eg. SHA256_DIGEST_SIZE).
- NOTE: DigestSize will be used to determine the hash algorithm.
- Only SHA1_DIGEST_SIZE or SHA256_DIGEST_SIZE is supported.
- @param[in] KeyLength Size of the derived key buffer in bytes.
- @param[out] OutKey Pointer to the output derived key buffer.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs5HashPassword (
- IN UINTN PasswordLength,
- IN CONST CHAR8 *Password,
- IN UINTN SaltLength,
- IN CONST UINT8 *Salt,
- IN UINTN IterationCount,
- IN UINTN DigestSize,
- IN UINTN KeyLength,
- OUT UINT8 *OutKey
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Sign.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Sign.c
deleted file mode 100644
index 11becdd..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Sign.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/** @file
- PKCS#7 SignedData Sign Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-#include
-#include
-#include
-
-/**
- Creates a PKCS#7 signedData as described in "PKCS #7: Cryptographic Message
- Syntax Standard, version 1.5". This interface is only intended to be used for
- application to perform PKCS#7 functionality validation.
-
- @param[in] PrivateKey Pointer to the PEM-formatted private key data for
- data signing.
- @param[in] PrivateKeySize Size of the PEM private key data in bytes.
- @param[in] KeyPassword NULL-terminated passphrase used for encrypted PEM
- key data.
- @param[in] InData Pointer to the content to be signed.
- @param[in] InDataSize Size of InData in bytes.
- @param[in] SignCert Pointer to signer's DER-encoded certificate to sign with.
- @param[in] OtherCerts Pointer to an optional additional set of certificates to
- include in the PKCS#7 signedData (e.g. any intermediate
- CAs in the chain).
- @param[out] SignedData Pointer to output PKCS#7 signedData. It's caller's
- responsibility to free the buffer with FreePool().
- @param[out] SignedDataSize Size of SignedData in bytes.
-
- @retval TRUE PKCS#7 data signing succeeded.
- @retval FALSE PKCS#7 data signing failed.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7Sign (
- IN CONST UINT8 *PrivateKey,
- IN UINTN PrivateKeySize,
- IN CONST UINT8 *KeyPassword,
- IN UINT8 *InData,
- IN UINTN InDataSize,
- IN UINT8 *SignCert,
- IN UINT8 *OtherCerts OPTIONAL,
- OUT UINT8 **SignedData,
- OUT UINTN *SignedDataSize
- )
-{
- BOOLEAN Status;
- EVP_PKEY *Key;
- BIO *DataBio;
- PKCS7 *Pkcs7;
- UINT8 *RsaContext;
- UINT8 *P7Data;
- UINTN P7DataSize;
- UINT8 *Tmp;
-
- //
- // Check input parameters.
- //
- if (PrivateKey == NULL || KeyPassword == NULL || InData == NULL ||
- SignCert == NULL || SignedData == NULL || SignedDataSize == NULL || InDataSize > INT_MAX) {
- return FALSE;
- }
-
- RsaContext = NULL;
- Key = NULL;
- Pkcs7 = NULL;
- DataBio = NULL;
- Status = FALSE;
-
- //
- // Retrieve RSA private key from PEM data.
- //
- Status = RsaGetPrivateKeyFromPem (
- PrivateKey,
- PrivateKeySize,
- (CONST CHAR8 *) KeyPassword,
- (VOID **) &RsaContext
- );
- if (!Status) {
- return Status;
- }
-
- Status = FALSE;
-
- //
- // Register & Initialize necessary digest algorithms and PRNG for PKCS#7 Handling
- //
- if (EVP_add_digest (EVP_md5 ()) == 0) {
- goto _Exit;
- }
- if (EVP_add_digest (EVP_sha1 ()) == 0) {
- goto _Exit;
- }
- if (EVP_add_digest (EVP_sha256 ()) == 0) {
- goto _Exit;
- }
-
- RandomSeed (NULL, 0);
-
- //
- // Construct OpenSSL EVP_PKEY for private key.
- //
- Key = EVP_PKEY_new ();
- if (Key == NULL) {
- goto _Exit;
- }
- if (EVP_PKEY_assign_RSA (Key, (RSA *) RsaContext) == 0) {
- goto _Exit;
- }
-
- //
- // Convert the data to be signed to BIO format.
- //
- DataBio = BIO_new (BIO_s_mem ());
- if (DataBio == NULL) {
- goto _Exit;
- }
-
- if (BIO_write (DataBio, InData, (int) InDataSize) <= 0) {
- goto _Exit;
- }
-
- //
- // Create the PKCS#7 signedData structure.
- //
- Pkcs7 = PKCS7_sign (
- (X509 *) SignCert,
- Key,
- (STACK_OF(X509) *) OtherCerts,
- DataBio,
- PKCS7_BINARY | PKCS7_NOATTR | PKCS7_DETACHED
- );
- if (Pkcs7 == NULL) {
- goto _Exit;
- }
-
- //
- // Convert PKCS#7 signedData structure into DER-encoded buffer.
- //
- P7DataSize = i2d_PKCS7 (Pkcs7, NULL);
- if (P7DataSize <= 19) {
- goto _Exit;
- }
-
- P7Data = malloc (P7DataSize);
- if (P7Data == NULL) {
- goto _Exit;
- }
-
- Tmp = P7Data;
- P7DataSize = i2d_PKCS7 (Pkcs7, (unsigned char **) &Tmp);
- ASSERT (P7DataSize > 19);
-
- //
- // Strip ContentInfo to content only for signeddata. The data be trimmed off
- // is totally 19 bytes.
- //
- *SignedDataSize = P7DataSize - 19;
- *SignedData = AllocatePool (*SignedDataSize);
- if (*SignedData == NULL) {
- OPENSSL_free (P7Data);
- goto _Exit;
- }
-
- CopyMem (*SignedData, P7Data + 19, *SignedDataSize);
-
- OPENSSL_free (P7Data);
-
- Status = TRUE;
-
-_Exit:
- //
- // Release Resources
- //
- if (Key != NULL) {
- EVP_PKEY_free (Key);
- }
-
- if (DataBio != NULL) {
- BIO_free (DataBio);
- }
-
- if (Pkcs7 != NULL) {
- PKCS7_free (Pkcs7);
- }
-
- return Status;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7SignNull.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7SignNull.c
deleted file mode 100644
index 830dbb4..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7SignNull.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @file
- PKCS#7 SignedData Sign Wrapper Implementation which does not provide real
- capabilities.
-
-Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Creates a PKCS#7 signedData as described in "PKCS #7: Cryptographic Message
- Syntax Standard, version 1.5". This interface is only intended to be used for
- application to perform PKCS#7 functionality validation.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] PrivateKey Pointer to the PEM-formatted private key data for
- data signing.
- @param[in] PrivateKeySize Size of the PEM private key data in bytes.
- @param[in] KeyPassword NULL-terminated passphrase used for encrypted PEM
- key data.
- @param[in] InData Pointer to the content to be signed.
- @param[in] InDataSize Size of InData in bytes.
- @param[in] SignCert Pointer to signer's DER-encoded certificate to sign with.
- @param[in] OtherCerts Pointer to an optional additional set of certificates to
- include in the PKCS#7 signedData (e.g. any intermediate
- CAs in the chain).
- @param[out] SignedData Pointer to output PKCS#7 signedData. It's caller's
- responsibility to free the buffer with FreePool().
- @param[out] SignedDataSize Size of SignedData in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7Sign (
- IN CONST UINT8 *PrivateKey,
- IN UINTN PrivateKeySize,
- IN CONST UINT8 *KeyPassword,
- IN UINT8 *InData,
- IN UINTN InDataSize,
- IN UINT8 *SignCert,
- IN UINT8 *OtherCerts OPTIONAL,
- OUT UINT8 **SignedData,
- OUT UINTN *SignedDataSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyBase.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyBase.c
deleted file mode 100644
index ce2b49f..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyBase.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/** @file
- Non-runtime specific implementation of PKCS#7 SignedData Verification Wrapper.
-
-Copyright (c) 2019, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-#include
-#include
-#include
-#include
-
-/**
- Extracts the attached content from a PKCS#7 signed data if existed. The input signed
- data could be wrapped in a ContentInfo structure.
-
- If P7Data, Content, or ContentSize is NULL, then return FALSE. If P7Length overflow,
- then return FALSE. If the P7Data is not correctly formatted, then return FALSE.
-
- Caution: This function may receive untrusted input. So this function will do
- basic check for PKCS#7 data structure.
-
- @param[in] P7Data Pointer to the PKCS#7 signed data to process.
- @param[in] P7Length Length of the PKCS#7 signed data in bytes.
- @param[out] Content Pointer to the extracted content from the PKCS#7 signedData.
- It's caller's responsibility to free the buffer with FreePool().
- @param[out] ContentSize The size of the extracted content in bytes.
-
- @retval TRUE The P7Data was correctly formatted for processing.
- @retval FALSE The P7Data was not correctly formatted for processing.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7GetAttachedContent (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- OUT VOID **Content,
- OUT UINTN *ContentSize
- )
-{
- BOOLEAN Status;
- PKCS7 *Pkcs7;
- UINT8 *SignedData;
- UINTN SignedDataSize;
- BOOLEAN Wrapped;
- CONST UINT8 *Temp;
- ASN1_OCTET_STRING *OctStr;
-
- //
- // Check input parameter.
- //
- if ((P7Data == NULL) || (P7Length > INT_MAX) || (Content == NULL) || (ContentSize == NULL)) {
- return FALSE;
- }
-
- *Content = NULL;
- Pkcs7 = NULL;
- SignedData = NULL;
- OctStr = NULL;
-
- Status = WrapPkcs7Data (P7Data, P7Length, &Wrapped, &SignedData, &SignedDataSize);
- if (!Status || (SignedDataSize > INT_MAX)) {
- goto _Exit;
- }
-
- Status = FALSE;
-
- //
- // Decoding PKCS#7 SignedData
- //
- Temp = SignedData;
- Pkcs7 = d2i_PKCS7 (NULL, (const unsigned char **)&Temp, (int)SignedDataSize);
- if (Pkcs7 == NULL) {
- goto _Exit;
- }
-
- //
- // The type of Pkcs7 must be signedData
- //
- if (!PKCS7_type_is_signed (Pkcs7)) {
- goto _Exit;
- }
-
- //
- // Check for detached or attached content
- //
- if (PKCS7_get_detached (Pkcs7)) {
- //
- // No Content supplied for PKCS7 detached signedData
- //
- *Content = NULL;
- *ContentSize = 0;
- } else {
- //
- // Retrieve the attached content in PKCS7 signedData
- //
- OctStr = Pkcs7->d.sign->contents->d.data;
- if ((OctStr->length > 0) && (OctStr->data != NULL)) {
- *ContentSize = OctStr->length;
- *Content = AllocatePool (*ContentSize);
- if (*Content == NULL) {
- *ContentSize = 0;
- goto _Exit;
- }
- CopyMem (*Content, OctStr->data, *ContentSize);
- }
- }
- Status = TRUE;
-
-_Exit:
- //
- // Release Resources
- //
- PKCS7_free (Pkcs7);
-
- if (!Wrapped) {
- OPENSSL_free (SignedData);
- }
-
- return Status;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c
deleted file mode 100644
index 0fb3107..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyCommon.c
+++ /dev/null
@@ -1,916 +0,0 @@
-/** @file
- PKCS#7 SignedData Verification Wrapper Implementation over OpenSSL.
-
- Caution: This module requires additional review when modified.
- This library will have external input - signature (e.g. UEFI Authenticated
- Variable). It may by input in SMM mode.
- This external input must be validated carefully to avoid security issue like
- buffer overflow, integer overflow.
-
- WrapPkcs7Data(), Pkcs7GetSigners(), Pkcs7Verify() will get UEFI Authenticated
- Variable and will do basic check for data structure.
-
-Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-#include
-#include
-#include
-#include
-
-UINT8 mOidValue[9] = { 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x02 };
-
-/**
- Check input P7Data is a wrapped ContentInfo structure or not. If not construct
- a new structure to wrap P7Data.
-
- Caution: This function may receive untrusted input.
- UEFI Authenticated Variable is external input, so this function will do basic
- check for PKCS#7 data structure.
-
- @param[in] P7Data Pointer to the PKCS#7 message to verify.
- @param[in] P7Length Length of the PKCS#7 message in bytes.
- @param[out] WrapFlag If TRUE P7Data is a ContentInfo structure, otherwise
- return FALSE.
- @param[out] WrapData If return status of this function is TRUE:
- 1) when WrapFlag is TRUE, pointer to P7Data.
- 2) when WrapFlag is FALSE, pointer to a new ContentInfo
- structure. It's caller's responsibility to free this
- buffer.
- @param[out] WrapDataSize Length of ContentInfo structure in bytes.
-
- @retval TRUE The operation is finished successfully.
- @retval FALSE The operation is failed due to lack of resources.
-
-**/
-BOOLEAN
-WrapPkcs7Data (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- OUT BOOLEAN *WrapFlag,
- OUT UINT8 **WrapData,
- OUT UINTN *WrapDataSize
- )
-{
- BOOLEAN Wrapped;
- UINT8 *SignedData;
-
- //
- // Check whether input P7Data is a wrapped ContentInfo structure or not.
- //
- Wrapped = FALSE;
- if ((P7Data[4] == 0x06) && (P7Data[5] == 0x09)) {
- if (CompareMem (P7Data + 6, mOidValue, sizeof (mOidValue)) == 0) {
- if ((P7Data[15] == 0xA0) && (P7Data[16] == 0x82)) {
- Wrapped = TRUE;
- }
- }
- }
-
- if (Wrapped) {
- *WrapData = (UINT8 *) P7Data;
- *WrapDataSize = P7Length;
- } else {
- //
- // Wrap PKCS#7 signeddata to a ContentInfo structure - add a header in 19 bytes.
- //
- *WrapDataSize = P7Length + 19;
- *WrapData = malloc (*WrapDataSize);
- if (*WrapData == NULL) {
- *WrapFlag = Wrapped;
- return FALSE;
- }
-
- SignedData = *WrapData;
-
- //
- // Part1: 0x30, 0x82.
- //
- SignedData[0] = 0x30;
- SignedData[1] = 0x82;
-
- //
- // Part2: Length1 = P7Length + 19 - 4, in big endian.
- //
- SignedData[2] = (UINT8) (((UINT16) (*WrapDataSize - 4)) >> 8);
- SignedData[3] = (UINT8) (((UINT16) (*WrapDataSize - 4)) & 0xff);
-
- //
- // Part3: 0x06, 0x09.
- //
- SignedData[4] = 0x06;
- SignedData[5] = 0x09;
-
- //
- // Part4: OID value -- 0x2A 0x86 0x48 0x86 0xF7 0x0D 0x01 0x07 0x02.
- //
- CopyMem (SignedData + 6, mOidValue, sizeof (mOidValue));
-
- //
- // Part5: 0xA0, 0x82.
- //
- SignedData[15] = 0xA0;
- SignedData[16] = 0x82;
-
- //
- // Part6: Length2 = P7Length, in big endian.
- //
- SignedData[17] = (UINT8) (((UINT16) P7Length) >> 8);
- SignedData[18] = (UINT8) (((UINT16) P7Length) & 0xff);
-
- //
- // Part7: P7Data.
- //
- CopyMem (SignedData + 19, P7Data, P7Length);
- }
-
- *WrapFlag = Wrapped;
- return TRUE;
-}
-
-/**
- Pop single certificate from STACK_OF(X509).
-
- If X509Stack, Cert, or CertSize is NULL, then return FALSE.
-
- @param[in] X509Stack Pointer to a X509 stack object.
- @param[out] Cert Pointer to a X509 certificate.
- @param[out] CertSize Length of output X509 certificate in bytes.
-
- @retval TRUE The X509 stack pop succeeded.
- @retval FALSE The pop operation failed.
-
-**/
-BOOLEAN
-X509PopCertificate (
- IN VOID *X509Stack,
- OUT UINT8 **Cert,
- OUT UINTN *CertSize
- )
-{
- BIO *CertBio;
- X509 *X509Cert;
- STACK_OF(X509) *CertStack;
- BOOLEAN Status;
- INT32 Result;
- BUF_MEM *Ptr;
- INT32 Length;
- VOID *Buffer;
-
- Status = FALSE;
-
- if ((X509Stack == NULL) || (Cert == NULL) || (CertSize == NULL)) {
- return Status;
- }
-
- CertStack = (STACK_OF(X509) *) X509Stack;
-
- X509Cert = sk_X509_pop (CertStack);
-
- if (X509Cert == NULL) {
- return Status;
- }
-
- Buffer = NULL;
-
- CertBio = BIO_new (BIO_s_mem ());
- if (CertBio == NULL) {
- return Status;
- }
-
- Result = i2d_X509_bio (CertBio, X509Cert);
- if (Result == 0) {
- goto _Exit;
- }
-
- BIO_get_mem_ptr (CertBio, &Ptr);
- Length = (INT32)(Ptr->length);
- if (Length <= 0) {
- goto _Exit;
- }
-
- Buffer = malloc (Length);
- if (Buffer == NULL) {
- goto _Exit;
- }
-
- Result = BIO_read (CertBio, Buffer, Length);
- if (Result != Length) {
- goto _Exit;
- }
-
- *Cert = Buffer;
- *CertSize = Length;
-
- Status = TRUE;
-
-_Exit:
-
- BIO_free (CertBio);
-
- if (!Status && (Buffer != NULL)) {
- free (Buffer);
- }
-
- return Status;
-}
-
-/**
- Get the signer's certificates from PKCS#7 signed data as described in "PKCS #7:
- Cryptographic Message Syntax Standard". The input signed data could be wrapped
- in a ContentInfo structure.
-
- If P7Data, CertStack, StackLength, TrustedCert or CertLength is NULL, then
- return FALSE. If P7Length overflow, then return FALSE.
-
- Caution: This function may receive untrusted input.
- UEFI Authenticated Variable is external input, so this function will do basic
- check for PKCS#7 data structure.
-
- @param[in] P7Data Pointer to the PKCS#7 message to verify.
- @param[in] P7Length Length of the PKCS#7 message in bytes.
- @param[out] CertStack Pointer to Signer's certificates retrieved from P7Data.
- It's caller's responsibility to free the buffer with
- Pkcs7FreeSigners().
- This data structure is EFI_CERT_STACK type.
- @param[out] StackLength Length of signer's certificates in bytes.
- @param[out] TrustedCert Pointer to a trusted certificate from Signer's certificates.
- It's caller's responsibility to free the buffer with
- Pkcs7FreeSigners().
- @param[out] CertLength Length of the trusted certificate in bytes.
-
- @retval TRUE The operation is finished successfully.
- @retval FALSE Error occurs during the operation.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7GetSigners (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- OUT UINT8 **CertStack,
- OUT UINTN *StackLength,
- OUT UINT8 **TrustedCert,
- OUT UINTN *CertLength
- )
-{
- PKCS7 *Pkcs7;
- BOOLEAN Status;
- UINT8 *SignedData;
- CONST UINT8 *Temp;
- UINTN SignedDataSize;
- BOOLEAN Wrapped;
- STACK_OF(X509) *Stack;
- UINT8 Index;
- UINT8 *CertBuf;
- UINT8 *OldBuf;
- UINTN BufferSize;
- UINTN OldSize;
- UINT8 *SingleCert;
- UINTN SingleCertSize;
-
- if ((P7Data == NULL) || (CertStack == NULL) || (StackLength == NULL) ||
- (TrustedCert == NULL) || (CertLength == NULL) || (P7Length > INT_MAX)) {
- return FALSE;
- }
-
- Status = WrapPkcs7Data (P7Data, P7Length, &Wrapped, &SignedData, &SignedDataSize);
- if (!Status) {
- return Status;
- }
-
- Status = FALSE;
- Pkcs7 = NULL;
- Stack = NULL;
- CertBuf = NULL;
- OldBuf = NULL;
- SingleCert = NULL;
-
- //
- // Retrieve PKCS#7 Data (DER encoding)
- //
- if (SignedDataSize > INT_MAX) {
- goto _Exit;
- }
-
- Temp = SignedData;
- Pkcs7 = d2i_PKCS7 (NULL, (const unsigned char **) &Temp, (int) SignedDataSize);
- if (Pkcs7 == NULL) {
- goto _Exit;
- }
-
- //
- // Check if it's PKCS#7 Signed Data (for Authenticode Scenario)
- //
- if (!PKCS7_type_is_signed (Pkcs7)) {
- goto _Exit;
- }
-
- Stack = PKCS7_get0_signers(Pkcs7, NULL, PKCS7_BINARY);
- if (Stack == NULL) {
- goto _Exit;
- }
-
- //
- // Convert CertStack to buffer in following format:
- // UINT8 CertNumber;
- // UINT32 Cert1Length;
- // UINT8 Cert1[];
- // UINT32 Cert2Length;
- // UINT8 Cert2[];
- // ...
- // UINT32 CertnLength;
- // UINT8 Certn[];
- //
- BufferSize = sizeof (UINT8);
- OldSize = BufferSize;
-
- for (Index = 0; ; Index++) {
- Status = X509PopCertificate (Stack, &SingleCert, &SingleCertSize);
- if (!Status) {
- break;
- }
-
- OldSize = BufferSize;
- OldBuf = CertBuf;
- BufferSize = OldSize + SingleCertSize + sizeof (UINT32);
- CertBuf = malloc (BufferSize);
-
- if (CertBuf == NULL) {
- goto _Exit;
- }
-
- if (OldBuf != NULL) {
- CopyMem (CertBuf, OldBuf, OldSize);
- free (OldBuf);
- OldBuf = NULL;
- }
-
- WriteUnaligned32 ((UINT32 *) (CertBuf + OldSize), (UINT32) SingleCertSize);
- CopyMem (CertBuf + OldSize + sizeof (UINT32), SingleCert, SingleCertSize);
-
- free (SingleCert);
- SingleCert = NULL;
- }
-
- if (CertBuf != NULL) {
- //
- // Update CertNumber.
- //
- CertBuf[0] = Index;
-
- *CertLength = BufferSize - OldSize - sizeof (UINT32);
- *TrustedCert = malloc (*CertLength);
- if (*TrustedCert == NULL) {
- goto _Exit;
- }
-
- CopyMem (*TrustedCert, CertBuf + OldSize + sizeof (UINT32), *CertLength);
- *CertStack = CertBuf;
- *StackLength = BufferSize;
- Status = TRUE;
- }
-
-_Exit:
- //
- // Release Resources
- //
- if (!Wrapped) {
- free (SignedData);
- }
-
- if (Pkcs7 != NULL) {
- PKCS7_free (Pkcs7);
- }
-
- if (Stack != NULL) {
- sk_X509_pop_free(Stack, X509_free);
- }
-
- if (SingleCert != NULL) {
- free (SingleCert);
- }
-
- if (!Status && (CertBuf != NULL)) {
- free (CertBuf);
- *CertStack = NULL;
- }
-
- if (OldBuf != NULL) {
- free (OldBuf);
- }
-
- return Status;
-}
-
-/**
- Wrap function to use free() to free allocated memory for certificates.
-
- @param[in] Certs Pointer to the certificates to be freed.
-
-**/
-VOID
-EFIAPI
-Pkcs7FreeSigners (
- IN UINT8 *Certs
- )
-{
- if (Certs == NULL) {
- return;
- }
-
- free (Certs);
-}
-
-/**
- Retrieves all embedded certificates from PKCS#7 signed data as described in "PKCS #7:
- Cryptographic Message Syntax Standard", and outputs two certificate lists chained and
- unchained to the signer's certificates.
- The input signed data could be wrapped in a ContentInfo structure.
-
- @param[in] P7Data Pointer to the PKCS#7 message.
- @param[in] P7Length Length of the PKCS#7 message in bytes.
- @param[out] SignerChainCerts Pointer to the certificates list chained to signer's
- certificate. It's caller's responsibility to free the buffer
- with Pkcs7FreeSigners().
- This data structure is EFI_CERT_STACK type.
- @param[out] ChainLength Length of the chained certificates list buffer in bytes.
- @param[out] UnchainCerts Pointer to the unchained certificates lists. It's caller's
- responsibility to free the buffer with Pkcs7FreeSigners().
- This data structure is EFI_CERT_STACK type.
- @param[out] UnchainLength Length of the unchained certificates list buffer in bytes.
-
- @retval TRUE The operation is finished successfully.
- @retval FALSE Error occurs during the operation.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7GetCertificatesList (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- OUT UINT8 **SignerChainCerts,
- OUT UINTN *ChainLength,
- OUT UINT8 **UnchainCerts,
- OUT UINTN *UnchainLength
- )
-{
- BOOLEAN Status;
- UINT8 *NewP7Data;
- UINTN NewP7Length;
- BOOLEAN Wrapped;
- UINT8 Index;
- PKCS7 *Pkcs7;
- X509_STORE_CTX *CertCtx;
- STACK_OF(X509) *CtxChain;
- STACK_OF(X509) *CtxUntrusted;
- X509 *CtxCert;
- STACK_OF(X509) *Signers;
- X509 *Signer;
- X509 *Cert;
- X509 *Issuer;
- X509_NAME *IssuerName;
- UINT8 *CertBuf;
- UINT8 *OldBuf;
- UINTN BufferSize;
- UINTN OldSize;
- UINT8 *SingleCert;
- UINTN CertSize;
-
- //
- // Initializations
- //
- Status = FALSE;
- NewP7Data = NULL;
- Pkcs7 = NULL;
- CertCtx = NULL;
- CtxChain = NULL;
- CtxCert = NULL;
- CtxUntrusted = NULL;
- Cert = NULL;
- SingleCert = NULL;
- CertBuf = NULL;
- OldBuf = NULL;
- Signers = NULL;
-
- ZeroMem (&CertCtx, sizeof (CertCtx));
-
- //
- // Parameter Checking
- //
- if ((P7Data == NULL) || (SignerChainCerts == NULL) || (ChainLength == NULL) ||
- (UnchainCerts == NULL) || (UnchainLength == NULL) || (P7Length > INT_MAX)) {
- return Status;
- }
-
- *SignerChainCerts = NULL;
- *ChainLength = 0;
- *UnchainCerts = NULL;
- *UnchainLength = 0;
-
- //
- // Construct a new PKCS#7 data wrapping with ContentInfo structure if needed.
- //
- Status = WrapPkcs7Data (P7Data, P7Length, &Wrapped, &NewP7Data, &NewP7Length);
- if (!Status || (NewP7Length > INT_MAX)) {
- goto _Error;
- }
-
- //
- // Decodes PKCS#7 SignedData
- //
- Pkcs7 = d2i_PKCS7 (NULL, (const unsigned char **) &NewP7Data, (int) NewP7Length);
- if ((Pkcs7 == NULL) || (!PKCS7_type_is_signed (Pkcs7))) {
- goto _Error;
- }
-
- //
- // Obtains Signer's Certificate from PKCS#7 data
- // NOTE: Only one signer case will be handled in this function, which means SignerInfos
- // should include only one signer's certificate.
- //
- Signers = PKCS7_get0_signers (Pkcs7, NULL, PKCS7_BINARY);
- if ((Signers == NULL) || (sk_X509_num (Signers) != 1)) {
- goto _Error;
- }
- Signer = sk_X509_value (Signers, 0);
-
- CertCtx = X509_STORE_CTX_new ();
- if (CertCtx == NULL) {
- goto _Error;
- }
- if (!X509_STORE_CTX_init (CertCtx, NULL, Signer, Pkcs7->d.sign->cert)) {
- goto _Error;
- }
- //
- // Initialize Chained & Untrusted stack
- //
- CtxChain = X509_STORE_CTX_get0_chain (CertCtx);
- CtxCert = X509_STORE_CTX_get0_cert (CertCtx);
- if (CtxChain == NULL) {
- if (((CtxChain = sk_X509_new_null ()) == NULL) ||
- (!sk_X509_push (CtxChain, CtxCert))) {
- goto _Error;
- }
- }
- CtxUntrusted = X509_STORE_CTX_get0_untrusted (CertCtx);
- if (CtxUntrusted != NULL) {
- (VOID)sk_X509_delete_ptr (CtxUntrusted, Signer);
- }
-
- //
- // Build certificates stack chained from Signer's certificate.
- //
- Cert = Signer;
- for (; ;) {
- //
- // Self-Issue checking
- //
- Issuer = NULL;
- if (X509_STORE_CTX_get1_issuer (&Issuer, CertCtx, Cert) == 1) {
- if (X509_cmp (Issuer, Cert) == 0) {
- break;
- }
- }
-
- //
- // Found the issuer of the current certificate
- //
- if (CtxUntrusted != NULL) {
- Issuer = NULL;
- IssuerName = X509_get_issuer_name (Cert);
- Issuer = X509_find_by_subject (CtxUntrusted, IssuerName);
- if (Issuer != NULL) {
- if (!sk_X509_push (CtxChain, Issuer)) {
- goto _Error;
- }
- (VOID)sk_X509_delete_ptr (CtxUntrusted, Issuer);
-
- Cert = Issuer;
- continue;
- }
- }
-
- break;
- }
-
- //
- // Converts Chained and Untrusted Certificate to Certificate Buffer in following format:
- // UINT8 CertNumber;
- // UINT32 Cert1Length;
- // UINT8 Cert1[];
- // UINT32 Cert2Length;
- // UINT8 Cert2[];
- // ...
- // UINT32 CertnLength;
- // UINT8 Certn[];
- //
-
- if (CtxChain != NULL) {
- BufferSize = sizeof (UINT8);
- CertBuf = NULL;
-
- for (Index = 0; ; Index++) {
- Status = X509PopCertificate (CtxChain, &SingleCert, &CertSize);
- if (!Status) {
- break;
- }
-
- OldSize = BufferSize;
- OldBuf = CertBuf;
- BufferSize = OldSize + CertSize + sizeof (UINT32);
- CertBuf = malloc (BufferSize);
-
- if (CertBuf == NULL) {
- Status = FALSE;
- goto _Error;
- }
- if (OldBuf != NULL) {
- CopyMem (CertBuf, OldBuf, OldSize);
- free (OldBuf);
- OldBuf = NULL;
- }
-
- WriteUnaligned32 ((UINT32 *) (CertBuf + OldSize), (UINT32) CertSize);
- CopyMem (CertBuf + OldSize + sizeof (UINT32), SingleCert, CertSize);
-
- free (SingleCert);
- SingleCert = NULL;
- }
-
- if (CertBuf != NULL) {
- //
- // Update CertNumber.
- //
- CertBuf[0] = Index;
-
- *SignerChainCerts = CertBuf;
- *ChainLength = BufferSize;
- }
- }
-
- if (CtxUntrusted != NULL) {
- BufferSize = sizeof (UINT8);
- CertBuf = NULL;
-
- for (Index = 0; ; Index++) {
- Status = X509PopCertificate (CtxUntrusted, &SingleCert, &CertSize);
- if (!Status) {
- break;
- }
-
- OldSize = BufferSize;
- OldBuf = CertBuf;
- BufferSize = OldSize + CertSize + sizeof (UINT32);
- CertBuf = malloc (BufferSize);
-
- if (CertBuf == NULL) {
- Status = FALSE;
- goto _Error;
- }
- if (OldBuf != NULL) {
- CopyMem (CertBuf, OldBuf, OldSize);
- free (OldBuf);
- OldBuf = NULL;
- }
-
- WriteUnaligned32 ((UINT32 *) (CertBuf + OldSize), (UINT32) CertSize);
- CopyMem (CertBuf + OldSize + sizeof (UINT32), SingleCert, CertSize);
-
- free (SingleCert);
- SingleCert = NULL;
- }
-
- if (CertBuf != NULL) {
- //
- // Update CertNumber.
- //
- CertBuf[0] = Index;
-
- *UnchainCerts = CertBuf;
- *UnchainLength = BufferSize;
- }
- }
-
- Status = TRUE;
-
-_Error:
- //
- // Release Resources.
- //
- if (!Wrapped && (NewP7Data != NULL)) {
- free (NewP7Data);
- }
-
- if (Pkcs7 != NULL) {
- PKCS7_free (Pkcs7);
- }
- sk_X509_free (Signers);
-
- if (CertCtx != NULL) {
- X509_STORE_CTX_cleanup (CertCtx);
- X509_STORE_CTX_free (CertCtx);
- }
-
- if (SingleCert != NULL) {
- free (SingleCert);
- }
-
- if (OldBuf != NULL) {
- free (OldBuf);
- }
-
- if (!Status && (CertBuf != NULL)) {
- free (CertBuf);
- *SignerChainCerts = NULL;
- *UnchainCerts = NULL;
- }
-
- return Status;
-}
-
-/**
- Verifies the validity of a PKCS#7 signed data as described in "PKCS #7:
- Cryptographic Message Syntax Standard". The input signed data could be wrapped
- in a ContentInfo structure.
-
- If P7Data, TrustedCert or InData is NULL, then return FALSE.
- If P7Length, CertLength or DataLength overflow, then return FALSE.
-
- Caution: This function may receive untrusted input.
- UEFI Authenticated Variable is external input, so this function will do basic
- check for PKCS#7 data structure.
-
- @param[in] P7Data Pointer to the PKCS#7 message to verify.
- @param[in] P7Length Length of the PKCS#7 message in bytes.
- @param[in] TrustedCert Pointer to a trusted/root certificate encoded in DER, which
- is used for certificate chain verification.
- @param[in] CertLength Length of the trusted certificate in bytes.
- @param[in] InData Pointer to the content to be verified.
- @param[in] DataLength Length of InData in bytes.
-
- @retval TRUE The specified PKCS#7 signed data is valid.
- @retval FALSE Invalid PKCS#7 signed data.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7Verify (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- IN CONST UINT8 *TrustedCert,
- IN UINTN CertLength,
- IN CONST UINT8 *InData,
- IN UINTN DataLength
- )
-{
- PKCS7 *Pkcs7;
- BIO *DataBio;
- BOOLEAN Status;
- X509 *Cert;
- X509_STORE *CertStore;
- UINT8 *SignedData;
- CONST UINT8 *Temp;
- UINTN SignedDataSize;
- BOOLEAN Wrapped;
-
- //
- // Check input parameters.
- //
- if (P7Data == NULL || TrustedCert == NULL || InData == NULL ||
- P7Length > INT_MAX || CertLength > INT_MAX || DataLength > INT_MAX) {
- return FALSE;
- }
-
- Pkcs7 = NULL;
- DataBio = NULL;
- Cert = NULL;
- CertStore = NULL;
-
- //
- // Register & Initialize necessary digest algorithms for PKCS#7 Handling
- //
- if (EVP_add_digest (EVP_md5 ()) == 0) {
- return FALSE;
- }
- if (EVP_add_digest (EVP_sha1 ()) == 0) {
- return FALSE;
- }
- if (EVP_add_digest (EVP_sha256 ()) == 0) {
- return FALSE;
- }
- if (EVP_add_digest (EVP_sha384 ()) == 0) {
- return FALSE;
- }
- if (EVP_add_digest (EVP_sha512 ()) == 0) {
- return FALSE;
- }
- if (EVP_add_digest_alias (SN_sha1WithRSAEncryption, SN_sha1WithRSA) == 0) {
- return FALSE;
- }
-
- Status = WrapPkcs7Data (P7Data, P7Length, &Wrapped, &SignedData, &SignedDataSize);
- if (!Status) {
- return Status;
- }
-
- Status = FALSE;
-
- //
- // Retrieve PKCS#7 Data (DER encoding)
- //
- if (SignedDataSize > INT_MAX) {
- goto _Exit;
- }
-
- Temp = SignedData;
- Pkcs7 = d2i_PKCS7 (NULL, (const unsigned char **) &Temp, (int) SignedDataSize);
- if (Pkcs7 == NULL) {
- goto _Exit;
- }
-
- //
- // Check if it's PKCS#7 Signed Data (for Authenticode Scenario)
- //
- if (!PKCS7_type_is_signed (Pkcs7)) {
- goto _Exit;
- }
-
- //
- // Read DER-encoded root certificate and Construct X509 Certificate
- //
- Temp = TrustedCert;
- Cert = d2i_X509 (NULL, &Temp, (long) CertLength);
- if (Cert == NULL) {
- goto _Exit;
- }
-
- //
- // Setup X509 Store for trusted certificate
- //
- CertStore = X509_STORE_new ();
- if (CertStore == NULL) {
- goto _Exit;
- }
- if (!(X509_STORE_add_cert (CertStore, Cert))) {
- goto _Exit;
- }
-
- //
- // For generic PKCS#7 handling, InData may be NULL if the content is present
- // in PKCS#7 structure. So ignore NULL checking here.
- //
- DataBio = BIO_new (BIO_s_mem ());
- if (DataBio == NULL) {
- goto _Exit;
- }
-
- if (BIO_write (DataBio, InData, (int) DataLength) <= 0) {
- goto _Exit;
- }
-
- //
- // Allow partial certificate chains, terminated by a non-self-signed but
- // still trusted intermediate certificate. Also disable time checks.
- //
- X509_STORE_set_flags (CertStore,
- X509_V_FLAG_PARTIAL_CHAIN | X509_V_FLAG_NO_CHECK_TIME);
-
- //
- // OpenSSL PKCS7 Verification by default checks for SMIME (email signing) and
- // doesn't support the extended key usage for Authenticode Code Signing.
- // Bypass the certificate purpose checking by enabling any purposes setting.
- //
- X509_STORE_set_purpose (CertStore, X509_PURPOSE_ANY);
-
- //
- // Verifies the PKCS#7 signedData structure
- //
- Status = (BOOLEAN) PKCS7_verify (Pkcs7, NULL, CertStore, DataBio, NULL, PKCS7_BINARY);
-
-_Exit:
- //
- // Release Resources
- //
- BIO_free (DataBio);
- X509_free (Cert);
- X509_STORE_free (CertStore);
- PKCS7_free (Pkcs7);
-
- if (!Wrapped) {
- OPENSSL_free (SignedData);
- }
-
- return Status;
-}
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyNull.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyNull.c
deleted file mode 100644
index bb32131..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyNull.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/** @file
- PKCS#7 SignedData Verification Wrapper Implementation which does not provide
- real capabilities.
-
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Get the signer's certificates from PKCS#7 signed data as described in "PKCS #7:
- Cryptographic Message Syntax Standard". The input signed data could be wrapped
- in a ContentInfo structure.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] P7Data Pointer to the PKCS#7 message to verify.
- @param[in] P7Length Length of the PKCS#7 message in bytes.
- @param[out] CertStack Pointer to Signer's certificates retrieved from P7Data.
- It's caller's responsibility to free the buffer with
- Pkcs7FreeSigners().
- This data structure is EFI_CERT_STACK type.
- @param[out] StackLength Length of signer's certificates in bytes.
- @param[out] TrustedCert Pointer to a trusted certificate from Signer's certificates.
- It's caller's responsibility to free the buffer with
- Pkcs7FreeSigners().
- @param[out] CertLength Length of the trusted certificate in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7GetSigners (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- OUT UINT8 **CertStack,
- OUT UINTN *StackLength,
- OUT UINT8 **TrustedCert,
- OUT UINTN *CertLength
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Wrap function to use free() to free allocated memory for certificates.
-
- If the interface is not supported, then ASSERT().
-
- @param[in] Certs Pointer to the certificates to be freed.
-
-**/
-VOID
-EFIAPI
-Pkcs7FreeSigners (
- IN UINT8 *Certs
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Retrieves all embedded certificates from PKCS#7 signed data as described in "PKCS #7:
- Cryptographic Message Syntax Standard", and outputs two certificate lists chained and
- unchained to the signer's certificates.
- The input signed data could be wrapped in a ContentInfo structure.
-
- @param[in] P7Data Pointer to the PKCS#7 message.
- @param[in] P7Length Length of the PKCS#7 message in bytes.
- @param[out] SignerChainCerts Pointer to the certificates list chained to signer's
- certificate. It's caller's responsibility to free the buffer
- with Pkcs7FreeSigners().
- This data structure is EFI_CERT_STACK type.
- @param[out] ChainLength Length of the chained certificates list buffer in bytes.
- @param[out] UnchainCerts Pointer to the unchained certificates lists. It's caller's
- responsibility to free the buffer with Pkcs7FreeSigners().
- This data structure is EFI_CERT_STACK type.
- @param[out] UnchainLength Length of the unchained certificates list buffer in bytes.
-
- @retval TRUE The operation is finished successfully.
- @retval FALSE Error occurs during the operation.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7GetCertificatesList (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- OUT UINT8 **SignerChainCerts,
- OUT UINTN *ChainLength,
- OUT UINT8 **UnchainCerts,
- OUT UINTN *UnchainLength
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Verifies the validity of a PKCS#7 signed data as described in "PKCS #7:
- Cryptographic Message Syntax Standard". The input signed data could be wrapped
- in a ContentInfo structure.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] P7Data Pointer to the PKCS#7 message to verify.
- @param[in] P7Length Length of the PKCS#7 message in bytes.
- @param[in] TrustedCert Pointer to a trusted/root certificate encoded in DER, which
- is used for certificate chain verification.
- @param[in] CertLength Length of the trusted certificate in bytes.
- @param[in] InData Pointer to the content to be verified.
- @param[in] DataLength Length of InData in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7Verify (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- IN CONST UINT8 *TrustedCert,
- IN UINTN CertLength,
- IN CONST UINT8 *InData,
- IN UINTN DataLength
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Extracts the attached content from a PKCS#7 signed data if existed. The input signed
- data could be wrapped in a ContentInfo structure.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] P7Data Pointer to the PKCS#7 signed data to process.
- @param[in] P7Length Length of the PKCS#7 signed data in bytes.
- @param[out] Content Pointer to the extracted content from the PKCS#7 signedData.
- It's caller's responsibility to free the buffer with FreePool().
- @param[out] ContentSize The size of the extracted content in bytes.
-
- @retval TRUE The P7Data was correctly formatted for processing.
- @retval FALSE The P7Data was not correctly formatted for processing.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7GetAttachedContent (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- OUT VOID **Content,
- OUT UINTN *ContentSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyRuntime.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyRuntime.c
deleted file mode 100644
index 857a40b..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyRuntime.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/** @file
- Runtime specific implementation of PKCS#7 SignedData Verification Wrapper.
-
-Copyright (c) 2019, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Extracts the attached content from a PKCS#7 signed data if existed. The input signed
- data could be wrapped in a ContentInfo structure.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] P7Data Pointer to the PKCS#7 signed data to process.
- @param[in] P7Length Length of the PKCS#7 signed data in bytes.
- @param[out] Content Pointer to the extracted content from the PKCS#7 signedData.
- It's caller's responsibility to free the buffer with FreePool().
- @param[out] ContentSize The size of the extracted content in bytes.
-
- @retval TRUE The P7Data was correctly formatted for processing.
- @retval FALSE The P7Data was not correctly formatted for processing.
-
-**/
-BOOLEAN
-EFIAPI
-Pkcs7GetAttachedContent (
- IN CONST UINT8 *P7Data,
- IN UINTN P7Length,
- OUT VOID **Content,
- OUT UINTN *ContentSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaBasic.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaBasic.c
deleted file mode 100644
index f0d2bb5..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaBasic.c
+++ /dev/null
@@ -1,325 +0,0 @@
-/** @file
- RSA Asymmetric Cipher Wrapper Implementation over OpenSSL.
-
- This file implements following APIs which provide basic capabilities for RSA:
- 1) RsaNew
- 2) RsaFree
- 3) RsaSetKey
- 4) RsaPkcs1Verify
-
-Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-#include
-#include
-#include
-
-/**
- Allocates and initializes one RSA context for subsequent use.
-
- @return Pointer to the RSA context that has been initialized.
- If the allocations fails, RsaNew() returns NULL.
-
-**/
-VOID *
-EFIAPI
-RsaNew (
- VOID
- )
-{
- //
- // Allocates & Initializes RSA Context by OpenSSL RSA_new()
- //
- return (VOID *) RSA_new ();
-}
-
-/**
- Release the specified RSA context.
-
- @param[in] RsaContext Pointer to the RSA context to be released.
-
-**/
-VOID
-EFIAPI
-RsaFree (
- IN VOID *RsaContext
- )
-{
- //
- // Free OpenSSL RSA Context
- //
- RSA_free ((RSA *) RsaContext);
-}
-
-/**
- Sets the tag-designated key component into the established RSA context.
-
- This function sets the tag-designated RSA key component into the established
- RSA context from the user-specified non-negative integer (octet string format
- represented in RSA PKCS#1).
- If BigNumber is NULL, then the specified key component in RSA context is cleared.
-
- If RsaContext is NULL, then return FALSE.
-
- @param[in, out] RsaContext Pointer to RSA context being set.
- @param[in] KeyTag Tag of RSA key component being set.
- @param[in] BigNumber Pointer to octet integer buffer.
- If NULL, then the specified key component in RSA
- context is cleared.
- @param[in] BnSize Size of big number buffer in bytes.
- If BigNumber is NULL, then it is ignored.
-
- @retval TRUE RSA key component was set successfully.
- @retval FALSE Invalid RSA key component tag.
-
-**/
-BOOLEAN
-EFIAPI
-RsaSetKey (
- IN OUT VOID *RsaContext,
- IN RSA_KEY_TAG KeyTag,
- IN CONST UINT8 *BigNumber,
- IN UINTN BnSize
- )
-{
- RSA *RsaKey;
- BIGNUM *BnN;
- BIGNUM *BnE;
- BIGNUM *BnD;
- BIGNUM *BnP;
- BIGNUM *BnQ;
- BIGNUM *BnDp;
- BIGNUM *BnDq;
- BIGNUM *BnQInv;
-
- //
- // Check input parameters.
- //
- if (RsaContext == NULL || BnSize > INT_MAX) {
- return FALSE;
- }
-
- BnN = NULL;
- BnE = NULL;
- BnD = NULL;
- BnP = NULL;
- BnQ = NULL;
- BnDp = NULL;
- BnDq = NULL;
- BnQInv = NULL;
-
- //
- // Retrieve the components from RSA object.
- //
- RsaKey = (RSA *) RsaContext;
- RSA_get0_key (RsaKey, (const BIGNUM **)&BnN, (const BIGNUM **)&BnE, (const BIGNUM **)&BnD);
- RSA_get0_factors (RsaKey, (const BIGNUM **)&BnP, (const BIGNUM **)&BnQ);
- RSA_get0_crt_params (RsaKey, (const BIGNUM **)&BnDp, (const BIGNUM **)&BnDq, (const BIGNUM **)&BnQInv);
-
- //
- // Set RSA Key Components by converting octet string to OpenSSL BN representation.
- // NOTE: For RSA public key (used in signature verification), only public components
- // (N, e) are needed.
- //
- switch (KeyTag) {
-
- //
- // RSA Public Modulus (N), Public Exponent (e) and Private Exponent (d)
- //
- case RsaKeyN:
- case RsaKeyE:
- case RsaKeyD:
- if (BnN == NULL) {
- BnN = BN_new ();
- }
- if (BnE == NULL) {
- BnE = BN_new ();
- }
- if (BnD == NULL) {
- BnD = BN_new ();
- }
-
- if ((BnN == NULL) || (BnE == NULL) || (BnD == NULL)) {
- return FALSE;
- }
-
- switch (KeyTag) {
- case RsaKeyN:
- BnN = BN_bin2bn (BigNumber, (UINT32)BnSize, BnN);
- break;
- case RsaKeyE:
- BnE = BN_bin2bn (BigNumber, (UINT32)BnSize, BnE);
- break;
- case RsaKeyD:
- BnD = BN_bin2bn (BigNumber, (UINT32)BnSize, BnD);
- break;
- default:
- return FALSE;
- }
- if (RSA_set0_key (RsaKey, BN_dup(BnN), BN_dup(BnE), BN_dup(BnD)) == 0) {
- return FALSE;
- }
-
- break;
-
- //
- // RSA Secret Prime Factor of Modulus (p and q)
- //
- case RsaKeyP:
- case RsaKeyQ:
- if (BnP == NULL) {
- BnP = BN_new ();
- }
- if (BnQ == NULL) {
- BnQ = BN_new ();
- }
- if ((BnP == NULL) || (BnQ == NULL)) {
- return FALSE;
- }
-
- switch (KeyTag) {
- case RsaKeyP:
- BnP = BN_bin2bn (BigNumber, (UINT32)BnSize, BnP);
- break;
- case RsaKeyQ:
- BnQ = BN_bin2bn (BigNumber, (UINT32)BnSize, BnQ);
- break;
- default:
- return FALSE;
- }
- if (RSA_set0_factors (RsaKey, BN_dup(BnP), BN_dup(BnQ)) == 0) {
- return FALSE;
- }
-
- break;
-
- //
- // p's CRT Exponent (== d mod (p - 1)), q's CRT Exponent (== d mod (q - 1)),
- // and CRT Coefficient (== 1/q mod p)
- //
- case RsaKeyDp:
- case RsaKeyDq:
- case RsaKeyQInv:
- if (BnDp == NULL) {
- BnDp = BN_new ();
- }
- if (BnDq == NULL) {
- BnDq = BN_new ();
- }
- if (BnQInv == NULL) {
- BnQInv = BN_new ();
- }
- if ((BnDp == NULL) || (BnDq == NULL) || (BnQInv == NULL)) {
- return FALSE;
- }
-
- switch (KeyTag) {
- case RsaKeyDp:
- BnDp = BN_bin2bn (BigNumber, (UINT32)BnSize, BnDp);
- break;
- case RsaKeyDq:
- BnDq = BN_bin2bn (BigNumber, (UINT32)BnSize, BnDq);
- break;
- case RsaKeyQInv:
- BnQInv = BN_bin2bn (BigNumber, (UINT32)BnSize, BnQInv);
- break;
- default:
- return FALSE;
- }
- if (RSA_set0_crt_params (RsaKey, BN_dup(BnDp), BN_dup(BnDq), BN_dup(BnQInv)) == 0) {
- return FALSE;
- }
-
- break;
-
- default:
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in
- RSA PKCS#1.
-
- If RsaContext is NULL, then return FALSE.
- If MessageHash is NULL, then return FALSE.
- If Signature is NULL, then return FALSE.
- If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.
-
- @param[in] RsaContext Pointer to RSA context for signature verification.
- @param[in] MessageHash Pointer to octet message hash to be checked.
- @param[in] HashSize Size of the message hash in bytes.
- @param[in] Signature Pointer to RSA PKCS1-v1_5 signature to be verified.
- @param[in] SigSize Size of signature in bytes.
-
- @retval TRUE Valid signature encoded in PKCS1-v1_5.
- @retval FALSE Invalid signature or invalid RSA context.
-
-**/
-BOOLEAN
-EFIAPI
-RsaPkcs1Verify (
- IN VOID *RsaContext,
- IN CONST UINT8 *MessageHash,
- IN UINTN HashSize,
- IN CONST UINT8 *Signature,
- IN UINTN SigSize
- )
-{
- INT32 DigestType;
- UINT8 *SigBuf;
-
- //
- // Check input parameters.
- //
- if (RsaContext == NULL || MessageHash == NULL || Signature == NULL) {
- return FALSE;
- }
-
- if (SigSize > INT_MAX || SigSize == 0) {
- return FALSE;
- }
-
- //
- // Determine the message digest algorithm according to digest size.
- // Only MD5, SHA-1 or SHA-256 algorithm is supported.
- //
- switch (HashSize) {
- case MD5_DIGEST_SIZE:
- DigestType = NID_md5;
- break;
-
- case SHA1_DIGEST_SIZE:
- DigestType = NID_sha1;
- break;
-
- case SHA256_DIGEST_SIZE:
- DigestType = NID_sha256;
- break;
-
- default:
- return FALSE;
- }
-
- SigBuf = (UINT8 *) Signature;
- return (BOOLEAN) RSA_verify (
- DigestType,
- MessageHash,
- (UINT32) HashSize,
- SigBuf,
- (UINT32) SigSize,
- (RSA *) RsaContext
- );
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaExt.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaExt.c
deleted file mode 100644
index 8bf0c01..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaExt.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/** @file
- RSA Asymmetric Cipher Wrapper Implementation over OpenSSL.
-
- This file implements following APIs which provide more capabilities for RSA:
- 1) RsaGetKey
- 2) RsaGenerateKey
- 3) RsaCheckKey
- 4) RsaPkcs1Sign
-
-Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-#include
-#include
-#include
-#include
-
-/**
- Gets the tag-designated RSA key component from the established RSA context.
-
- This function retrieves the tag-designated RSA key component from the
- established RSA context as a non-negative integer (octet string format
- represented in RSA PKCS#1).
- If specified key component has not been set or has been cleared, then returned
- BnSize is set to 0.
- If the BigNumber buffer is too small to hold the contents of the key, FALSE
- is returned and BnSize is set to the required buffer size to obtain the key.
-
- If RsaContext is NULL, then return FALSE.
- If BnSize is NULL, then return FALSE.
- If BnSize is large enough but BigNumber is NULL, then return FALSE.
-
- @param[in, out] RsaContext Pointer to RSA context being set.
- @param[in] KeyTag Tag of RSA key component being set.
- @param[out] BigNumber Pointer to octet integer buffer.
- @param[in, out] BnSize On input, the size of big number buffer in bytes.
- On output, the size of data returned in big number buffer in bytes.
-
- @retval TRUE RSA key component was retrieved successfully.
- @retval FALSE Invalid RSA key component tag.
- @retval FALSE BnSize is too small.
-
-**/
-BOOLEAN
-EFIAPI
-RsaGetKey (
- IN OUT VOID *RsaContext,
- IN RSA_KEY_TAG KeyTag,
- OUT UINT8 *BigNumber,
- IN OUT UINTN *BnSize
- )
-{
- RSA *RsaKey;
- BIGNUM *BnKey;
- UINTN Size;
-
- //
- // Check input parameters.
- //
- if (RsaContext == NULL || BnSize == NULL) {
- return FALSE;
- }
-
- RsaKey = (RSA *) RsaContext;
- Size = *BnSize;
- *BnSize = 0;
- BnKey = NULL;
-
- switch (KeyTag) {
-
- //
- // RSA Public Modulus (N)
- //
- case RsaKeyN:
- RSA_get0_key (RsaKey, (const BIGNUM **)&BnKey, NULL, NULL);
- break;
-
- //
- // RSA Public Exponent (e)
- //
- case RsaKeyE:
- RSA_get0_key (RsaKey, NULL, (const BIGNUM **)&BnKey, NULL);
- break;
-
- //
- // RSA Private Exponent (d)
- //
- case RsaKeyD:
- RSA_get0_key (RsaKey, NULL, NULL, (const BIGNUM **)&BnKey);
- break;
-
- //
- // RSA Secret Prime Factor of Modulus (p)
- //
- case RsaKeyP:
- RSA_get0_factors (RsaKey, (const BIGNUM **)&BnKey, NULL);
- break;
-
- //
- // RSA Secret Prime Factor of Modules (q)
- //
- case RsaKeyQ:
- RSA_get0_factors (RsaKey, NULL, (const BIGNUM **)&BnKey);
- break;
-
- //
- // p's CRT Exponent (== d mod (p - 1))
- //
- case RsaKeyDp:
- RSA_get0_crt_params (RsaKey, (const BIGNUM **)&BnKey, NULL, NULL);
- break;
-
- //
- // q's CRT Exponent (== d mod (q - 1))
- //
- case RsaKeyDq:
- RSA_get0_crt_params (RsaKey, NULL, (const BIGNUM **)&BnKey, NULL);
- break;
-
- //
- // The CRT Coefficient (== 1/q mod p)
- //
- case RsaKeyQInv:
- RSA_get0_crt_params (RsaKey, NULL, NULL, (const BIGNUM **)&BnKey);
- break;
-
- default:
- return FALSE;
- }
-
- if (BnKey == NULL) {
- return FALSE;
- }
-
- *BnSize = Size;
- Size = BN_num_bytes (BnKey);
-
- if (*BnSize < Size) {
- *BnSize = Size;
- return FALSE;
- }
-
- if (BigNumber == NULL) {
- *BnSize = Size;
- return TRUE;
- }
- *BnSize = BN_bn2bin (BnKey, BigNumber) ;
-
- return TRUE;
-}
-
-/**
- Generates RSA key components.
-
- This function generates RSA key components. It takes RSA public exponent E and
- length in bits of RSA modulus N as input, and generates all key components.
- If PublicExponent is NULL, the default RSA public exponent (0x10001) will be used.
-
- Before this function can be invoked, pseudorandom number generator must be correctly
- initialized by RandomSeed().
-
- If RsaContext is NULL, then return FALSE.
-
- @param[in, out] RsaContext Pointer to RSA context being set.
- @param[in] ModulusLength Length of RSA modulus N in bits.
- @param[in] PublicExponent Pointer to RSA public exponent.
- @param[in] PublicExponentSize Size of RSA public exponent buffer in bytes.
-
- @retval TRUE RSA key component was generated successfully.
- @retval FALSE Invalid RSA key component tag.
-
-**/
-BOOLEAN
-EFIAPI
-RsaGenerateKey (
- IN OUT VOID *RsaContext,
- IN UINTN ModulusLength,
- IN CONST UINT8 *PublicExponent,
- IN UINTN PublicExponentSize
- )
-{
- BIGNUM *KeyE;
- BOOLEAN RetVal;
-
- //
- // Check input parameters.
- //
- if (RsaContext == NULL || ModulusLength > INT_MAX || PublicExponentSize > INT_MAX) {
- return FALSE;
- }
-
- KeyE = BN_new ();
- if (KeyE == NULL) {
- return FALSE;
- }
-
- RetVal = FALSE;
-
- if (PublicExponent == NULL) {
- if (BN_set_word (KeyE, 0x10001) == 0) {
- goto _Exit;
- }
- } else {
- if (BN_bin2bn (PublicExponent, (UINT32) PublicExponentSize, KeyE) == NULL) {
- goto _Exit;
- }
- }
-
- if (RSA_generate_key_ex ((RSA *) RsaContext, (UINT32) ModulusLength, KeyE, NULL) == 1) {
- RetVal = TRUE;
- }
-
-_Exit:
- BN_free (KeyE);
- return RetVal;
-}
-
-/**
- Validates key components of RSA context.
- NOTE: This function performs integrity checks on all the RSA key material, so
- the RSA key structure must contain all the private key data.
-
- This function validates key components of RSA context in following aspects:
- - Whether p is a prime
- - Whether q is a prime
- - Whether n = p * q
- - Whether d*e = 1 mod lcm(p-1,q-1)
-
- If RsaContext is NULL, then return FALSE.
-
- @param[in] RsaContext Pointer to RSA context to check.
-
- @retval TRUE RSA key components are valid.
- @retval FALSE RSA key components are not valid.
-
-**/
-BOOLEAN
-EFIAPI
-RsaCheckKey (
- IN VOID *RsaContext
- )
-{
- UINTN Reason;
-
- //
- // Check input parameters.
- //
- if (RsaContext == NULL) {
- return FALSE;
- }
-
- if (RSA_check_key ((RSA *) RsaContext) != 1) {
- Reason = ERR_GET_REASON (ERR_peek_last_error ());
- if (Reason == RSA_R_P_NOT_PRIME ||
- Reason == RSA_R_Q_NOT_PRIME ||
- Reason == RSA_R_N_DOES_NOT_EQUAL_P_Q ||
- Reason == RSA_R_D_E_NOT_CONGRUENT_TO_1) {
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-/**
- Carries out the RSA-SSA signature generation with EMSA-PKCS1-v1_5 encoding scheme.
-
- This function carries out the RSA-SSA signature generation with EMSA-PKCS1-v1_5 encoding scheme defined in
- RSA PKCS#1.
- If the Signature buffer is too small to hold the contents of signature, FALSE
- is returned and SigSize is set to the required buffer size to obtain the signature.
-
- If RsaContext is NULL, then return FALSE.
- If MessageHash is NULL, then return FALSE.
- If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.
- If SigSize is large enough but Signature is NULL, then return FALSE.
-
- @param[in] RsaContext Pointer to RSA context for signature generation.
- @param[in] MessageHash Pointer to octet message hash to be signed.
- @param[in] HashSize Size of the message hash in bytes.
- @param[out] Signature Pointer to buffer to receive RSA PKCS1-v1_5 signature.
- @param[in, out] SigSize On input, the size of Signature buffer in bytes.
- On output, the size of data returned in Signature buffer in bytes.
-
- @retval TRUE Signature successfully generated in PKCS1-v1_5.
- @retval FALSE Signature generation failed.
- @retval FALSE SigSize is too small.
-
-**/
-BOOLEAN
-EFIAPI
-RsaPkcs1Sign (
- IN VOID *RsaContext,
- IN CONST UINT8 *MessageHash,
- IN UINTN HashSize,
- OUT UINT8 *Signature,
- IN OUT UINTN *SigSize
- )
-{
- RSA *Rsa;
- UINTN Size;
- INT32 DigestType;
-
- //
- // Check input parameters.
- //
- if (RsaContext == NULL || MessageHash == NULL) {
- return FALSE;
- }
-
- Rsa = (RSA *) RsaContext;
- Size = RSA_size (Rsa);
-
- if (*SigSize < Size) {
- *SigSize = Size;
- return FALSE;
- }
-
- if (Signature == NULL) {
- return FALSE;
- }
-
- //
- // Determine the message digest algorithm according to digest size.
- // Only MD5, SHA-1 or SHA-256 algorithm is supported.
- //
- switch (HashSize) {
- case MD5_DIGEST_SIZE:
- DigestType = NID_md5;
- break;
-
- case SHA1_DIGEST_SIZE:
- DigestType = NID_sha1;
- break;
-
- case SHA256_DIGEST_SIZE:
- DigestType = NID_sha256;
- break;
-
- default:
- return FALSE;
- }
-
- return (BOOLEAN) RSA_sign (
- DigestType,
- MessageHash,
- (UINT32) HashSize,
- Signature,
- (UINT32 *) SigSize,
- (RSA *) RsaContext
- );
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaExtNull.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaExtNull.c
deleted file mode 100644
index 0d1b204..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaExtNull.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/** @file
- RSA Asymmetric Cipher Wrapper Implementation over OpenSSL.
-
- This file does not provide real capabilities for following APIs in RSA handling:
- 1) RsaGetKey
- 2) RsaGenerateKey
- 3) RsaCheckKey
- 4) RsaPkcs1Sign
-
-Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Gets the tag-designated RSA key component from the established RSA context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] RsaContext Pointer to RSA context being set.
- @param[in] KeyTag Tag of RSA key component being set.
- @param[out] BigNumber Pointer to octet integer buffer.
- @param[in, out] BnSize On input, the size of big number buffer in bytes.
- On output, the size of data returned in big number buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-RsaGetKey (
- IN OUT VOID *RsaContext,
- IN RSA_KEY_TAG KeyTag,
- OUT UINT8 *BigNumber,
- IN OUT UINTN *BnSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Generates RSA key components.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] RsaContext Pointer to RSA context being set.
- @param[in] ModulusLength Length of RSA modulus N in bits.
- @param[in] PublicExponent Pointer to RSA public exponent.
- @param[in] PublicExponentSize Size of RSA public exponent buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-RsaGenerateKey (
- IN OUT VOID *RsaContext,
- IN UINTN ModulusLength,
- IN CONST UINT8 *PublicExponent,
- IN UINTN PublicExponentSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Validates key components of RSA context.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] RsaContext Pointer to RSA context to check.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-RsaCheckKey (
- IN VOID *RsaContext
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Carries out the RSA-SSA signature generation with EMSA-PKCS1-v1_5 encoding scheme.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] RsaContext Pointer to RSA context for signature generation.
- @param[in] MessageHash Pointer to octet message hash to be signed.
- @param[in] HashSize Size of the message hash in bytes.
- @param[out] Signature Pointer to buffer to receive RSA PKCS1-v1_5 signature.
- @param[in, out] SigSize On input, the size of Signature buffer in bytes.
- On output, the size of data returned in Signature buffer in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-RsaPkcs1Sign (
- IN VOID *RsaContext,
- IN CONST UINT8 *MessageHash,
- IN UINTN HashSize,
- OUT UINT8 *Signature,
- IN OUT UINTN *SigSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c
deleted file mode 100644
index 10715bd..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/** @file
- RFC3161 Timestamp Countersignature Verification over OpenSSL.
- The timestamp is generated by a TimeStamping Authority (TSA) and asserts that a
- publisher's signature existed before the specified time. The timestamp extends
- the lifetime of the signature when a signing certificate expires or is later
- revoked.
-
-Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-#include
-#include
-#include
-#include
-#include
-
-//
-// OID ASN.1 Value for SPC_RFC3161_OBJID ("1.3.6.1.4.1.311.3.3.1")
-//
-UINT8 mSpcRFC3161OidValue[] = {
- 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x03, 0x03, 0x01
- };
-
-///
-/// The messageImprint field SHOULD contain the hash of the datum to be
-/// time-stamped. The hash is represented as an OCTET STRING. Its
-/// length MUST match the length of the hash value for that algorithm
-/// (e.g., 20 bytes for SHA-1 or 16 bytes for MD5).
-///
-/// MessageImprint ::= SEQUENCE {
-/// hashAlgorithm AlgorithmIdentifier,
-/// hashedMessage OCTET STRING }
-///
-typedef struct {
- X509_ALGOR *HashAlgorithm;
- ASN1_OCTET_STRING *HashedMessage;
-} TS_MESSAGE_IMPRINT;
-
-//
-// ASN.1 Functions for TS_MESSAGE_IMPRINT
-//
-DECLARE_ASN1_FUNCTIONS (TS_MESSAGE_IMPRINT)
-ASN1_SEQUENCE (TS_MESSAGE_IMPRINT) = {
- ASN1_SIMPLE (TS_MESSAGE_IMPRINT, HashAlgorithm, X509_ALGOR),
- ASN1_SIMPLE (TS_MESSAGE_IMPRINT, HashedMessage, ASN1_OCTET_STRING)
-} ASN1_SEQUENCE_END (TS_MESSAGE_IMPRINT)
-IMPLEMENT_ASN1_FUNCTIONS (TS_MESSAGE_IMPRINT)
-
-///
-/// Accuracy represents the time deviation around the UTC time contained
-/// in GeneralizedTime of time-stamp token.
-///
-/// Accuracy ::= SEQUENCE {
-/// seconds INTEGER OPTIONAL,
-/// millis [0] INTEGER (1..999) OPTIONAL,
-/// micros [1] INTEGER (1..999) OPTIONAL }
-///
-typedef struct {
- ASN1_INTEGER *Seconds;
- ASN1_INTEGER *Millis;
- ASN1_INTEGER *Micros;
-} TS_ACCURACY;
-
-//
-// ASN.1 Functions for TS_ACCURACY
-//
-DECLARE_ASN1_FUNCTIONS (TS_ACCURACY)
-ASN1_SEQUENCE (TS_ACCURACY) = {
- ASN1_OPT (TS_ACCURACY, Seconds, ASN1_INTEGER),
- ASN1_IMP_OPT (TS_ACCURACY, Millis, ASN1_INTEGER, 0),
- ASN1_IMP_OPT (TS_ACCURACY, Micros, ASN1_INTEGER, 1)
-} ASN1_SEQUENCE_END (TS_ACCURACY)
-IMPLEMENT_ASN1_FUNCTIONS (TS_ACCURACY)
-
-///
-/// The timestamp token info resulting from a successful timestamp request,
-/// as defined in RFC 3161.
-///
-/// TSTInfo ::= SEQUENCE {
-/// version INTEGER { v1(1) },
-/// policy TSAPolicyId,
-/// messageImprint MessageImprint,
-/// -- MUST have the same value as the similar field in
-/// -- TimeStampReq
-/// serialNumber INTEGER,
-/// -- Time-Stamping users MUST be ready to accommodate integers
-/// -- up to 160 bits.
-/// genTime GeneralizedTime,
-/// accuracy Accuracy OPTIONAL,
-/// ordering BOOLEAN DEFAULT FALSE,
-/// nonce INTEGER OPTIONAL,
-/// -- MUST be present if the similar field was present
-/// -- in TimeStampReq. In that case it MUST have the same value.
-/// tsa [0] GeneralName OPTIONAL,
-/// extensions [1] IMPLICIT Extensions OPTIONAL }
-///
-typedef struct {
- ASN1_INTEGER *Version;
- ASN1_OBJECT *Policy;
- TS_MESSAGE_IMPRINT *MessageImprint;
- ASN1_INTEGER *SerialNumber;
- ASN1_GENERALIZEDTIME *GenTime;
- TS_ACCURACY *Accuracy;
- ASN1_BOOLEAN Ordering;
- ASN1_INTEGER *Nonce;
- GENERAL_NAME *Tsa;
- STACK_OF(X509_EXTENSION) *Extensions;
-} TS_TST_INFO;
-
-//
-// ASN.1 Functions for TS_TST_INFO
-//
-DECLARE_ASN1_FUNCTIONS (TS_TST_INFO)
-ASN1_SEQUENCE (TS_TST_INFO) = {
- ASN1_SIMPLE (TS_TST_INFO, Version, ASN1_INTEGER),
- ASN1_SIMPLE (TS_TST_INFO, Policy, ASN1_OBJECT),
- ASN1_SIMPLE (TS_TST_INFO, MessageImprint, TS_MESSAGE_IMPRINT),
- ASN1_SIMPLE (TS_TST_INFO, SerialNumber, ASN1_INTEGER),
- ASN1_SIMPLE (TS_TST_INFO, GenTime, ASN1_GENERALIZEDTIME),
- ASN1_OPT (TS_TST_INFO, Accuracy, TS_ACCURACY),
- ASN1_OPT (TS_TST_INFO, Ordering, ASN1_FBOOLEAN),
- ASN1_OPT (TS_TST_INFO, Nonce, ASN1_INTEGER),
- ASN1_EXP_OPT(TS_TST_INFO, Tsa, GENERAL_NAME, 0),
- ASN1_IMP_SEQUENCE_OF_OPT (TS_TST_INFO, Extensions, X509_EXTENSION, 1)
-} ASN1_SEQUENCE_END (TS_TST_INFO)
-IMPLEMENT_ASN1_FUNCTIONS (TS_TST_INFO)
-
-
-/**
- Convert ASN.1 GeneralizedTime to EFI Time.
-
- @param[in] Asn1Time Pointer to the ASN.1 GeneralizedTime to be converted.
- @param[out] SigningTime Return the corresponding EFI Time.
-
- @retval TRUE The time conversion succeeds.
- @retval FALSE Invalid parameters.
-
-**/
-BOOLEAN
-EFIAPI
-ConvertAsn1TimeToEfiTime (
- IN ASN1_TIME *Asn1Time,
- OUT EFI_TIME *EfiTime
- )
-{
- CONST CHAR8 *Str;
- UINTN Index;
-
- if ((Asn1Time == NULL) || (EfiTime == NULL)) {
- return FALSE;
- }
-
- Str = (CONST CHAR8*)Asn1Time->data;
- SetMem (EfiTime, 0, sizeof (EFI_TIME));
-
- Index = 0;
- if (Asn1Time->type == V_ASN1_UTCTIME) { /* two digit year */
- EfiTime->Year = (Str[Index++] - '0') * 10;
- EfiTime->Year += (Str[Index++] - '0');
- if (EfiTime->Year < 70) {
- EfiTime->Year += 100;
- }
- } else if (Asn1Time->type == V_ASN1_GENERALIZEDTIME) { /* four digit year */
- EfiTime->Year = (Str[Index++] - '0') * 1000;
- EfiTime->Year += (Str[Index++] - '0') * 100;
- EfiTime->Year += (Str[Index++] - '0') * 10;
- EfiTime->Year += (Str[Index++] - '0');
- if ((EfiTime->Year < 1900) || (EfiTime->Year > 9999)) {
- return FALSE;
- }
- }
-
- EfiTime->Month = (Str[Index++] - '0') * 10;
- EfiTime->Month += (Str[Index++] - '0');
- if ((EfiTime->Month < 1) || (EfiTime->Month > 12)) {
- return FALSE;
- }
-
- EfiTime->Day = (Str[Index++] - '0') * 10;
- EfiTime->Day += (Str[Index++] - '0');
- if ((EfiTime->Day < 1) || (EfiTime->Day > 31)) {
- return FALSE;
- }
-
- EfiTime->Hour = (Str[Index++] - '0') * 10;
- EfiTime->Hour += (Str[Index++] - '0');
- if (EfiTime->Hour > 23) {
- return FALSE;
- }
-
- EfiTime->Minute = (Str[Index++] - '0') * 10;
- EfiTime->Minute += (Str[Index++] - '0');
- if (EfiTime->Minute > 59) {
- return FALSE;
- }
-
- EfiTime->Second = (Str[Index++] - '0') * 10;
- EfiTime->Second += (Str[Index++] - '0');
- if (EfiTime->Second > 59) {
- return FALSE;
- }
-
- /* Note: we did not adjust the time based on time zone information */
-
- return TRUE;
-}
-
-/**
-
- Check the validity of TimeStamp Token Information.
-
- @param[in] TstInfo Pointer to the TS_TST_INFO structure.
- @param[in] TimestampedData Pointer to the data to be time-stamped.
- @param[in] DataSize Size of timestamped data in bytes.
-
- @retval TRUE The TimeStamp Token Information is valid.
- @retval FALSE Invalid TimeStamp Token Information.
-
-**/
-BOOLEAN
-EFIAPI
-CheckTSTInfo (
- IN CONST TS_TST_INFO *TstInfo,
- IN CONST UINT8 *TimestampedData,
- IN UINTN DataSize
- )
-{
- BOOLEAN Status;
- TS_MESSAGE_IMPRINT *Imprint;
- X509_ALGOR *HashAlgo;
- CONST EVP_MD *Md;
- EVP_MD_CTX *MdCtx;
- UINTN MdSize;
- UINT8 *HashedMsg;
-
- //
- // Initialization
- //
- Status = FALSE;
- HashAlgo = NULL;
- HashedMsg = NULL;
- MdCtx = NULL;
-
- //
- // -- Check version number of Timestamp:
- // The version field (currently v1) describes the version of the time-stamp token.
- // Conforming time-stamping servers MUST be able to provide version 1 time-stamp tokens.
- //
- if ((ASN1_INTEGER_get (TstInfo->Version)) != 1) {
- return FALSE;
- }
-
- //
- // -- Check Policies
- // The policy field MUST indicate the TSA's policy under which the response was produced.
- //
- if (TstInfo->Policy == NULL) {
- /// NOTE: Need to check if the requested and returned policies.
- /// We have no information about the Requested TSA Policy.
- return FALSE;
- }
-
- //
- // -- Compute & Check Message Imprint
- //
- Imprint = TstInfo->MessageImprint;
- HashAlgo = X509_ALGOR_dup (Imprint->HashAlgorithm);
-
- Md = EVP_get_digestbyobj (HashAlgo->algorithm);
- if (Md == NULL) {
- goto _Exit;
- }
-
- MdSize = EVP_MD_size (Md);
- HashedMsg = AllocateZeroPool (MdSize);
- if (HashedMsg == NULL) {
- goto _Exit;
- }
- MdCtx = EVP_MD_CTX_new ();
- if (MdCtx == NULL) {
- goto _Exit;
- }
- if ((EVP_DigestInit_ex (MdCtx, Md, NULL) != 1) ||
- (EVP_DigestUpdate (MdCtx, TimestampedData, DataSize) != 1) ||
- (EVP_DigestFinal (MdCtx, HashedMsg, NULL) != 1)) {
- goto _Exit;
- }
- if ((MdSize == (UINTN)ASN1_STRING_length (Imprint->HashedMessage)) &&
- (CompareMem (HashedMsg, ASN1_STRING_get0_data (Imprint->HashedMessage), MdSize) != 0)) {
- goto _Exit;
- }
-
- //
- // -- Check Nonces
- //
- if (TstInfo->Nonce != NULL) {
- //
- // Nonces is optional, No error if no nonce is returned;
- //
- }
-
- //
- // -- Check if the TSA name and signer certificate is matched.
- //
- if (TstInfo->Tsa != NULL) {
- //
- // Ignored the optional Tsa field checking.
- //
- }
-
- Status = TRUE;
-
-_Exit:
- X509_ALGOR_free (HashAlgo);
- EVP_MD_CTX_free (MdCtx);
- if (HashedMsg != NULL) {
- FreePool (HashedMsg);
- }
-
- return Status;
-}
-
-/**
- Verifies the validity of a TimeStamp Token as described in RFC 3161 ("Internet
- X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)").
-
- If TSToken is NULL, then return FALSE.
- If TimestampedData is NULL, then return FALSE.
-
- @param[in] TSToken Pointer to the RFC3161 TimeStamp Token, which is generated
- by a TSA and located in the software publisher's SignerInfo
- structure.
- @param[in] TokenSize Size of the TimeStamp Token in bytes.
- @param[in] TsaCert Pointer to a trusted/root TSA certificate encoded in DER.
- @param[in] CertSize Size of the trusted TSA certificate in bytes.
- @param[in] TimestampedData Pointer to the data to be time-stamped.
- @param[in] DataSize Size of timestamped data in bytes.
- @param[out] SigningTime Return the time of timestamp generation time if the timestamp
- signature is valid.
-
- @retval TRUE The specified timestamp token is valid.
- @retval FALSE Invalid timestamp token.
-
-**/
-BOOLEAN
-EFIAPI
-TimestampTokenVerify (
- IN CONST UINT8 *TSToken,
- IN UINTN TokenSize,
- IN CONST UINT8 *TsaCert,
- IN UINTN CertSize,
- IN CONST UINT8 *TimestampedData,
- IN UINTN DataSize,
- OUT EFI_TIME *SigningTime
- )
-{
- BOOLEAN Status;
- CONST UINT8 *TokenTemp;
- PKCS7 *Pkcs7;
- X509 *Cert;
- CONST UINT8 *CertTemp;
- X509_STORE *CertStore;
- BIO *OutBio;
- UINT8 *TstData;
- UINTN TstSize;
- CONST UINT8 *TstTemp;
- TS_TST_INFO *TstInfo;
-
- Status = FALSE;
-
- //
- // Check input parameters
- //
- if ((TSToken == NULL) || (TsaCert == NULL) || (TimestampedData == NULL) ||
- (TokenSize > INT_MAX) || (CertSize > INT_MAX) || (DataSize > INT_MAX)) {
- return FALSE;
- }
-
- //
- // Initializations
- //
- if (SigningTime != NULL) {
- SetMem (SigningTime, sizeof (EFI_TIME), 0);
- }
- Pkcs7 = NULL;
- Cert = NULL;
- CertStore = NULL;
- OutBio = NULL;
- TstData = NULL;
- TstInfo = NULL;
-
- //
- // TimeStamp Token should contain one valid DER-encoded ASN.1 PKCS#7 structure.
- //
- TokenTemp = TSToken;
- Pkcs7 = d2i_PKCS7 (NULL, (const unsigned char **) &TokenTemp, (int) TokenSize);
- if (Pkcs7 == NULL) {
- goto _Exit;
- }
-
- //
- // The timestamp signature (TSA's response) will be one PKCS#7 signed data.
- //
- if (!PKCS7_type_is_signed (Pkcs7)) {
- goto _Exit;
- }
-
- //
- // Read the trusted TSA certificate (DER-encoded), and Construct X509 Certificate.
- //
- CertTemp = TsaCert;
- Cert = d2i_X509 (NULL, &CertTemp, (long) CertSize);
- if (Cert == NULL) {
- goto _Exit;
- }
-
- //
- // Setup X509 Store for trusted certificate.
- //
- CertStore = X509_STORE_new ();
- if ((CertStore == NULL) || !(X509_STORE_add_cert (CertStore, Cert))) {
- goto _Exit;
- }
-
- //
- // Allow partial certificate chains, terminated by a non-self-signed but
- // still trusted intermediate certificate. Also disable time checks.
- //
- X509_STORE_set_flags (CertStore,
- X509_V_FLAG_PARTIAL_CHAIN | X509_V_FLAG_NO_CHECK_TIME);
-
- X509_STORE_set_purpose (CertStore, X509_PURPOSE_ANY);
-
- //
- // Verifies the PKCS#7 signedData structure, and output the signed contents.
- //
- OutBio = BIO_new (BIO_s_mem ());
- if (OutBio == NULL) {
- goto _Exit;
- }
- if (!PKCS7_verify (Pkcs7, NULL, CertStore, NULL, OutBio, PKCS7_BINARY)) {
- goto _Exit;
- }
-
- //
- // Read the signed contents detached in timestamp signature.
- //
- TstData = AllocateZeroPool (2048);
- if (TstData == NULL) {
- goto _Exit;
- }
- TstSize = BIO_read (OutBio, (void *) TstData, 2048);
-
- //
- // Construct TS_TST_INFO structure from the signed contents.
- //
- TstTemp = TstData;
- TstInfo = d2i_TS_TST_INFO (NULL, (const unsigned char **) &TstTemp,
- (int)TstSize);
- if (TstInfo == NULL) {
- goto _Exit;
- }
-
- //
- // Check TS_TST_INFO structure.
- //
- Status = CheckTSTInfo (TstInfo, TimestampedData, DataSize);
- if (!Status) {
- goto _Exit;
- }
-
- //
- // Retrieve the signing time from TS_TST_INFO structure.
- //
- if (SigningTime != NULL) {
- SetMem (SigningTime, sizeof (EFI_TIME), 0);
- Status = ConvertAsn1TimeToEfiTime (TstInfo->GenTime, SigningTime);
- }
-
-_Exit:
- //
- // Release Resources
- //
- PKCS7_free (Pkcs7);
- X509_free (Cert);
- X509_STORE_free (CertStore);
- BIO_free (OutBio);
- TS_TST_INFO_free (TstInfo);
-
- if (TstData != NULL) {
- FreePool (TstData);
- }
-
- return Status;
-}
-
-/**
- Verifies the validity of a RFC3161 Timestamp CounterSignature embedded in PE/COFF Authenticode
- signature.
-
- If AuthData is NULL, then return FALSE.
-
- @param[in] AuthData Pointer to the Authenticode Signature retrieved from signed
- PE/COFF image to be verified.
- @param[in] DataSize Size of the Authenticode Signature in bytes.
- @param[in] TsaCert Pointer to a trusted/root TSA certificate encoded in DER, which
- is used for TSA certificate chain verification.
- @param[in] CertSize Size of the trusted certificate in bytes.
- @param[out] SigningTime Return the time of timestamp generation time if the timestamp
- signature is valid.
-
- @retval TRUE The specified Authenticode includes a valid RFC3161 Timestamp CounterSignature.
- @retval FALSE No valid RFC3161 Timestamp CounterSignature in the specified Authenticode data.
-
-**/
-BOOLEAN
-EFIAPI
-ImageTimestampVerify (
- IN CONST UINT8 *AuthData,
- IN UINTN DataSize,
- IN CONST UINT8 *TsaCert,
- IN UINTN CertSize,
- OUT EFI_TIME *SigningTime
- )
-{
- BOOLEAN Status;
- PKCS7 *Pkcs7;
- CONST UINT8 *Temp;
- STACK_OF(PKCS7_SIGNER_INFO) *SignerInfos;
- PKCS7_SIGNER_INFO *SignInfo;
- UINTN Index;
- STACK_OF(X509_ATTRIBUTE) *Sk;
- X509_ATTRIBUTE *Xa;
- ASN1_OBJECT *XaObj;
- ASN1_TYPE *Asn1Type;
- ASN1_OCTET_STRING *EncDigest;
- UINT8 *TSToken;
- UINTN TokenSize;
-
- //
- // Input Parameters Checking.
- //
- if ((AuthData == NULL) || (TsaCert == NULL)) {
- return FALSE;
- }
-
- if ((DataSize > INT_MAX) || (CertSize > INT_MAX)) {
- return FALSE;
- }
-
- //
- // Register & Initialize necessary digest algorithms for PKCS#7 Handling.
- //
- if ((EVP_add_digest (EVP_md5 ()) == 0) || (EVP_add_digest (EVP_sha1 ()) == 0) ||
- (EVP_add_digest (EVP_sha256 ()) == 0) || (EVP_add_digest_alias (SN_sha1WithRSAEncryption, SN_sha1WithRSA)) == 0) {
- return FALSE;
- }
-
- //
- // Initialization.
- //
- Status = FALSE;
- Pkcs7 = NULL;
- SignInfo = NULL;
-
- //
- // Decode ASN.1-encoded Authenticode data into PKCS7 structure.
- //
- Temp = AuthData;
- Pkcs7 = d2i_PKCS7 (NULL, (const unsigned char **) &Temp, (int) DataSize);
- if (Pkcs7 == NULL) {
- goto _Exit;
- }
-
- //
- // Check if there is one and only one signer.
- //
- SignerInfos = PKCS7_get_signer_info (Pkcs7);
- if (!SignerInfos || (sk_PKCS7_SIGNER_INFO_num (SignerInfos) != 1)) {
- goto _Exit;
- }
-
- //
- // Locate the TimeStamp CounterSignature.
- //
- SignInfo = sk_PKCS7_SIGNER_INFO_value (SignerInfos, 0);
- if (SignInfo == NULL) {
- goto _Exit;
- }
-
- //
- // Locate Message Digest which will be the data to be time-stamped.
- //
- EncDigest = SignInfo->enc_digest;
- if (EncDigest == NULL) {
- goto _Exit;
- }
-
- //
- // The RFC3161 timestamp counterSignature is contained in unauthenticatedAttributes field
- // of SignerInfo.
- //
- Sk = SignInfo->unauth_attr;
- if (Sk == NULL) { // No timestamp counterSignature.
- goto _Exit;
- }
-
- Asn1Type = NULL;
- for (Index = 0; Index < (UINTN) sk_X509_ATTRIBUTE_num (Sk); Index++) {
- //
- // Search valid RFC3161 timestamp counterSignature based on OBJID.
- //
- Xa = sk_X509_ATTRIBUTE_value (Sk, (int)Index);
- if (Xa == NULL) {
- continue;
- }
- XaObj = X509_ATTRIBUTE_get0_object(Xa);
- if (XaObj == NULL) {
- continue;
- }
- if ((OBJ_length(XaObj) != sizeof (mSpcRFC3161OidValue)) ||
- (CompareMem (OBJ_get0_data(XaObj), mSpcRFC3161OidValue, sizeof (mSpcRFC3161OidValue)) != 0)) {
- continue;
- }
- Asn1Type = X509_ATTRIBUTE_get0_type(Xa, 0);
- }
-
- if (Asn1Type == NULL) {
- Status = FALSE;
- goto _Exit;
- }
- TSToken = Asn1Type->value.octet_string->data;
- TokenSize = Asn1Type->value.octet_string->length;
-
- //
- // TimeStamp counterSignature (Token) verification.
- //
- Status = TimestampTokenVerify (
- TSToken,
- TokenSize,
- TsaCert,
- CertSize,
- EncDigest->data,
- EncDigest->length,
- SigningTime
- );
-
-_Exit:
- //
- // Release Resources
- //
- PKCS7_free (Pkcs7);
-
- return Status;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptTsNull.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptTsNull.c
deleted file mode 100644
index 3a9b5f2..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptTsNull.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file
- RFC3161 Timestamp Countersignature Verification Wrapper Implementation which does
- not provide real capabilities.
-
-Copyright (c) 2014, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Verifies the validity of a RFC3161 Timestamp CounterSignature embedded in PE/COFF Authenticode
- signature.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] AuthData Pointer to the Authenticode Signature retrieved from signed
- PE/COFF image to be verified.
- @param[in] DataSize Size of the Authenticode Signature in bytes.
- @param[in] TsaCert Pointer to a trusted/root TSA certificate encoded in DER, which
- is used for TSA certificate chain verification.
- @param[in] CertSize Size of the trusted certificate in bytes.
- @param[out] SigningTime Return the time of timestamp generation time if the timestamp
- signature is valid.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-ImageTimestampVerify (
- IN CONST UINT8 *AuthData,
- IN UINTN DataSize,
- IN CONST UINT8 *TsaCert,
- IN UINTN CertSize,
- OUT EFI_TIME *SigningTime
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c
deleted file mode 100644
index 7424b80..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c
+++ /dev/null
@@ -1,730 +0,0 @@
-/** @file
- X.509 Certificate Handler Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-#include
-
-/**
- Construct a X509 object from DER-encoded certificate data.
-
- If Cert is NULL, then return FALSE.
- If SingleX509Cert is NULL, then return FALSE.
-
- @param[in] Cert Pointer to the DER-encoded certificate data.
- @param[in] CertSize The size of certificate data in bytes.
- @param[out] SingleX509Cert The generated X509 object.
-
- @retval TRUE The X509 object generation succeeded.
- @retval FALSE The operation failed.
-
-**/
-BOOLEAN
-EFIAPI
-X509ConstructCertificate (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- OUT UINT8 **SingleX509Cert
- )
-{
- X509 *X509Cert;
- CONST UINT8 *Temp;
-
- //
- // Check input parameters.
- //
- if (Cert == NULL || SingleX509Cert == NULL || CertSize > INT_MAX) {
- return FALSE;
- }
-
- //
- // Read DER-encoded X509 Certificate and Construct X509 object.
- //
- Temp = Cert;
- X509Cert = d2i_X509 (NULL, &Temp, (long) CertSize);
- if (X509Cert == NULL) {
- return FALSE;
- }
-
- *SingleX509Cert = (UINT8 *) X509Cert;
-
- return TRUE;
-}
-
-/**
- Construct a X509 stack object from a list of DER-encoded certificate data.
-
- If X509Stack is NULL, then return FALSE.
-
- @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.
- On output, pointer to the X509 stack object with new
- inserted X509 certificate.
- @param ... A list of DER-encoded single certificate data followed
- by certificate size. A NULL terminates the list. The
- pairs are the arguments to X509ConstructCertificate().
-
- @retval TRUE The X509 stack construction succeeded.
- @retval FALSE The construction operation failed.
-
-**/
-BOOLEAN
-EFIAPI
-X509ConstructCertificateStack (
- IN OUT UINT8 **X509Stack,
- ...
- )
-{
- UINT8 *Cert;
- UINTN CertSize;
- X509 *X509Cert;
- STACK_OF(X509) *CertStack;
- BOOLEAN Status;
- VA_LIST Args;
- UINTN Index;
-
- //
- // Check input parameters.
- //
- if (X509Stack == NULL) {
- return FALSE;
- }
-
- Status = FALSE;
-
- //
- // Initialize X509 stack object.
- //
- CertStack = (STACK_OF(X509) *) (*X509Stack);
- if (CertStack == NULL) {
- CertStack = sk_X509_new_null ();
- if (CertStack == NULL) {
- return Status;
- }
- }
-
- VA_START (Args, X509Stack);
-
- for (Index = 0; ; Index++) {
- //
- // If Cert is NULL, then it is the end of the list.
- //
- Cert = VA_ARG (Args, UINT8 *);
- if (Cert == NULL) {
- break;
- }
-
- CertSize = VA_ARG (Args, UINTN);
- if (CertSize == 0) {
- break;
- }
-
- //
- // Construct X509 Object from the given DER-encoded certificate data.
- //
- X509Cert = NULL;
- Status = X509ConstructCertificate (
- (CONST UINT8 *) Cert,
- CertSize,
- (UINT8 **) &X509Cert
- );
- if (!Status) {
- if (X509Cert != NULL) {
- X509_free (X509Cert);
- }
- break;
- }
-
- //
- // Insert the new X509 object into X509 stack object.
- //
- sk_X509_push (CertStack, X509Cert);
- }
-
- VA_END (Args);
-
- if (!Status) {
- sk_X509_pop_free (CertStack, X509_free);
- } else {
- *X509Stack = (UINT8 *) CertStack;
- }
-
- return Status;
-}
-
-/**
- Release the specified X509 object.
-
- If X509Cert is NULL, then return FALSE.
-
- @param[in] X509Cert Pointer to the X509 object to be released.
-
-**/
-VOID
-EFIAPI
-X509Free (
- IN VOID *X509Cert
- )
-{
- //
- // Check input parameters.
- //
- if (X509Cert == NULL) {
- return;
- }
-
- //
- // Free OpenSSL X509 object.
- //
- X509_free ((X509 *) X509Cert);
-}
-
-/**
- Release the specified X509 stack object.
-
- If X509Stack is NULL, then return FALSE.
-
- @param[in] X509Stack Pointer to the X509 stack object to be released.
-
-**/
-VOID
-EFIAPI
-X509StackFree (
- IN VOID *X509Stack
- )
-{
- //
- // Check input parameters.
- //
- if (X509Stack == NULL) {
- return;
- }
-
- //
- // Free OpenSSL X509 stack object.
- //
- sk_X509_pop_free ((STACK_OF(X509) *) X509Stack, X509_free);
-}
-
-/**
- Retrieve the subject bytes from one X.509 certificate.
-
- @param[in] Cert Pointer to the DER-encoded X509 certificate.
- @param[in] CertSize Size of the X509 certificate in bytes.
- @param[out] CertSubject Pointer to the retrieved certificate subject bytes.
- @param[in, out] SubjectSize The size in bytes of the CertSubject buffer on input,
- and the size of buffer returned CertSubject on output.
-
- If Cert is NULL, then return FALSE.
- If SubjectSize is NULL, then return FALSE.
-
- @retval TRUE The certificate subject retrieved successfully.
- @retval FALSE Invalid certificate, or the SubjectSize is too small for the result.
- The SubjectSize will be updated with the required size.
-
-**/
-BOOLEAN
-EFIAPI
-X509GetSubjectName (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- OUT UINT8 *CertSubject,
- IN OUT UINTN *SubjectSize
- )
-{
- BOOLEAN Status;
- X509 *X509Cert;
- X509_NAME *X509Name;
- UINTN X509NameSize;
-
- //
- // Check input parameters.
- //
- if (Cert == NULL || SubjectSize == NULL) {
- return FALSE;
- }
-
- X509Cert = NULL;
-
- //
- // Read DER-encoded X509 Certificate and Construct X509 object.
- //
- Status = X509ConstructCertificate (Cert, CertSize, (UINT8 **) &X509Cert);
- if ((X509Cert == NULL) || (!Status)) {
- Status = FALSE;
- goto _Exit;
- }
-
- Status = FALSE;
-
- //
- // Retrieve subject name from certificate object.
- //
- X509Name = X509_get_subject_name (X509Cert);
- if (X509Name == NULL) {
- goto _Exit;
- }
-
- X509NameSize = i2d_X509_NAME(X509Name, NULL);
- if (*SubjectSize < X509NameSize) {
- *SubjectSize = X509NameSize;
- goto _Exit;
- }
- *SubjectSize = X509NameSize;
- if (CertSubject != NULL) {
- i2d_X509_NAME(X509Name, &CertSubject);
- Status = TRUE;
- }
-
-_Exit:
- //
- // Release Resources.
- //
- if (X509Cert != NULL) {
- X509_free (X509Cert);
- }
-
- return Status;
-}
-
-/**
- Retrieve the common name (CN) string from one X.509 certificate.
-
- @param[in] Cert Pointer to the DER-encoded X509 certificate.
- @param[in] CertSize Size of the X509 certificate in bytes.
- @param[out] CommonName Buffer to contain the retrieved certificate common
- name string (UTF8). At most CommonNameSize bytes will be
- written and the string will be null terminated. May be
- NULL in order to determine the size buffer needed.
- @param[in,out] CommonNameSize The size in bytes of the CommonName buffer on input,
- and the size of buffer returned CommonName on output.
- If CommonName is NULL then the amount of space needed
- in buffer (including the final null) is returned.
-
- @retval RETURN_SUCCESS The certificate CommonName retrieved successfully.
- @retval RETURN_INVALID_PARAMETER If Cert is NULL.
- If CommonNameSize is NULL.
- If CommonName is not NULL and *CommonNameSize is 0.
- If Certificate is invalid.
- @retval RETURN_NOT_FOUND If no CommonName entry exists.
- @retval RETURN_BUFFER_TOO_SMALL If the CommonName is NULL. The required buffer size
- (including the final null) is returned in the
- CommonNameSize parameter.
- @retval RETURN_UNSUPPORTED The operation is not supported.
-
-**/
-RETURN_STATUS
-EFIAPI
-X509GetCommonName (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- OUT CHAR8 *CommonName, OPTIONAL
- IN OUT UINTN *CommonNameSize
- )
-{
- RETURN_STATUS ReturnStatus;
- BOOLEAN Status;
- X509 *X509Cert;
- X509_NAME *X509Name;
- INT32 Index;
- INTN Length;
- X509_NAME_ENTRY *Entry;
- ASN1_STRING *EntryData;
- UINT8 *UTF8Name;
-
- ReturnStatus = RETURN_INVALID_PARAMETER;
- UTF8Name = NULL;
-
- //
- // Check input parameters.
- //
- if ((Cert == NULL) || (CertSize > INT_MAX) || (CommonNameSize == NULL)) {
- return ReturnStatus;
- }
- if ((CommonName != NULL) && (*CommonNameSize == 0)) {
- return ReturnStatus;
- }
-
- X509Cert = NULL;
- //
- // Read DER-encoded X509 Certificate and Construct X509 object.
- //
- Status = X509ConstructCertificate (Cert, CertSize, (UINT8 **) &X509Cert);
- if ((X509Cert == NULL) || (!Status)) {
- //
- // Invalid X.509 Certificate
- //
- goto _Exit;
- }
-
- Status = FALSE;
-
- //
- // Retrieve subject name from certificate object.
- //
- X509Name = X509_get_subject_name (X509Cert);
- if (X509Name == NULL) {
- //
- // Fail to retrieve subject name content
- //
- goto _Exit;
- }
-
- //
- // Retrieve the CommonName information from X.509 Subject
- //
- Index = X509_NAME_get_index_by_NID (X509Name, NID_commonName, -1);
- if (Index < 0) {
- //
- // No CommonName entry exists in X509_NAME object
- //
- *CommonNameSize = 0;
- ReturnStatus = RETURN_NOT_FOUND;
- goto _Exit;
- }
-
- Entry = X509_NAME_get_entry (X509Name, Index);
- if (Entry == NULL) {
- //
- // Fail to retrieve name entry data
- //
- *CommonNameSize = 0;
- ReturnStatus = RETURN_NOT_FOUND;
- goto _Exit;
- }
-
- EntryData = X509_NAME_ENTRY_get_data (Entry);
-
- Length = ASN1_STRING_to_UTF8 (&UTF8Name, EntryData);
- if (Length < 0) {
- //
- // Fail to convert the commonName string
- //
- *CommonNameSize = 0;
- ReturnStatus = RETURN_INVALID_PARAMETER;
- goto _Exit;
- }
-
- if (CommonName == NULL) {
- *CommonNameSize = Length + 1;
- ReturnStatus = RETURN_BUFFER_TOO_SMALL;
- } else {
- *CommonNameSize = MIN ((UINTN)Length, *CommonNameSize - 1) + 1;
- CopyMem (CommonName, UTF8Name, *CommonNameSize - 1);
- CommonName[*CommonNameSize - 1] = '\0';
- ReturnStatus = RETURN_SUCCESS;
- }
-
-_Exit:
- //
- // Release Resources.
- //
- if (X509Cert != NULL) {
- X509_free (X509Cert);
- }
- if (UTF8Name != NULL) {
- OPENSSL_free (UTF8Name);
- }
-
- return ReturnStatus;
-}
-
-/**
- Retrieve the RSA Public Key from one DER-encoded X509 certificate.
-
- @param[in] Cert Pointer to the DER-encoded X509 certificate.
- @param[in] CertSize Size of the X509 certificate in bytes.
- @param[out] RsaContext Pointer to new-generated RSA context which contain the retrieved
- RSA public key component. Use RsaFree() function to free the
- resource.
-
- If Cert is NULL, then return FALSE.
- If RsaContext is NULL, then return FALSE.
-
- @retval TRUE RSA Public Key was retrieved successfully.
- @retval FALSE Fail to retrieve RSA public key from X509 certificate.
-
-**/
-BOOLEAN
-EFIAPI
-RsaGetPublicKeyFromX509 (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- OUT VOID **RsaContext
- )
-{
- BOOLEAN Status;
- EVP_PKEY *Pkey;
- X509 *X509Cert;
-
- //
- // Check input parameters.
- //
- if (Cert == NULL || RsaContext == NULL) {
- return FALSE;
- }
-
- Pkey = NULL;
- X509Cert = NULL;
-
- //
- // Read DER-encoded X509 Certificate and Construct X509 object.
- //
- Status = X509ConstructCertificate (Cert, CertSize, (UINT8 **) &X509Cert);
- if ((X509Cert == NULL) || (!Status)) {
- Status = FALSE;
- goto _Exit;
- }
-
- Status = FALSE;
-
- //
- // Retrieve and check EVP_PKEY data from X509 Certificate.
- //
- Pkey = X509_get_pubkey (X509Cert);
- if ((Pkey == NULL) || (EVP_PKEY_id (Pkey) != EVP_PKEY_RSA)) {
- goto _Exit;
- }
-
- //
- // Duplicate RSA Context from the retrieved EVP_PKEY.
- //
- if ((*RsaContext = RSAPublicKey_dup (EVP_PKEY_get0_RSA (Pkey))) != NULL) {
- Status = TRUE;
- }
-
-_Exit:
- //
- // Release Resources.
- //
- if (X509Cert != NULL) {
- X509_free (X509Cert);
- }
-
- if (Pkey != NULL) {
- EVP_PKEY_free (Pkey);
- }
-
- return Status;
-}
-
-/**
- Verify one X509 certificate was issued by the trusted CA.
-
- @param[in] Cert Pointer to the DER-encoded X509 certificate to be verified.
- @param[in] CertSize Size of the X509 certificate in bytes.
- @param[in] CACert Pointer to the DER-encoded trusted CA certificate.
- @param[in] CACertSize Size of the CA Certificate in bytes.
-
- If Cert is NULL, then return FALSE.
- If CACert is NULL, then return FALSE.
-
- @retval TRUE The certificate was issued by the trusted CA.
- @retval FALSE Invalid certificate or the certificate was not issued by the given
- trusted CA.
-
-**/
-BOOLEAN
-EFIAPI
-X509VerifyCert (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- IN CONST UINT8 *CACert,
- IN UINTN CACertSize
- )
-{
- BOOLEAN Status;
- X509 *X509Cert;
- X509 *X509CACert;
- X509_STORE *CertStore;
- X509_STORE_CTX *CertCtx;
-
- //
- // Check input parameters.
- //
- if (Cert == NULL || CACert == NULL) {
- return FALSE;
- }
-
- Status = FALSE;
- X509Cert = NULL;
- X509CACert = NULL;
- CertStore = NULL;
- CertCtx = NULL;
-
- //
- // Register & Initialize necessary digest algorithms for certificate verification.
- //
- if (EVP_add_digest (EVP_md5 ()) == 0) {
- goto _Exit;
- }
- if (EVP_add_digest (EVP_sha1 ()) == 0) {
- goto _Exit;
- }
- if (EVP_add_digest (EVP_sha256 ()) == 0) {
- goto _Exit;
- }
-
- //
- // Read DER-encoded certificate to be verified and Construct X509 object.
- //
- Status = X509ConstructCertificate (Cert, CertSize, (UINT8 **) &X509Cert);
- if ((X509Cert == NULL) || (!Status)) {
- Status = FALSE;
- goto _Exit;
- }
-
- //
- // Read DER-encoded root certificate and Construct X509 object.
- //
- Status = X509ConstructCertificate (CACert, CACertSize, (UINT8 **) &X509CACert);
- if ((X509CACert == NULL) || (!Status)) {
- Status = FALSE;
- goto _Exit;
- }
-
- Status = FALSE;
-
- //
- // Set up X509 Store for trusted certificate.
- //
- CertStore = X509_STORE_new ();
- if (CertStore == NULL) {
- goto _Exit;
- }
- if (!(X509_STORE_add_cert (CertStore, X509CACert))) {
- goto _Exit;
- }
-
- //
- // Allow partial certificate chains, terminated by a non-self-signed but
- // still trusted intermediate certificate. Also disable time checks.
- //
- X509_STORE_set_flags (CertStore,
- X509_V_FLAG_PARTIAL_CHAIN | X509_V_FLAG_NO_CHECK_TIME);
-
- //
- // Set up X509_STORE_CTX for the subsequent verification operation.
- //
- CertCtx = X509_STORE_CTX_new ();
- if (CertCtx == NULL) {
- goto _Exit;
- }
- if (!X509_STORE_CTX_init (CertCtx, CertStore, X509Cert, NULL)) {
- goto _Exit;
- }
-
- //
- // X509 Certificate Verification.
- //
- Status = (BOOLEAN) X509_verify_cert (CertCtx);
- X509_STORE_CTX_cleanup (CertCtx);
-
-_Exit:
- //
- // Release Resources.
- //
- if (X509Cert != NULL) {
- X509_free (X509Cert);
- }
-
- if (X509CACert != NULL) {
- X509_free (X509CACert);
- }
-
- if (CertStore != NULL) {
- X509_STORE_free (CertStore);
- }
-
- X509_STORE_CTX_free (CertCtx);
-
- return Status;
-}
-
-/**
- Retrieve the TBSCertificate from one given X.509 certificate.
-
- @param[in] Cert Pointer to the given DER-encoded X509 certificate.
- @param[in] CertSize Size of the X509 certificate in bytes.
- @param[out] TBSCert DER-Encoded To-Be-Signed certificate.
- @param[out] TBSCertSize Size of the TBS certificate in bytes.
-
- If Cert is NULL, then return FALSE.
- If TBSCert is NULL, then return FALSE.
- If TBSCertSize is NULL, then return FALSE.
-
- @retval TRUE The TBSCertificate was retrieved successfully.
- @retval FALSE Invalid X.509 certificate.
-
-**/
-BOOLEAN
-EFIAPI
-X509GetTBSCert (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- OUT UINT8 **TBSCert,
- OUT UINTN *TBSCertSize
- )
-{
- CONST UINT8 *Temp;
- UINT32 Asn1Tag;
- UINT32 ObjClass;
- UINTN Length;
-
- //
- // Check input parameters.
- //
- if ((Cert == NULL) || (TBSCert == NULL) ||
- (TBSCertSize == NULL) || (CertSize > INT_MAX)) {
- return FALSE;
- }
-
- //
- // An X.509 Certificate is: (defined in RFC3280)
- // Certificate ::= SEQUENCE {
- // tbsCertificate TBSCertificate,
- // signatureAlgorithm AlgorithmIdentifier,
- // signature BIT STRING }
- //
- // and
- //
- // TBSCertificate ::= SEQUENCE {
- // version [0] Version DEFAULT v1,
- // ...
- // }
- //
- // So we can just ASN1-parse the x.509 DER-encoded data. If we strip
- // the first SEQUENCE, the second SEQUENCE is the TBSCertificate.
- //
- Temp = Cert;
- Length = 0;
- ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int *)&ObjClass, (long)CertSize);
-
- if (Asn1Tag != V_ASN1_SEQUENCE) {
- return FALSE;
- }
-
- *TBSCert = (UINT8 *)Temp;
-
- ASN1_get_object (&Temp, (long *)&Length, (int *)&Asn1Tag, (int *)&ObjClass, (long)Length);
- //
- // Verify the parsed TBSCertificate is one correct SEQUENCE data.
- //
- if (Asn1Tag != V_ASN1_SEQUENCE) {
- return FALSE;
- }
-
- *TBSCertSize = Length + (Temp - *TBSCert);
-
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c
deleted file mode 100644
index 86b56eb..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/** @file
- X.509 Certificate Handler Wrapper Implementation which does not provide
- real capabilities.
-
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-/**
- Construct a X509 object from DER-encoded certificate data.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Cert Pointer to the DER-encoded certificate data.
- @param[in] CertSize The size of certificate data in bytes.
- @param[out] SingleX509Cert The generated X509 object.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-X509ConstructCertificate (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- OUT UINT8 **SingleX509Cert
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Construct a X509 stack object from a list of DER-encoded certificate data.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in, out] X509Stack On input, pointer to an existing or NULL X509 stack object.
- On output, pointer to the X509 stack object with new
- inserted X509 certificate.
- @param ... A list of DER-encoded single certificate data followed
- by certificate size. A NULL terminates the list. The
- pairs are the arguments to X509ConstructCertificate().
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-X509ConstructCertificateStack (
- IN OUT UINT8 **X509Stack,
- ...
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Release the specified X509 object.
-
- If the interface is not supported, then ASSERT().
-
- @param[in] X509Cert Pointer to the X509 object to be released.
-
-**/
-VOID
-EFIAPI
-X509Free (
- IN VOID *X509Cert
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Release the specified X509 stack object.
-
- If the interface is not supported, then ASSERT().
-
- @param[in] X509Stack Pointer to the X509 stack object to be released.
-
-**/
-VOID
-EFIAPI
-X509StackFree (
- IN VOID *X509Stack
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Retrieve the subject bytes from one X.509 certificate.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Cert Pointer to the DER-encoded X509 certificate.
- @param[in] CertSize Size of the X509 certificate in bytes.
- @param[out] CertSubject Pointer to the retrieved certificate subject bytes.
- @param[in, out] SubjectSize The size in bytes of the CertSubject buffer on input,
- and the size of buffer returned CertSubject on output.
-
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-X509GetSubjectName (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- OUT UINT8 *CertSubject,
- IN OUT UINTN *SubjectSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Retrieve the common name (CN) string from one X.509 certificate.
-
- Return RETURN_UNSUPPORTED to indicate this interface is not supported.
-
- @param[in] Cert Pointer to the DER-encoded X509 certificate.
- @param[in] CertSize Size of the X509 certificate in bytes.
- @param[out] CommonName Buffer to contain the retrieved certificate common
- name string (UTF8). At most CommonNameSize bytes will be
- written and the string will be null terminated. May be
- NULL in order to determine the size buffer needed.
- @param[in,out] CommonNameSize The size in bytes of the CommonName buffer on input,
- and the size of buffer returned CommonName on output.
- If CommonName is NULL then the amount of space needed
- in buffer (including the final null) is returned.
-
- @retval RETURN_UNSUPPORTED The operation is not supported.
-
-**/
-RETURN_STATUS
-EFIAPI
-X509GetCommonName (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- OUT CHAR8 *CommonName, OPTIONAL
- IN OUT UINTN *CommonNameSize
- )
-{
- ASSERT (FALSE);
- return RETURN_UNSUPPORTED;
-}
-
-/**
- Retrieve the RSA Public Key from one DER-encoded X509 certificate.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Cert Pointer to the DER-encoded X509 certificate.
- @param[in] CertSize Size of the X509 certificate in bytes.
- @param[out] RsaContext Pointer to new-generated RSA context which contain the retrieved
- RSA public key component. Use RsaFree() function to free the
- resource.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-RsaGetPublicKeyFromX509 (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- OUT VOID **RsaContext
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Verify one X509 certificate was issued by the trusted CA.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Cert Pointer to the DER-encoded X509 certificate to be verified.
- @param[in] CertSize Size of the X509 certificate in bytes.
- @param[in] CACert Pointer to the DER-encoded trusted CA certificate.
- @param[in] CACertSize Size of the CA Certificate in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-X509VerifyCert (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- IN CONST UINT8 *CACert,
- IN UINTN CACertSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Retrieve the TBSCertificate from one given X.509 certificate.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Cert Pointer to the given DER-encoded X509 certificate.
- @param[in] CertSize Size of the X509 certificate in bytes.
- @param[out] TBSCert DER-Encoded To-Be-Signed certificate.
- @param[out] TBSCertSize Size of the TBS certificate in bytes.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-X509GetTBSCert (
- IN CONST UINT8 *Cert,
- IN UINTN CertSize,
- OUT UINT8 **TBSCert,
- OUT UINTN *TBSCertSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c
deleted file mode 100644
index e1ee0d0..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/** @file
- Pseudorandom Number Generator Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-#include
-
-//
-// Default seed for UEFI Crypto Library
-//
-CONST UINT8 DefaultSeed[] = "UEFI Crypto Library default seed";
-
-/**
- Sets up the seed value for the pseudorandom number generator.
-
- This function sets up the seed value for the pseudorandom number generator.
- If Seed is not NULL, then the seed passed in is used.
- If Seed is NULL, then default seed is used.
-
- @param[in] Seed Pointer to seed value.
- If NULL, default seed is used.
- @param[in] SeedSize Size of seed value.
- If Seed is NULL, this parameter is ignored.
-
- @retval TRUE Pseudorandom number generator has enough entropy for random generation.
- @retval FALSE Pseudorandom number generator does not have enough entropy for random generation.
-
-**/
-BOOLEAN
-EFIAPI
-RandomSeed (
- IN CONST UINT8 *Seed OPTIONAL,
- IN UINTN SeedSize
- )
-{
- if (SeedSize > INT_MAX) {
- return FALSE;
- }
-
- //
- // The software PRNG implementation built in OpenSSL depends on message digest algorithm.
- // Make sure SHA-1 digest algorithm is available here.
- //
- if (EVP_add_digest (EVP_sha1 ()) == 0) {
- return FALSE;
- }
-
- //
- // Seed the pseudorandom number generator with user-supplied value.
- // NOTE: A cryptographic PRNG must be seeded with unpredictable data.
- //
- if (Seed != NULL) {
- RAND_seed (Seed, (UINT32) SeedSize);
- } else {
- RAND_seed (DefaultSeed, sizeof (DefaultSeed));
- }
-
- if (RAND_status () == 1) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Generates a pseudorandom byte stream of the specified size.
-
- If Output is NULL, then return FALSE.
-
- @param[out] Output Pointer to buffer to receive random value.
- @param[in] Size Size of random bytes to generate.
-
- @retval TRUE Pseudorandom byte stream generated successfully.
- @retval FALSE Pseudorandom number generator fails to generate due to lack of entropy.
-
-**/
-BOOLEAN
-EFIAPI
-RandomBytes (
- OUT UINT8 *Output,
- IN UINTN Size
- )
-{
- //
- // Check input parameters.
- //
- if (Output == NULL || Size > INT_MAX) {
- return FALSE;
- }
-
- //
- // Generate random data.
- //
- if (RAND_bytes (Output, (UINT32) Size) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
deleted file mode 100644
index 01227dc..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/** @file
- Pseudorandom Number Generator Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-#include
-#include
-
-/**
- Sets up the seed value for the pseudorandom number generator.
-
- This function sets up the seed value for the pseudorandom number generator.
- If Seed is not NULL, then the seed passed in is used.
- If Seed is NULL, then default seed is used.
-
- @param[in] Seed Pointer to seed value.
- If NULL, default seed is used.
- @param[in] SeedSize Size of seed value.
- If Seed is NULL, this parameter is ignored.
-
- @retval TRUE Pseudorandom number generator has enough entropy for random generation.
- @retval FALSE Pseudorandom number generator does not have enough entropy for random generation.
-
-**/
-BOOLEAN
-EFIAPI
-RandomSeed (
- IN CONST UINT8 *Seed OPTIONAL,
- IN UINTN SeedSize
- )
-{
- CHAR8 DefaultSeed[128];
-
- if (SeedSize > INT_MAX) {
- return FALSE;
- }
-
- //
- // The software PRNG implementation built in OpenSSL depends on message digest algorithm.
- // Make sure SHA-1 digest algorithm is available here.
- //
- if (EVP_add_digest (EVP_sha1 ()) == 0) {
- return FALSE;
- }
-
- //
- // Seed the pseudorandom number generator with user-supplied value.
- // NOTE: A cryptographic PRNG must be seeded with unpredictable data.
- //
- if (Seed != NULL) {
- RAND_seed (Seed, (UINT32) SeedSize);
- } else {
- //
- // Retrieve current time.
- //
- AsciiSPrint (
- DefaultSeed,
- sizeof (DefaultSeed),
- "UEFI Crypto Library default seed (%ld)",
- AsmReadItc ()
- );
-
- RAND_seed (DefaultSeed, sizeof (DefaultSeed));
- }
-
- if (RAND_status () == 1) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Generates a pseudorandom byte stream of the specified size.
-
- If Output is NULL, then return FALSE.
-
- @param[out] Output Pointer to buffer to receive random value.
- @param[in] Size Size of random bytes to generate.
-
- @retval TRUE Pseudorandom byte stream generated successfully.
- @retval FALSE Pseudorandom number generator fails to generate due to lack of entropy.
-
-**/
-BOOLEAN
-EFIAPI
-RandomBytes (
- OUT UINT8 *Output,
- IN UINTN Size
- )
-{
- //
- // Check input parameters.
- //
- if (Output == NULL || Size > INT_MAX) {
- return FALSE;
- }
-
- //
- // Generate random data.
- //
- if (RAND_bytes (Output, (UINT32) Size) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandNull.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandNull.c
deleted file mode 100644
index ef9c5bd..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandNull.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file
- Pseudorandom Number Generator Wrapper Implementation which does not provide
- real capabilities.
-
-Copyright (c) 2012, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-
-
-/**
- Sets up the seed value for the pseudorandom number generator.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[in] Seed Pointer to seed value.
- If NULL, default seed is used.
- @param[in] SeedSize Size of seed value.
- If Seed is NULL, this parameter is ignored.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-RandomSeed (
- IN CONST UINT8 *Seed OPTIONAL,
- IN UINTN SeedSize
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Generates a pseudorandom byte stream of the specified size.
-
- Return FALSE to indicate this interface is not supported.
-
- @param[out] Output Pointer to buffer to receive random value.
- @param[in] Size Size of random bytes to generate.
-
- @retval FALSE This interface is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-RandomBytes (
- OUT UINT8 *Output,
- IN UINTN Size
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
deleted file mode 100644
index 349d0a2..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/** @file
- Pseudorandom Number Generator Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalCryptLib.h"
-#include
-#include
-#include
-
-/**
- Sets up the seed value for the pseudorandom number generator.
-
- This function sets up the seed value for the pseudorandom number generator.
- If Seed is not NULL, then the seed passed in is used.
- If Seed is NULL, then default seed is used.
-
- @param[in] Seed Pointer to seed value.
- If NULL, default seed is used.
- @param[in] SeedSize Size of seed value.
- If Seed is NULL, this parameter is ignored.
-
- @retval TRUE Pseudorandom number generator has enough entropy for random generation.
- @retval FALSE Pseudorandom number generator does not have enough entropy for random generation.
-
-**/
-BOOLEAN
-EFIAPI
-RandomSeed (
- IN CONST UINT8 *Seed OPTIONAL,
- IN UINTN SeedSize
- )
-{
- CHAR8 DefaultSeed[128];
-
- if (SeedSize > INT_MAX) {
- return FALSE;
- }
-
- //
- // The software PRNG implementation built in OpenSSL depends on message digest algorithm.
- // Make sure SHA-1 digest algorithm is available here.
- //
- if (EVP_add_digest (EVP_sha1 ()) == 0) {
- return FALSE;
- }
-
- //
- // Seed the pseudorandom number generator with user-supplied value.
- // NOTE: A cryptographic PRNG must be seeded with unpredictable data.
- //
- if (Seed != NULL) {
- RAND_seed (Seed, (UINT32) SeedSize);
- } else {
- //
- // Retrieve current time.
- //
- AsciiSPrint (
- DefaultSeed,
- sizeof (DefaultSeed),
- "UEFI Crypto Library default seed (%ld)",
- AsmReadTsc ()
- );
-
- RAND_seed (DefaultSeed, sizeof (DefaultSeed));
- }
-
- if (RAND_status () == 1) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Generates a pseudorandom byte stream of the specified size.
-
- If Output is NULL, then return FALSE.
-
- @param[out] Output Pointer to buffer to receive random value.
- @param[in] Size Size of random bytes to generate.
-
- @retval TRUE Pseudorandom byte stream generated successfully.
- @retval FALSE Pseudorandom number generator fails to generate due to lack of entropy.
-
-**/
-BOOLEAN
-EFIAPI
-RandomBytes (
- OUT UINT8 *Output,
- IN UINTN Size
- )
-{
- //
- // Check input parameters.
- //
- if (Output == NULL || Size > INT_MAX) {
- return FALSE;
- }
-
- //
- // Generate random data.
- //
- if (RAND_bytes (Output, (UINT32) Size) != 1) {
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
deleted file mode 100644
index 71ba8bf..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
+++ /dev/null
@@ -1,107 +0,0 @@
-## @file
-# Cryptographic Library Instance for DXE_RUNTIME_DRIVER.
-#
-# Caution: This module requires additional review when modified.
-# This library will have external input - signature.
-# This external input must be validated carefully to avoid security issues such as
-# buffer overflow or integer overflow.
-#
-# Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,
-# HMAC-MD5 functions, HMAC-SHA1/SHA256 functions, AES/TDES/ARC4 functions, RSA external
-# functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and
-# authenticode signature verification functions are not supported in this instance.
-#
-# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = RuntimeCryptLib
- MODULE_UNI_FILE = RuntimeCryptLib.uni
- FILE_GUID = 78189cc0-727d-46a4-84ea-f7dd860de64a
- MODULE_TYPE = DXE_RUNTIME_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = BaseCryptLib|DXE_RUNTIME_DRIVER
- CONSTRUCTOR = RuntimeCryptLibConstructor
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
-#
-
-[Sources]
- Hash/CryptMd4Null.c
- Hash/CryptMd5.c
- Hash/CryptSha1.c
- Hash/CryptSha256.c
- Hash/CryptSha512Null.c
- Hmac/CryptHmacMd5Null.c
- Hmac/CryptHmacSha1Null.c
- Hmac/CryptHmacSha256Null.c
- Cipher/CryptAesNull.c
- Cipher/CryptTdesNull.c
- Cipher/CryptArc4Null.c
- Pk/CryptRsaBasic.c
- Pk/CryptRsaExtNull.c
- Pk/CryptPkcs5Pbkdf2Null.c
- Pk/CryptPkcs7SignNull.c
- Pk/CryptPkcs7VerifyCommon.c
- Pk/CryptPkcs7VerifyRuntime.c
- Pk/CryptDhNull.c
- Pk/CryptX509.c
- Pk/CryptAuthenticodeNull.c
- Pk/CryptTsNull.c
- Pem/CryptPem.c
-
- SysCall/CrtWrapper.c
- SysCall/TimerWrapper.c
- SysCall/RuntimeMemAllocation.c
-
-[Sources.Ia32]
- Rand/CryptRandTsc.c
-
-[Sources.X64]
- Rand/CryptRandTsc.c
-
-[Sources.ARM]
- Rand/CryptRand.c
-
-[Sources.AARCH64]
- Rand/CryptRand.c
-
-[Packages]
- MdePkg/MdePkg.dec
- CryptoPkg/CryptoPkg.dec
-
-[LibraryClasses]
- BaseLib
- BaseMemoryLib
- UefiBootServicesTableLib
- UefiRuntimeServicesTableLib
- DebugLib
- OpensslLib
- IntrinsicLib
- PrintLib
-
-#
-# Remove these [BuildOptions] after this library is cleaned up
-#
-[BuildOptions]
- #
- # suppress the following warnings so we do not break the build with warnings-as-errors:
- # C4090: 'function' : different 'const' qualifiers
- #
- MSFT:*_*_*_CC_FLAGS = /wd4090
-
- # -JCryptoPkg/Include : To disable the use of the system includes provided by RVCT
- # --diag_remark=1 : Reduce severity of "#1-D: last line of file ends without a newline"
- RVCT:*_*_ARM_CC_FLAGS = -JCryptoPkg/Include --diag_remark=1
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.uni b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.uni
deleted file mode 100644
index 601ed80..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.uni
+++ /dev/null
@@ -1,30 +0,0 @@
-// /** @file
-// Cryptographic Library Instance for DXE_RUNTIME_DRIVER.
-//
-// Caution: This module requires additional review when modified.
-// This library will have external input - signature.
-// This external input must be validated carefully to avoid security issues such as
-// buffer overflow or integer overflow.
-//
-// Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/
-// TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions,
-// Diffie-Hellman functions, and authenticode signature verification functions are
-// not supported in this instance.
-//
-// Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Cryptographic Library Instance for DXE_RUNTIME_DRIVER"
-
-#string STR_MODULE_DESCRIPTION #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/ TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and authenticode signature verification functions are not supported in this instance."
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
deleted file mode 100644
index c1b39f9..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+++ /dev/null
@@ -1,104 +0,0 @@
-## @file
-# Cryptographic Library Instance for SMM driver.
-#
-# Caution: This module requires additional review when modified.
-# This library will have external input - signature.
-# This external input must be validated carefully to avoid security issues such as
-# buffer overflow or integer overflow.
-#
-# Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions,
-# HMAC-MD5 functions, HMAC-SHA1 functions, TDES/ARC4 functions, RSA external
-# functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and
-# authenticode signature verification functions are not supported in this instance.
-#
-# Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = SmmCryptLib
- MODULE_UNI_FILE = SmmCryptLib.uni
- FILE_GUID = 028080a3-8958-4a62-a1a8-0fa1da162007
- MODULE_TYPE = DXE_SMM_DRIVER
- VERSION_STRING = 1.0
- PI_SPECIFICATION_VERSION = 0x0001000A
- LIBRARY_CLASS = BaseCryptLib|DXE_SMM_DRIVER SMM_CORE MM_STANDALONE
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
-#
-
-[Sources]
- Hash/CryptMd4Null.c
- Hash/CryptMd5.c
- Hash/CryptSha1.c
- Hash/CryptSha256.c
- Hash/CryptSha512Null.c
- Hmac/CryptHmacMd5Null.c
- Hmac/CryptHmacSha1Null.c
- Hmac/CryptHmacSha256.c
- Cipher/CryptAes.c
- Cipher/CryptTdesNull.c
- Cipher/CryptArc4Null.c
- Pk/CryptRsaBasic.c
- Pk/CryptRsaExtNull.c
- Pk/CryptPkcs5Pbkdf2.c
- Pk/CryptPkcs7SignNull.c
- Pk/CryptPkcs7VerifyCommon.c
- Pk/CryptPkcs7VerifyBase.c
- Pk/CryptDhNull.c
- Pk/CryptX509.c
- Pk/CryptAuthenticodeNull.c
- Pk/CryptTsNull.c
- Pem/CryptPem.c
-
- SysCall/CrtWrapper.c
- SysCall/ConstantTimeClock.c
- SysCall/BaseMemAllocation.c
-
-[Sources.Ia32]
- Rand/CryptRandTsc.c
-
-[Sources.X64]
- Rand/CryptRandTsc.c
-
-[Sources.ARM]
- Rand/CryptRand.c
-
-[Sources.AARCH64]
- Rand/CryptRand.c
-
-[Packages]
- MdePkg/MdePkg.dec
- CryptoPkg/CryptoPkg.dec
-
-[LibraryClasses]
- BaseLib
- IoLib
- BaseMemoryLib
- MemoryAllocationLib
- OpensslLib
- IntrinsicLib
- PrintLib
-
-#
-# Remove these [BuildOptions] after this library is cleaned up
-#
-[BuildOptions]
- #
- # suppress the following warnings so we do not break the build with warnings-as-errors:
- # C4090: 'function' : different 'const' qualifiers
- #
- MSFT:*_*_*_CC_FLAGS = /wd4090
-
- XCODE:*_*_*_CC_FLAGS = -mmmx -msse
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.uni b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.uni
deleted file mode 100644
index 261d0fe..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.uni
+++ /dev/null
@@ -1,30 +0,0 @@
-// /** @file
-// Cryptographic Library Instance for SMM driver.
-//
-// Caution: This module requires additional review when modified.
-// This library will have external input - signature.
-// This external input must be validated carefully to avoid security issues such as
-// buffer overflow or integer overflow.
-//
-// Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/
-// TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions,
-// Diffie-Hellman functions, and authenticode signature verification functions are
-// not supported in this instance.
-//
-// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Cryptographic Library Instance for SMM driver"
-
-#string STR_MODULE_DESCRIPTION #language en-US "Caution: This module requires additional review when modified. This library will have external input - signature. This external input must be validated carefully to avoid security issues such as buffer overflow or integer overflow. Note: MD4 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, AES/ TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and authenticode signature verification functions are not supported in this instance."
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c
deleted file mode 100644
index e0c32ca..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/BaseMemAllocation.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/** @file
- Base Memory Allocation Routines Wrapper for Crypto library over OpenSSL
- during PEI & DXE phases.
-
-Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-#include
-
-//
-// Extra header to record the memory buffer size from malloc routine.
-//
-#define CRYPTMEM_HEAD_SIGNATURE SIGNATURE_32('c','m','h','d')
-typedef struct {
- UINT32 Signature;
- UINT32 Reserved;
- UINTN Size;
-} CRYPTMEM_HEAD;
-
-#define CRYPTMEM_OVERHEAD sizeof(CRYPTMEM_HEAD)
-
-//
-// -- Memory-Allocation Routines --
-//
-
-/* Allocates memory blocks */
-void *malloc (size_t size)
-{
- CRYPTMEM_HEAD *PoolHdr;
- UINTN NewSize;
- VOID *Data;
-
- //
- // Adjust the size by the buffer header overhead
- //
- NewSize = (UINTN)(size) + CRYPTMEM_OVERHEAD;
-
- Data = AllocatePool (NewSize);
- if (Data != NULL) {
- PoolHdr = (CRYPTMEM_HEAD *)Data;
- //
- // Record the memory brief information
- //
- PoolHdr->Signature = CRYPTMEM_HEAD_SIGNATURE;
- PoolHdr->Size = size;
-
- return (VOID *)(PoolHdr + 1);
- } else {
- //
- // The buffer allocation failed.
- //
- return NULL;
- }
-}
-
-/* Reallocate memory blocks */
-void *realloc (void *ptr, size_t size)
-{
- CRYPTMEM_HEAD *OldPoolHdr;
- CRYPTMEM_HEAD *NewPoolHdr;
- UINTN OldSize;
- UINTN NewSize;
- VOID *Data;
-
- NewSize = (UINTN)size + CRYPTMEM_OVERHEAD;
- Data = AllocatePool (NewSize);
- if (Data != NULL) {
- NewPoolHdr = (CRYPTMEM_HEAD *)Data;
- NewPoolHdr->Signature = CRYPTMEM_HEAD_SIGNATURE;
- NewPoolHdr->Size = size;
- if (ptr != NULL) {
- //
- // Retrieve the original size from the buffer header.
- //
- OldPoolHdr = (CRYPTMEM_HEAD *)ptr - 1;
- ASSERT (OldPoolHdr->Signature == CRYPTMEM_HEAD_SIGNATURE);
- OldSize = OldPoolHdr->Size;
-
- //
- // Duplicate the buffer content.
- //
- CopyMem ((VOID *)(NewPoolHdr + 1), ptr, MIN (OldSize, size));
- FreePool ((VOID *)OldPoolHdr);
- }
-
- return (VOID *)(NewPoolHdr + 1);
- } else {
- //
- // The buffer allocation failed.
- //
- return NULL;
- }
-}
-
-/* De-allocates or frees a memory block */
-void free (void *ptr)
-{
- CRYPTMEM_HEAD *PoolHdr;
-
- //
- // In Standard C, free() handles a null pointer argument transparently. This
- // is not true of FreePool() below, so protect it.
- //
- if (ptr != NULL) {
- PoolHdr = (CRYPTMEM_HEAD *)ptr - 1;
- ASSERT (PoolHdr->Signature == CRYPTMEM_HEAD_SIGNATURE);
- FreePool (PoolHdr);
- }
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c
deleted file mode 100644
index 6904a19..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/** @file
- C Run-Time Libraries (CRT) Time Management Routines Wrapper Implementation
- for OpenSSL-based Cryptographic Library.
-
- This C file implements constant time value for time() and NULL for gmtime()
- thus should not be used in library instances which require functionality
- of following APIs which need system time support:
- 1) RsaGenerateKey
- 2) RsaCheckKey
- 3) RsaPkcs1Sign
- 4) Pkcs7Sign
- 5) DhGenerateParameter
- 6) DhGenerateKey
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-
-//
-// -- Time Management Routines --
-//
-
-time_t time (time_t *timer)
-{
- if (timer != NULL) {
- *timer = 0;
- }
- return 0;
-}
-
-struct tm * gmtime (const time_t *timer)
-{
- return NULL;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
deleted file mode 100644
index c98a36e..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
+++ /dev/null
@@ -1,474 +0,0 @@
-/** @file
- C Run-Time Libraries (CRT) Wrapper Implementation for OpenSSL-based
- Cryptographic Library.
-
-Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-
-int errno = 0;
-
-FILE *stderr = NULL;
-FILE *stdin = NULL;
-FILE *stdout = NULL;
-
-typedef
-int
-(*SORT_COMPARE)(
- IN VOID *Buffer1,
- IN VOID *Buffer2
- );
-
-//
-// Duplicated from EDKII BaseSortLib for qsort() wrapper
-//
-STATIC
-VOID
-QuickSortWorker (
- IN OUT VOID *BufferToSort,
- IN CONST UINTN Count,
- IN CONST UINTN ElementSize,
- IN SORT_COMPARE CompareFunction,
- IN VOID *Buffer
- )
-{
- VOID *Pivot;
- UINTN LoopCount;
- UINTN NextSwapLocation;
-
- ASSERT(BufferToSort != NULL);
- ASSERT(CompareFunction != NULL);
- ASSERT(Buffer != NULL);
-
- if (Count < 2 || ElementSize < 1) {
- return;
- }
-
- NextSwapLocation = 0;
-
- //
- // Pick a pivot (we choose last element)
- //
- Pivot = ((UINT8 *)BufferToSort + ((Count - 1) * ElementSize));
-
- //
- // Now get the pivot such that all on "left" are below it
- // and everything "right" are above it
- //
- for (LoopCount = 0; LoopCount < Count - 1; LoopCount++)
- {
- //
- // If the element is less than the pivot
- //
- if (CompareFunction ((VOID *)((UINT8 *)BufferToSort + ((LoopCount) * ElementSize)), Pivot) <= 0) {
- //
- // Swap
- //
- CopyMem (Buffer, (UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), ElementSize);
- CopyMem ((UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), (UINT8 *)BufferToSort + ((LoopCount) * ElementSize), ElementSize);
- CopyMem ((UINT8 *)BufferToSort + ((LoopCount) * ElementSize), Buffer, ElementSize);
-
- //
- // Increment NextSwapLocation
- //
- NextSwapLocation++;
- }
- }
- //
- // Swap pivot to its final position (NextSwapLocation)
- //
- CopyMem (Buffer, Pivot, ElementSize);
- CopyMem (Pivot, (UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), ElementSize);
- CopyMem ((UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), Buffer, ElementSize);
-
- //
- // Now recurse on 2 partial lists. Neither of these will have the 'pivot' element.
- // IE list is sorted left half, pivot element, sorted right half...
- //
- QuickSortWorker (
- BufferToSort,
- NextSwapLocation,
- ElementSize,
- CompareFunction,
- Buffer
- );
-
- QuickSortWorker (
- (UINT8 *)BufferToSort + (NextSwapLocation + 1) * ElementSize,
- Count - NextSwapLocation - 1,
- ElementSize,
- CompareFunction,
- Buffer
- );
-
- return;
-}
-
-//---------------------------------------------------------
-// Standard C Run-time Library Interface Wrapper
-//---------------------------------------------------------
-
-//
-// -- String Manipulation Routines --
-//
-
-/* Scan a string for the last occurrence of a character */
-char *strrchr (const char *str, int c)
-{
- char * save;
-
- for (save = NULL; ; ++str) {
- if (*str == c) {
- save = (char *)str;
- }
- if (*str == 0) {
- return (save);
- }
- }
-}
-
-/* Compare first n bytes of string s1 with string s2, ignoring case */
-int strncasecmp (const char *s1, const char *s2, size_t n)
-{
- int Val;
-
- ASSERT(s1 != NULL);
- ASSERT(s2 != NULL);
-
- if (n != 0) {
- do {
- Val = tolower(*s1) - tolower(*s2);
- if (Val != 0) {
- return Val;
- }
- ++s1;
- ++s2;
- if (*s1 == '\0') {
- break;
- }
- } while (--n != 0);
- }
- return 0;
-}
-
-/* Read formatted data from a string */
-int sscanf (const char *buffer, const char *format, ...)
-{
- //
- // Null sscanf() function implementation to satisfy the linker, since
- // no direct functionality logic dependency in present UEFI cases.
- //
- return 0;
-}
-
-/* Maps errnum to an error-message string */
-char * strerror (int errnum)
-{
- return NULL;
-}
-
-/* Computes the length of the maximum initial segment of the string pointed to by s1
- which consists entirely of characters from the string pointed to by s2. */
-size_t strspn (const char *s1 , const char *s2)
-{
- UINT8 Map[32];
- UINT32 Index;
- size_t Count;
-
- for (Index = 0; Index < 32; Index++) {
- Map[Index] = 0;
- }
-
- while (*s2) {
- Map[*s2 >> 3] |= (1 << (*s2 & 7));
- s2++;
- }
-
- if (*s1) {
- Count = 0;
- while (Map[*s1 >> 3] & (1 << (*s1 & 7))) {
- Count++;
- s1++;
- }
-
- return Count;
- }
-
- return 0;
-}
-
-/* Computes the length of the maximum initial segment of the string pointed to by s1
- which consists entirely of characters not from the string pointed to by s2. */
-size_t strcspn (const char *s1, const char *s2)
-{
- UINT8 Map[32];
- UINT32 Index;
- size_t Count;
-
- for (Index = 0; Index < 32; Index++) {
- Map[Index] = 0;
- }
-
- while (*s2) {
- Map[*s2 >> 3] |= (1 << (*s2 & 7));
- s2++;
- }
-
- Map[0] |= 1;
-
- Count = 0;
- while (!(Map[*s1 >> 3] & (1 << (*s1 & 7)))) {
- Count ++;
- s1++;
- }
-
- return Count;
-}
-
-//
-// -- Character Classification Routines --
-//
-
-/* Determines if a particular character is a decimal-digit character */
-int isdigit (int c)
-{
- //
- // ::= [0-9]
- //
- return (('0' <= (c)) && ((c) <= '9'));
-}
-
-/* Determine if an integer represents character that is a hex digit */
-int isxdigit (int c)
-{
- //
- // ::= [0-9] | [a-f] | [A-F]
- //
- return ((('0' <= (c)) && ((c) <= '9')) ||
- (('a' <= (c)) && ((c) <= 'f')) ||
- (('A' <= (c)) && ((c) <= 'F')));
-}
-
-/* Determines if a particular character represents a space character */
-int isspace (int c)
-{
- //
- // ::= [ ]
- //
- return ((c) == ' ');
-}
-
-/* Determine if a particular character is an alphanumeric character */
-int isalnum (int c)
-{
- //
- // ::= [0-9] | [a-z] | [A-Z]
- //
- return ((('0' <= (c)) && ((c) <= '9')) ||
- (('a' <= (c)) && ((c) <= 'z')) ||
- (('A' <= (c)) && ((c) <= 'Z')));
-}
-
-/* Determines if a particular character is in upper case */
-int isupper (int c)
-{
- //
- // := [A-Z]
- //
- return (('A' <= (c)) && ((c) <= 'Z'));
-}
-
-//
-// -- Data Conversion Routines --
-//
-
-/* Convert strings to a long-integer value */
-long strtol (const char *nptr, char **endptr, int base)
-{
- //
- // Null strtol() function implementation to satisfy the linker, since there is
- // no direct functionality logic dependency in present UEFI cases.
- //
- return 0;
-}
-
-/* Convert strings to an unsigned long-integer value */
-unsigned long strtoul (const char *nptr, char **endptr, int base)
-{
- //
- // Null strtoul() function implementation to satisfy the linker, since there is
- // no direct functionality logic dependency in present UEFI cases.
- //
- return 0;
-}
-
-/* Convert character to lowercase */
-int tolower (int c)
-{
- if (('A' <= (c)) && ((c) <= 'Z')) {
- return (c - ('A' - 'a'));
- }
- return (c);
-}
-
-//
-// -- Searching and Sorting Routines --
-//
-
-/* Performs a quick sort */
-void qsort (void *base, size_t num, size_t width, int (*compare)(const void *, const void *))
-{
- VOID *Buffer;
-
- ASSERT (base != NULL);
- ASSERT (compare != NULL);
-
- //
- // Use CRT-style malloc to cover BS and RT memory allocation.
- //
- Buffer = malloc (width);
- ASSERT (Buffer != NULL);
-
- //
- // Re-use PerformQuickSort() function Implementation in EDKII BaseSortLib.
- //
- QuickSortWorker (base, (UINTN)num, (UINTN)width, (SORT_COMPARE)compare, Buffer);
-
- free (Buffer);
- return;
-}
-
-//
-// -- Process and Environment Control Routines --
-//
-
-/* Get a value from the current environment */
-char *getenv (const char *varname)
-{
- //
- // Null getenv() function implementation to satisfy the linker, since there is
- // no direct functionality logic dependency in present UEFI cases.
- //
- return NULL;
-}
-
-/* Get a value from the current environment */
-char *secure_getenv (const char *varname)
-{
- //
- // Null secure_getenv() function implementation to satisfy the linker, since
- // there is no direct functionality logic dependency in present UEFI cases.
- //
- // From the secure_getenv() manual: 'just like getenv() except that it
- // returns NULL in cases where "secure execution" is required'.
- //
- return NULL;
-}
-
-//
-// -- Stream I/O Routines --
-//
-
-/* Write data to a stream */
-size_t fwrite (const void *buffer, size_t size, size_t count, FILE *stream)
-{
- return 0;
-}
-
-//
-// -- Dummy OpenSSL Support Routines --
-//
-
-int BIO_printf (void *bio, const char *format, ...)
-{
- return 0;
-}
-
-int BIO_snprintf(char *buf, size_t n, const char *format, ...)
-{
- return 0;
-}
-
-#ifdef __GNUC__
-
-typedef
-VOID
-(EFIAPI *NoReturnFuncPtr)(
- VOID
- ) __attribute__((__noreturn__));
-
-STATIC
-VOID
-EFIAPI
-NopFunction (
- VOID
- )
-{
-}
-
-void abort (void)
-{
- NoReturnFuncPtr NoReturnFunc;
-
- NoReturnFunc = (NoReturnFuncPtr) NopFunction;
-
- NoReturnFunc ();
-}
-
-#else
-
-void abort (void)
-{
- // Do nothing
-}
-
-#endif
-
-int fclose (FILE *f)
-{
- return 0;
-}
-
-FILE *fopen (const char *c, const char *m)
-{
- return NULL;
-}
-
-size_t fread (void *b, size_t c, size_t i, FILE *f)
-{
- return 0;
-}
-
-uid_t getuid (void)
-{
- return 0;
-}
-
-uid_t geteuid (void)
-{
- return 0;
-}
-
-gid_t getgid (void)
-{
- return 0;
-}
-
-gid_t getegid (void)
-{
- return 0;
-}
-
-int printf (char const *fmt, ...)
-{
- return 0;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c
deleted file mode 100644
index b0142c2..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/** @file
- Light-weight Memory Management Routines for OpenSSL-based Crypto
- Library at Runtime Phase.
-
-Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-#include
-#include
-#include
-#include
-
-//----------------------------------------------------------------
-// Initial version. Needs further optimizations.
-//----------------------------------------------------------------
-
-//
-// Definitions for Runtime Memory Operations
-//
-#define RT_PAGE_SIZE 0x200
-#define RT_PAGE_MASK 0x1FF
-#define RT_PAGE_SHIFT 9
-
-#define RT_SIZE_TO_PAGES(a) (((a) >> RT_PAGE_SHIFT) + (((a) & RT_PAGE_MASK) ? 1 : 0))
-#define RT_PAGES_TO_SIZE(a) ((a) << RT_PAGE_SHIFT)
-
-//
-// Page Flag Definitions
-//
-#define RT_PAGE_FREE 0x00000000
-#define RT_PAGE_USED 0x00000001
-
-#define MIN_REQUIRED_BLOCKS 600
-
-//
-// Memory Page Table
-//
-typedef struct {
- UINTN StartPageOffset; // Offset of the starting page allocated.
- // Only available for USED pages.
- UINT32 PageFlag; // Page Attributes.
-} RT_MEMORY_PAGE_ENTRY;
-
-typedef struct {
- UINTN PageCount;
- UINTN LastEmptyPageOffset;
- UINT8 *DataAreaBase; // Pointer to data Area.
- RT_MEMORY_PAGE_ENTRY Pages[1]; // Page Table Entries.
-} RT_MEMORY_PAGE_TABLE;
-
-//
-// Global Page Table for Runtime Cryptographic Provider.
-//
-RT_MEMORY_PAGE_TABLE *mRTPageTable = NULL;
-
-//
-// Event for Runtime Address Conversion.
-//
-STATIC EFI_EVENT mVirtualAddressChangeEvent;
-
-
-/**
- Initializes pre-allocated memory pointed by ScratchBuffer for subsequent
- runtime use.
-
- @param[in, out] ScratchBuffer Pointer to user-supplied memory buffer.
- @param[in] ScratchBufferSize Size of supplied buffer in bytes.
-
- @retval EFI_SUCCESS Successful initialization.
-
-**/
-EFI_STATUS
-InitializeScratchMemory (
- IN OUT UINT8 *ScratchBuffer,
- IN UINTN ScratchBufferSize
- )
-{
- UINTN Index;
- UINTN MemorySize;
-
- //
- // Parameters Checking
- //
- if (ScratchBuffer == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (ScratchBufferSize < MIN_REQUIRED_BLOCKS * 1024) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- mRTPageTable = (RT_MEMORY_PAGE_TABLE *)ScratchBuffer;
-
- //
- // Initialize Internal Page Table for Memory Management
- //
- SetMem (mRTPageTable, ScratchBufferSize, 0xFF);
- MemorySize = ScratchBufferSize - sizeof (RT_MEMORY_PAGE_TABLE) + sizeof (RT_MEMORY_PAGE_ENTRY);
-
- mRTPageTable->PageCount = MemorySize / (RT_PAGE_SIZE + sizeof (RT_MEMORY_PAGE_ENTRY));
- mRTPageTable->LastEmptyPageOffset = 0x0;
-
- for (Index = 0; Index < mRTPageTable->PageCount; Index++) {
- mRTPageTable->Pages[Index].PageFlag = RT_PAGE_FREE;
- mRTPageTable->Pages[Index].StartPageOffset = 0;
- }
-
- mRTPageTable->DataAreaBase = ScratchBuffer + sizeof (RT_MEMORY_PAGE_TABLE) +
- (mRTPageTable->PageCount - 1) * sizeof (RT_MEMORY_PAGE_ENTRY);
-
- return EFI_SUCCESS;
-}
-
-
-/**
- Look-up Free memory Region for object allocation.
-
- @param[in] AllocationSize Bytes to be allocated.
-
- @return Return available page offset for object allocation.
-
-**/
-UINTN
-LookupFreeMemRegion (
- IN UINTN AllocationSize
- )
-{
- UINTN StartPageIndex;
- UINTN Index;
- UINTN SubIndex;
- UINTN ReqPages;
-
- StartPageIndex = RT_SIZE_TO_PAGES (mRTPageTable->LastEmptyPageOffset);
- ReqPages = RT_SIZE_TO_PAGES (AllocationSize);
- if (ReqPages > mRTPageTable->PageCount) {
- //
- // No enough region for object allocation.
- //
- return (UINTN)(-1);
- }
-
- //
- // Look up the free memory region with in current memory map table.
- //
- for (Index = StartPageIndex; Index <= (mRTPageTable->PageCount - ReqPages); ) {
- //
- // Check consecutive ReqPages pages.
- //
- for (SubIndex = 0; SubIndex < ReqPages; SubIndex++) {
- if ((mRTPageTable->Pages[SubIndex + Index].PageFlag & RT_PAGE_USED) != 0) {
- break;
- }
- }
-
- if (SubIndex == ReqPages) {
- //
- // Succeed! Return the Starting Offset.
- //
- return RT_PAGES_TO_SIZE (Index);
- }
-
- //
- // Failed! Skip current free memory pages and adjacent Used pages
- //
- while ((mRTPageTable->Pages[SubIndex + Index].PageFlag & RT_PAGE_USED) != 0) {
- SubIndex++;
- }
-
- Index += SubIndex;
- }
-
- //
- // Look up the free memory region from the beginning of the memory table
- // until the StartCursorOffset
- //
- if (ReqPages > StartPageIndex) {
- //
- // No enough region for object allocation.
- //
- return (UINTN)(-1);
- }
- for (Index = 0; Index < (StartPageIndex - ReqPages); ) {
- //
- // Check Consecutive ReqPages Pages.
- //
- for (SubIndex = 0; SubIndex < ReqPages; SubIndex++) {
- if ((mRTPageTable->Pages[SubIndex + Index].PageFlag & RT_PAGE_USED) != 0) {
- break;
- }
- }
-
- if (SubIndex == ReqPages) {
- //
- // Succeed! Return the Starting Offset.
- //
- return RT_PAGES_TO_SIZE (Index);
- }
-
- //
- // Failed! Skip current adjacent Used pages
- //
- while ((SubIndex < (StartPageIndex - ReqPages)) &&
- ((mRTPageTable->Pages[SubIndex + Index].PageFlag & RT_PAGE_USED) != 0)) {
- SubIndex++;
- }
-
- Index += SubIndex;
- }
-
- //
- // No available region for object allocation!
- //
- return (UINTN)(-1);
-}
-
-
-/**
- Allocates a buffer at runtime phase.
-
- @param[in] AllocationSize Bytes to be allocated.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-RuntimeAllocateMem (
- IN UINTN AllocationSize
- )
-{
- UINT8 *AllocPtr;
- UINTN ReqPages;
- UINTN Index;
- UINTN StartPage;
- UINTN AllocOffset;
-
- AllocPtr = NULL;
- ReqPages = 0;
-
- //
- // Look for available consecutive memory region starting from LastEmptyPageOffset.
- // If no proper memory region found, look up from the beginning.
- // If still not found, return NULL to indicate failed allocation.
- //
- AllocOffset = LookupFreeMemRegion (AllocationSize);
- if (AllocOffset == (UINTN)(-1)) {
- return NULL;
- }
-
- //
- // Allocates consecutive memory pages with length of Size. Update the page
- // table status. Returns the starting address.
- //
- ReqPages = RT_SIZE_TO_PAGES (AllocationSize);
- AllocPtr = mRTPageTable->DataAreaBase + AllocOffset;
- StartPage = RT_SIZE_TO_PAGES (AllocOffset);
- Index = 0;
- while (Index < ReqPages) {
- mRTPageTable->Pages[StartPage + Index].PageFlag |= RT_PAGE_USED;
- mRTPageTable->Pages[StartPage + Index].StartPageOffset = AllocOffset;
-
- Index++;
- }
-
- mRTPageTable->LastEmptyPageOffset = AllocOffset + RT_PAGES_TO_SIZE (ReqPages);
-
- ZeroMem (AllocPtr, AllocationSize);
-
- //
- // Returns a void pointer to the allocated space
- //
- return AllocPtr;
-}
-
-
-/**
- Frees a buffer that was previously allocated at runtime phase.
-
- @param[in] Buffer Pointer to the buffer to free.
-
-**/
-VOID
-RuntimeFreeMem (
- IN VOID *Buffer
- )
-{
- UINTN StartOffset;
- UINTN StartPageIndex;
-
- StartOffset = (UINTN)Buffer - (UINTN)mRTPageTable->DataAreaBase;
- StartPageIndex = RT_SIZE_TO_PAGES (mRTPageTable->Pages[RT_SIZE_TO_PAGES(StartOffset)].StartPageOffset);
-
- while (StartPageIndex < mRTPageTable->PageCount) {
- if (((mRTPageTable->Pages[StartPageIndex].PageFlag & RT_PAGE_USED) != 0) &&
- (mRTPageTable->Pages[StartPageIndex].StartPageOffset == StartOffset)) {
- //
- // Free this page
- //
- mRTPageTable->Pages[StartPageIndex].PageFlag &= ~RT_PAGE_USED;
- mRTPageTable->Pages[StartPageIndex].PageFlag |= RT_PAGE_FREE;
- mRTPageTable->Pages[StartPageIndex].StartPageOffset = 0;
-
- StartPageIndex++;
- } else {
- break;
- }
- }
-
- return;
-}
-
-
-/**
- Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE.
-
- This is a notification function registered on EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE
- event. It converts a pointer to a new virtual address.
-
- @param[in] Event The event whose notification function is being invoked.
- @param[in] Context The pointer to the notification function's context.
-
-**/
-VOID
-EFIAPI
-RuntimeCryptLibAddressChangeEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- //
- // Converts a pointer for runtime memory management to a new virtual address.
- //
- EfiConvertPointer (0x0, (VOID **) &mRTPageTable->DataAreaBase);
- EfiConvertPointer (0x0, (VOID **) &mRTPageTable);
-}
-
-
-/**
- Constructor routine for runtime crypt library instance.
-
- The constructor function pre-allocates space for runtime cryptographic operation.
-
- @param ImageHandle The firmware allocated handle for the EFI image.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The construction succeeded.
- @retval EFI_OUT_OF_RESOURCE Failed to allocate memory.
-
-**/
-EFI_STATUS
-EFIAPI
-RuntimeCryptLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- VOID *Buffer;
-
- //
- // Pre-allocates runtime space for possible cryptographic operations
- //
- Buffer = AllocateRuntimePool (MIN_REQUIRED_BLOCKS * 1024);
- Status = InitializeScratchMemory (Buffer, MIN_REQUIRED_BLOCKS * 1024);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Create address change event
- //
- Status = gBS->CreateEventEx (
- EVT_NOTIFY_SIGNAL,
- TPL_NOTIFY,
- RuntimeCryptLibAddressChangeEvent,
- NULL,
- &gEfiEventVirtualAddressChangeGuid,
- &mVirtualAddressChangeEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
-
-
-//
-// -- Memory-Allocation Routines Wrapper for UEFI-OpenSSL Library --
-//
-
-/* Allocates memory blocks */
-void *malloc (size_t size)
-{
- return RuntimeAllocateMem ((UINTN) size);
-}
-
-/* Reallocate memory blocks */
-void *realloc (void *ptr, size_t size)
-{
- VOID *NewPtr;
- UINTN StartOffset;
- UINTN StartPageIndex;
- UINTN PageCount;
-
- if (ptr == NULL) {
- return malloc (size);
- }
-
- //
- // Get Original Size of ptr
- //
- StartOffset = (UINTN)ptr - (UINTN)mRTPageTable->DataAreaBase;
- StartPageIndex = RT_SIZE_TO_PAGES (mRTPageTable->Pages[RT_SIZE_TO_PAGES (StartOffset)].StartPageOffset);
- PageCount = 0;
- while (StartPageIndex < mRTPageTable->PageCount) {
- if (((mRTPageTable->Pages[StartPageIndex].PageFlag & RT_PAGE_USED) != 0) &&
- (mRTPageTable->Pages[StartPageIndex].StartPageOffset == StartOffset)) {
- StartPageIndex++;
- PageCount++;
- } else {
- break;
- }
- }
-
- if (size <= RT_PAGES_TO_SIZE (PageCount)) {
- //
- // Return the original pointer, if Caller try to reduce region size;
- //
- return ptr;
- }
-
- NewPtr = RuntimeAllocateMem ((UINTN) size);
- if (NewPtr == NULL) {
- return NULL;
- }
-
- CopyMem (NewPtr, ptr, RT_PAGES_TO_SIZE (PageCount));
-
- RuntimeFreeMem (ptr);
-
- return NewPtr;
-}
-
-/* Deallocates or frees a memory block */
-void free (void *ptr)
-{
- //
- // In Standard C, free() handles a null pointer argument transparently. This
- // is not true of RuntimeFreeMem() below, so protect it.
- //
- if (ptr != NULL) {
- RuntimeFreeMem (ptr);
- }
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c b/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
deleted file mode 100644
index dd544a3..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/** @file
- C Run-Time Libraries (CRT) Time Management Routines Wrapper Implementation
- for OpenSSL-based Cryptographic Library (used in DXE & RUNTIME).
-
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-#include
-#include
-
-//
-// -- Time Management Routines --
-//
-
-#define IsLeap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
-#define SECSPERMIN (60)
-#define SECSPERHOUR (60 * 60)
-#define SECSPERDAY (24 * SECSPERHOUR)
-
-//
-// The arrays give the cumulative number of days up to the first of the
-// month number used as the index (1 -> 12) for regular and leap years.
-// The value at index 13 is for the whole year.
-//
-UINTN CumulativeDays[2][14] = {
- {
- 0,
- 0,
- 31,
- 31 + 28,
- 31 + 28 + 31,
- 31 + 28 + 31 + 30,
- 31 + 28 + 31 + 30 + 31,
- 31 + 28 + 31 + 30 + 31 + 30,
- 31 + 28 + 31 + 30 + 31 + 30 + 31,
- 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
- 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
- 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
- 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30,
- 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31
- },
- {
- 0,
- 0,
- 31,
- 31 + 29,
- 31 + 29 + 31,
- 31 + 29 + 31 + 30,
- 31 + 29 + 31 + 30 + 31,
- 31 + 29 + 31 + 30 + 31 + 30,
- 31 + 29 + 31 + 30 + 31 + 30 + 31,
- 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31,
- 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
- 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
- 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30,
- 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31
- }
-};
-
-/* Get the system time as seconds elapsed since midnight, January 1, 1970. */
-//INTN time(
-// INTN *timer
-// )
-time_t time (time_t *timer)
-{
- EFI_STATUS Status;
- EFI_TIME Time;
- time_t CalTime;
- UINTN Year;
-
- //
- // Get the current time and date information
- //
- Status = gRT->GetTime (&Time, NULL);
- if (EFI_ERROR (Status) || (Time.Year < 1970)) {
- return 0;
- }
-
- //
- // Years Handling
- // UTime should now be set to 00:00:00 on Jan 1 of the current year.
- //
- for (Year = 1970, CalTime = 0; Year != Time.Year; Year++) {
- CalTime = CalTime + (time_t)(CumulativeDays[IsLeap(Year)][13] * SECSPERDAY);
- }
-
- //
- // Add in number of seconds for current Month, Day, Hour, Minute, Seconds, and TimeZone adjustment
- //
- CalTime = CalTime +
- (time_t)((Time.TimeZone != EFI_UNSPECIFIED_TIMEZONE) ? (Time.TimeZone * 60) : 0) +
- (time_t)(CumulativeDays[IsLeap(Time.Year)][Time.Month] * SECSPERDAY) +
- (time_t)(((Time.Day > 0) ? Time.Day - 1 : 0) * SECSPERDAY) +
- (time_t)(Time.Hour * SECSPERHOUR) +
- (time_t)(Time.Minute * 60) +
- (time_t)Time.Second;
-
- if (timer != NULL) {
- *timer = CalTime;
- }
-
- return CalTime;
-}
-
-//
-// Convert a time value from type time_t to struct tm.
-//
-struct tm * gmtime (const time_t *timer)
-{
- struct tm *GmTime;
- UINT16 DayNo;
- UINT16 DayRemainder;
- time_t Year;
- time_t YearNo;
- UINT16 TotalDays;
- UINT16 MonthNo;
-
- if (timer == NULL) {
- return NULL;
- }
-
- GmTime = malloc (sizeof (struct tm));
- if (GmTime == NULL) {
- return NULL;
- }
-
- ZeroMem ((VOID *) GmTime, (UINTN) sizeof (struct tm));
-
- DayNo = (UINT16) (*timer / SECSPERDAY);
- DayRemainder = (UINT16) (*timer % SECSPERDAY);
-
- GmTime->tm_sec = (int) (DayRemainder % SECSPERMIN);
- GmTime->tm_min = (int) ((DayRemainder % SECSPERHOUR) / SECSPERMIN);
- GmTime->tm_hour = (int) (DayRemainder / SECSPERHOUR);
- GmTime->tm_wday = (int) ((DayNo + 4) % 7);
-
- for (Year = 1970, YearNo = 0; DayNo > 0; Year++) {
- TotalDays = (UINT16) (IsLeap (Year) ? 366 : 365);
- if (DayNo >= TotalDays) {
- DayNo = (UINT16) (DayNo - TotalDays);
- YearNo++;
- } else {
- break;
- }
- }
-
- GmTime->tm_year = (int) (YearNo + (1970 - 1900));
- GmTime->tm_yday = (int) DayNo;
-
- for (MonthNo = 12; MonthNo > 1; MonthNo--) {
- if (DayNo >= CumulativeDays[IsLeap(Year)][MonthNo]) {
- DayNo = (UINT16) (DayNo - (UINT16) (CumulativeDays[IsLeap(Year)][MonthNo]));
- break;
- }
- }
-
- GmTime->tm_mon = (int) MonthNo - 1;
- GmTime->tm_mday = (int) DayNo + 1;
-
- GmTime->tm_isdst = 0;
- GmTime->tm_gmtoff = 0;
- GmTime->tm_zone = NULL;
-
- return GmTime;
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/CrtLibSupport.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/CrtLibSupport.h
deleted file mode 100644
index ab1168b..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/CrtLibSupport.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/** @file
- Root include file of C runtime library to support building the third-party
- cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __CRT_LIB_SUPPORT_H__
-#define __CRT_LIB_SUPPORT_H__
-
-#include
-#include
-#include
-#include
-
-#define OPENSSLDIR ""
-#define ENGINESDIR ""
-
-#define MAX_STRING_SIZE 0x1000
-
-//
-// OpenSSL relies on explicit configuration for word size in crypto/bn,
-// but we want it to be automatically inferred from the target. So we
-// bypass what's in for OPENSSL_SYS_UEFI, and
-// define our own here.
-//
-#ifdef CONFIG_HEADER_BN_H
-#error CONFIG_HEADER_BN_H already defined
-#endif
-
-#define CONFIG_HEADER_BN_H
-
-#if defined(MDE_CPU_X64) || defined(MDE_CPU_AARCH64) || defined(MDE_CPU_IA64)
-//
-// With GCC we would normally use SIXTY_FOUR_BIT_LONG, but MSVC needs
-// SIXTY_FOUR_BIT, because 'long' is 32-bit and only 'long long' is
-// 64-bit. Since using 'long long' works fine on GCC too, just do that.
-//
-#define SIXTY_FOUR_BIT
-#elif defined(MDE_CPU_IA32) || defined(MDE_CPU_ARM) || defined(MDE_CPU_EBC)
-#define THIRTY_TWO_BIT
-#else
-#error Unknown target architecture
-#endif
-
-//
-// Map all va_xxxx elements to VA_xxx defined in MdePkg/Include/Base.h
-//
-#if !defined(__CC_ARM) // if va_list is not already defined
-#define va_list VA_LIST
-#define va_arg VA_ARG
-#define va_start VA_START
-#define va_end VA_END
-#else // __CC_ARM
-#define va_start(Marker, Parameter) __va_start(Marker, Parameter)
-#define va_arg(Marker, TYPE) __va_arg(Marker, TYPE)
-#define va_end(Marker) ((void)0)
-#endif
-
-//
-// Definitions for global constants used by CRT library routines
-//
-#define EINVAL 22 /* Invalid argument */
-#define INT_MAX 0x7FFFFFFF /* Maximum (signed) int value */
-#define LONG_MAX 0X7FFFFFFFL /* max value for a long */
-#define LONG_MIN (-LONG_MAX-1) /* min value for a long */
-#define ULONG_MAX 0xFFFFFFFF /* Maximum unsigned long value */
-#define CHAR_BIT 8 /* Number of bits in a char */
-
-//
-// Basic types mapping
-//
-typedef UINTN size_t;
-typedef INTN ssize_t;
-typedef INT32 time_t;
-typedef UINT8 __uint8_t;
-typedef UINT8 sa_family_t;
-typedef UINT32 uid_t;
-typedef UINT32 gid_t;
-
-//
-// File operations are not required for EFI building,
-// so FILE is mapped to VOID * to pass build
-//
-typedef VOID *FILE;
-
-//
-// Structures Definitions
-//
-struct tm {
- int tm_sec; /* seconds after the minute [0-60] */
- int tm_min; /* minutes after the hour [0-59] */
- int tm_hour; /* hours since midnight [0-23] */
- int tm_mday; /* day of the month [1-31] */
- int tm_mon; /* months since January [0-11] */
- int tm_year; /* years since 1900 */
- int tm_wday; /* days since Sunday [0-6] */
- int tm_yday; /* days since January 1 [0-365] */
- int tm_isdst; /* Daylight Savings Time flag */
- long tm_gmtoff; /* offset from CUT in seconds */
- char *tm_zone; /* timezone abbreviation */
-};
-
-struct timeval {
- long tv_sec; /* time value, in seconds */
- long tv_usec; /* time value, in microseconds */
-};
-
-struct sockaddr {
- __uint8_t sa_len; /* total length */
- sa_family_t sa_family; /* address family */
- char sa_data[14]; /* actually longer; address value */
-};
-
-//
-// Global variables
-//
-extern int errno;
-extern FILE *stderr;
-
-//
-// Function prototypes of CRT Library routines
-//
-void *malloc (size_t);
-void *realloc (void *, size_t);
-void free (void *);
-void *memset (void *, int, size_t);
-int memcmp (const void *, const void *, size_t);
-int isdigit (int);
-int isspace (int);
-int isxdigit (int);
-int isalnum (int);
-int isupper (int);
-int tolower (int);
-int strcmp (const char *, const char *);
-int strncasecmp (const char *, const char *, size_t);
-char *strrchr (const char *, int);
-unsigned long strtoul (const char *, char **, int);
-long strtol (const char *, char **, int);
-char *strerror (int);
-size_t strspn (const char *, const char *);
-size_t strcspn (const char *, const char *);
-int printf (const char *, ...);
-int sscanf (const char *, const char *, ...);
-FILE *fopen (const char *, const char *);
-size_t fread (void *, size_t, size_t, FILE *);
-size_t fwrite (const void *, size_t, size_t, FILE *);
-int fclose (FILE *);
-int fprintf (FILE *, const char *, ...);
-time_t time (time_t *);
-struct tm *gmtime (const time_t *);
-uid_t getuid (void);
-uid_t geteuid (void);
-gid_t getgid (void);
-gid_t getegid (void);
-void qsort (void *, size_t, size_t, int (*)(const void *, const void *));
-char *getenv (const char *);
-char *secure_getenv (const char *);
-#if defined(__GNUC__) && (__GNUC__ >= 2)
-void abort (void) __attribute__((__noreturn__));
-#else
-void abort (void);
-#endif
-
-//
-// Macros that directly map functions to BaseLib, BaseMemoryLib, and DebugLib functions
-//
-#define memcpy(dest,source,count) CopyMem(dest,source,(UINTN)(count))
-#define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch))
-#define memchr(buf,ch,count) ScanMem8(buf,(UINTN)(count),(UINT8)ch)
-#define memcmp(buf1,buf2,count) (int)(CompareMem(buf1,buf2,(UINTN)(count)))
-#define memmove(dest,source,count) CopyMem(dest,source,(UINTN)(count))
-#define strlen(str) (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE))
-#define strcpy(strDest,strSource) AsciiStrCpyS(strDest,MAX_STRING_SIZE,strSource)
-#define strncpy(strDest,strSource,count) AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count)
-#define strcat(strDest,strSource) AsciiStrCatS(strDest,MAX_STRING_SIZE,strSource)
-#define strchr(str,ch) ScanMem8((VOID *)(str),AsciiStrSize(str),(UINT8)ch)
-#define strncmp(string1,string2,count) (int)(AsciiStrnCmp(string1,string2,(UINTN)(count)))
-#define strcasecmp(str1,str2) (int)AsciiStriCmp(str1,str2)
-#define sprintf(buf,...) AsciiSPrint(buf,MAX_STRING_SIZE,__VA_ARGS__)
-#define localtime(timer) NULL
-#define assert(expression)
-#define offsetof(type,member) OFFSET_OF(type,member)
-#define atoi(nptr) AsciiStrDecimalToUintn(nptr)
-#define gettimeofday(tvp,tz) do { (tvp)->tv_sec = time(NULL); (tvp)->tv_usec = 0; } while (0)
-
-#endif
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/assert.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/assert.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/assert.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/ctype.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/ctype.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/ctype.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/errno.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/errno.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/errno.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/internal/dso_conf.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/internal/dso_conf.h
deleted file mode 100644
index e69de29..0000000
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/limits.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/limits.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/limits.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/memory.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/memory.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/memory.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/openssl/opensslconf.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/openssl/opensslconf.h
deleted file mode 100644
index 28dd9ab..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/openssl/opensslconf.h
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * WARNING: do not edit!
- * Generated from include/openssl/opensslconf.h.in
- *
- * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the OpenSSL license (the "License"). You may not use
- * this file except in compliance with the License. You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef OPENSSL_ALGORITHM_DEFINES
-# error OPENSSL_ALGORITHM_DEFINES no longer supported
-#endif
-
-/*
- * OpenSSL was configured with the following options:
- */
-
-#ifndef OPENSSL_SYS_UEFI
-# define OPENSSL_SYS_UEFI 1
-#endif
-#define OPENSSL_MIN_API 0x10100000L
-#ifndef OPENSSL_NO_BF
-# define OPENSSL_NO_BF
-#endif
-#ifndef OPENSSL_NO_BLAKE2
-# define OPENSSL_NO_BLAKE2
-#endif
-#ifndef OPENSSL_NO_CAMELLIA
-# define OPENSSL_NO_CAMELLIA
-#endif
-#ifndef OPENSSL_NO_CAST
-# define OPENSSL_NO_CAST
-#endif
-#ifndef OPENSSL_NO_CHACHA
-# define OPENSSL_NO_CHACHA
-#endif
-#ifndef OPENSSL_NO_CMS
-# define OPENSSL_NO_CMS
-#endif
-#ifndef OPENSSL_NO_CT
-# define OPENSSL_NO_CT
-#endif
-#ifndef OPENSSL_NO_DSA
-# define OPENSSL_NO_DSA
-#endif
-#ifndef OPENSSL_NO_EC
-# define OPENSSL_NO_EC
-#endif
-#ifndef OPENSSL_NO_IDEA
-# define OPENSSL_NO_IDEA
-#endif
-#ifndef OPENSSL_NO_MD2
-# define OPENSSL_NO_MD2
-#endif
-#ifndef OPENSSL_NO_MDC2
-# define OPENSSL_NO_MDC2
-#endif
-#ifndef OPENSSL_NO_POLY1305
-# define OPENSSL_NO_POLY1305
-#endif
-#ifndef OPENSSL_NO_RC2
-# define OPENSSL_NO_RC2
-#endif
-#ifndef OPENSSL_NO_RC5
-# define OPENSSL_NO_RC5
-#endif
-#ifndef OPENSSL_NO_RMD160
-# define OPENSSL_NO_RMD160
-#endif
-#ifndef OPENSSL_NO_SEED
-# define OPENSSL_NO_SEED
-#endif
-#ifndef OPENSSL_NO_SRP
-# define OPENSSL_NO_SRP
-#endif
-#ifndef OPENSSL_NO_TS
-# define OPENSSL_NO_TS
-#endif
-#ifndef OPENSSL_NO_UI
-# define OPENSSL_NO_UI
-#endif
-#ifndef OPENSSL_NO_WHIRLPOOL
-# define OPENSSL_NO_WHIRLPOOL
-#endif
-#ifndef OPENSSL_NO_AFALGENG
-# define OPENSSL_NO_AFALGENG
-#endif
-#ifndef OPENSSL_NO_APPS
-# define OPENSSL_NO_APPS
-#endif
-#ifndef OPENSSL_NO_ASAN
-# define OPENSSL_NO_ASAN
-#endif
-#ifndef OPENSSL_NO_ASM
-# define OPENSSL_NO_ASM
-#endif
-#ifndef OPENSSL_NO_ASYNC
-# define OPENSSL_NO_ASYNC
-#endif
-#ifndef OPENSSL_NO_AUTOALGINIT
-# define OPENSSL_NO_AUTOALGINIT
-#endif
-#ifndef OPENSSL_NO_AUTOERRINIT
-# define OPENSSL_NO_AUTOERRINIT
-#endif
-#ifndef OPENSSL_NO_CAPIENG
-# define OPENSSL_NO_CAPIENG
-#endif
-#ifndef OPENSSL_NO_CRYPTO_MDEBUG
-# define OPENSSL_NO_CRYPTO_MDEBUG
-#endif
-#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
-# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
-#endif
-#ifndef OPENSSL_NO_DEPRECATED
-# define OPENSSL_NO_DEPRECATED
-#endif
-#ifndef OPENSSL_NO_DGRAM
-# define OPENSSL_NO_DGRAM
-#endif
-#ifndef OPENSSL_NO_DTLS
-# define OPENSSL_NO_DTLS
-#endif
-#ifndef OPENSSL_NO_DTLS1
-# define OPENSSL_NO_DTLS1
-#endif
-#ifndef OPENSSL_NO_DTLS1_2
-# define OPENSSL_NO_DTLS1_2
-#endif
-#ifndef OPENSSL_NO_EC2M
-# define OPENSSL_NO_EC2M
-#endif
-#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
-# define OPENSSL_NO_EC_NISTP_64_GCC_128
-#endif
-#ifndef OPENSSL_NO_ECDH
-# define OPENSSL_NO_ECDH
-#endif
-#ifndef OPENSSL_NO_ECDSA
-# define OPENSSL_NO_ECDSA
-#endif
-#ifndef OPENSSL_NO_EGD
-# define OPENSSL_NO_EGD
-#endif
-#ifndef OPENSSL_NO_ENGINE
-# define OPENSSL_NO_ENGINE
-#endif
-#ifndef OPENSSL_NO_ERR
-# define OPENSSL_NO_ERR
-#endif
-#ifndef OPENSSL_NO_FILENAMES
-# define OPENSSL_NO_FILENAMES
-#endif
-#ifndef OPENSSL_NO_FUZZ_AFL
-# define OPENSSL_NO_FUZZ_AFL
-#endif
-#ifndef OPENSSL_NO_FUZZ_LIBFUZZER
-# define OPENSSL_NO_FUZZ_LIBFUZZER
-#endif
-#ifndef OPENSSL_NO_GOST
-# define OPENSSL_NO_GOST
-#endif
-#ifndef OPENSSL_NO_HEARTBEATS
-# define OPENSSL_NO_HEARTBEATS
-#endif
-#ifndef OPENSSL_NO_HW
-# define OPENSSL_NO_HW
-#endif
-#ifndef OPENSSL_NO_MSAN
-# define OPENSSL_NO_MSAN
-#endif
-#ifndef OPENSSL_NO_OCB
-# define OPENSSL_NO_OCB
-#endif
-#ifndef OPENSSL_NO_POSIX_IO
-# define OPENSSL_NO_POSIX_IO
-#endif
-#ifndef OPENSSL_NO_RFC3779
-# define OPENSSL_NO_RFC3779
-#endif
-#ifndef OPENSSL_NO_SCRYPT
-# define OPENSSL_NO_SCRYPT
-#endif
-#ifndef OPENSSL_NO_SCTP
-# define OPENSSL_NO_SCTP
-#endif
-#ifndef OPENSSL_NO_SOCK
-# define OPENSSL_NO_SOCK
-#endif
-#ifndef OPENSSL_NO_SSL_TRACE
-# define OPENSSL_NO_SSL_TRACE
-#endif
-#ifndef OPENSSL_NO_SSL3
-# define OPENSSL_NO_SSL3
-#endif
-#ifndef OPENSSL_NO_SSL3_METHOD
-# define OPENSSL_NO_SSL3_METHOD
-#endif
-#ifndef OPENSSL_NO_STDIO
-# define OPENSSL_NO_STDIO
-#endif
-#ifndef OPENSSL_NO_TESTS
-# define OPENSSL_NO_TESTS
-#endif
-#ifndef OPENSSL_NO_UBSAN
-# define OPENSSL_NO_UBSAN
-#endif
-#ifndef OPENSSL_NO_UNIT_TEST
-# define OPENSSL_NO_UNIT_TEST
-#endif
-#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
-# define OPENSSL_NO_WEAK_SSL_CIPHERS
-#endif
-#ifndef OPENSSL_NO_AFALGENG
-# define OPENSSL_NO_AFALGENG
-#endif
-
-
-/*
- * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers
- * don't like that. This will hopefully silence them.
- */
-#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
-
-/*
- * Applications should use -DOPENSSL_API_COMPAT= to suppress the
- * declarations of functions deprecated in or before . Otherwise, they
- * still won't see them if the library has been built to disable deprecated
- * functions.
- */
-#ifndef DECLARE_DEPRECATED
-# if defined(OPENSSL_NO_DEPRECATED)
-# define DECLARE_DEPRECATED(f)
-# else
-# define DECLARE_DEPRECATED(f) f;
-# ifdef __GNUC__
-# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
-# undef DECLARE_DEPRECATED
-# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
-# endif
-# endif
-# endif
-#endif
-
-#ifndef OPENSSL_FILE
-# ifdef OPENSSL_NO_FILENAMES
-# define OPENSSL_FILE ""
-# define OPENSSL_LINE 0
-# else
-# define OPENSSL_FILE __FILE__
-# define OPENSSL_LINE __LINE__
-# endif
-#endif
-
-#ifndef OPENSSL_MIN_API
-# define OPENSSL_MIN_API 0
-#endif
-
-#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API
-# undef OPENSSL_API_COMPAT
-# define OPENSSL_API_COMPAT OPENSSL_MIN_API
-#endif
-
-#if OPENSSL_API_COMPAT < 0x10100000L
-# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f)
-#else
-# define DEPRECATEDIN_1_1_0(f)
-#endif
-
-#if OPENSSL_API_COMPAT < 0x10000000L
-# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f)
-#else
-# define DEPRECATEDIN_1_0_0(f)
-#endif
-
-#if OPENSSL_API_COMPAT < 0x00908000L
-# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f)
-#else
-# define DEPRECATEDIN_0_9_8(f)
-#endif
-
-
-
-/* Generate 80386 code? */
-#undef I386_ONLY
-
-#undef OPENSSL_UNISTD
-#define OPENSSL_UNISTD
-
-#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
-
-/*
- * The following are cipher-specific, but are part of the public API.
- */
-#if !defined(OPENSSL_SYS_UEFI)
-# undef BN_LLONG
-/* Only one for the following should be defined */
-# undef SIXTY_FOUR_BIT_LONG
-# undef SIXTY_FOUR_BIT
-# define THIRTY_TWO_BIT
-#endif
-
-#define RC4_INT unsigned int
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stdarg.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stdarg.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stdarg.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stddef.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stddef.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stddef.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stdio.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stdio.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stdio.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stdlib.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stdlib.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/stdlib.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/string.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/string.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/string.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/strings.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/strings.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/strings.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/sys/time.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/sys/time.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/sys/time.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/sys/types.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/sys/types.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/sys/types.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/syslog.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/syslog.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/syslog.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/time.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/time.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/time.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/unistd.h b/Voyager/Voyager/edk2/CryptoPkg/Library/Include/unistd.h
deleted file mode 100644
index 6f8b4f8..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/Include/unistd.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** @file
- Include file to support building the third-party cryptographic library.
-
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni b/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni
deleted file mode 100644
index fbecd7d..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/BaseIntrinsicLib.uni
+++ /dev/null
@@ -1,22 +0,0 @@
-// /** @file
-// Intrinsic Routines Wrapper Library Instance.
-//
-// This module is intrinsic routines wrapper library instance.
-//
-// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Intrinsic Routines Wrapper Library Instance"
-
-#string STR_MODULE_DESCRIPTION #language en-US "This module is intrinsic routines wrapper library instance."
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/CopyMem.c b/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/CopyMem.c
deleted file mode 100644
index 40aad7f..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/CopyMem.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/** @file
- Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based
- Cryptographic Library.
-
-Copyright (c) 2010, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-#include
-
-/* Copies bytes between buffers */
-void * memcpy (void *dest, const void *src, unsigned int count)
-{
- return CopyMem (dest, src, (UINTN)count);
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.S b/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.S
deleted file mode 100644
index a7342a4..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.S
+++ /dev/null
@@ -1,62 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2014, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# MathLShiftS64.S
-#
-# Abstract:
-#
-# 64-bit Math Worker Function.
-# Shifts a 64-bit signed value left by a certain number of bits.
-#
-#------------------------------------------------------------------------------
-
- .686:
- .code:
-
-ASM_GLOBAL ASM_PFX(__ashldi3)
-
-#------------------------------------------------------------------------------
-#
-# void __cdecl __ashldi3 (void)
-#
-#------------------------------------------------------------------------------
-ASM_PFX(__ashldi3):
- #
- # Handle shifting of 64 or more bits (return 0)
- #
- cmpb $64, %cl
- jae ReturnZero
-
- #
- # Handle shifting of between 0 and 31 bits
- #
- cmpb $32, %cl
- jae More32
- shld %cl, %eax, %edx
- shl %cl, %eax
- ret
-
- #
- # Handle shifting of between 32 and 63 bits
- #
-More32:
- movl %eax, %edx
- xor %eax, %eax
- and $31, %cl
- shl %cl, %edx
- ret
-
-ReturnZero:
- xor %eax, %eax
- xor %edx, %edx
- ret
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c b/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c
deleted file mode 100644
index f5baf0e..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
- 64-bit Math Worker Function.
- The 32-bit versions of C compiler generate calls to library routines
- to handle 64-bit math. These functions use non-standard calling conventions.
-
-Copyright (c) 2014, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-/*
- * Shifts a 64-bit signed value left by a particular number of bits.
- */
-__declspec(naked) void __cdecl _allshl (void)
-{
- _asm {
- ;
- ; Handle shifting of 64 or more bits (return 0)
- ;
- cmp cl, 64
- jae short ReturnZero
-
- ;
- ; Handle shifting of between 0 and 31 bits
- ;
- cmp cl, 32
- jae short More32
- shld edx, eax, cl
- shl eax, cl
- ret
-
- ;
- ; Handle shifting of between 32 and 63 bits
- ;
-More32:
- mov edx, eax
- xor eax, eax
- and cl, 31
- shl edx, cl
- ret
-
-ReturnZero:
- xor eax,eax
- xor edx,edx
- ret
- }
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm b/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm
deleted file mode 100644
index 8855a3d..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm
+++ /dev/null
@@ -1,48 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; MathLShiftS64.nasm
-;
-; Abstract:
-;
-; 64-bit Math Worker Function.
-; Shifts a 64-bit signed value left by a certain number of bits.
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-global ASM_PFX(__ashldi3)
-;------------------------------------------------------------------------------
-;
-; void __cdecl __ashldi3 (void)
-;
-;------------------------------------------------------------------------------
-ASM_PFX(__ashldi3):
- cmp cl,0x40
- jnc ReturnZero
- cmp cl,0x20
- jnc More32
- shld edx,eax,cl
- shl eax,cl
- ret
-More32:
- mov edx,eax
- xor eax,eax
- and cl,0x1f
- shl edx,cl
- ret
-ReturnZero:
- xor eax,eax
- xor edx,edx
- ret
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.S b/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.S
deleted file mode 100644
index 2e2d92e..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.S
+++ /dev/null
@@ -1,66 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2014, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# MathRShiftU64.S
-#
-# Abstract:
-#
-# 64-bit Math Worker Function.
-# Shifts a 64-bit unsigned value right by a certain number of bits.
-#
-#------------------------------------------------------------------------------
-
-
- .686:
- .code:
-
-ASM_GLOBAL ASM_PFX(__ashrdi3)
-
-#------------------------------------------------------------------------------
-#
-# void __cdecl __ashrdi3 (void)
-#
-#------------------------------------------------------------------------------
-ASM_PFX(__ashrdi3):
- #
- # Checking: Only handle 64bit shifting or more
- #
- cmpb $64, %cl
- jae _Exit
-
- #
- # Handle shifting between 0 and 31 bits
- #
- cmpb $32, %cl
- jae More32
- shrd %cl, %edx, %eax
- shr %cl, %edx
- ret
-
- #
- # Handle shifting of 32-63 bits
- #
-More32:
- movl %edx, %eax
- xor %edx, %edx
- and $31, %cl
- shr %cl, %eax
- ret
-
- #
- # Invalid number (less then 32bits), return 0
- #
-_Exit:
- xor %eax, %eax
- xor %edx, %edx
- ret
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c b/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c
deleted file mode 100644
index 2fe4deb..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/** @file
- 64-bit Math Worker Function.
- The 32-bit versions of C compiler generate calls to library routines
- to handle 64-bit math. These functions use non-standard calling conventions.
-
-Copyright (c) 2014, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-/*
- * Shifts a 64-bit unsigned value right by a certain number of bits.
- */
-__declspec(naked) void __cdecl _aullshr (void)
-{
- _asm {
- ;
- ; Checking: Only handle 64bit shifting or more
- ;
- cmp cl, 64
- jae _Exit
-
- ;
- ; Handle shifting between 0 and 31 bits
- ;
- cmp cl, 32
- jae More32
- shrd eax, edx, cl
- shr edx, cl
- ret
-
- ;
- ; Handle shifting of 32-63 bits
- ;
-More32:
- mov eax, edx
- xor edx, edx
- and cl, 31
- shr eax, cl
- ret
-
- ;
- ; Invalid number (less then 32bits), return 0
- ;
-_Exit:
- xor eax, eax
- xor edx, edx
- ret
- }
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm b/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm
deleted file mode 100644
index 65a3684..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm
+++ /dev/null
@@ -1,49 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; MathRShiftU64.nasm
-;
-; Abstract:
-;
-; 64-bit Math Worker Function.
-; Shifts a 64-bit unsigned value right by a certain number of bits.
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-;
-; void __cdecl __ashrdi3 (void)
-;
-;------------------------------------------------------------------------------
-global ASM_PFX(__ashrdi3)
-ASM_PFX(__ashrdi3):
- cmp cl,0x40
- jnc _Exit
- cmp cl,0x20
- jnc More32
- shrd eax,edx,cl
- shr edx,cl
- ret
-More32:
- mov eax,edx
- xor edx,edx
- and cl,0x1f
- shr eax,cl
- ret
-_Exit:
- xor eax,eax
- xor edx,edx
- ret
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf b/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
deleted file mode 100644
index f43254b..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+++ /dev/null
@@ -1,73 +0,0 @@
-## @file
-# Intrinsic Routines Wrapper Library Instance.
-#
-# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseIntrinsicLib
- MODULE_UNI_FILE = BaseIntrinsicLib.uni
- FILE_GUID = 63850097-3E97-4c4f-A52D-C811A0106105
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = IntrinsicLib
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64
-#
-
-[Sources]
- MemoryIntrinsics.c
-
-[Sources.IA32]
- CopyMem.c
-
- Ia32/MathLShiftS64.c | MSFT
- Ia32/MathRShiftU64.c | MSFT
-
- Ia32/MathLShiftS64.c | INTEL
- Ia32/MathRShiftU64.c | INTEL
-
- Ia32/MathLShiftS64.S | GCC
- Ia32/MathRShiftU64.S | GCC
- Ia32/MathLShiftS64.nasm | GCC
- Ia32/MathRShiftU64.nasm | GCC
-
-[Sources.X64]
- CopyMem.c
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- BaseLib
- BaseMemoryLib
-
-[BuildOptions]
- #
- # Override MSFT build option to remove /Oi and /GL
- #
- MSFT:DEBUG_VS2003_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm
- MSFT:RELEASE_VS2003_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX-
- MSFT:DEBUG_VS2003xASL_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX- /Zi /Gm
- MSFT:RELEASE_VS2003xASL_IA32_CC_FLAGS == /nologo /c /WX /W4 /Gs32768 /Gy /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /GX-
- MSFT:DEBUG_DDK3790_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
- MSFT:RELEASE_DDK3790_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF
- MSFT:DEBUG_DDK3790xASL_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
- MSFT:RELEASE_DDK3790xASL_IA32_CC_FLAGS == /nologo /c /WX /Gy /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF
- MSFT:DEBUG_*_IA32_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm
- MSFT:RELEASE_*_IA32_CC_FLAGS == /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /FIAutoGen.h /EHs-c- /GR- /GF
- MSFT:DEBUG_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm
- MSFT:RELEASE_*_X64_CC_FLAGS == /nologo /c /WX /GS- /X /W4 /Gs32768 /D UNICODE /O1b2s /Gy /FIAutoGen.h /EHs-c- /GR- /GF
- INTEL:*_*_*_CC_FLAGS = /Oi-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c b/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
deleted file mode 100644
index 9a66b37..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @file
- Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based
- Cryptographic Library.
-
-Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-#include
-#include
-
-typedef UINTN size_t;
-
-/* OpenSSL will use floating point support, and C compiler produces the _fltused
- symbol by default. Simply define this symbol here to satisfy the linker. */
-int _fltused = 1;
-
-/* Sets buffers to a specified character */
-void * memset (void *dest, int ch, size_t count)
-{
- //
- // NOTE: Here we use one base implementation for memset, instead of the direct
- // optimized SetMem() wrapper. Because the IntrinsicLib has to be built
- // without whole program optimization option, and there will be some
- // potential register usage errors when calling other optimized codes.
- //
-
- //
- // Declare the local variables that actually move the data elements as
- // volatile to prevent the optimizer from replacing this function with
- // the intrinsic memset()
- //
- volatile UINT8 *Pointer;
-
- Pointer = (UINT8 *)dest;
- while (count-- != 0) {
- *(Pointer++) = (UINT8)ch;
- }
-
- return dest;
-}
-
-/* Compare bytes in two buffers. */
-int memcmp (const void *buf1, const void *buf2, size_t count)
-{
- return (int)CompareMem(buf1, buf2, count);
-}
-
-int strcmp (const char *s1, const char *s2)
-{
- return (int)AsciiStrCmp(s1, s2);
-}
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpenSSL-HOWTO.txt b/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpenSSL-HOWTO.txt
deleted file mode 100644
index a062b95..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpenSSL-HOWTO.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-
-=============================================================================
- Introduction
-=============================================================================
- OpenSSL is a well-known open source implementation of SSL/TLS protocols.
-The core library implements the cryptographic and SSL/TLS functions and
-also provides various utility functions. The OpenSSL library is widely used
-in variety of security products development as base crypto provider.
-(See http://www.openssl.org/ for more information about OpenSSL).
- UEFI (Unified Extensible Firmware Interface) is a specification detailing
-the interfaces between OS and platform firmware. Several security features
-were introduced (e.g. Authenticated Variable Service, Driver Signing, etc)
-from UEFI 2.2 (http://www.uefi.org/). These security features highly depend
-on the cryptography.
- This HOWTO documents OpenSSL building under UEFI/EDKII environment.
-
-=============================================================================
- OpenSSL-Version
-=============================================================================
- EDKII supports building with the latest release of OpenSSL.
- NOTE: Only latest release version was fully validated.
- And no guarantees on build & functionality if using other versions.
-
-=============================================================================
- HOW to Install OpenSSL for UEFI Building
-=============================================================================
- OpenSSL repository was added as one submodule of EDKII project.
-
- The user can use the following commands to clone both main EDKII repo and
-openssl submodule:
- 1) Add the "--recursive" flag to the git clone command:
- $ git clone --recursive https://github.com/tianocore/edk2
-or
- 2) Manually initialize and update the submodules after the clone operation
- on main project:
- $ git clone https://github.com/tianocore/edk2
- $ git submodule update --init --recursive
-
- And use the following combined commands to pull the remote submodule updates
-(e.g. Updating the new supported OpenSSL release tag):
- $ git pull --recurse-submodules && \
- git submodule update --recursive
-
-=============================================================================
- About process_files.pl
-=============================================================================
- "process_files.pl" is one Perl script which runs the OpenSSL Configure,
-then processes the resulting file list into our local OpensslLib.inf and
-OpensslLibCrypto.inf.
- This only needs to be done once by the maintainer / developer when
-updating to a new version of OpenSSL (or changing options, etc.).
-Normal users do not need do this, since the results are already stored in
-the EDKII git repository for them.
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf
deleted file mode 100644
index 8a9265a..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ /dev/null
@@ -1,597 +0,0 @@
-## @file
-# This module provides OpenSSL Library implementation.
-#
-# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = OpensslLib
- MODULE_UNI_FILE = OpensslLib.uni
- FILE_GUID = C873A7D0-9824-409f-9B42-2C158B992E69
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = OpensslLib
- DEFINE OPENSSL_PATH = openssl
- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNO_SYSLOG
-
-#
-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
-#
-
-[Sources]
- $(OPENSSL_PATH)/e_os.h
-# Autogenerated files list starts here
- $(OPENSSL_PATH)/crypto/aes/aes_cbc.c
- $(OPENSSL_PATH)/crypto/aes/aes_cfb.c
- $(OPENSSL_PATH)/crypto/aes/aes_core.c
- $(OPENSSL_PATH)/crypto/aes/aes_ecb.c
- $(OPENSSL_PATH)/crypto/aes/aes_ige.c
- $(OPENSSL_PATH)/crypto/aes/aes_misc.c
- $(OPENSSL_PATH)/crypto/aes/aes_ofb.c
- $(OPENSSL_PATH)/crypto/aes/aes_wrap.c
- $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c
- $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c
- $(OPENSSL_PATH)/crypto/asn1/a_digest.c
- $(OPENSSL_PATH)/crypto/asn1/a_dup.c
- $(OPENSSL_PATH)/crypto/asn1/a_gentm.c
- $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c
- $(OPENSSL_PATH)/crypto/asn1/a_int.c
- $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c
- $(OPENSSL_PATH)/crypto/asn1/a_object.c
- $(OPENSSL_PATH)/crypto/asn1/a_octet.c
- $(OPENSSL_PATH)/crypto/asn1/a_print.c
- $(OPENSSL_PATH)/crypto/asn1/a_sign.c
- $(OPENSSL_PATH)/crypto/asn1/a_strex.c
- $(OPENSSL_PATH)/crypto/asn1/a_strnid.c
- $(OPENSSL_PATH)/crypto/asn1/a_time.c
- $(OPENSSL_PATH)/crypto/asn1/a_type.c
- $(OPENSSL_PATH)/crypto/asn1/a_utctm.c
- $(OPENSSL_PATH)/crypto/asn1/a_utf8.c
- $(OPENSSL_PATH)/crypto/asn1/a_verify.c
- $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c
- $(OPENSSL_PATH)/crypto/asn1/asn1_err.c
- $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c
- $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c
- $(OPENSSL_PATH)/crypto/asn1/asn1_par.c
- $(OPENSSL_PATH)/crypto/asn1/asn_mime.c
- $(OPENSSL_PATH)/crypto/asn1/asn_moid.c
- $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c
- $(OPENSSL_PATH)/crypto/asn1/asn_pack.c
- $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c
- $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c
- $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c
- $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c
- $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c
- $(OPENSSL_PATH)/crypto/asn1/f_int.c
- $(OPENSSL_PATH)/crypto/asn1/f_string.c
- $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c
- $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c
- $(OPENSSL_PATH)/crypto/asn1/n_pkey.c
- $(OPENSSL_PATH)/crypto/asn1/nsseq.c
- $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c
- $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c
- $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c
- $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c
- $(OPENSSL_PATH)/crypto/asn1/t_bitst.c
- $(OPENSSL_PATH)/crypto/asn1/t_pkey.c
- $(OPENSSL_PATH)/crypto/asn1/t_spki.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_new.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c
- $(OPENSSL_PATH)/crypto/asn1/x_algor.c
- $(OPENSSL_PATH)/crypto/asn1/x_bignum.c
- $(OPENSSL_PATH)/crypto/asn1/x_info.c
- $(OPENSSL_PATH)/crypto/asn1/x_int64.c
- $(OPENSSL_PATH)/crypto/asn1/x_long.c
- $(OPENSSL_PATH)/crypto/asn1/x_pkey.c
- $(OPENSSL_PATH)/crypto/asn1/x_sig.c
- $(OPENSSL_PATH)/crypto/asn1/x_spki.c
- $(OPENSSL_PATH)/crypto/asn1/x_val.c
- $(OPENSSL_PATH)/crypto/async/arch/async_null.c
- $(OPENSSL_PATH)/crypto/async/arch/async_posix.c
- $(OPENSSL_PATH)/crypto/async/arch/async_win.c
- $(OPENSSL_PATH)/crypto/async/async.c
- $(OPENSSL_PATH)/crypto/async/async_err.c
- $(OPENSSL_PATH)/crypto/async/async_wait.c
- $(OPENSSL_PATH)/crypto/bio/b_addr.c
- $(OPENSSL_PATH)/crypto/bio/b_dump.c
- $(OPENSSL_PATH)/crypto/bio/b_sock.c
- $(OPENSSL_PATH)/crypto/bio/b_sock2.c
- $(OPENSSL_PATH)/crypto/bio/bf_buff.c
- $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c
- $(OPENSSL_PATH)/crypto/bio/bf_nbio.c
- $(OPENSSL_PATH)/crypto/bio/bf_null.c
- $(OPENSSL_PATH)/crypto/bio/bio_cb.c
- $(OPENSSL_PATH)/crypto/bio/bio_err.c
- $(OPENSSL_PATH)/crypto/bio/bio_lib.c
- $(OPENSSL_PATH)/crypto/bio/bio_meth.c
- $(OPENSSL_PATH)/crypto/bio/bss_acpt.c
- $(OPENSSL_PATH)/crypto/bio/bss_bio.c
- $(OPENSSL_PATH)/crypto/bio/bss_conn.c
- $(OPENSSL_PATH)/crypto/bio/bss_dgram.c
- $(OPENSSL_PATH)/crypto/bio/bss_fd.c
- $(OPENSSL_PATH)/crypto/bio/bss_file.c
- $(OPENSSL_PATH)/crypto/bio/bss_log.c
- $(OPENSSL_PATH)/crypto/bio/bss_mem.c
- $(OPENSSL_PATH)/crypto/bio/bss_null.c
- $(OPENSSL_PATH)/crypto/bio/bss_sock.c
- $(OPENSSL_PATH)/crypto/bn/bn_add.c
- $(OPENSSL_PATH)/crypto/bn/bn_asm.c
- $(OPENSSL_PATH)/crypto/bn/bn_blind.c
- $(OPENSSL_PATH)/crypto/bn/bn_const.c
- $(OPENSSL_PATH)/crypto/bn/bn_ctx.c
- $(OPENSSL_PATH)/crypto/bn/bn_depr.c
- $(OPENSSL_PATH)/crypto/bn/bn_dh.c
- $(OPENSSL_PATH)/crypto/bn/bn_div.c
- $(OPENSSL_PATH)/crypto/bn/bn_err.c
- $(OPENSSL_PATH)/crypto/bn/bn_exp.c
- $(OPENSSL_PATH)/crypto/bn/bn_exp2.c
- $(OPENSSL_PATH)/crypto/bn/bn_gcd.c
- $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c
- $(OPENSSL_PATH)/crypto/bn/bn_intern.c
- $(OPENSSL_PATH)/crypto/bn/bn_kron.c
- $(OPENSSL_PATH)/crypto/bn/bn_lib.c
- $(OPENSSL_PATH)/crypto/bn/bn_mod.c
- $(OPENSSL_PATH)/crypto/bn/bn_mont.c
- $(OPENSSL_PATH)/crypto/bn/bn_mpi.c
- $(OPENSSL_PATH)/crypto/bn/bn_mul.c
- $(OPENSSL_PATH)/crypto/bn/bn_nist.c
- $(OPENSSL_PATH)/crypto/bn/bn_prime.c
- $(OPENSSL_PATH)/crypto/bn/bn_print.c
- $(OPENSSL_PATH)/crypto/bn/bn_rand.c
- $(OPENSSL_PATH)/crypto/bn/bn_recp.c
- $(OPENSSL_PATH)/crypto/bn/bn_shift.c
- $(OPENSSL_PATH)/crypto/bn/bn_sqr.c
- $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c
- $(OPENSSL_PATH)/crypto/bn/bn_srp.c
- $(OPENSSL_PATH)/crypto/bn/bn_word.c
- $(OPENSSL_PATH)/crypto/bn/bn_x931p.c
- $(OPENSSL_PATH)/crypto/buffer/buf_err.c
- $(OPENSSL_PATH)/crypto/buffer/buffer.c
- $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
- $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c
- $(OPENSSL_PATH)/crypto/cmac/cmac.c
- $(OPENSSL_PATH)/crypto/comp/c_zlib.c
- $(OPENSSL_PATH)/crypto/comp/comp_err.c
- $(OPENSSL_PATH)/crypto/comp/comp_lib.c
- $(OPENSSL_PATH)/crypto/conf/conf_api.c
- $(OPENSSL_PATH)/crypto/conf/conf_def.c
- $(OPENSSL_PATH)/crypto/conf/conf_err.c
- $(OPENSSL_PATH)/crypto/conf/conf_lib.c
- $(OPENSSL_PATH)/crypto/conf/conf_mall.c
- $(OPENSSL_PATH)/crypto/conf/conf_mod.c
- $(OPENSSL_PATH)/crypto/conf/conf_sap.c
- $(OPENSSL_PATH)/crypto/conf/conf_ssl.c
- $(OPENSSL_PATH)/crypto/cpt_err.c
- $(OPENSSL_PATH)/crypto/cryptlib.c
- $(OPENSSL_PATH)/crypto/cversion.c
- $(OPENSSL_PATH)/crypto/des/cbc_cksm.c
- $(OPENSSL_PATH)/crypto/des/cbc_enc.c
- $(OPENSSL_PATH)/crypto/des/cfb64ede.c
- $(OPENSSL_PATH)/crypto/des/cfb64enc.c
- $(OPENSSL_PATH)/crypto/des/cfb_enc.c
- $(OPENSSL_PATH)/crypto/des/des_enc.c
- $(OPENSSL_PATH)/crypto/des/ecb3_enc.c
- $(OPENSSL_PATH)/crypto/des/ecb_enc.c
- $(OPENSSL_PATH)/crypto/des/fcrypt.c
- $(OPENSSL_PATH)/crypto/des/fcrypt_b.c
- $(OPENSSL_PATH)/crypto/des/ofb64ede.c
- $(OPENSSL_PATH)/crypto/des/ofb64enc.c
- $(OPENSSL_PATH)/crypto/des/ofb_enc.c
- $(OPENSSL_PATH)/crypto/des/pcbc_enc.c
- $(OPENSSL_PATH)/crypto/des/qud_cksm.c
- $(OPENSSL_PATH)/crypto/des/rand_key.c
- $(OPENSSL_PATH)/crypto/des/rpc_enc.c
- $(OPENSSL_PATH)/crypto/des/set_key.c
- $(OPENSSL_PATH)/crypto/des/str2key.c
- $(OPENSSL_PATH)/crypto/des/xcbc_enc.c
- $(OPENSSL_PATH)/crypto/dh/dh_ameth.c
- $(OPENSSL_PATH)/crypto/dh/dh_asn1.c
- $(OPENSSL_PATH)/crypto/dh/dh_check.c
- $(OPENSSL_PATH)/crypto/dh/dh_depr.c
- $(OPENSSL_PATH)/crypto/dh/dh_err.c
- $(OPENSSL_PATH)/crypto/dh/dh_gen.c
- $(OPENSSL_PATH)/crypto/dh/dh_kdf.c
- $(OPENSSL_PATH)/crypto/dh/dh_key.c
- $(OPENSSL_PATH)/crypto/dh/dh_lib.c
- $(OPENSSL_PATH)/crypto/dh/dh_meth.c
- $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c
- $(OPENSSL_PATH)/crypto/dh/dh_prn.c
- $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c
- $(OPENSSL_PATH)/crypto/dso/dso_dl.c
- $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c
- $(OPENSSL_PATH)/crypto/dso/dso_err.c
- $(OPENSSL_PATH)/crypto/dso/dso_lib.c
- $(OPENSSL_PATH)/crypto/dso/dso_openssl.c
- $(OPENSSL_PATH)/crypto/dso/dso_vms.c
- $(OPENSSL_PATH)/crypto/dso/dso_win32.c
- $(OPENSSL_PATH)/crypto/ebcdic.c
- $(OPENSSL_PATH)/crypto/err/err.c
- $(OPENSSL_PATH)/crypto/err/err_all.c
- $(OPENSSL_PATH)/crypto/err/err_prn.c
- $(OPENSSL_PATH)/crypto/evp/bio_b64.c
- $(OPENSSL_PATH)/crypto/evp/bio_enc.c
- $(OPENSSL_PATH)/crypto/evp/bio_md.c
- $(OPENSSL_PATH)/crypto/evp/bio_ok.c
- $(OPENSSL_PATH)/crypto/evp/c_allc.c
- $(OPENSSL_PATH)/crypto/evp/c_alld.c
- $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c
- $(OPENSSL_PATH)/crypto/evp/digest.c
- $(OPENSSL_PATH)/crypto/evp/e_aes.c
- $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c
- $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c
- $(OPENSSL_PATH)/crypto/evp/e_bf.c
- $(OPENSSL_PATH)/crypto/evp/e_camellia.c
- $(OPENSSL_PATH)/crypto/evp/e_cast.c
- $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c
- $(OPENSSL_PATH)/crypto/evp/e_des.c
- $(OPENSSL_PATH)/crypto/evp/e_des3.c
- $(OPENSSL_PATH)/crypto/evp/e_idea.c
- $(OPENSSL_PATH)/crypto/evp/e_null.c
- $(OPENSSL_PATH)/crypto/evp/e_old.c
- $(OPENSSL_PATH)/crypto/evp/e_rc2.c
- $(OPENSSL_PATH)/crypto/evp/e_rc4.c
- $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c
- $(OPENSSL_PATH)/crypto/evp/e_rc5.c
- $(OPENSSL_PATH)/crypto/evp/e_seed.c
- $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c
- $(OPENSSL_PATH)/crypto/evp/encode.c
- $(OPENSSL_PATH)/crypto/evp/evp_cnf.c
- $(OPENSSL_PATH)/crypto/evp/evp_enc.c
- $(OPENSSL_PATH)/crypto/evp/evp_err.c
- $(OPENSSL_PATH)/crypto/evp/evp_key.c
- $(OPENSSL_PATH)/crypto/evp/evp_lib.c
- $(OPENSSL_PATH)/crypto/evp/evp_pbe.c
- $(OPENSSL_PATH)/crypto/evp/evp_pkey.c
- $(OPENSSL_PATH)/crypto/evp/m_md2.c
- $(OPENSSL_PATH)/crypto/evp/m_md4.c
- $(OPENSSL_PATH)/crypto/evp/m_md5.c
- $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c
- $(OPENSSL_PATH)/crypto/evp/m_mdc2.c
- $(OPENSSL_PATH)/crypto/evp/m_null.c
- $(OPENSSL_PATH)/crypto/evp/m_ripemd.c
- $(OPENSSL_PATH)/crypto/evp/m_sha1.c
- $(OPENSSL_PATH)/crypto/evp/m_sigver.c
- $(OPENSSL_PATH)/crypto/evp/m_wp.c
- $(OPENSSL_PATH)/crypto/evp/names.c
- $(OPENSSL_PATH)/crypto/evp/p5_crpt.c
- $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c
- $(OPENSSL_PATH)/crypto/evp/p_dec.c
- $(OPENSSL_PATH)/crypto/evp/p_enc.c
- $(OPENSSL_PATH)/crypto/evp/p_lib.c
- $(OPENSSL_PATH)/crypto/evp/p_open.c
- $(OPENSSL_PATH)/crypto/evp/p_seal.c
- $(OPENSSL_PATH)/crypto/evp/p_sign.c
- $(OPENSSL_PATH)/crypto/evp/p_verify.c
- $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c
- $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c
- $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c
- $(OPENSSL_PATH)/crypto/evp/scrypt.c
- $(OPENSSL_PATH)/crypto/ex_data.c
- $(OPENSSL_PATH)/crypto/getenv.c
- $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c
- $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c
- $(OPENSSL_PATH)/crypto/hmac/hmac.c
- $(OPENSSL_PATH)/crypto/init.c
- $(OPENSSL_PATH)/crypto/kdf/hkdf.c
- $(OPENSSL_PATH)/crypto/kdf/kdf_err.c
- $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c
- $(OPENSSL_PATH)/crypto/lhash/lh_stats.c
- $(OPENSSL_PATH)/crypto/lhash/lhash.c
- $(OPENSSL_PATH)/crypto/md4/md4_dgst.c
- $(OPENSSL_PATH)/crypto/md4/md4_one.c
- $(OPENSSL_PATH)/crypto/md5/md5_dgst.c
- $(OPENSSL_PATH)/crypto/md5/md5_one.c
- $(OPENSSL_PATH)/crypto/mem.c
- $(OPENSSL_PATH)/crypto/mem_clr.c
- $(OPENSSL_PATH)/crypto/mem_dbg.c
- $(OPENSSL_PATH)/crypto/mem_sec.c
- $(OPENSSL_PATH)/crypto/modes/cbc128.c
- $(OPENSSL_PATH)/crypto/modes/ccm128.c
- $(OPENSSL_PATH)/crypto/modes/cfb128.c
- $(OPENSSL_PATH)/crypto/modes/ctr128.c
- $(OPENSSL_PATH)/crypto/modes/cts128.c
- $(OPENSSL_PATH)/crypto/modes/gcm128.c
- $(OPENSSL_PATH)/crypto/modes/ocb128.c
- $(OPENSSL_PATH)/crypto/modes/ofb128.c
- $(OPENSSL_PATH)/crypto/modes/wrap128.c
- $(OPENSSL_PATH)/crypto/modes/xts128.c
- $(OPENSSL_PATH)/crypto/o_dir.c
- $(OPENSSL_PATH)/crypto/o_fips.c
- $(OPENSSL_PATH)/crypto/o_fopen.c
- $(OPENSSL_PATH)/crypto/o_init.c
- $(OPENSSL_PATH)/crypto/o_str.c
- $(OPENSSL_PATH)/crypto/o_time.c
- $(OPENSSL_PATH)/crypto/objects/o_names.c
- $(OPENSSL_PATH)/crypto/objects/obj_dat.c
- $(OPENSSL_PATH)/crypto/objects/obj_err.c
- $(OPENSSL_PATH)/crypto/objects/obj_lib.c
- $(OPENSSL_PATH)/crypto/objects/obj_xref.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c
- $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c
- $(OPENSSL_PATH)/crypto/pem/pem_all.c
- $(OPENSSL_PATH)/crypto/pem/pem_err.c
- $(OPENSSL_PATH)/crypto/pem/pem_info.c
- $(OPENSSL_PATH)/crypto/pem/pem_lib.c
- $(OPENSSL_PATH)/crypto/pem/pem_oth.c
- $(OPENSSL_PATH)/crypto/pem/pem_pk8.c
- $(OPENSSL_PATH)/crypto/pem/pem_pkey.c
- $(OPENSSL_PATH)/crypto/pem/pem_sign.c
- $(OPENSSL_PATH)/crypto/pem/pem_x509.c
- $(OPENSSL_PATH)/crypto/pem/pem_xaux.c
- $(OPENSSL_PATH)/crypto/pem/pvkfmt.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c
- $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c
- $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c
- $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c
- $(OPENSSL_PATH)/crypto/rand/md_rand.c
- $(OPENSSL_PATH)/crypto/rand/rand_egd.c
- $(OPENSSL_PATH)/crypto/rand/rand_err.c
- $(OPENSSL_PATH)/crypto/rand/rand_lib.c
- $(OPENSSL_PATH)/crypto/rand/rand_unix.c
- $(OPENSSL_PATH)/crypto/rand/rand_vms.c
- $(OPENSSL_PATH)/crypto/rand/rand_win.c
- $(OPENSSL_PATH)/crypto/rand/randfile.c
- $(OPENSSL_PATH)/crypto/rc4/rc4_enc.c
- $(OPENSSL_PATH)/crypto/rc4/rc4_skey.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_err.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_none.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_null.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c
- $(OPENSSL_PATH)/crypto/sha/sha1_one.c
- $(OPENSSL_PATH)/crypto/sha/sha1dgst.c
- $(OPENSSL_PATH)/crypto/sha/sha256.c
- $(OPENSSL_PATH)/crypto/sha/sha512.c
- $(OPENSSL_PATH)/crypto/stack/stack.c
- $(OPENSSL_PATH)/crypto/threads_none.c
- $(OPENSSL_PATH)/crypto/threads_pthread.c
- $(OPENSSL_PATH)/crypto/threads_win.c
- $(OPENSSL_PATH)/crypto/txt_db/txt_db.c
- $(OPENSSL_PATH)/crypto/uid.c
- $(OPENSSL_PATH)/crypto/x509/by_dir.c
- $(OPENSSL_PATH)/crypto/x509/by_file.c
- $(OPENSSL_PATH)/crypto/x509/t_crl.c
- $(OPENSSL_PATH)/crypto/x509/t_req.c
- $(OPENSSL_PATH)/crypto/x509/t_x509.c
- $(OPENSSL_PATH)/crypto/x509/x509_att.c
- $(OPENSSL_PATH)/crypto/x509/x509_cmp.c
- $(OPENSSL_PATH)/crypto/x509/x509_d2.c
- $(OPENSSL_PATH)/crypto/x509/x509_def.c
- $(OPENSSL_PATH)/crypto/x509/x509_err.c
- $(OPENSSL_PATH)/crypto/x509/x509_ext.c
- $(OPENSSL_PATH)/crypto/x509/x509_lu.c
- $(OPENSSL_PATH)/crypto/x509/x509_meth.c
- $(OPENSSL_PATH)/crypto/x509/x509_obj.c
- $(OPENSSL_PATH)/crypto/x509/x509_r2x.c
- $(OPENSSL_PATH)/crypto/x509/x509_req.c
- $(OPENSSL_PATH)/crypto/x509/x509_set.c
- $(OPENSSL_PATH)/crypto/x509/x509_trs.c
- $(OPENSSL_PATH)/crypto/x509/x509_txt.c
- $(OPENSSL_PATH)/crypto/x509/x509_v3.c
- $(OPENSSL_PATH)/crypto/x509/x509_vfy.c
- $(OPENSSL_PATH)/crypto/x509/x509_vpm.c
- $(OPENSSL_PATH)/crypto/x509/x509cset.c
- $(OPENSSL_PATH)/crypto/x509/x509name.c
- $(OPENSSL_PATH)/crypto/x509/x509rset.c
- $(OPENSSL_PATH)/crypto/x509/x509spki.c
- $(OPENSSL_PATH)/crypto/x509/x509type.c
- $(OPENSSL_PATH)/crypto/x509/x_all.c
- $(OPENSSL_PATH)/crypto/x509/x_attrib.c
- $(OPENSSL_PATH)/crypto/x509/x_crl.c
- $(OPENSSL_PATH)/crypto/x509/x_exten.c
- $(OPENSSL_PATH)/crypto/x509/x_name.c
- $(OPENSSL_PATH)/crypto/x509/x_pubkey.c
- $(OPENSSL_PATH)/crypto/x509/x_req.c
- $(OPENSSL_PATH)/crypto/x509/x_x509.c
- $(OPENSSL_PATH)/crypto/x509/x_x509a.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_info.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_int.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c
- $(OPENSSL_PATH)/crypto/x509v3/v3err.c
- $(OPENSSL_PATH)/ssl/bio_ssl.c
- $(OPENSSL_PATH)/ssl/d1_lib.c
- $(OPENSSL_PATH)/ssl/d1_msg.c
- $(OPENSSL_PATH)/ssl/d1_srtp.c
- $(OPENSSL_PATH)/ssl/methods.c
- $(OPENSSL_PATH)/ssl/pqueue.c
- $(OPENSSL_PATH)/ssl/record/dtls1_bitmap.c
- $(OPENSSL_PATH)/ssl/record/rec_layer_d1.c
- $(OPENSSL_PATH)/ssl/record/rec_layer_s3.c
- $(OPENSSL_PATH)/ssl/record/ssl3_buffer.c
- $(OPENSSL_PATH)/ssl/record/ssl3_record.c
- $(OPENSSL_PATH)/ssl/s3_cbc.c
- $(OPENSSL_PATH)/ssl/s3_enc.c
- $(OPENSSL_PATH)/ssl/s3_lib.c
- $(OPENSSL_PATH)/ssl/s3_msg.c
- $(OPENSSL_PATH)/ssl/ssl_asn1.c
- $(OPENSSL_PATH)/ssl/ssl_cert.c
- $(OPENSSL_PATH)/ssl/ssl_ciph.c
- $(OPENSSL_PATH)/ssl/ssl_conf.c
- $(OPENSSL_PATH)/ssl/ssl_err.c
- $(OPENSSL_PATH)/ssl/ssl_init.c
- $(OPENSSL_PATH)/ssl/ssl_lib.c
- $(OPENSSL_PATH)/ssl/ssl_mcnf.c
- $(OPENSSL_PATH)/ssl/ssl_rsa.c
- $(OPENSSL_PATH)/ssl/ssl_sess.c
- $(OPENSSL_PATH)/ssl/ssl_stat.c
- $(OPENSSL_PATH)/ssl/ssl_txt.c
- $(OPENSSL_PATH)/ssl/ssl_utst.c
- $(OPENSSL_PATH)/ssl/statem/statem.c
- $(OPENSSL_PATH)/ssl/statem/statem_clnt.c
- $(OPENSSL_PATH)/ssl/statem/statem_dtls.c
- $(OPENSSL_PATH)/ssl/statem/statem_lib.c
- $(OPENSSL_PATH)/ssl/statem/statem_srvr.c
- $(OPENSSL_PATH)/ssl/t1_enc.c
- $(OPENSSL_PATH)/ssl/t1_ext.c
- $(OPENSSL_PATH)/ssl/t1_lib.c
- $(OPENSSL_PATH)/ssl/t1_reneg.c
- $(OPENSSL_PATH)/ssl/t1_trce.c
- $(OPENSSL_PATH)/ssl/tls_srp.c
-# Autogenerated files list ends here
-
-[Packages]
- MdePkg/MdePkg.dec
- CryptoPkg/CryptoPkg.dec
-
-[LibraryClasses]
- DebugLib
-
-[LibraryClasses.ARM]
- ArmSoftFloatLib
-
-[BuildOptions]
- #
- # Disables the following Visual Studio compiler warnings brought by openssl source,
- # so we do not break the build with /WX option:
- # C4090: 'function' : different 'const' qualifiers
- # C4244: conversion from type1 to type2, possible loss of data
- # C4245: conversion from type1 to type2, signed/unsigned mismatch
- # C4267: conversion from size_t to type, possible loss of data
- # C4306: 'identifier' : conversion from 'type1' to 'type2' of greater size
- # C4389: 'operator' : signed/unsigned mismatch (xxxx)
- # C4702: unreachable code
- # C4706: assignment within conditional expression
- # C4819: The file contains a character that cannot be represented in the current code page
- #
- MSFT:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4389 /wd4702 /wd4706 /wd4819
- MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4306 /wd4389 /wd4702 /wd4706 /wd4819
-
- INTEL:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w
- INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w
-
- #
- # Suppress the following build warnings in openssl so we don't break the build with -Werror
- # -Werror=maybe-uninitialized: there exist some other paths for which the variable is not initialized.
- # -Werror=format: Check calls to printf and scanf, etc., to make sure that the arguments supplied have
- # types appropriate to the format string specified.
- #
- GCC:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized
- GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -DNO_MSABI_VA_FUNCS
- GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized
- GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format
-
- # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:
- # 1295: Deprecated declaration - give arg types
- # 550: was set but never used
- # 1293: assignment in condition
- # 111: statement is unreachable (invariably "break;" after "return X;" in case statement)
- # 68: integer conversion resulted in a change of sign ("if (Status == -1)")
- # 177: was declared but never referenced
- # 223: function declared implicitly
- # 144: a value of type cannot be used to initialize an entity of type
- # 513: a value of type cannot be assigned to an entity of type
- # 188: enumerated type mixed with another type (i.e. passing an integer as an enum without a cast)
- # 1296: Extended constant initialiser used
- # 128: loop is not reachable - may be emitted inappropriately if code follows a conditional return
- # from the function that evaluates to true at compile time
- # 546: transfer of control bypasses initialization - may be emitted inappropriately if the uninitialized
- # variable is never referenced after the jump
- # 1: ignore "#1-D: last line of file ends without a newline"
- # 3017: may be used before being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with
- # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.)
- RVCT:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) --library_interface=aeabi_clib99 --diag_suppress=1296,1295,550,1293,111,68,177,223,144,513,188,128,546,1,3017 -JCryptoPkg/Include
- XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w
- XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w
-
- #
- # AARCH64 uses strict alignment and avoids SIMD registers for code that may execute
- # with the MMU off. This involves SEC, PEI_CORE and PEIM modules as well as BASE
- # libraries, given that they may be included into such modules.
- # This library, even though of the BASE type, is never used in such cases, and
- # avoiding the SIMD register file (which is shared with the FPU) prevents the
- # compiler from successfully building some of the OpenSSL source files that
- # use floating point types, so clear the flags here.
- #
- GCC:*_*_AARCH64_CC_XIPFLAGS ==
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.uni b/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.uni
deleted file mode 100644
index f91f2ca..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLib.uni
+++ /dev/null
@@ -1,22 +0,0 @@
-// /** @file
-// This module provides openSSL Library implementation.
-//
-// This module provides OpenSSL Library implementation.
-//
-// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "OpenSSL Library implementation"
-
-#string STR_MODULE_DESCRIPTION #language en-US "This module provides OpenSSL Library implementation."
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
deleted file mode 100644
index 9a64c80..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
+++ /dev/null
@@ -1,558 +0,0 @@
-## @file
-# This module provides OpenSSL Library implementation.
-#
-# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = OpensslLibCrypto
- MODULE_UNI_FILE = OpensslLibCrypto.uni
- FILE_GUID = E29FC209-8B64-4500-BD20-AF4EAE47EA0E
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = OpensslLib
- DEFINE OPENSSL_PATH = openssl
- DEFINE OPENSSL_FLAGS = -DL_ENDIAN -DOPENSSL_SMALL_FOOTPRINT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNO_SYSLOG
-
-#
-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
-#
-
-[Sources]
- $(OPENSSL_PATH)/e_os.h
-# Autogenerated files list starts here
- $(OPENSSL_PATH)/crypto/aes/aes_cbc.c
- $(OPENSSL_PATH)/crypto/aes/aes_cfb.c
- $(OPENSSL_PATH)/crypto/aes/aes_core.c
- $(OPENSSL_PATH)/crypto/aes/aes_ecb.c
- $(OPENSSL_PATH)/crypto/aes/aes_ige.c
- $(OPENSSL_PATH)/crypto/aes/aes_misc.c
- $(OPENSSL_PATH)/crypto/aes/aes_ofb.c
- $(OPENSSL_PATH)/crypto/aes/aes_wrap.c
- $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c
- $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c
- $(OPENSSL_PATH)/crypto/asn1/a_digest.c
- $(OPENSSL_PATH)/crypto/asn1/a_dup.c
- $(OPENSSL_PATH)/crypto/asn1/a_gentm.c
- $(OPENSSL_PATH)/crypto/asn1/a_i2d_fp.c
- $(OPENSSL_PATH)/crypto/asn1/a_int.c
- $(OPENSSL_PATH)/crypto/asn1/a_mbstr.c
- $(OPENSSL_PATH)/crypto/asn1/a_object.c
- $(OPENSSL_PATH)/crypto/asn1/a_octet.c
- $(OPENSSL_PATH)/crypto/asn1/a_print.c
- $(OPENSSL_PATH)/crypto/asn1/a_sign.c
- $(OPENSSL_PATH)/crypto/asn1/a_strex.c
- $(OPENSSL_PATH)/crypto/asn1/a_strnid.c
- $(OPENSSL_PATH)/crypto/asn1/a_time.c
- $(OPENSSL_PATH)/crypto/asn1/a_type.c
- $(OPENSSL_PATH)/crypto/asn1/a_utctm.c
- $(OPENSSL_PATH)/crypto/asn1/a_utf8.c
- $(OPENSSL_PATH)/crypto/asn1/a_verify.c
- $(OPENSSL_PATH)/crypto/asn1/ameth_lib.c
- $(OPENSSL_PATH)/crypto/asn1/asn1_err.c
- $(OPENSSL_PATH)/crypto/asn1/asn1_gen.c
- $(OPENSSL_PATH)/crypto/asn1/asn1_lib.c
- $(OPENSSL_PATH)/crypto/asn1/asn1_par.c
- $(OPENSSL_PATH)/crypto/asn1/asn_mime.c
- $(OPENSSL_PATH)/crypto/asn1/asn_moid.c
- $(OPENSSL_PATH)/crypto/asn1/asn_mstbl.c
- $(OPENSSL_PATH)/crypto/asn1/asn_pack.c
- $(OPENSSL_PATH)/crypto/asn1/bio_asn1.c
- $(OPENSSL_PATH)/crypto/asn1/bio_ndef.c
- $(OPENSSL_PATH)/crypto/asn1/d2i_pr.c
- $(OPENSSL_PATH)/crypto/asn1/d2i_pu.c
- $(OPENSSL_PATH)/crypto/asn1/evp_asn1.c
- $(OPENSSL_PATH)/crypto/asn1/f_int.c
- $(OPENSSL_PATH)/crypto/asn1/f_string.c
- $(OPENSSL_PATH)/crypto/asn1/i2d_pr.c
- $(OPENSSL_PATH)/crypto/asn1/i2d_pu.c
- $(OPENSSL_PATH)/crypto/asn1/n_pkey.c
- $(OPENSSL_PATH)/crypto/asn1/nsseq.c
- $(OPENSSL_PATH)/crypto/asn1/p5_pbe.c
- $(OPENSSL_PATH)/crypto/asn1/p5_pbev2.c
- $(OPENSSL_PATH)/crypto/asn1/p5_scrypt.c
- $(OPENSSL_PATH)/crypto/asn1/p8_pkey.c
- $(OPENSSL_PATH)/crypto/asn1/t_bitst.c
- $(OPENSSL_PATH)/crypto/asn1/t_pkey.c
- $(OPENSSL_PATH)/crypto/asn1/t_spki.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_dec.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_enc.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_fre.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_new.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_prn.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_scn.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_typ.c
- $(OPENSSL_PATH)/crypto/asn1/tasn_utl.c
- $(OPENSSL_PATH)/crypto/asn1/x_algor.c
- $(OPENSSL_PATH)/crypto/asn1/x_bignum.c
- $(OPENSSL_PATH)/crypto/asn1/x_info.c
- $(OPENSSL_PATH)/crypto/asn1/x_int64.c
- $(OPENSSL_PATH)/crypto/asn1/x_long.c
- $(OPENSSL_PATH)/crypto/asn1/x_pkey.c
- $(OPENSSL_PATH)/crypto/asn1/x_sig.c
- $(OPENSSL_PATH)/crypto/asn1/x_spki.c
- $(OPENSSL_PATH)/crypto/asn1/x_val.c
- $(OPENSSL_PATH)/crypto/async/arch/async_null.c
- $(OPENSSL_PATH)/crypto/async/arch/async_posix.c
- $(OPENSSL_PATH)/crypto/async/arch/async_win.c
- $(OPENSSL_PATH)/crypto/async/async.c
- $(OPENSSL_PATH)/crypto/async/async_err.c
- $(OPENSSL_PATH)/crypto/async/async_wait.c
- $(OPENSSL_PATH)/crypto/bio/b_addr.c
- $(OPENSSL_PATH)/crypto/bio/b_dump.c
- $(OPENSSL_PATH)/crypto/bio/b_sock.c
- $(OPENSSL_PATH)/crypto/bio/b_sock2.c
- $(OPENSSL_PATH)/crypto/bio/bf_buff.c
- $(OPENSSL_PATH)/crypto/bio/bf_lbuf.c
- $(OPENSSL_PATH)/crypto/bio/bf_nbio.c
- $(OPENSSL_PATH)/crypto/bio/bf_null.c
- $(OPENSSL_PATH)/crypto/bio/bio_cb.c
- $(OPENSSL_PATH)/crypto/bio/bio_err.c
- $(OPENSSL_PATH)/crypto/bio/bio_lib.c
- $(OPENSSL_PATH)/crypto/bio/bio_meth.c
- $(OPENSSL_PATH)/crypto/bio/bss_acpt.c
- $(OPENSSL_PATH)/crypto/bio/bss_bio.c
- $(OPENSSL_PATH)/crypto/bio/bss_conn.c
- $(OPENSSL_PATH)/crypto/bio/bss_dgram.c
- $(OPENSSL_PATH)/crypto/bio/bss_fd.c
- $(OPENSSL_PATH)/crypto/bio/bss_file.c
- $(OPENSSL_PATH)/crypto/bio/bss_log.c
- $(OPENSSL_PATH)/crypto/bio/bss_mem.c
- $(OPENSSL_PATH)/crypto/bio/bss_null.c
- $(OPENSSL_PATH)/crypto/bio/bss_sock.c
- $(OPENSSL_PATH)/crypto/bn/bn_add.c
- $(OPENSSL_PATH)/crypto/bn/bn_asm.c
- $(OPENSSL_PATH)/crypto/bn/bn_blind.c
- $(OPENSSL_PATH)/crypto/bn/bn_const.c
- $(OPENSSL_PATH)/crypto/bn/bn_ctx.c
- $(OPENSSL_PATH)/crypto/bn/bn_depr.c
- $(OPENSSL_PATH)/crypto/bn/bn_dh.c
- $(OPENSSL_PATH)/crypto/bn/bn_div.c
- $(OPENSSL_PATH)/crypto/bn/bn_err.c
- $(OPENSSL_PATH)/crypto/bn/bn_exp.c
- $(OPENSSL_PATH)/crypto/bn/bn_exp2.c
- $(OPENSSL_PATH)/crypto/bn/bn_gcd.c
- $(OPENSSL_PATH)/crypto/bn/bn_gf2m.c
- $(OPENSSL_PATH)/crypto/bn/bn_intern.c
- $(OPENSSL_PATH)/crypto/bn/bn_kron.c
- $(OPENSSL_PATH)/crypto/bn/bn_lib.c
- $(OPENSSL_PATH)/crypto/bn/bn_mod.c
- $(OPENSSL_PATH)/crypto/bn/bn_mont.c
- $(OPENSSL_PATH)/crypto/bn/bn_mpi.c
- $(OPENSSL_PATH)/crypto/bn/bn_mul.c
- $(OPENSSL_PATH)/crypto/bn/bn_nist.c
- $(OPENSSL_PATH)/crypto/bn/bn_prime.c
- $(OPENSSL_PATH)/crypto/bn/bn_print.c
- $(OPENSSL_PATH)/crypto/bn/bn_rand.c
- $(OPENSSL_PATH)/crypto/bn/bn_recp.c
- $(OPENSSL_PATH)/crypto/bn/bn_shift.c
- $(OPENSSL_PATH)/crypto/bn/bn_sqr.c
- $(OPENSSL_PATH)/crypto/bn/bn_sqrt.c
- $(OPENSSL_PATH)/crypto/bn/bn_srp.c
- $(OPENSSL_PATH)/crypto/bn/bn_word.c
- $(OPENSSL_PATH)/crypto/bn/bn_x931p.c
- $(OPENSSL_PATH)/crypto/buffer/buf_err.c
- $(OPENSSL_PATH)/crypto/buffer/buffer.c
- $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c
- $(OPENSSL_PATH)/crypto/cmac/cm_pmeth.c
- $(OPENSSL_PATH)/crypto/cmac/cmac.c
- $(OPENSSL_PATH)/crypto/comp/c_zlib.c
- $(OPENSSL_PATH)/crypto/comp/comp_err.c
- $(OPENSSL_PATH)/crypto/comp/comp_lib.c
- $(OPENSSL_PATH)/crypto/conf/conf_api.c
- $(OPENSSL_PATH)/crypto/conf/conf_def.c
- $(OPENSSL_PATH)/crypto/conf/conf_err.c
- $(OPENSSL_PATH)/crypto/conf/conf_lib.c
- $(OPENSSL_PATH)/crypto/conf/conf_mall.c
- $(OPENSSL_PATH)/crypto/conf/conf_mod.c
- $(OPENSSL_PATH)/crypto/conf/conf_sap.c
- $(OPENSSL_PATH)/crypto/conf/conf_ssl.c
- $(OPENSSL_PATH)/crypto/cpt_err.c
- $(OPENSSL_PATH)/crypto/cryptlib.c
- $(OPENSSL_PATH)/crypto/cversion.c
- $(OPENSSL_PATH)/crypto/des/cbc_cksm.c
- $(OPENSSL_PATH)/crypto/des/cbc_enc.c
- $(OPENSSL_PATH)/crypto/des/cfb64ede.c
- $(OPENSSL_PATH)/crypto/des/cfb64enc.c
- $(OPENSSL_PATH)/crypto/des/cfb_enc.c
- $(OPENSSL_PATH)/crypto/des/des_enc.c
- $(OPENSSL_PATH)/crypto/des/ecb3_enc.c
- $(OPENSSL_PATH)/crypto/des/ecb_enc.c
- $(OPENSSL_PATH)/crypto/des/fcrypt.c
- $(OPENSSL_PATH)/crypto/des/fcrypt_b.c
- $(OPENSSL_PATH)/crypto/des/ofb64ede.c
- $(OPENSSL_PATH)/crypto/des/ofb64enc.c
- $(OPENSSL_PATH)/crypto/des/ofb_enc.c
- $(OPENSSL_PATH)/crypto/des/pcbc_enc.c
- $(OPENSSL_PATH)/crypto/des/qud_cksm.c
- $(OPENSSL_PATH)/crypto/des/rand_key.c
- $(OPENSSL_PATH)/crypto/des/rpc_enc.c
- $(OPENSSL_PATH)/crypto/des/set_key.c
- $(OPENSSL_PATH)/crypto/des/str2key.c
- $(OPENSSL_PATH)/crypto/des/xcbc_enc.c
- $(OPENSSL_PATH)/crypto/dh/dh_ameth.c
- $(OPENSSL_PATH)/crypto/dh/dh_asn1.c
- $(OPENSSL_PATH)/crypto/dh/dh_check.c
- $(OPENSSL_PATH)/crypto/dh/dh_depr.c
- $(OPENSSL_PATH)/crypto/dh/dh_err.c
- $(OPENSSL_PATH)/crypto/dh/dh_gen.c
- $(OPENSSL_PATH)/crypto/dh/dh_kdf.c
- $(OPENSSL_PATH)/crypto/dh/dh_key.c
- $(OPENSSL_PATH)/crypto/dh/dh_lib.c
- $(OPENSSL_PATH)/crypto/dh/dh_meth.c
- $(OPENSSL_PATH)/crypto/dh/dh_pmeth.c
- $(OPENSSL_PATH)/crypto/dh/dh_prn.c
- $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c
- $(OPENSSL_PATH)/crypto/dso/dso_dl.c
- $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c
- $(OPENSSL_PATH)/crypto/dso/dso_err.c
- $(OPENSSL_PATH)/crypto/dso/dso_lib.c
- $(OPENSSL_PATH)/crypto/dso/dso_openssl.c
- $(OPENSSL_PATH)/crypto/dso/dso_vms.c
- $(OPENSSL_PATH)/crypto/dso/dso_win32.c
- $(OPENSSL_PATH)/crypto/ebcdic.c
- $(OPENSSL_PATH)/crypto/err/err.c
- $(OPENSSL_PATH)/crypto/err/err_all.c
- $(OPENSSL_PATH)/crypto/err/err_prn.c
- $(OPENSSL_PATH)/crypto/evp/bio_b64.c
- $(OPENSSL_PATH)/crypto/evp/bio_enc.c
- $(OPENSSL_PATH)/crypto/evp/bio_md.c
- $(OPENSSL_PATH)/crypto/evp/bio_ok.c
- $(OPENSSL_PATH)/crypto/evp/c_allc.c
- $(OPENSSL_PATH)/crypto/evp/c_alld.c
- $(OPENSSL_PATH)/crypto/evp/cmeth_lib.c
- $(OPENSSL_PATH)/crypto/evp/digest.c
- $(OPENSSL_PATH)/crypto/evp/e_aes.c
- $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha1.c
- $(OPENSSL_PATH)/crypto/evp/e_aes_cbc_hmac_sha256.c
- $(OPENSSL_PATH)/crypto/evp/e_bf.c
- $(OPENSSL_PATH)/crypto/evp/e_camellia.c
- $(OPENSSL_PATH)/crypto/evp/e_cast.c
- $(OPENSSL_PATH)/crypto/evp/e_chacha20_poly1305.c
- $(OPENSSL_PATH)/crypto/evp/e_des.c
- $(OPENSSL_PATH)/crypto/evp/e_des3.c
- $(OPENSSL_PATH)/crypto/evp/e_idea.c
- $(OPENSSL_PATH)/crypto/evp/e_null.c
- $(OPENSSL_PATH)/crypto/evp/e_old.c
- $(OPENSSL_PATH)/crypto/evp/e_rc2.c
- $(OPENSSL_PATH)/crypto/evp/e_rc4.c
- $(OPENSSL_PATH)/crypto/evp/e_rc4_hmac_md5.c
- $(OPENSSL_PATH)/crypto/evp/e_rc5.c
- $(OPENSSL_PATH)/crypto/evp/e_seed.c
- $(OPENSSL_PATH)/crypto/evp/e_xcbc_d.c
- $(OPENSSL_PATH)/crypto/evp/encode.c
- $(OPENSSL_PATH)/crypto/evp/evp_cnf.c
- $(OPENSSL_PATH)/crypto/evp/evp_enc.c
- $(OPENSSL_PATH)/crypto/evp/evp_err.c
- $(OPENSSL_PATH)/crypto/evp/evp_key.c
- $(OPENSSL_PATH)/crypto/evp/evp_lib.c
- $(OPENSSL_PATH)/crypto/evp/evp_pbe.c
- $(OPENSSL_PATH)/crypto/evp/evp_pkey.c
- $(OPENSSL_PATH)/crypto/evp/m_md2.c
- $(OPENSSL_PATH)/crypto/evp/m_md4.c
- $(OPENSSL_PATH)/crypto/evp/m_md5.c
- $(OPENSSL_PATH)/crypto/evp/m_md5_sha1.c
- $(OPENSSL_PATH)/crypto/evp/m_mdc2.c
- $(OPENSSL_PATH)/crypto/evp/m_null.c
- $(OPENSSL_PATH)/crypto/evp/m_ripemd.c
- $(OPENSSL_PATH)/crypto/evp/m_sha1.c
- $(OPENSSL_PATH)/crypto/evp/m_sigver.c
- $(OPENSSL_PATH)/crypto/evp/m_wp.c
- $(OPENSSL_PATH)/crypto/evp/names.c
- $(OPENSSL_PATH)/crypto/evp/p5_crpt.c
- $(OPENSSL_PATH)/crypto/evp/p5_crpt2.c
- $(OPENSSL_PATH)/crypto/evp/p_dec.c
- $(OPENSSL_PATH)/crypto/evp/p_enc.c
- $(OPENSSL_PATH)/crypto/evp/p_lib.c
- $(OPENSSL_PATH)/crypto/evp/p_open.c
- $(OPENSSL_PATH)/crypto/evp/p_seal.c
- $(OPENSSL_PATH)/crypto/evp/p_sign.c
- $(OPENSSL_PATH)/crypto/evp/p_verify.c
- $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c
- $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c
- $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c
- $(OPENSSL_PATH)/crypto/evp/scrypt.c
- $(OPENSSL_PATH)/crypto/ex_data.c
- $(OPENSSL_PATH)/crypto/getenv.c
- $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c
- $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c
- $(OPENSSL_PATH)/crypto/hmac/hmac.c
- $(OPENSSL_PATH)/crypto/init.c
- $(OPENSSL_PATH)/crypto/kdf/hkdf.c
- $(OPENSSL_PATH)/crypto/kdf/kdf_err.c
- $(OPENSSL_PATH)/crypto/kdf/tls1_prf.c
- $(OPENSSL_PATH)/crypto/lhash/lh_stats.c
- $(OPENSSL_PATH)/crypto/lhash/lhash.c
- $(OPENSSL_PATH)/crypto/md4/md4_dgst.c
- $(OPENSSL_PATH)/crypto/md4/md4_one.c
- $(OPENSSL_PATH)/crypto/md5/md5_dgst.c
- $(OPENSSL_PATH)/crypto/md5/md5_one.c
- $(OPENSSL_PATH)/crypto/mem.c
- $(OPENSSL_PATH)/crypto/mem_clr.c
- $(OPENSSL_PATH)/crypto/mem_dbg.c
- $(OPENSSL_PATH)/crypto/mem_sec.c
- $(OPENSSL_PATH)/crypto/modes/cbc128.c
- $(OPENSSL_PATH)/crypto/modes/ccm128.c
- $(OPENSSL_PATH)/crypto/modes/cfb128.c
- $(OPENSSL_PATH)/crypto/modes/ctr128.c
- $(OPENSSL_PATH)/crypto/modes/cts128.c
- $(OPENSSL_PATH)/crypto/modes/gcm128.c
- $(OPENSSL_PATH)/crypto/modes/ocb128.c
- $(OPENSSL_PATH)/crypto/modes/ofb128.c
- $(OPENSSL_PATH)/crypto/modes/wrap128.c
- $(OPENSSL_PATH)/crypto/modes/xts128.c
- $(OPENSSL_PATH)/crypto/o_dir.c
- $(OPENSSL_PATH)/crypto/o_fips.c
- $(OPENSSL_PATH)/crypto/o_fopen.c
- $(OPENSSL_PATH)/crypto/o_init.c
- $(OPENSSL_PATH)/crypto/o_str.c
- $(OPENSSL_PATH)/crypto/o_time.c
- $(OPENSSL_PATH)/crypto/objects/o_names.c
- $(OPENSSL_PATH)/crypto/objects/obj_dat.c
- $(OPENSSL_PATH)/crypto/objects/obj_err.c
- $(OPENSSL_PATH)/crypto/objects/obj_lib.c
- $(OPENSSL_PATH)/crypto/objects/obj_xref.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_asn.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_cl.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_err.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_ext.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_ht.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_lib.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_prn.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_srv.c
- $(OPENSSL_PATH)/crypto/ocsp/ocsp_vfy.c
- $(OPENSSL_PATH)/crypto/ocsp/v3_ocsp.c
- $(OPENSSL_PATH)/crypto/pem/pem_all.c
- $(OPENSSL_PATH)/crypto/pem/pem_err.c
- $(OPENSSL_PATH)/crypto/pem/pem_info.c
- $(OPENSSL_PATH)/crypto/pem/pem_lib.c
- $(OPENSSL_PATH)/crypto/pem/pem_oth.c
- $(OPENSSL_PATH)/crypto/pem/pem_pk8.c
- $(OPENSSL_PATH)/crypto/pem/pem_pkey.c
- $(OPENSSL_PATH)/crypto/pem/pem_sign.c
- $(OPENSSL_PATH)/crypto/pem/pem_x509.c
- $(OPENSSL_PATH)/crypto/pem/pem_xaux.c
- $(OPENSSL_PATH)/crypto/pem/pvkfmt.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_add.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_asn.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_attr.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_crpt.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_crt.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_decr.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_init.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_key.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_kiss.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_mutl.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_npas.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_p8d.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_p8e.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_sbag.c
- $(OPENSSL_PATH)/crypto/pkcs12/p12_utl.c
- $(OPENSSL_PATH)/crypto/pkcs12/pk12err.c
- $(OPENSSL_PATH)/crypto/pkcs7/bio_pk7.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_asn1.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_attr.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_doit.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_lib.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_mime.c
- $(OPENSSL_PATH)/crypto/pkcs7/pk7_smime.c
- $(OPENSSL_PATH)/crypto/pkcs7/pkcs7err.c
- $(OPENSSL_PATH)/crypto/rand/md_rand.c
- $(OPENSSL_PATH)/crypto/rand/rand_egd.c
- $(OPENSSL_PATH)/crypto/rand/rand_err.c
- $(OPENSSL_PATH)/crypto/rand/rand_lib.c
- $(OPENSSL_PATH)/crypto/rand/rand_unix.c
- $(OPENSSL_PATH)/crypto/rand/rand_vms.c
- $(OPENSSL_PATH)/crypto/rand/rand_win.c
- $(OPENSSL_PATH)/crypto/rand/randfile.c
- $(OPENSSL_PATH)/crypto/rc4/rc4_enc.c
- $(OPENSSL_PATH)/crypto/rc4/rc4_skey.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_ameth.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_asn1.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_chk.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_crpt.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_depr.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_err.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_gen.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_lib.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_meth.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_none.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_null.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_oaep.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_ossl.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_pk1.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_pmeth.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_prn.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_pss.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_saos.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_sign.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_ssl.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_x931.c
- $(OPENSSL_PATH)/crypto/rsa/rsa_x931g.c
- $(OPENSSL_PATH)/crypto/sha/sha1_one.c
- $(OPENSSL_PATH)/crypto/sha/sha1dgst.c
- $(OPENSSL_PATH)/crypto/sha/sha256.c
- $(OPENSSL_PATH)/crypto/sha/sha512.c
- $(OPENSSL_PATH)/crypto/stack/stack.c
- $(OPENSSL_PATH)/crypto/threads_none.c
- $(OPENSSL_PATH)/crypto/threads_pthread.c
- $(OPENSSL_PATH)/crypto/threads_win.c
- $(OPENSSL_PATH)/crypto/txt_db/txt_db.c
- $(OPENSSL_PATH)/crypto/uid.c
- $(OPENSSL_PATH)/crypto/x509/by_dir.c
- $(OPENSSL_PATH)/crypto/x509/by_file.c
- $(OPENSSL_PATH)/crypto/x509/t_crl.c
- $(OPENSSL_PATH)/crypto/x509/t_req.c
- $(OPENSSL_PATH)/crypto/x509/t_x509.c
- $(OPENSSL_PATH)/crypto/x509/x509_att.c
- $(OPENSSL_PATH)/crypto/x509/x509_cmp.c
- $(OPENSSL_PATH)/crypto/x509/x509_d2.c
- $(OPENSSL_PATH)/crypto/x509/x509_def.c
- $(OPENSSL_PATH)/crypto/x509/x509_err.c
- $(OPENSSL_PATH)/crypto/x509/x509_ext.c
- $(OPENSSL_PATH)/crypto/x509/x509_lu.c
- $(OPENSSL_PATH)/crypto/x509/x509_meth.c
- $(OPENSSL_PATH)/crypto/x509/x509_obj.c
- $(OPENSSL_PATH)/crypto/x509/x509_r2x.c
- $(OPENSSL_PATH)/crypto/x509/x509_req.c
- $(OPENSSL_PATH)/crypto/x509/x509_set.c
- $(OPENSSL_PATH)/crypto/x509/x509_trs.c
- $(OPENSSL_PATH)/crypto/x509/x509_txt.c
- $(OPENSSL_PATH)/crypto/x509/x509_v3.c
- $(OPENSSL_PATH)/crypto/x509/x509_vfy.c
- $(OPENSSL_PATH)/crypto/x509/x509_vpm.c
- $(OPENSSL_PATH)/crypto/x509/x509cset.c
- $(OPENSSL_PATH)/crypto/x509/x509name.c
- $(OPENSSL_PATH)/crypto/x509/x509rset.c
- $(OPENSSL_PATH)/crypto/x509/x509spki.c
- $(OPENSSL_PATH)/crypto/x509/x509type.c
- $(OPENSSL_PATH)/crypto/x509/x_all.c
- $(OPENSSL_PATH)/crypto/x509/x_attrib.c
- $(OPENSSL_PATH)/crypto/x509/x_crl.c
- $(OPENSSL_PATH)/crypto/x509/x_exten.c
- $(OPENSSL_PATH)/crypto/x509/x_name.c
- $(OPENSSL_PATH)/crypto/x509/x_pubkey.c
- $(OPENSSL_PATH)/crypto/x509/x_req.c
- $(OPENSSL_PATH)/crypto/x509/x_x509.c
- $(OPENSSL_PATH)/crypto/x509/x_x509a.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_cache.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_data.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_lib.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_map.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_node.c
- $(OPENSSL_PATH)/crypto/x509v3/pcy_tree.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_addr.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_akey.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_akeya.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_alt.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_asid.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_bcons.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_bitst.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_conf.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_cpols.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_crld.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_enum.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_extku.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_genn.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_ia5.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_info.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_int.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_lib.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_ncons.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_pci.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_pcia.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_pcons.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_pku.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_pmaps.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_prn.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_purp.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_skey.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_sxnet.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_tlsf.c
- $(OPENSSL_PATH)/crypto/x509v3/v3_utl.c
- $(OPENSSL_PATH)/crypto/x509v3/v3err.c
-# Autogenerated files list ends here
-
-[Packages]
- MdePkg/MdePkg.dec
- CryptoPkg/CryptoPkg.dec
-
-[LibraryClasses]
- DebugLib
-
-[LibraryClasses.ARM]
- ArmSoftFloatLib
-
-[BuildOptions]
- #
- # Disables the following Visual Studio compiler warnings brought by openssl source,
- # so we do not break the build with /WX option:
- # C4090: 'function' : different 'const' qualifiers
- # C4244: conversion from type1 to type2, possible loss of data
- # C4245: conversion from type1 to type2, signed/unsigned mismatch
- # C4267: conversion from size_t to type, possible loss of data
- # C4306: 'identifier' : conversion from 'type1' to 'type2' of greater size
- # C4389: 'operator' : signed/unsigned mismatch (xxxx)
- # C4702: unreachable code
- # C4706: assignment within conditional expression
- # C4819: The file contains a character that cannot be represented in the current code page
- #
- MSFT:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4389 /wd4702 /wd4706 /wd4819
- MSFT:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER $(OPENSSL_FLAGS) /wd4090 /wd4244 /wd4245 /wd4267 /wd4306 /wd4389 /wd4702 /wd4706 /wd4819
-
- INTEL:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w
- INTEL:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) /w
-
- #
- # Suppress the following build warnings in openssl so we don't break the build with -Werror
- # -Werror=maybe-uninitialized: there exist some other paths for which the variable is not initialized.
- # -Werror=format: Check calls to printf and scanf, etc., to make sure that the arguments supplied have
- # types appropriate to the format string specified.
- #
- GCC:*_*_IA32_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized
- GCC:*_*_X64_CC_FLAGS = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -DNO_MSABI_VA_FUNCS
- GCC:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized
- GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) -Wno-error=maybe-uninitialized -Wno-format
-
- # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:
- # 1295: Deprecated declaration - give arg types
- # 550: was set but never used
- # 1293: assignment in condition
- # 111: statement is unreachable (invariably "break;" after "return X;" in case statement)
- # 68: integer conversion resulted in a change of sign ("if (Status == -1)")
- # 177: was declared but never referenced
- # 223: function declared implicitly
- # 144: a value of type cannot be used to initialize an entity of type
- # 513: a value of type cannot be assigned to an entity of type
- # 188: enumerated type mixed with another type (i.e. passing an integer as an enum without a cast)
- # 1296: Extended constant initialiser used
- # 128: loop is not reachable - may be emitted inappropriately if code follows a conditional return
- # from the function that evaluates to true at compile time
- # 546: transfer of control bypasses initialization - may be emitted inappropriately if the uninitialized
- # variable is never referenced after the jump
- # 1: ignore "#1-D: last line of file ends without a newline"
- # 3017: may be used before being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with
- # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.)
- RVCT:*_*_ARM_CC_FLAGS = $(OPENSSL_FLAGS) --library_interface=aeabi_clib99 --diag_suppress=1296,1295,550,1293,111,68,177,223,144,513,188,128,546,1,3017 -JCryptoPkg/Include
- XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w
- XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) -w
-
- #
- # AARCH64 uses strict alignment and avoids SIMD registers for code that may execute
- # with the MMU off. This involves SEC, PEI_CORE and PEIM modules as well as BASE
- # libraries, given that they may be included into such modules.
- # This library, even though of the BASE type, is never used in such cases, and
- # avoiding the SIMD register file (which is shared with the FPU) prevents the
- # compiler from successfully building some of the OpenSSL source files that
- # use floating point types, so clear the flags here.
- #
- GCC:*_*_AARCH64_CC_XIPFLAGS ==
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.uni b/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.uni
deleted file mode 100644
index 4defa21..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.uni
+++ /dev/null
@@ -1,22 +0,0 @@
-// /** @file
-// This module provides openSSL Library implementation (libcrypto only, no libssl).
-//
-// This module provides OpenSSL Library implementation (libcrypto only, no libssl).
-//
-// Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "OpenSSL Library implementation (libcrypto only, no libssl)"
-
-#string STR_MODULE_DESCRIPTION #language en-US "This module provides OpenSSL Library implementation (libcrypto only, no libssl)."
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/buildinf.h b/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/buildinf.h
deleted file mode 100644
index 80781e7..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/buildinf.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define PLATFORM "UEFI"
-#define DATE "Fri Dec 22 01:23:45 PDT 2017"
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/process_files.pl b/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/process_files.pl
deleted file mode 100644
index 8f10c34..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/OpensslLib/process_files.pl
+++ /dev/null
@@ -1,224 +0,0 @@
-#!/usr/bin/perl -w
-#
-# This script runs the OpenSSL Configure script, then processes the
-# resulting file list into our local OpensslLib[Crypto].inf and also
-# takes a copy of opensslconf.h.
-#
-# This only needs to be done once by a developer when updating to a
-# new version of OpenSSL (or changing options, etc.). Normal users
-# do not need to do this, since the results are stored in the EDK2
-# git repository for them.
-#
-use strict;
-use Cwd;
-use File::Copy;
-
-#
-# Find the openssl directory name for use lib. We have to do this
-# inside of BEGIN. The variables we create here, however, don't seem
-# to be available to the main script, so we have to repeat the
-# exercise.
-#
-my $inf_file;
-my $OPENSSL_PATH;
-my @inf;
-
-BEGIN {
- $inf_file = "OpensslLib.inf";
-
- # Read the contents of the inf file
- open( FD, "<" . $inf_file ) ||
- die "Cannot open \"" . $inf_file . "\"!";
- @inf = ();
- close(FD) ||
- die "Cannot close \"" . $inf_file . "\"!";
-
- foreach (@inf) {
- if (/DEFINE\s+OPENSSL_PATH\s*=\s*([a-z]+)/) {
-
- # We need to run Configure before we can include its result...
- $OPENSSL_PATH = $1;
-
- my $basedir = getcwd();
-
- chdir($OPENSSL_PATH) ||
- die "Cannot change to OpenSSL directory \"" . $OPENSSL_PATH . "\"";
-
- # Configure UEFI
- system(
- "./Configure",
- "UEFI",
- "no-afalgeng",
- "no-asm",
- "no-async",
- "no-autoalginit",
- "no-autoerrinit",
- "no-bf",
- "no-blake2",
- "no-camellia",
- "no-capieng",
- "no-cast",
- "no-chacha",
- "no-cms",
- "no-ct",
- "no-deprecated",
- "no-dgram",
- "no-dsa",
- "no-dynamic-engine",
- "no-ec",
- "no-ec2m",
- "no-engine",
- "no-err",
- "no-filenames",
- "no-gost",
- "no-hw",
- "no-idea",
- "no-mdc2",
- "no-pic",
- "no-ocb",
- "no-poly1305",
- "no-posix-io",
- "no-rc2",
- "no-rfc3779",
- "no-rmd160",
- "no-scrypt",
- "no-seed",
- "no-sock",
- "no-srp",
- "no-ssl",
- "no-stdio",
- "no-threads",
- "no-ts",
- "no-ui",
- "no-whirlpool"
- ) == 0 ||
- die "OpenSSL Configure failed!\n";
-
- # Generate opensslconf.h per config data
- system(
- "perl -I. -Mconfigdata util/dofile.pl " .
- "include/openssl/opensslconf.h.in " .
- "> include/openssl/opensslconf.h"
- ) == 0 ||
- die "Failed to generate opensslconf.h!\n";
-
- chdir($basedir) ||
- die "Cannot change to base directory \"" . $basedir . "\"";
-
- push @INC, $1;
- last;
- }
- }
-}
-
-#
-# Retrieve file lists from OpenSSL configdata
-#
-use configdata qw/%unified_info/;
-
-my @cryptofilelist = ();
-my @sslfilelist = ();
-foreach my $product ((@{$unified_info{libraries}},
- @{$unified_info{engines}})) {
- foreach my $o (@{$unified_info{sources}->{$product}}) {
- foreach my $s (@{$unified_info{sources}->{$o}}) {
- next if ($unified_info{generate}->{$s});
- next if $s =~ "crypto/bio/b_print.c";
- if ($product =~ "libssl") {
- push @sslfilelist, ' $(OPENSSL_PATH)/' . $s . "\r\n";
- next;
- }
- push @cryptofilelist, ' $(OPENSSL_PATH)/' . $s . "\r\n";
- }
- }
-}
-
-#
-# Update OpensslLib.inf with autogenerated file list
-#
-my @new_inf = ();
-my $subbing = 0;
-print "\n--> Updating OpensslLib.inf ... ";
-foreach (@inf) {
- if ( $_ =~ "# Autogenerated files list starts here" ) {
- push @new_inf, $_, @cryptofilelist, @sslfilelist;
- $subbing = 1;
- next;
- }
- if ( $_ =~ "# Autogenerated files list ends here" ) {
- push @new_inf, $_;
- $subbing = 0;
- next;
- }
-
- push @new_inf, $_
- unless ($subbing);
-}
-
-my $new_inf_file = $inf_file . ".new";
-open( FD, ">" . $new_inf_file ) ||
- die $new_inf_file;
-print( FD @new_inf ) ||
- die $new_inf_file;
-close(FD) ||
- die $new_inf_file;
-rename( $new_inf_file, $inf_file ) ||
- die "rename $inf_file";
-print "Done!";
-
-#
-# Update OpensslLibCrypto.inf with auto-generated file list (no libssl)
-#
-$inf_file = "OpensslLibCrypto.inf";
-
-# Read the contents of the inf file
-@inf = ();
-@new_inf = ();
-open( FD, "<" . $inf_file ) ||
- die "Cannot open \"" . $inf_file . "\"!";
-@inf = ();
-close(FD) ||
- die "Cannot close \"" . $inf_file . "\"!";
-
-$subbing = 0;
-print "\n--> Updating OpensslLibCrypto.inf ... ";
-foreach (@inf) {
- if ( $_ =~ "# Autogenerated files list starts here" ) {
- push @new_inf, $_, @cryptofilelist;
- $subbing = 1;
- next;
- }
- if ( $_ =~ "# Autogenerated files list ends here" ) {
- push @new_inf, $_;
- $subbing = 0;
- next;
- }
-
- push @new_inf, $_
- unless ($subbing);
-}
-
-$new_inf_file = $inf_file . ".new";
-open( FD, ">" . $new_inf_file ) ||
- die $new_inf_file;
-print( FD @new_inf ) ||
- die $new_inf_file;
-close(FD) ||
- die $new_inf_file;
-rename( $new_inf_file, $inf_file ) ||
- die "rename $inf_file";
-print "Done!";
-
-#
-# Copy opensslconf.h generated from OpenSSL Configuration
-#
-print "\n--> Duplicating opensslconf.h into Include/openssl ... ";
-copy($OPENSSL_PATH . "/include/openssl/opensslconf.h",
- $OPENSSL_PATH . "/../../Include/openssl/") ||
- die "Cannot copy opensslconf.h!";
-print "Done!\n";
-
-print "\nProcessing Files Done!\n";
-
-exit(0);
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/InternalTlsLib.h b/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/InternalTlsLib.h
deleted file mode 100644
index ffab14f..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/InternalTlsLib.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file
- Internal include file for TlsLib.
-
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __INTERNAL_TLS_LIB_H__
-#define __INTERNAL_TLS_LIB_H__
-
-#undef _WIN32
-#undef _WIN64
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-typedef struct {
- //
- // Main SSL Connection which is created by a server or a client
- // per established connection.
- //
- SSL *Ssl;
- //
- // Memory BIO for the TLS/SSL Reading operations.
- //
- BIO *InBio;
- //
- // Memory BIO for the TLS/SSL Writing operations.
- //
- BIO *OutBio;
-} TLS_CONNECTION;
-
-#endif
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsConfig.c b/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsConfig.c
deleted file mode 100644
index 502ce82..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsConfig.c
+++ /dev/null
@@ -1,1217 +0,0 @@
-/** @file
- SSL/TLS Configuration Library Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalTlsLib.h"
-
-typedef struct {
- //
- // IANA/IETF defined Cipher Suite ID
- //
- UINT16 IanaCipher;
- //
- // OpenSSL-used Cipher Suite String
- //
- CONST CHAR8 *OpensslCipher;
- //
- // Length of OpensslCipher
- //
- UINTN OpensslCipherLength;
-} TLS_CIPHER_MAPPING;
-
-//
-// Create a TLS_CIPHER_MAPPING initializer from IanaCipher and OpensslCipher so
-// that OpensslCipherLength is filled in automatically. IanaCipher must be an
-// integer constant expression, and OpensslCipher must be a string literal.
-//
-#define MAP(IanaCipher, OpensslCipher) \
- { (IanaCipher), (OpensslCipher), sizeof (OpensslCipher) - 1 }
-
-//
-// The mapping table between IANA/IETF Cipher Suite definitions and
-// OpenSSL-used Cipher Suite name.
-//
-// Keep the table uniquely sorted by the IanaCipher field, in increasing order.
-//
-STATIC CONST TLS_CIPHER_MAPPING TlsCipherMappingTable[] = {
- MAP ( 0x0001, "NULL-MD5" ), /// TLS_RSA_WITH_NULL_MD5
- MAP ( 0x0002, "NULL-SHA" ), /// TLS_RSA_WITH_NULL_SHA
- MAP ( 0x0004, "RC4-MD5" ), /// TLS_RSA_WITH_RC4_128_MD5
- MAP ( 0x0005, "RC4-SHA" ), /// TLS_RSA_WITH_RC4_128_SHA
- MAP ( 0x000A, "DES-CBC3-SHA" ), /// TLS_RSA_WITH_3DES_EDE_CBC_SHA, mandatory TLS 1.1
- MAP ( 0x0016, "DHE-RSA-DES-CBC3-SHA" ), /// TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
- MAP ( 0x002F, "AES128-SHA" ), /// TLS_RSA_WITH_AES_128_CBC_SHA, mandatory TLS 1.2
- MAP ( 0x0030, "DH-DSS-AES128-SHA" ), /// TLS_DH_DSS_WITH_AES_128_CBC_SHA
- MAP ( 0x0031, "DH-RSA-AES128-SHA" ), /// TLS_DH_RSA_WITH_AES_128_CBC_SHA
- MAP ( 0x0033, "DHE-RSA-AES128-SHA" ), /// TLS_DHE_RSA_WITH_AES_128_CBC_SHA
- MAP ( 0x0035, "AES256-SHA" ), /// TLS_RSA_WITH_AES_256_CBC_SHA
- MAP ( 0x0036, "DH-DSS-AES256-SHA" ), /// TLS_DH_DSS_WITH_AES_256_CBC_SHA
- MAP ( 0x0037, "DH-RSA-AES256-SHA" ), /// TLS_DH_RSA_WITH_AES_256_CBC_SHA
- MAP ( 0x0039, "DHE-RSA-AES256-SHA" ), /// TLS_DHE_RSA_WITH_AES_256_CBC_SHA
- MAP ( 0x003B, "NULL-SHA256" ), /// TLS_RSA_WITH_NULL_SHA256
- MAP ( 0x003C, "AES128-SHA256" ), /// TLS_RSA_WITH_AES_128_CBC_SHA256
- MAP ( 0x003D, "AES256-SHA256" ), /// TLS_RSA_WITH_AES_256_CBC_SHA256
- MAP ( 0x003E, "DH-DSS-AES128-SHA256" ), /// TLS_DH_DSS_WITH_AES_128_CBC_SHA256
- MAP ( 0x003F, "DH-RSA-AES128-SHA256" ), /// TLS_DH_RSA_WITH_AES_128_CBC_SHA256
- MAP ( 0x0067, "DHE-RSA-AES128-SHA256" ), /// TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
- MAP ( 0x0068, "DH-DSS-AES256-SHA256" ), /// TLS_DH_DSS_WITH_AES_256_CBC_SHA256
- MAP ( 0x0069, "DH-RSA-AES256-SHA256" ), /// TLS_DH_RSA_WITH_AES_256_CBC_SHA256
- MAP ( 0x006B, "DHE-RSA-AES256-SHA256" ), /// TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
-};
-
-/**
- Gets the OpenSSL cipher suite mapping for the supplied IANA TLS cipher suite.
-
- @param[in] CipherId The supplied IANA TLS cipher suite ID.
-
- @return The corresponding OpenSSL cipher suite mapping if found,
- NULL otherwise.
-
-**/
-STATIC
-CONST TLS_CIPHER_MAPPING *
-TlsGetCipherMapping (
- IN UINT16 CipherId
- )
-{
- INTN Left;
- INTN Right;
- INTN Middle;
-
- //
- // Binary Search Cipher Mapping Table for IANA-OpenSSL Cipher Translation
- //
- Left = 0;
- Right = ARRAY_SIZE (TlsCipherMappingTable) - 1;
-
- while (Right >= Left) {
- Middle = (Left + Right) / 2;
-
- if (CipherId == TlsCipherMappingTable[Middle].IanaCipher) {
- //
- // Translate IANA cipher suite ID to OpenSSL name.
- //
- return &TlsCipherMappingTable[Middle];
- }
-
- if (CipherId < TlsCipherMappingTable[Middle].IanaCipher) {
- Right = Middle - 1;
- } else {
- Left = Middle + 1;
- }
- }
-
- //
- // No Cipher Mapping found, return NULL.
- //
- return NULL;
-}
-
-/**
- Set a new TLS/SSL method for a particular TLS object.
-
- This function sets a new TLS/SSL method for a particular TLS object.
-
- @param[in] Tls Pointer to a TLS object.
- @param[in] MajorVer Major Version of TLS/SSL Protocol.
- @param[in] MinorVer Minor Version of TLS/SSL Protocol.
-
- @retval EFI_SUCCESS The TLS/SSL method was set successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_UNSUPPORTED Unsupported TLS/SSL method.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsSetVersion (
- IN VOID *Tls,
- IN UINT8 MajorVer,
- IN UINT8 MinorVer
- )
-{
- TLS_CONNECTION *TlsConn;
- UINT16 ProtoVersion;
-
- TlsConn = (TLS_CONNECTION *)Tls;
- if (TlsConn == NULL || TlsConn->Ssl == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- ProtoVersion = (MajorVer << 8) | MinorVer;
-
- //
- // Bound TLS method to the particular specified version.
- //
- switch (ProtoVersion) {
- case TLS1_VERSION:
- //
- // TLS 1.0
- //
- SSL_set_min_proto_version (TlsConn->Ssl, TLS1_VERSION);
- SSL_set_max_proto_version (TlsConn->Ssl, TLS1_VERSION);
- break;
- case TLS1_1_VERSION:
- //
- // TLS 1.1
- //
- SSL_set_min_proto_version (TlsConn->Ssl, TLS1_1_VERSION);
- SSL_set_max_proto_version (TlsConn->Ssl, TLS1_1_VERSION);
- break;
- case TLS1_2_VERSION:
- //
- // TLS 1.2
- //
- SSL_set_min_proto_version (TlsConn->Ssl, TLS1_2_VERSION);
- SSL_set_max_proto_version (TlsConn->Ssl, TLS1_2_VERSION);
- break;
- default:
- //
- // Unsupported Protocol Version
- //
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;;
-}
-
-/**
- Set TLS object to work in client or server mode.
-
- This function prepares a TLS object to work in client or server mode.
-
- @param[in] Tls Pointer to a TLS object.
- @param[in] IsServer Work in server mode.
-
- @retval EFI_SUCCESS The TLS/SSL work mode was set successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_UNSUPPORTED Unsupported TLS/SSL work mode.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsSetConnectionEnd (
- IN VOID *Tls,
- IN BOOLEAN IsServer
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- if (TlsConn == NULL || TlsConn->Ssl == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (!IsServer) {
- //
- // Set TLS to work in Client mode.
- //
- SSL_set_connect_state (TlsConn->Ssl);
- } else {
- //
- // Set TLS to work in Server mode.
- // It is unsupported for UEFI version currently.
- //
- //SSL_set_accept_state (TlsConn->Ssl);
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Set the ciphers list to be used by the TLS object.
-
- This function sets the ciphers for use by a specified TLS object.
-
- @param[in] Tls Pointer to a TLS object.
- @param[in] CipherId Array of UINT16 cipher identifiers. Each UINT16
- cipher identifier comes from the TLS Cipher Suite
- Registry of the IANA, interpreting Byte1 and Byte2
- in network (big endian) byte order.
- @param[in] CipherNum The number of cipher in the list.
-
- @retval EFI_SUCCESS The ciphers list was set successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_UNSUPPORTED No supported TLS cipher was found in CipherId.
- @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsSetCipherList (
- IN VOID *Tls,
- IN UINT16 *CipherId,
- IN UINTN CipherNum
- )
-{
- TLS_CONNECTION *TlsConn;
- EFI_STATUS Status;
- CONST TLS_CIPHER_MAPPING **MappedCipher;
- UINTN MappedCipherBytes;
- UINTN MappedCipherCount;
- UINTN CipherStringSize;
- UINTN Index;
- CONST TLS_CIPHER_MAPPING *Mapping;
- CHAR8 *CipherString;
- CHAR8 *CipherStringPosition;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- if (TlsConn == NULL || TlsConn->Ssl == NULL || CipherId == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Allocate the MappedCipher array for recording the mappings that we find
- // for the input IANA identifiers in CipherId.
- //
- Status = SafeUintnMult (CipherNum, sizeof (*MappedCipher),
- &MappedCipherBytes);
- if (EFI_ERROR (Status)) {
- return EFI_OUT_OF_RESOURCES;
- }
- MappedCipher = AllocatePool (MappedCipherBytes);
- if (MappedCipher == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Map the cipher IDs, and count the number of bytes for the full
- // CipherString.
- //
- MappedCipherCount = 0;
- CipherStringSize = 0;
- for (Index = 0; Index < CipherNum; Index++) {
- //
- // Look up the IANA-to-OpenSSL mapping.
- //
- Mapping = TlsGetCipherMapping (CipherId[Index]);
- if (Mapping == NULL) {
- DEBUG ((DEBUG_VERBOSE, "%a:%a: skipping CipherId=0x%04x\n",
- gEfiCallerBaseName, __FUNCTION__, CipherId[Index]));
- //
- // Skipping the cipher is valid because CipherId is an ordered
- // preference list of ciphers, thus we can filter it as long as we
- // don't change the relative order of elements on it.
- //
- continue;
- }
- //
- // Accumulate Mapping->OpensslCipherLength into CipherStringSize. If this
- // is not the first successful mapping, account for a colon (":") prefix
- // too.
- //
- if (MappedCipherCount > 0) {
- Status = SafeUintnAdd (CipherStringSize, 1, &CipherStringSize);
- if (EFI_ERROR (Status)) {
- Status = EFI_OUT_OF_RESOURCES;
- goto FreeMappedCipher;
- }
- }
- Status = SafeUintnAdd (CipherStringSize, Mapping->OpensslCipherLength,
- &CipherStringSize);
- if (EFI_ERROR (Status)) {
- Status = EFI_OUT_OF_RESOURCES;
- goto FreeMappedCipher;
- }
- //
- // Record the mapping.
- //
- MappedCipher[MappedCipherCount++] = Mapping;
- }
-
- //
- // Verify that at least one IANA cipher ID could be mapped; account for the
- // terminating NUL character in CipherStringSize; allocate CipherString.
- //
- if (MappedCipherCount == 0) {
- DEBUG ((DEBUG_ERROR, "%a:%a: no CipherId could be mapped\n",
- gEfiCallerBaseName, __FUNCTION__));
- Status = EFI_UNSUPPORTED;
- goto FreeMappedCipher;
- }
- Status = SafeUintnAdd (CipherStringSize, 1, &CipherStringSize);
- if (EFI_ERROR (Status)) {
- Status = EFI_OUT_OF_RESOURCES;
- goto FreeMappedCipher;
- }
- CipherString = AllocatePool (CipherStringSize);
- if (CipherString == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto FreeMappedCipher;
- }
-
- //
- // Go over the collected mappings and populate CipherString.
- //
- CipherStringPosition = CipherString;
- for (Index = 0; Index < MappedCipherCount; Index++) {
- Mapping = MappedCipher[Index];
- //
- // Append the colon (":") prefix except for the first mapping, then append
- // Mapping->OpensslCipher.
- //
- if (Index > 0) {
- *(CipherStringPosition++) = ':';
- }
- CopyMem (CipherStringPosition, Mapping->OpensslCipher,
- Mapping->OpensslCipherLength);
- CipherStringPosition += Mapping->OpensslCipherLength;
- }
-
- //
- // NUL-terminate CipherString.
- //
- *(CipherStringPosition++) = '\0';
- ASSERT (CipherStringPosition == CipherString + CipherStringSize);
-
- //
- // Log CipherString for debugging. CipherString can be very long if the
- // caller provided a large CipherId array, so log CipherString in segments of
- // 79 non-newline characters. (MAX_DEBUG_MESSAGE_LENGTH is usually 0x100 in
- // DebugLib instances.)
- //
- DEBUG_CODE (
- UINTN FullLength;
- UINTN SegmentLength;
-
- FullLength = CipherStringSize - 1;
- DEBUG ((DEBUG_VERBOSE, "%a:%a: CipherString={\n", gEfiCallerBaseName,
- __FUNCTION__));
- for (CipherStringPosition = CipherString;
- CipherStringPosition < CipherString + FullLength;
- CipherStringPosition += SegmentLength) {
- SegmentLength = FullLength - (CipherStringPosition - CipherString);
- if (SegmentLength > 79) {
- SegmentLength = 79;
- }
- DEBUG ((DEBUG_VERBOSE, "%.*a\n", SegmentLength, CipherStringPosition));
- }
- DEBUG ((DEBUG_VERBOSE, "}\n"));
- //
- // Restore the pre-debug value of CipherStringPosition by skipping over the
- // trailing NUL.
- //
- CipherStringPosition++;
- ASSERT (CipherStringPosition == CipherString + CipherStringSize);
- );
-
- //
- // Sets the ciphers for use by the Tls object.
- //
- if (SSL_set_cipher_list (TlsConn->Ssl, CipherString) <= 0) {
- Status = EFI_UNSUPPORTED;
- goto FreeCipherString;
- }
-
- Status = EFI_SUCCESS;
-
-FreeCipherString:
- FreePool (CipherString);
-
-FreeMappedCipher:
- FreePool (MappedCipher);
-
- return Status;
-}
-
-/**
- Set the compression method for TLS/SSL operations.
-
- This function handles TLS/SSL integrated compression methods.
-
- @param[in] CompMethod The compression method ID.
-
- @retval EFI_SUCCESS The compression method for the communication was
- set successfully.
- @retval EFI_UNSUPPORTED Unsupported compression method.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsSetCompressionMethod (
- IN UINT8 CompMethod
- )
-{
- COMP_METHOD *Cm;
- INTN Ret;
-
- Cm = NULL;
- Ret = 0;
-
- if (CompMethod == 0) {
- //
- // TLS defines one standard compression method, CompressionMethod.null (0),
- // which specifies that data exchanged via the record protocol will not be compressed.
- // So, return EFI_SUCCESS directly (RFC 3749).
- //
- return EFI_SUCCESS;
- } else if (CompMethod == 1) {
- Cm = COMP_zlib();
- } else {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Adds the compression method to the list of available
- // compression methods.
- //
- Ret = SSL_COMP_add_compression_method (CompMethod, Cm);
- if (Ret != 0) {
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Set peer certificate verification mode for the TLS connection.
-
- This function sets the verification mode flags for the TLS connection.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in] VerifyMode A set of logically or'ed verification mode flags.
-
-**/
-VOID
-EFIAPI
-TlsSetVerify (
- IN VOID *Tls,
- IN UINT32 VerifyMode
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- if (TlsConn == NULL || TlsConn->Ssl == NULL) {
- return;
- }
-
- //
- // Set peer certificate verification parameters with NULL callback.
- //
- SSL_set_verify (TlsConn->Ssl, VerifyMode, NULL);
-}
-
-/**
- Sets a TLS/SSL session ID to be used during TLS/SSL connect.
-
- This function sets a session ID to be used when the TLS/SSL connection is
- to be established.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in] SessionId Session ID data used for session resumption.
- @param[in] SessionIdLen Length of Session ID in bytes.
-
- @retval EFI_SUCCESS Session ID was set successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_UNSUPPORTED No available session for ID setting.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsSetSessionId (
- IN VOID *Tls,
- IN UINT8 *SessionId,
- IN UINT16 SessionIdLen
- )
-{
- TLS_CONNECTION *TlsConn;
- SSL_SESSION *Session;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- Session = NULL;
-
- if (TlsConn == NULL || TlsConn->Ssl == NULL || SessionId == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Session = SSL_get_session (TlsConn->Ssl);
- if (Session == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- SSL_SESSION_set1_id (Session, (const unsigned char *)SessionId, SessionIdLen);
-
- return EFI_SUCCESS;
-}
-
-/**
- Adds the CA to the cert store when requesting Server or Client authentication.
-
- This function adds the CA certificate to the list of CAs when requesting
- Server or Client authentication for the chosen TLS connection.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in] Data Pointer to the data buffer of a DER-encoded binary
- X.509 certificate or PEM-encoded X.509 certificate.
- @param[in] DataSize The size of data buffer in bytes.
-
- @retval EFI_SUCCESS The operation succeeded.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_OUT_OF_RESOURCES Required resources could not be allocated.
- @retval EFI_ABORTED Invalid X.509 certificate.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsSetCaCertificate (
- IN VOID *Tls,
- IN VOID *Data,
- IN UINTN DataSize
- )
-{
- BIO *BioCert;
- X509 *Cert;
- X509_STORE *X509Store;
- EFI_STATUS Status;
- TLS_CONNECTION *TlsConn;
- SSL_CTX *SslCtx;
- INTN Ret;
- UINTN ErrorCode;
-
- BioCert = NULL;
- Cert = NULL;
- X509Store = NULL;
- Status = EFI_SUCCESS;
- TlsConn = (TLS_CONNECTION *) Tls;
- Ret = 0;
-
- if (TlsConn == NULL || TlsConn->Ssl == NULL || Data == NULL || DataSize == 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // DER-encoded binary X.509 certificate or PEM-encoded X.509 certificate.
- // Determine whether certificate is from DER encoding, if so, translate it to X509 structure.
- //
- Cert = d2i_X509 (NULL, (const unsigned char ** )&Data, (long) DataSize);
- if (Cert == NULL) {
- //
- // Certificate is from PEM encoding.
- //
- BioCert = BIO_new (BIO_s_mem ());
- if (BioCert == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto ON_EXIT;
- }
-
- if (BIO_write (BioCert, Data, (UINT32) DataSize) <= 0) {
- Status = EFI_ABORTED;
- goto ON_EXIT;
- }
-
- Cert = PEM_read_bio_X509 (BioCert, NULL, NULL, NULL);
- if (Cert == NULL) {
- Status = EFI_ABORTED;
- goto ON_EXIT;
- }
- }
-
- SslCtx = SSL_get_SSL_CTX (TlsConn->Ssl);
- X509Store = SSL_CTX_get_cert_store (SslCtx);
- if (X509Store == NULL) {
- Status = EFI_ABORTED;
- goto ON_EXIT;
- }
-
- //
- // Add certificate to X509 store
- //
- Ret = X509_STORE_add_cert (X509Store, Cert);
- if (Ret != 1) {
- ErrorCode = ERR_peek_last_error ();
- //
- // Ignore "already in table" errors
- //
- if (!(ERR_GET_FUNC (ErrorCode) == X509_F_X509_STORE_ADD_CERT &&
- ERR_GET_REASON (ErrorCode) == X509_R_CERT_ALREADY_IN_HASH_TABLE)) {
- Status = EFI_ABORTED;
- goto ON_EXIT;
- }
- }
-
-ON_EXIT:
- if (BioCert != NULL) {
- BIO_free (BioCert);
- }
-
- if (Cert != NULL) {
- X509_free (Cert);
- }
-
- return Status;
-}
-
-/**
- Loads the local public certificate into the specified TLS object.
-
- This function loads the X.509 certificate into the specified TLS object
- for TLS negotiation.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in] Data Pointer to the data buffer of a DER-encoded binary
- X.509 certificate or PEM-encoded X.509 certificate.
- @param[in] DataSize The size of data buffer in bytes.
-
- @retval EFI_SUCCESS The operation succeeded.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_OUT_OF_RESOURCES Required resources could not be allocated.
- @retval EFI_ABORTED Invalid X.509 certificate.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsSetHostPublicCert (
- IN VOID *Tls,
- IN VOID *Data,
- IN UINTN DataSize
- )
-{
- BIO *BioCert;
- X509 *Cert;
- EFI_STATUS Status;
- TLS_CONNECTION *TlsConn;
-
- BioCert = NULL;
- Cert = NULL;
- Status = EFI_SUCCESS;
- TlsConn = (TLS_CONNECTION *) Tls;
-
- if (TlsConn == NULL || TlsConn->Ssl == NULL || Data == NULL || DataSize == 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // DER-encoded binary X.509 certificate or PEM-encoded X.509 certificate.
- // Determine whether certificate is from DER encoding, if so, translate it to X509 structure.
- //
- Cert = d2i_X509 (NULL, (const unsigned char ** )&Data, (long) DataSize);
- if (Cert == NULL) {
- //
- // Certificate is from PEM encoding.
- //
- BioCert = BIO_new (BIO_s_mem ());
- if (BioCert == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto ON_EXIT;
- }
-
- if (BIO_write (BioCert, Data, (UINT32) DataSize) <= 0) {
- Status = EFI_ABORTED;
- goto ON_EXIT;
- }
-
- Cert = PEM_read_bio_X509 (BioCert, NULL, NULL, NULL);
- if (Cert == NULL) {
- Status = EFI_ABORTED;
- goto ON_EXIT;
- }
- }
-
- if (SSL_use_certificate (TlsConn->Ssl, Cert) != 1) {
- Status = EFI_ABORTED;
- goto ON_EXIT;
- }
-
-ON_EXIT:
- if (BioCert != NULL) {
- BIO_free (BioCert);
- }
-
- if (Cert != NULL) {
- X509_free (Cert);
- }
-
- return Status;
-}
-
-/**
- Adds the local private key to the specified TLS object.
-
- This function adds the local private key (PEM-encoded RSA or PKCS#8 private
- key) into the specified TLS object for TLS negotiation.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in] Data Pointer to the data buffer of a PEM-encoded RSA
- or PKCS#8 private key.
- @param[in] DataSize The size of data buffer in bytes.
-
- @retval EFI_SUCCESS The operation succeeded.
- @retval EFI_UNSUPPORTED This function is not supported.
- @retval EFI_ABORTED Invalid private key data.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsSetHostPrivateKey (
- IN VOID *Tls,
- IN VOID *Data,
- IN UINTN DataSize
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- Adds the CA-supplied certificate revocation list for certificate validation.
-
- This function adds the CA-supplied certificate revocation list data for
- certificate validity checking.
-
- @param[in] Data Pointer to the data buffer of a DER-encoded CRL data.
- @param[in] DataSize The size of data buffer in bytes.
-
- @retval EFI_SUCCESS The operation succeeded.
- @retval EFI_UNSUPPORTED This function is not supported.
- @retval EFI_ABORTED Invalid CRL data.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsSetCertRevocationList (
- IN VOID *Data,
- IN UINTN DataSize
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- Gets the protocol version used by the specified TLS connection.
-
- This function returns the protocol version used by the specified TLS
- connection.
-
- If Tls is NULL, then ASSERT().
-
- @param[in] Tls Pointer to the TLS object.
-
- @return The protocol version of the specified TLS connection.
-
-**/
-UINT16
-EFIAPI
-TlsGetVersion (
- IN VOID *Tls
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
-
- ASSERT (TlsConn != NULL);
-
- return (UINT16)(SSL_version (TlsConn->Ssl));
-}
-
-/**
- Gets the connection end of the specified TLS connection.
-
- This function returns the connection end (as client or as server) used by
- the specified TLS connection.
-
- If Tls is NULL, then ASSERT().
-
- @param[in] Tls Pointer to the TLS object.
-
- @return The connection end used by the specified TLS connection.
-
-**/
-UINT8
-EFIAPI
-TlsGetConnectionEnd (
- IN VOID *Tls
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
-
- ASSERT (TlsConn != NULL);
-
- return (UINT8)SSL_is_server (TlsConn->Ssl);
-}
-
-/**
- Gets the cipher suite used by the specified TLS connection.
-
- This function returns current cipher suite used by the specified
- TLS connection.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in,out] CipherId The cipher suite used by the TLS object.
-
- @retval EFI_SUCCESS The cipher suite was returned successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_UNSUPPORTED Unsupported cipher suite.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsGetCurrentCipher (
- IN VOID *Tls,
- IN OUT UINT16 *CipherId
- )
-{
- TLS_CONNECTION *TlsConn;
- CONST SSL_CIPHER *Cipher;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- Cipher = NULL;
-
- if (TlsConn == NULL || TlsConn->Ssl == NULL || CipherId == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Cipher = SSL_get_current_cipher (TlsConn->Ssl);
- if (Cipher == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- *CipherId = (SSL_CIPHER_get_id (Cipher)) & 0xFFFF;
-
- return EFI_SUCCESS;
-}
-
-/**
- Gets the compression methods used by the specified TLS connection.
-
- This function returns current integrated compression methods used by
- the specified TLS connection.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in,out] CompressionId The current compression method used by
- the TLS object.
-
- @retval EFI_SUCCESS The compression method was returned successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_ABORTED Invalid Compression method.
- @retval EFI_UNSUPPORTED This function is not supported.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsGetCurrentCompressionId (
- IN VOID *Tls,
- IN OUT UINT8 *CompressionId
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- Gets the verification mode currently set in the TLS connection.
-
- This function returns the peer verification mode currently set in the
- specified TLS connection.
-
- If Tls is NULL, then ASSERT().
-
- @param[in] Tls Pointer to the TLS object.
-
- @return The verification mode set in the specified TLS connection.
-
-**/
-UINT32
-EFIAPI
-TlsGetVerify (
- IN VOID *Tls
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
-
- ASSERT (TlsConn != NULL);
-
- return SSL_get_verify_mode (TlsConn->Ssl);
-}
-
-/**
- Gets the session ID used by the specified TLS connection.
-
- This function returns the TLS/SSL session ID currently used by the
- specified TLS connection.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in,out] SessionId Buffer to contain the returned session ID.
- @param[in,out] SessionIdLen The length of Session ID in bytes.
-
- @retval EFI_SUCCESS The Session ID was returned successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_UNSUPPORTED Invalid TLS/SSL session.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsGetSessionId (
- IN VOID *Tls,
- IN OUT UINT8 *SessionId,
- IN OUT UINT16 *SessionIdLen
- )
-{
- TLS_CONNECTION *TlsConn;
- SSL_SESSION *Session;
- CONST UINT8 *SslSessionId;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- Session = NULL;
-
- if (TlsConn == NULL || TlsConn->Ssl == NULL || SessionId == NULL || SessionIdLen == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Session = SSL_get_session (TlsConn->Ssl);
- if (Session == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- SslSessionId = SSL_SESSION_get_id (Session, (unsigned int *)SessionIdLen);
- CopyMem (SessionId, SslSessionId, *SessionIdLen);
-
- return EFI_SUCCESS;
-}
-
-/**
- Gets the client random data used in the specified TLS connection.
-
- This function returns the TLS/SSL client random data currently used in
- the specified TLS connection.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in,out] ClientRandom Buffer to contain the returned client
- random data (32 bytes).
-
-**/
-VOID
-EFIAPI
-TlsGetClientRandom (
- IN VOID *Tls,
- IN OUT UINT8 *ClientRandom
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
-
- if (TlsConn == NULL || TlsConn->Ssl == NULL || ClientRandom == NULL) {
- return;
- }
-
- SSL_get_client_random (TlsConn->Ssl, ClientRandom, SSL3_RANDOM_SIZE);
-}
-
-/**
- Gets the server random data used in the specified TLS connection.
-
- This function returns the TLS/SSL server random data currently used in
- the specified TLS connection.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in,out] ServerRandom Buffer to contain the returned server
- random data (32 bytes).
-
-**/
-VOID
-EFIAPI
-TlsGetServerRandom (
- IN VOID *Tls,
- IN OUT UINT8 *ServerRandom
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
-
- if (TlsConn == NULL || TlsConn->Ssl == NULL || ServerRandom == NULL) {
- return;
- }
-
- SSL_get_server_random (TlsConn->Ssl, ServerRandom, SSL3_RANDOM_SIZE);
-}
-
-/**
- Gets the master key data used in the specified TLS connection.
-
- This function returns the TLS/SSL master key material currently used in
- the specified TLS connection.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in,out] KeyMaterial Buffer to contain the returned key material.
-
- @retval EFI_SUCCESS Key material was returned successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_UNSUPPORTED Invalid TLS/SSL session.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsGetKeyMaterial (
- IN VOID *Tls,
- IN OUT UINT8 *KeyMaterial
- )
-{
- TLS_CONNECTION *TlsConn;
- SSL_SESSION *Session;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- Session = NULL;
-
- if (TlsConn == NULL || TlsConn->Ssl == NULL || KeyMaterial == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Session = SSL_get_session (TlsConn->Ssl);
-
- if (Session == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- SSL_SESSION_get_master_key (Session, KeyMaterial, SSL3_MASTER_SECRET_SIZE);
-
- return EFI_SUCCESS;
-}
-
-/**
- Gets the CA Certificate from the cert store.
-
- This function returns the CA certificate for the chosen
- TLS connection.
-
- @param[in] Tls Pointer to the TLS object.
- @param[out] Data Pointer to the data buffer to receive the CA
- certificate data sent to the client.
- @param[in,out] DataSize The size of data buffer in bytes.
-
- @retval EFI_SUCCESS The operation succeeded.
- @retval EFI_UNSUPPORTED This function is not supported.
- @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsGetCaCertificate (
- IN VOID *Tls,
- OUT VOID *Data,
- IN OUT UINTN *DataSize
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- Gets the local public Certificate set in the specified TLS object.
-
- This function returns the local public certificate which was currently set
- in the specified TLS object.
-
- @param[in] Tls Pointer to the TLS object.
- @param[out] Data Pointer to the data buffer to receive the local
- public certificate.
- @param[in,out] DataSize The size of data buffer in bytes.
-
- @retval EFI_SUCCESS The operation succeeded.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_NOT_FOUND The certificate is not found.
- @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsGetHostPublicCert (
- IN VOID *Tls,
- OUT VOID *Data,
- IN OUT UINTN *DataSize
- )
-{
- X509 *Cert;
- TLS_CONNECTION *TlsConn;
-
- Cert = NULL;
- TlsConn = (TLS_CONNECTION *) Tls;
-
- if (TlsConn == NULL || TlsConn->Ssl == NULL || DataSize == NULL || (*DataSize != 0 && Data == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Cert = SSL_get_certificate(TlsConn->Ssl);
- if (Cert == NULL) {
- return EFI_NOT_FOUND;
- }
-
- //
- // Only DER encoding is supported currently.
- //
- if (*DataSize < (UINTN) i2d_X509 (Cert, NULL)) {
- *DataSize = (UINTN) i2d_X509 (Cert, NULL);
- return EFI_BUFFER_TOO_SMALL;
- }
-
- *DataSize = (UINTN) i2d_X509 (Cert, (unsigned char **) &Data);
-
- return EFI_SUCCESS;
-}
-
-/**
- Gets the local private key set in the specified TLS object.
-
- This function returns the local private key data which was currently set
- in the specified TLS object.
-
- @param[in] Tls Pointer to the TLS object.
- @param[out] Data Pointer to the data buffer to receive the local
- private key data.
- @param[in,out] DataSize The size of data buffer in bytes.
-
- @retval EFI_SUCCESS The operation succeeded.
- @retval EFI_UNSUPPORTED This function is not supported.
- @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsGetHostPrivateKey (
- IN VOID *Tls,
- OUT VOID *Data,
- IN OUT UINTN *DataSize
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- Gets the CA-supplied certificate revocation list data set in the specified
- TLS object.
-
- This function returns the CA-supplied certificate revocation list data which
- was currently set in the specified TLS object.
-
- @param[out] Data Pointer to the data buffer to receive the CRL data.
- @param[in,out] DataSize The size of data buffer in bytes.
-
- @retval EFI_SUCCESS The operation succeeded.
- @retval EFI_UNSUPPORTED This function is not supported.
- @retval EFI_BUFFER_TOO_SMALL The Data is too small to hold the data.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsGetCertRevocationList (
- OUT VOID *Data,
- IN OUT UINTN *DataSize
- )
-{
- return EFI_UNSUPPORTED;
-}
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsInit.c b/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsInit.c
deleted file mode 100644
index d9fe744..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsInit.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/** @file
- SSL/TLS Initialization Library Wrapper Implementation over OpenSSL.
-
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalTlsLib.h"
-
-/**
- Initializes the OpenSSL library.
-
- This function registers ciphers and digests used directly and indirectly
- by SSL/TLS, and initializes the readable error messages.
- This function must be called before any other action takes places.
-
- @retval TRUE The OpenSSL library has been initialized.
- @retval FALSE Failed to initialize the OpenSSL library.
-
-**/
-BOOLEAN
-EFIAPI
-TlsInitialize (
- VOID
- )
-{
- INTN Ret;
-
- //
- // Performs initialization of crypto and ssl library, and loads required
- // algorithms.
- //
- Ret = OPENSSL_init_ssl (
- OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS,
- NULL
- );
- if (Ret != 1) {
- return FALSE;
- }
-
- //
- // Initialize the pseudorandom number generator.
- //
- return RandomSeed (NULL, 0);
-}
-
-/**
- Free an allocated SSL_CTX object.
-
- @param[in] TlsCtx Pointer to the SSL_CTX object to be released.
-
-**/
-VOID
-EFIAPI
-TlsCtxFree (
- IN VOID *TlsCtx
- )
-{
- if (TlsCtx == NULL) {
- return;
- }
-
- if (TlsCtx != NULL) {
- SSL_CTX_free ((SSL_CTX *) (TlsCtx));
- }
-}
-
-/**
- Creates a new SSL_CTX object as framework to establish TLS/SSL enabled
- connections.
-
- @param[in] MajorVer Major Version of TLS/SSL Protocol.
- @param[in] MinorVer Minor Version of TLS/SSL Protocol.
-
- @return Pointer to an allocated SSL_CTX object.
- If the creation failed, TlsCtxNew() returns NULL.
-
-**/
-VOID *
-EFIAPI
-TlsCtxNew (
- IN UINT8 MajorVer,
- IN UINT8 MinorVer
- )
-{
- SSL_CTX *TlsCtx;
- UINT16 ProtoVersion;
-
- ProtoVersion = (MajorVer << 8) | MinorVer;
-
- TlsCtx = SSL_CTX_new (SSLv23_client_method ());
- if (TlsCtx == NULL) {
- return NULL;
- }
-
- //
- // Ensure SSLv3 is disabled
- //
- SSL_CTX_set_options (TlsCtx, SSL_OP_NO_SSLv3);
-
- //
- // Treat as minimum accepted versions by setting the minimal bound.
- // Client can use higher TLS version if server supports it
- //
- SSL_CTX_set_min_proto_version (TlsCtx, ProtoVersion);
-
- return (VOID *) TlsCtx;
-}
-
-/**
- Free an allocated TLS object.
-
- This function removes the TLS object pointed to by Tls and frees up the
- allocated memory. If Tls is NULL, nothing is done.
-
- @param[in] Tls Pointer to the TLS object to be freed.
-
-**/
-VOID
-EFIAPI
-TlsFree (
- IN VOID *Tls
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- if (TlsConn == NULL) {
- return;
- }
-
- //
- // Free the internal TLS and related BIO objects.
- //
- if (TlsConn->Ssl != NULL) {
- SSL_free (TlsConn->Ssl);
- }
-
- OPENSSL_free (Tls);
-}
-
-/**
- Create a new TLS object for a connection.
-
- This function creates a new TLS object for a connection. The new object
- inherits the setting of the underlying context TlsCtx: connection method,
- options, verification setting.
-
- @param[in] TlsCtx Pointer to the SSL_CTX object.
-
- @return Pointer to an allocated SSL object.
- If the creation failed, TlsNew() returns NULL.
-
-**/
-VOID *
-EFIAPI
-TlsNew (
- IN VOID *TlsCtx
- )
-{
- TLS_CONNECTION *TlsConn;
- SSL_CTX *SslCtx;
- X509_STORE *X509Store;
-
- TlsConn = NULL;
-
- //
- // Allocate one new TLS_CONNECTION object
- //
- TlsConn = (TLS_CONNECTION *) OPENSSL_malloc (sizeof (TLS_CONNECTION));
- if (TlsConn == NULL) {
- return NULL;
- }
-
- TlsConn->Ssl = NULL;
-
- //
- // Create a new SSL Object
- //
- TlsConn->Ssl = SSL_new ((SSL_CTX *) TlsCtx);
- if (TlsConn->Ssl == NULL) {
- TlsFree ((VOID *) TlsConn);
- return NULL;
- }
-
- //
- // This retains compatibility with previous version of OpenSSL.
- //
- SSL_set_security_level (TlsConn->Ssl, 0);
-
- //
- // Initialize the created SSL Object
- //
- SSL_set_info_callback (TlsConn->Ssl, NULL);
-
- TlsConn->InBio = NULL;
-
- //
- // Set up Reading BIO for TLS connection
- //
- TlsConn->InBio = BIO_new (BIO_s_mem ());
- if (TlsConn->InBio == NULL) {
- TlsFree ((VOID *) TlsConn);
- return NULL;
- }
-
- //
- // Sets the behaviour of memory BIO when it is empty. It will set the
- // read retry flag.
- //
- BIO_set_mem_eof_return (TlsConn->InBio, -1);
-
- TlsConn->OutBio = NULL;
-
- //
- // Set up Writing BIO for TLS connection
- //
- TlsConn->OutBio = BIO_new (BIO_s_mem ());
- if (TlsConn->OutBio == NULL) {
- TlsFree ((VOID *) TlsConn);
- return NULL;
- }
-
- //
- // Sets the behaviour of memory BIO when it is empty. It will set the
- // write retry flag.
- //
- BIO_set_mem_eof_return (TlsConn->OutBio, -1);
-
- ASSERT (TlsConn->Ssl != NULL && TlsConn->InBio != NULL && TlsConn->OutBio != NULL);
-
- //
- // Connects the InBio and OutBio for the read and write operations.
- //
- SSL_set_bio (TlsConn->Ssl, TlsConn->InBio, TlsConn->OutBio);
-
- //
- // Create new X509 store if needed
- //
- SslCtx = SSL_get_SSL_CTX (TlsConn->Ssl);
- X509Store = SSL_CTX_get_cert_store (SslCtx);
- if (X509Store == NULL) {
- X509Store = X509_STORE_new ();
- if (X509Store == NULL) {
- TlsFree ((VOID *) TlsConn);
- return NULL;
- }
- SSL_CTX_set1_verify_cert_store (SslCtx, X509Store);
- X509_STORE_free (X509Store);
- }
-
- //
- // Set X509_STORE flags used in certificate validation
- //
- X509_STORE_set_flags (
- X509Store,
- X509_V_FLAG_PARTIAL_CHAIN | X509_V_FLAG_NO_CHECK_TIME
- );
- return (VOID *) TlsConn;
-}
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsLib.inf b/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsLib.inf
deleted file mode 100644
index 4bc20ab..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsLib.inf
+++ /dev/null
@@ -1,56 +0,0 @@
-## @file
-# SSL/TLS Wrapper Library Instance based on OpenSSL.
-#
-# Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
-# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = TlsLib
- MODULE_UNI_FILE = TlsLib.uni
- FILE_GUID = CC729DC5-4E21-0B36-1A00-3A8E1B86A155
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = TlsLib|DXE_DRIVER DXE_CORE UEFI_APPLICATION UEFI_DRIVER
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
-#
-
-[Sources]
- InternalTlsLib.h
- TlsInit.c
- TlsConfig.c
- TlsProcess.c
-
-[Packages]
- MdePkg/MdePkg.dec
- CryptoPkg/CryptoPkg.dec
-
-[LibraryClasses]
- BaseCryptLib
- BaseMemoryLib
- DebugLib
- IntrinsicLib
- MemoryAllocationLib
- OpensslLib
- SafeIntLib
-
-[BuildOptions]
- #
- # suppress the following warnings so we do not break the build with warnings-as-errors:
- # C4090: 'function' : different 'const' qualifiers
- #
- MSFT:*_*_*_CC_FLAGS = /wd4090
-
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsLib.uni b/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsLib.uni
deleted file mode 100644
index b418cde..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsLib.uni
+++ /dev/null
@@ -1,19 +0,0 @@
-// /** @file
-// SSL/TLS Wrapper Library Instance based on OpenSSL.
-//
-// Copyright (c) 2016, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "SSL/TLS Wrapper Library Instance"
-
-#string STR_MODULE_DESCRIPTION #language en-US "This module provides SSL/TLS Wrapper Library Instance."
diff --git a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsProcess.c b/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsProcess.c
deleted file mode 100644
index 3a79fe4..0000000
--- a/Voyager/Voyager/edk2/CryptoPkg/Library/TlsLib/TlsProcess.c
+++ /dev/null
@@ -1,463 +0,0 @@
-/** @file
- SSL/TLS Process Library Wrapper Implementation over OpenSSL.
- The process includes the TLS handshake and packet I/O.
-
-Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
-(C) Copyright 2016 Hewlett Packard Enterprise Development LP
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "InternalTlsLib.h"
-
-#define MAX_BUFFER_SIZE 32768
-
-/**
- Checks if the TLS handshake was done.
-
- This function will check if the specified TLS handshake was done.
-
- @param[in] Tls Pointer to the TLS object for handshake state checking.
-
- @retval TRUE The TLS handshake was done.
- @retval FALSE The TLS handshake was not done.
-
-**/
-BOOLEAN
-EFIAPI
-TlsInHandshake (
- IN VOID *Tls
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- if (TlsConn == NULL || TlsConn->Ssl == NULL) {
- return FALSE;
- }
-
- //
- // Return the status which indicates if the TLS handshake was done.
- //
- return !SSL_is_init_finished (TlsConn->Ssl);
-}
-
-/**
- Perform a TLS/SSL handshake.
-
- This function will perform a TLS/SSL handshake.
-
- @param[in] Tls Pointer to the TLS object for handshake operation.
- @param[in] BufferIn Pointer to the most recently received TLS Handshake packet.
- @param[in] BufferInSize Packet size in bytes for the most recently received TLS
- Handshake packet.
- @param[out] BufferOut Pointer to the buffer to hold the built packet.
- @param[in, out] BufferOutSize Pointer to the buffer size in bytes. On input, it is
- the buffer size provided by the caller. On output, it
- is the buffer size in fact needed to contain the
- packet.
-
- @retval EFI_SUCCESS The required TLS packet is built successfully.
- @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- Tls is NULL.
- BufferIn is NULL but BufferInSize is NOT 0.
- BufferInSize is 0 but BufferIn is NOT NULL.
- BufferOutSize is NULL.
- BufferOut is NULL if *BufferOutSize is not zero.
- @retval EFI_BUFFER_TOO_SMALL BufferOutSize is too small to hold the response packet.
- @retval EFI_ABORTED Something wrong during handshake.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsDoHandshake (
- IN VOID *Tls,
- IN UINT8 *BufferIn, OPTIONAL
- IN UINTN BufferInSize, OPTIONAL
- OUT UINT8 *BufferOut, OPTIONAL
- IN OUT UINTN *BufferOutSize
- )
-{
- TLS_CONNECTION *TlsConn;
- UINTN PendingBufferSize;
- INTN Ret;
- UINTN ErrorCode;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- PendingBufferSize = 0;
- Ret = 1;
-
- if (TlsConn == NULL || \
- TlsConn->Ssl == NULL || TlsConn->InBio == NULL || TlsConn->OutBio == NULL || \
- BufferOutSize == NULL || \
- (BufferIn == NULL && BufferInSize != 0) || \
- (BufferIn != NULL && BufferInSize == 0) || \
- (BufferOut == NULL && *BufferOutSize != 0)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if(BufferIn == NULL && BufferInSize == 0) {
- //
- // If RequestBuffer is NULL and RequestSize is 0, and TLS session
- // status is EfiTlsSessionNotStarted, the TLS session will be initiated
- // and the response packet needs to be ClientHello.
- //
- PendingBufferSize = (UINTN) BIO_ctrl_pending (TlsConn->OutBio);
- if (PendingBufferSize == 0) {
- SSL_set_connect_state (TlsConn->Ssl);
- Ret = SSL_do_handshake (TlsConn->Ssl);
- PendingBufferSize = (UINTN) BIO_ctrl_pending (TlsConn->OutBio);
- }
- } else {
- PendingBufferSize = (UINTN) BIO_ctrl_pending (TlsConn->OutBio);
- if (PendingBufferSize == 0) {
- BIO_write (TlsConn->InBio, BufferIn, (UINT32) BufferInSize);
- Ret = SSL_do_handshake (TlsConn->Ssl);
- PendingBufferSize = (UINTN) BIO_ctrl_pending (TlsConn->OutBio);
- }
- }
-
- if (Ret < 1) {
- Ret = SSL_get_error (TlsConn->Ssl, (int) Ret);
- if (Ret == SSL_ERROR_SSL ||
- Ret == SSL_ERROR_SYSCALL ||
- Ret == SSL_ERROR_ZERO_RETURN) {
- DEBUG ((
- DEBUG_ERROR,
- "%a SSL_HANDSHAKE_ERROR State=0x%x SSL_ERROR_%a\n",
- __FUNCTION__,
- SSL_get_state (TlsConn->Ssl),
- Ret == SSL_ERROR_SSL ? "SSL" : Ret == SSL_ERROR_SYSCALL ? "SYSCALL" : "ZERO_RETURN"
- ));
- DEBUG_CODE_BEGIN ();
- while (TRUE) {
- ErrorCode = ERR_get_error ();
- if (ErrorCode == 0) {
- break;
- }
- DEBUG ((
- DEBUG_ERROR,
- "%a ERROR 0x%x=L%x:F%x:R%x\n",
- __FUNCTION__,
- ErrorCode,
- ERR_GET_LIB (ErrorCode),
- ERR_GET_FUNC (ErrorCode),
- ERR_GET_REASON (ErrorCode)
- ));
- }
- DEBUG_CODE_END ();
- return EFI_ABORTED;
- }
- }
-
- if (PendingBufferSize > *BufferOutSize) {
- *BufferOutSize = PendingBufferSize;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- if (PendingBufferSize > 0) {
- *BufferOutSize = BIO_read (TlsConn->OutBio, BufferOut, (UINT32) PendingBufferSize);
- } else {
- *BufferOutSize = 0;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Handle Alert message recorded in BufferIn. If BufferIn is NULL and BufferInSize is zero,
- TLS session has errors and the response packet needs to be Alert message based on error type.
-
- @param[in] Tls Pointer to the TLS object for state checking.
- @param[in] BufferIn Pointer to the most recently received TLS Alert packet.
- @param[in] BufferInSize Packet size in bytes for the most recently received TLS
- Alert packet.
- @param[out] BufferOut Pointer to the buffer to hold the built packet.
- @param[in, out] BufferOutSize Pointer to the buffer size in bytes. On input, it is
- the buffer size provided by the caller. On output, it
- is the buffer size in fact needed to contain the
- packet.
-
- @retval EFI_SUCCESS The required TLS packet is built successfully.
- @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- Tls is NULL.
- BufferIn is NULL but BufferInSize is NOT 0.
- BufferInSize is 0 but BufferIn is NOT NULL.
- BufferOutSize is NULL.
- BufferOut is NULL if *BufferOutSize is not zero.
- @retval EFI_ABORTED An error occurred.
- @retval EFI_BUFFER_TOO_SMALL BufferOutSize is too small to hold the response packet.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsHandleAlert (
- IN VOID *Tls,
- IN UINT8 *BufferIn, OPTIONAL
- IN UINTN BufferInSize, OPTIONAL
- OUT UINT8 *BufferOut, OPTIONAL
- IN OUT UINTN *BufferOutSize
- )
-{
- TLS_CONNECTION *TlsConn;
- UINTN PendingBufferSize;
- UINT8 *TempBuffer;
- INTN Ret;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- PendingBufferSize = 0;
- TempBuffer = NULL;
- Ret = 0;
-
- if (TlsConn == NULL || \
- TlsConn->Ssl == NULL || TlsConn->InBio == NULL || TlsConn->OutBio == NULL || \
- BufferOutSize == NULL || \
- (BufferIn == NULL && BufferInSize != 0) || \
- (BufferIn != NULL && BufferInSize == 0) || \
- (BufferOut == NULL && *BufferOutSize != 0)) {
- return EFI_INVALID_PARAMETER;
- }
-
- PendingBufferSize = (UINTN) BIO_ctrl_pending (TlsConn->OutBio);
- if (PendingBufferSize == 0 && BufferIn != NULL && BufferInSize != 0) {
- Ret = BIO_write (TlsConn->InBio, BufferIn, (UINT32) BufferInSize);
- if (Ret != (INTN) BufferInSize) {
- return EFI_ABORTED;
- }
-
- TempBuffer = (UINT8 *) OPENSSL_malloc (MAX_BUFFER_SIZE);
-
- //
- // ssl3_send_alert() will be called in ssl3_read_bytes() function.
- // TempBuffer is invalid since it's a Alert message, so just ignore it.
- //
- SSL_read (TlsConn->Ssl, TempBuffer, MAX_BUFFER_SIZE);
-
- OPENSSL_free (TempBuffer);
-
- PendingBufferSize = (UINTN) BIO_ctrl_pending (TlsConn->OutBio);
- }
-
- if (PendingBufferSize > *BufferOutSize) {
- *BufferOutSize = PendingBufferSize;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- if (PendingBufferSize > 0) {
- *BufferOutSize = BIO_read (TlsConn->OutBio, BufferOut, (UINT32) PendingBufferSize);
- } else {
- *BufferOutSize = 0;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Build the CloseNotify packet.
-
- @param[in] Tls Pointer to the TLS object for state checking.
- @param[in, out] Buffer Pointer to the buffer to hold the built packet.
- @param[in, out] BufferSize Pointer to the buffer size in bytes. On input, it is
- the buffer size provided by the caller. On output, it
- is the buffer size in fact needed to contain the
- packet.
-
- @retval EFI_SUCCESS The required TLS packet is built successfully.
- @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- Tls is NULL.
- BufferSize is NULL.
- Buffer is NULL if *BufferSize is not zero.
- @retval EFI_BUFFER_TOO_SMALL BufferSize is too small to hold the response packet.
-
-**/
-EFI_STATUS
-EFIAPI
-TlsCloseNotify (
- IN VOID *Tls,
- IN OUT UINT8 *Buffer,
- IN OUT UINTN *BufferSize
- )
-{
- TLS_CONNECTION *TlsConn;
- UINTN PendingBufferSize;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- PendingBufferSize = 0;
-
- if (TlsConn == NULL || \
- TlsConn->Ssl == NULL || TlsConn->InBio == NULL || TlsConn->OutBio == NULL || \
- BufferSize == NULL || \
- (Buffer == NULL && *BufferSize != 0)) {
- return EFI_INVALID_PARAMETER;
- }
-
- PendingBufferSize = (UINTN) BIO_ctrl_pending (TlsConn->OutBio);
- if (PendingBufferSize == 0) {
- //
- // ssl3_send_alert() and ssl3_dispatch_alert() function will be called.
- //
- SSL_shutdown (TlsConn->Ssl);
- PendingBufferSize = (UINTN) BIO_ctrl_pending (TlsConn->OutBio);
- }
-
- if (PendingBufferSize > *BufferSize) {
- *BufferSize = PendingBufferSize;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- if (PendingBufferSize > 0) {
- *BufferSize = BIO_read (TlsConn->OutBio, Buffer, (UINT32) PendingBufferSize);
- } else {
- *BufferSize = 0;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Attempts to read bytes from one TLS object and places the data in Buffer.
-
- This function will attempt to read BufferSize bytes from the TLS object
- and places the data in Buffer.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in,out] Buffer Pointer to the buffer to store the data.
- @param[in] BufferSize The size of Buffer in bytes.
-
- @retval >0 The amount of data successfully read from the TLS object.
- @retval <=0 No data was successfully read.
-
-**/
-INTN
-EFIAPI
-TlsCtrlTrafficOut (
- IN VOID *Tls,
- IN OUT VOID *Buffer,
- IN UINTN BufferSize
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- if (TlsConn == NULL || TlsConn->OutBio == 0) {
- return -1;
- }
-
- //
- // Read and return the amount of data from the BIO.
- //
- return BIO_read (TlsConn->OutBio, Buffer, (UINT32) BufferSize);
-}
-
-/**
- Attempts to write data from the buffer to TLS object.
-
- This function will attempt to write BufferSize bytes data from the Buffer
- to the TLS object.
-
- @param[in] Tls Pointer to the TLS object.
- @param[in] Buffer Pointer to the data buffer.
- @param[in] BufferSize The size of Buffer in bytes.
-
- @retval >0 The amount of data successfully written to the TLS object.
- @retval <=0 No data was successfully written.
-
-**/
-INTN
-EFIAPI
-TlsCtrlTrafficIn (
- IN VOID *Tls,
- IN VOID *Buffer,
- IN UINTN BufferSize
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- if (TlsConn == NULL || TlsConn->InBio == 0) {
- return -1;
- }
-
- //
- // Write and return the amount of data to the BIO.
- //
- return BIO_write (TlsConn->InBio, Buffer, (UINT32) BufferSize);
-}
-/**
- Attempts to read bytes from the specified TLS connection into the buffer.
-
- This function tries to read BufferSize bytes data from the specified TLS
- connection into the Buffer.
-
- @param[in] Tls Pointer to the TLS connection for data reading.
- @param[in,out] Buffer Pointer to the data buffer.
- @param[in] BufferSize The size of Buffer in bytes.
-
- @retval >0 The read operation was successful, and return value is the
- number of bytes actually read from the TLS connection.
- @retval <=0 The read operation was not successful.
-
-**/
-INTN
-EFIAPI
-TlsRead (
- IN VOID *Tls,
- IN OUT VOID *Buffer,
- IN UINTN BufferSize
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- if (TlsConn == NULL || TlsConn->Ssl == NULL) {
- return -1;
- }
-
- //
- // Read bytes from the specified TLS connection.
- //
- return SSL_read (TlsConn->Ssl, Buffer, (UINT32) BufferSize);
-}
-
-/**
- Attempts to write data to a TLS connection.
-
- This function tries to write BufferSize bytes data from the Buffer into the
- specified TLS connection.
-
- @param[in] Tls Pointer to the TLS connection for data writing.
- @param[in] Buffer Pointer to the data buffer.
- @param[in] BufferSize The size of Buffer in bytes.
-
- @retval >0 The write operation was successful, and return value is the
- number of bytes actually written to the TLS connection.
- @retval <=0 The write operation was not successful.
-
-**/
-INTN
-EFIAPI
-TlsWrite (
- IN VOID *Tls,
- IN VOID *Buffer,
- IN UINTN BufferSize
- )
-{
- TLS_CONNECTION *TlsConn;
-
- TlsConn = (TLS_CONNECTION *) Tls;
- if (TlsConn == NULL || TlsConn->Ssl == NULL) {
- return -1;
- }
-
- //
- // Write bytes to the specified TLS connection.
- //
- return SSL_write (TlsConn->Ssl, Buffer, (UINT32) BufferSize);
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/ArmCache.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/ArmCache.c
deleted file mode 100644
index 2326047..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/ArmCache.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/** @file
- Cache Maintenance Functions. These functions vary by ARM architecture so the MdePkg
- versions are null functions used to make sure things will compile.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-//
-// Include common header file for this module.
-//
-#include
-#include
-
-/**
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
-**/
-VOID
-EFIAPI
-InvalidateInstructionCache (
- VOID
- )
-{
- ASSERT(FALSE);
-}
-
-/**
- Invalidates a range of instruction cache lines in the cache coherency domain
- of the calling CPU.
-
- Invalidates the instruction cache lines specified by Address and Length. If
- Address is not aligned on a cache line boundary, then entire instruction
- cache line containing Address is invalidated. If Address + Length is not
- aligned on a cache line boundary, then the entire instruction cache line
- containing Address + Length -1 is invalidated. This function may choose to
- invalidate the entire instruction cache if that is more efficient than
- invalidating the specified range. If Length is 0, then no instruction cache
- lines are invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the instruction cache lines to
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
-
- @param Length The number of bytes to invalidate from the instruction cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-InvalidateInstructionCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- ASSERT(FALSE);
- return Address;
-}
-
-/**
- Writes back and invalidates the entire data cache in cache coherency domain
- of the calling CPU.
-
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU. This function guarantees that all dirty cache lines are
- written back to system memory, and also invalidates all the data cache lines
- in the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackInvalidateDataCache (
- VOID
- )
-{
- ASSERT(FALSE);
-}
-
-/**
- Writes back and invalidates a range of data cache lines in the cache
- coherency domain of the calling CPU.
-
- Writes back and invalidates the data cache lines specified by Address and
- Length. If Address is not aligned on a cache line boundary, then entire data
- cache line containing Address is written back and invalidated. If Address +
- Length is not aligned on a cache line boundary, then the entire data cache
- line containing Address + Length -1 is written back and invalidated. This
- function may choose to write back and invalidate the entire data cache if
- that is more efficient than writing back and invalidating the specified
- range. If Length is 0, then no data cache lines are written back and
- invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back and
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
- @param Length The number of bytes to write back and invalidate from the
- data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-WriteBackInvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- ASSERT(FALSE);
- return Address;
-}
-
-/**
- Writes back the entire data cache in cache coherency domain of the calling
- CPU.
-
- Writes back the entire data cache in cache coherency domain of the calling
- CPU. This function guarantees that all dirty cache lines are written back to
- system memory. This function may also invalidate all the data cache lines in
- the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackDataCache (
- VOID
- )
-{
- ASSERT(FALSE);
-}
-
-/**
- Writes back a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Writes back the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is written back. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is written back. This function may choose to write back the entire
- data cache if that is more efficient than writing back the specified range.
- If Length is 0, then no data cache lines are written back. This function may
- also invalidate all the data cache lines in the specified range of the cache
- coherency domain of the calling CPU. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing
- mode, then Address is a virtual address.
- @param Length The number of bytes to write back from the data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-WriteBackDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- ASSERT(FALSE);
- return Address;
-}
-
-/**
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU.
-
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU. This function must be used with care because dirty cache lines are not
- written back to system memory. It is typically used for cache diagnostics. If
- the CPU does not support invalidation of the entire data cache, then a write
- back and invalidate operation should be performed on the entire data cache.
-
-**/
-VOID
-EFIAPI
-InvalidateDataCache (
- VOID
- )
-{
- ASSERT(FALSE);
-}
-
-/**
- Invalidates a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Invalidates the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is invalidated. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is invalidated. This function must never invalidate any cache lines
- outside the specified range. If Length is 0, then no data cache lines are
- invalidated. Address is returned. This function must be used with care
- because dirty cache lines are not written back to system memory. It is
- typically used for cache diagnostics. If the CPU does not support
- invalidation of a data cache range, then a write back and invalidate
- operation should be performed on the data cache range.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to invalidate. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing mode,
- then Address is a virtual address.
- @param Length The number of bytes to invalidate from the data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-InvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- ASSERT(FALSE);
- return Address;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
deleted file mode 100644
index ae16421..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
+++ /dev/null
@@ -1,55 +0,0 @@
-## @file
-# Instance of Cache Maintenance Library using Base Library services.
-#
-# Cache Maintenance Library that uses Base Library services to maintain caches.
-# This library assumes there are no chipset dependencies required to maintain caches.
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseCacheMaintenanceLib
- MODULE_UNI_FILE = BaseCacheMaintenanceLib.uni
- FILE_GUID = 123dd843-57c9-4158-8418-ce68b3944ce7
- MODULE_TYPE = BASE
- VERSION_STRING = 1.1
- LIBRARY_CLASS = CacheMaintenanceLib
-
-
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64
-#
-
-[Sources.IA32]
- X86Cache.c
-
-[Sources.X64]
- X86Cache.c
-
-[Sources.EBC]
- EbcCache.c
-
-[Sources.ARM]
- ArmCache.c
-
-[Sources.AARCH64]
- ArmCache.c
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- BaseLib
- DebugLib
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.uni
deleted file mode 100644
index 9df91be..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.uni
+++ /dev/null
@@ -1,23 +0,0 @@
-// /** @file
-// Instance of Cache Maintenance Library using Base Library services.
-//
-// Cache Maintenance Library that uses Base Library services to maintain caches.
-// This library assumes there are no chipset dependencies required to maintain caches.
-//
-// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-// Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Instance of Cache Maintenance Library using Base Library services"
-
-#string STR_MODULE_DESCRIPTION #language en-US "The Cache Maintenance Library that uses Base Library services to maintain caches. This library assumes there are no chipset dependencies required to maintain caches."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/EbcCache.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/EbcCache.c
deleted file mode 100644
index efbb03a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/EbcCache.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/** @file
- Cache Maintenance Functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-#include
-
-/**
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
-**/
-VOID
-EFIAPI
-InvalidateInstructionCache (
- VOID
- )
-{
-}
-
-/**
- Invalidates a range of instruction cache lines in the cache coherency domain
- of the calling CPU.
-
- Invalidates the instruction cache lines specified by Address and Length. If
- Address is not aligned on a cache line boundary, then entire instruction
- cache line containing Address is invalidated. If Address + Length is not
- aligned on a cache line boundary, then the entire instruction cache line
- containing Address + Length -1 is invalidated. This function may choose to
- invalidate the entire instruction cache if that is more efficient than
- invalidating the specified range. If Length is 0, then no instruction cache
- lines are invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the instruction cache lines to
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
-
- @param Length The number of bytes to invalidate from the instruction cache.
-
- @return Address.
-
-**/
-VOID *
-EFIAPI
-InvalidateInstructionCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- return Address;
-}
-
-/**
- Writes back and invalidates the entire data cache in cache coherency domain
- of the calling CPU.
-
- Writes back and invalidates the entire data cache in cache coherency domain
- of the calling CPU. This function guarantees that all dirty cache lines are
- written back to system memory, and also invalidates all the data cache lines
- in the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackInvalidateDataCache (
- VOID
- )
-{
-}
-
-/**
- Writes back and invalidates a range of data cache lines in the cache
- coherency domain of the calling CPU.
-
- Writes Back and Invalidate the data cache lines specified by Address and
- Length. If Address is not aligned on a cache line boundary, then entire data
- cache line containing Address is written back and invalidated. If Address +
- Length is not aligned on a cache line boundary, then the entire data cache
- line containing Address + Length -1 is written back and invalidated. This
- function may choose to write back and invalidate the entire data cache if
- that is more efficient than writing back and invalidating the specified
- range. If Length is 0, then no data cache lines are written back and
- invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back and
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
- @param Length The number of bytes to write back and invalidate from the
- data cache.
-
- @return Address of cache invalidation.
-
-**/
-VOID *
-EFIAPI
-WriteBackInvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- return Address;
-}
-
-/**
- Writes back the entire data cache in cache coherency domain of the calling
- CPU.
-
- Writes back the entire data cache in cache coherency domain of the calling
- CPU. This function guarantees that all dirty cache lines are written back to
- system memory. This function may also invalidate all the data cache lines in
- the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackDataCache (
- VOID
- )
-{
-}
-
-/**
- Writes back a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Writes back the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is written back. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is written back. This function may choose to write back the entire
- data cache if that is more efficient than writing back the specified range.
- If Length is 0, then no data cache lines are written back. This function may
- also invalidate all the data cache lines in the specified range of the cache
- coherency domain of the calling CPU. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing
- mode, then Address is a virtual address.
- @param Length The number of bytes to write back from the data cache.
-
- @return Address of cache written in main memory.
-
-**/
-VOID *
-EFIAPI
-WriteBackDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- return Address;
-}
-
-/**
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU.
-
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU. This function must be used with care because dirty cache lines are not
- written back to system memory. It is typically used for cache diagnostics. If
- the CPU does not support invalidation of the entire data cache, then a write
- back and invalidate operation should be performed on the entire data cache.
-
-**/
-VOID
-EFIAPI
-InvalidateDataCache (
- VOID
- )
-{
-}
-
-/**
- Invalidates a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Invalidates the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is invalidated. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is invalidated. This function must never invalidate any cache lines
- outside the specified range. If Length is 0, then no data cache lines are
- invalidated. Address is returned. This function must be used with care
- because dirty cache lines are not written back to system memory. It is
- typically used for cache diagnostics. If the CPU does not support
- invalidation of a data cache range, then a write back and invalidate
- operation should be performed on the data cache range.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to invalidate. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing mode,
- then Address is a virtual address.
- @param Length The number of bytes to invalidate from the data cache.
-
- @return Address.
-
-**/
-VOID *
-EFIAPI
-InvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- return Address;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c
deleted file mode 100644
index 9462bb9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCacheMaintenanceLib/X86Cache.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/** @file
- Cache Maintenance Functions.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
-**/
-
-#include
-#include
-#include
-
-/**
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
-**/
-VOID
-EFIAPI
-InvalidateInstructionCache (
- VOID
- )
-{
-}
-
-/**
- Invalidates a range of instruction cache lines in the cache coherency domain
- of the calling CPU.
-
- Invalidates the instruction cache lines specified by Address and Length. If
- Address is not aligned on a cache line boundary, then entire instruction
- cache line containing Address is invalidated. If Address + Length is not
- aligned on a cache line boundary, then the entire instruction cache line
- containing Address + Length -1 is invalidated. This function may choose to
- invalidate the entire instruction cache if that is more efficient than
- invalidating the specified range. If Length is 0, then no instruction cache
- lines are invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the instruction cache lines to
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
-
- @param Length The number of bytes to invalidate from the instruction cache.
-
- @return Address.
-
-**/
-VOID *
-EFIAPI
-InvalidateInstructionCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return Address;
- }
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Address));
- return Address;
-}
-
-/**
- Writes back and invalidates the entire data cache in cache coherency domain
- of the calling CPU.
-
- Writes back and invalidates the entire data cache in cache coherency domain
- of the calling CPU. This function guarantees that all dirty cache lines are
- written back to system memory, and also invalidates all the data cache lines
- in the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackInvalidateDataCache (
- VOID
- )
-{
- AsmWbinvd ();
-}
-
-/**
- Writes back and invalidates a range of data cache lines in the cache
- coherency domain of the calling CPU.
-
- Writes back and invalidates the data cache lines specified by Address and
- Length. If Address is not aligned on a cache line boundary, then entire data
- cache line containing Address is written back and invalidated. If Address +
- Length is not aligned on a cache line boundary, then the entire data cache
- line containing Address + Length -1 is written back and invalidated. This
- function may choose to write back and invalidate the entire data cache if
- that is more efficient than writing back and invalidating the specified
- range. If Length is 0, then no data cache lines are written back and
- invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back and
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
- @param Length The number of bytes to write back and invalidate from the
- data cache.
-
- @return Address of cache invalidation.
-
-**/
-VOID *
-EFIAPI
-WriteBackInvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- UINT32 RegEbx;
- UINT32 RegEdx;
- UINTN CacheLineSize;
- UINTN Start;
- UINTN End;
-
- if (Length == 0) {
- return Address;
- }
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Address));
-
- //
- // If the CPU does not support CLFLUSH instruction,
- // then promote flush range to flush entire cache.
- //
- AsmCpuid (0x01, NULL, &RegEbx, NULL, &RegEdx);
- if ((RegEdx & BIT19) == 0) {
- AsmWbinvd ();
- return Address;
- }
-
- //
- // Cache line size is 8 * Bits 15-08 of EBX returned from CPUID 01H
- //
- CacheLineSize = (RegEbx & 0xff00) >> 5;
-
- Start = (UINTN)Address;
- //
- // Calculate the cache line alignment
- //
- End = (Start + Length + (CacheLineSize - 1)) & ~(CacheLineSize - 1);
- Start &= ~((UINTN)CacheLineSize - 1);
-
- do {
- Start = (UINTN)AsmFlushCacheLine ((VOID*)Start) + CacheLineSize;
- } while (Start != End);
- return Address;
-}
-
-/**
- Writes back the entire data cache in cache coherency domain of the calling
- CPU.
-
- Writes back the entire data cache in cache coherency domain of the calling
- CPU. This function guarantees that all dirty cache lines are written back to
- system memory. This function may also invalidate all the data cache lines in
- the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackDataCache (
- VOID
- )
-{
- WriteBackInvalidateDataCache ();
-}
-
-/**
- Writes back a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Writes back the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is written back. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is written back. This function may choose to write back the entire
- data cache if that is more efficient than writing back the specified range.
- If Length is 0, then no data cache lines are written back. This function may
- also invalidate all the data cache lines in the specified range of the cache
- coherency domain of the calling CPU. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing
- mode, then Address is a virtual address.
- @param Length The number of bytes to write back from the data cache.
-
- @return Address of cache written in main memory.
-
-**/
-VOID *
-EFIAPI
-WriteBackDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- return WriteBackInvalidateDataCacheRange (Address, Length);
-}
-
-/**
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU.
-
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU. This function must be used with care because dirty cache lines are not
- written back to system memory. It is typically used for cache diagnostics. If
- the CPU does not support invalidation of the entire data cache, then a write
- back and invalidate operation should be performed on the entire data cache.
-
-**/
-VOID
-EFIAPI
-InvalidateDataCache (
- VOID
- )
-{
- AsmInvd ();
-}
-
-/**
- Invalidates a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Invalidates the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is invalidated. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is invalidated. This function must never invalidate any cache lines
- outside the specified range. If Length is 0, then no data cache lines are
- invalidated. Address is returned. This function must be used with care
- because dirty cache lines are not written back to system memory. It is
- typically used for cache diagnostics. If the CPU does not support
- invalidation of a data cache range, then a write back and invalidate
- operation should be performed on the data cache range.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to invalidate. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing mode,
- then Address is a virtual address.
- @param Length The number of bytes to invalidate from the data cache.
-
- @return Address.
-
-**/
-VOID *
-EFIAPI
-InvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- //
- // Invalidation of a data cache range without writing back is not supported on
- // x86 architecture, so write back and invalidate operation is performed.
- //
- return WriteBackInvalidateDataCacheRange (Address, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S
deleted file mode 100644
index 4b9a326..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# CpuFlushTlb() for ARM
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT(CpuFlushTlb)
-
-#/**
-# Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-#
-# Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-#
-#**/
-#VOID
-#EFIAPI
-#CpuFlushTlb (
-# VOID
-# )#
-#
-ASM_PFX(CpuFlushTlb):
- tlbi vmalle1 // Invalidate Inst TLB and Data TLB
- dsb sy
- isb
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.asm
deleted file mode 100644
index 846d23a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; CpuFlushTlb() for ARM
-;
-; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT CpuFlushTlb
- AREA BaseCpuLib_LowLevel, CODE, READONLY
-
-;/**
-; Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-;
-; Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-;
-;**/
-;VOID
-;EFIAPI
-;CpuFlushTlb (
-; VOID
-; );
-;
-CpuFlushTlb
- tlbi vmalle1 // Invalidate Inst TLB and Data TLB
- dsb sy
- isb
- ret
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S
deleted file mode 100644
index b08bdfb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# CpuSleep() for AArch64
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Portions copyright (c) 2011 - 2013, ARM LTD. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.align 3
-GCC_ASM_EXPORT(CpuSleep)
-
-#/**
-# Places the CPU in a sleep state until an interrupt is received.
-#
-# Places the CPU in a sleep state until an interrupt is received. If interrupts
-# are disabled prior to calling this function, then the CPU will be placed in a
-# sleep state indefinitely.
-#
-#**/
-#VOID
-#EFIAPI
-#CpuSleep (
-# VOID
-# );
-#
-
-ASM_PFX(CpuSleep):
- wfi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.asm
deleted file mode 100644
index aca244e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; CpuSleep() for AArch64
-;
-; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; Portions copyright (c) 2011 - 2013, ARM LTD. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT CpuSleep
- AREA BaseCpuLib_LowLevel, CODE, READONLY
-
-;/**
-; Places the CPU in a sleep state until an interrupt is received.
-;
-; Places the CPU in a sleep state until an interrupt is received. If interrupts
-; are disabled prior to calling this function, then the CPU will be placed in a
-; sleep state indefinitely.
-;
-;**/
-;VOID
-;EFIAPI
-;CpuSleep (
-; VOID
-; );
-;
-
-CpuSleep
- wfi
- ret
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuFlushTlb.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuFlushTlb.S
deleted file mode 100644
index e014723..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuFlushTlb.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# CpuFlushTlb() for ARM
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT(CpuFlushTlb)
-
-#/**
-# Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-#
-# Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-#
-#**/
-#VOID
-#EFIAPI
-#CpuFlushTlb (
-# VOID
-# )#
-#
-ASM_PFX(CpuFlushTlb):
- mov r0,#0
- mcr p15,0,r0,c8,c5,0 // Invalidate all the unlocked entried in TLB
- bx LR
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuFlushTlb.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuFlushTlb.asm
deleted file mode 100644
index 78ee84b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuFlushTlb.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; CpuFlushTlb() for ARM
-;
-; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT CpuFlushTlb
- AREA cpu_flush_tlb, CODE, READONLY
-
-;/**
-; Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-;
-; Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-;
-;**/
-;VOID
-;EFIAPI
-;CpuFlushTlb (
-; VOID
-; );
-;
-CpuFlushTlb
- MOV r0,#0
- MCR p15,0,r0,c8,c5,0 ;Invalidate all the unlocked entried in TLB
- BX LR
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.S
deleted file mode 100644
index 001db87..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# CpuSleep() for ARMv7
-#
-# ARMv6 versions was:
-# MOV r0,#0
-# MCR p15,0,r0,c7,c0,4 ;Wait for Interrupt instruction
-#
-# But this is a no-op on ARMv7
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT(CpuSleep)
-
-#/**
-# Places the CPU in a sleep state until an interrupt is received.
-#
-# Places the CPU in a sleep state until an interrupt is received. If interrupts
-# are disabled prior to calling this function, then the CPU will be placed in a
-# sleep state indefinitely.
-#
-#**/
-#VOID
-#EFIAPI
-#CpuSleep (
-# VOID
-# );
-#
-ASM_PFX(CpuSleep):
- wfi
- bx lr
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.asm
deleted file mode 100644
index 0bcad14..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.asm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; CpuSleep() for ARMv7
-;
-; ARMv6 versions was:
-; MOV r0,#0
-; MCR p15,0,r0,c7,c0,4 ;Wait for Interrupt instruction
-;
-; But this is a no-op on ARMv7
-;
-; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT CpuSleep
- AREA cpu_sleep, CODE, READONLY
-
-;/**
-; Places the CPU in a sleep state until an interrupt is received.
-;
-; Places the CPU in a sleep state until an interrupt is received. If interrupts
-; are disabled prior to calling this function, then the CPU will be placed in a
-; sleep state indefinitely.
-;
-;**/
-;VOID
-;EFIAPI
-;CpuSleep (
-; VOID
-; );
-;
-CpuSleep
- WFI
- BX LR
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
deleted file mode 100644
index 7d82eda..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
+++ /dev/null
@@ -1,74 +0,0 @@
-## @file
-# Instance of CPU Library for various architecture.
-#
-# CPU Library implemented using ASM functions for IA32, X64, ARM, AARCH64,
-# PAL CALLs for IPF, and empty functions for EBC.
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseCpuLib
- MODULE_UNI_FILE = BaseCpuLib.uni
- FILE_GUID = 4FBD2538-249C-4b50-8F4A-A9E66609CBF6
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = CpuLib
-
-
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64
-#
-
-[Sources.IA32]
- Ia32/CpuSleep.c | MSFT
- Ia32/CpuFlushTlb.c | MSFT
-
- Ia32/CpuSleep.nasm| INTEL
- Ia32/CpuFlushTlb.nasm| INTEL
-
- Ia32/CpuSleepGcc.c | GCC
- Ia32/CpuFlushTlbGcc.c | GCC
-
-[Sources.X64]
- X64/CpuFlushTlb.nasm
- X64/CpuSleep.nasm
-
- X64/CpuSleep.nasm| GCC
- X64/CpuSleep.S | GCC
- X64/CpuFlushTlb.nasm| GCC
- X64/CpuFlushTlb.S | GCC
-
-[Sources.EBC]
- Ebc/CpuSleepFlushTlb.c
-
-[Sources.ARM]
- Arm/CpuFlushTlb.asm | RVCT
- Arm/CpuSleep.asm | RVCT
- Arm/CpuFlushTlb.asm | MSFT
- Arm/CpuSleep.asm | MSFT
- Arm/CpuFlushTlb.S | GCC
- Arm/CpuSleep.S | GCC
-
-[Sources.AARCH64]
- AArch64/CpuFlushTlb.S | GCC
- AArch64/CpuSleep.S | GCC
- AArch64/CpuFlushTlb.asm | MSFT
- AArch64/CpuSleep.asm | MSFT
-
-[Packages]
- MdePkg/MdePkg.dec
-
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/BaseCpuLib.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/BaseCpuLib.uni
deleted file mode 100644
index 19510f4..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/BaseCpuLib.uni
+++ /dev/null
@@ -1,24 +0,0 @@
-// /** @file
-// Instance of CPU Library for various architecture.
-//
-// CPU Library implemented using ASM functions for IA-32 and X64,
-// PAL CALLs for IPF, and empty functions for EBC.
-//
-// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-// Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Instance of CPU Library for various architectures"
-
-#string STR_MODULE_DESCRIPTION #language en-US "CPU Library implemented using ASM functions for IA-32 and X64, PAL CALLs for IPF, and empty functions for EBC."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ebc/CpuSleepFlushTlb.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ebc/CpuSleepFlushTlb.c
deleted file mode 100644
index 81ae029..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ebc/CpuSleepFlushTlb.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/** @file
- Base Library CPU Functions for EBC
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-#include
-#include
-
-/**
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
-**/
-VOID
-EFIAPI
-CpuFlushTlb (
- VOID
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Places the CPU in a sleep state until an interrupt is received.
-
- Places the CPU in a sleep state until an interrupt is received. If interrupts
- are disabled prior to calling this function, then the CPU will be placed in a
- sleep state indefinitely.
-
-**/
-VOID
-EFIAPI
-CpuSleep (
- VOID
- )
-{
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c
deleted file mode 100644
index 25b16c5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/** @file
- CpuFlushTlb function.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-/**
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
-**/
-VOID
-EFIAPI
-CpuFlushTlb (
- VOID
- )
-{
- _asm {
- mov eax, cr3
- mov cr3, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm
deleted file mode 100644
index aa34345..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlb.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuFlushTlb.Asm
-;
-; Abstract:
-;
-; CpuFlushTlb function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuFlushTlb (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(CpuFlushTlb)
-ASM_PFX(CpuFlushTlb):
- mov eax, cr3
- mov cr3, eax ; moving to CR3 flushes TLB
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c
deleted file mode 100644
index 4cff851..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuFlushTlbGcc.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
- CpuFlushTlb function for Ia32/X64 GCC.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-
-/**
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
-**/
-VOID
-EFIAPI
-CpuFlushTlb (
- VOID
- )
-{
- AsmWriteCr3 (AsmReadCr3 ());
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.c
deleted file mode 100644
index 40b0453..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/** @file
- CpuSleep function.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-/**
- Places the CPU in a sleep state until an interrupt is received.
-
- Places the CPU in a sleep state until an interrupt is received. If interrupts
- are disabled prior to calling this function, then the CPU will be placed in a
- sleep state indefinitely.
-
-**/
-VOID
-EFIAPI
-CpuSleep (
- VOID
- )
-{
- _asm {
- hlt
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.nasm
deleted file mode 100644
index c808f96..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuSleep.nasm
+++ /dev/null
@@ -1,36 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuSleep.Asm
-;
-; Abstract:
-;
-; CpuSleep function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuSleep (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(CpuSleep)
-ASM_PFX(CpuSleep):
- hlt
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuSleepGcc.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuSleepGcc.c
deleted file mode 100644
index b61a61f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/Ia32/CpuSleepGcc.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/** @file
- CpuSleep function for Ia32/X64 GCC.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-/**
- Places the CPU in a sleep state until an interrupt is received.
-
- Places the CPU in a sleep state until an interrupt is received. If interrupts
- are disabled prior to calling this function, then the CPU will be placed in a
- sleep state indefinitely.
-
-**/
-VOID
-EFIAPI
-CpuSleep (
- VOID
- )
-{
- __asm__ __volatile__ ("hlt"::: "memory");
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.S
deleted file mode 100644
index 009b280..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuFlushTlb.Asm
-#
-# Abstract:
-#
-# CpuFlushTlb function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(CpuFlushTlb)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuFlushTlb (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(CpuFlushTlb):
- mov %cr3, %rax
- mov %rax, %cr3
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.nasm
deleted file mode 100644
index cdcbbca..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuFlushTlb.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuFlushTlb.Asm
-;
-; Abstract:
-;
-; CpuFlushTlb function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuFlushTlb (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(CpuFlushTlb)
-ASM_PFX(CpuFlushTlb):
- mov rax, cr3
- mov cr3, rax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuSleep.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuSleep.S
deleted file mode 100644
index 44d58e9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuSleep.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuSleep.S
-#
-# Abstract:
-#
-# CpuSleep function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuSleep (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(CpuSleep)
-ASM_PFX(CpuSleep):
- hlt
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuSleep.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuSleep.nasm
deleted file mode 100644
index 0deed7f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseCpuLib/X64/CpuSleep.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuSleep.Asm
-;
-; Abstract:
-;
-; CpuSleep function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuSleep (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(CpuSleep)
-ASM_PFX(CpuSleep):
- hlt
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
deleted file mode 100644
index b5ada20..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+++ /dev/null
@@ -1,36 +0,0 @@
-## @file
-# Debug Library with empty functions.
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseDebugLibNull
- MODULE_UNI_FILE = BaseDebugLibNull.uni
- FILE_GUID = 9ba1d976-0624-41a3-8650-28165e8d9ae8
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = DebugLib
-
-
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC
-#
-
-[Sources]
- DebugLib.c
-
-
-[Packages]
- MdePkg/MdePkg.dec
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.uni
deleted file mode 100644
index 3cf6a75..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.uni
+++ /dev/null
@@ -1,21 +0,0 @@
-// /** @file
-// Debug Library with empty functions.
-//
-// Debug Library with empty functions.
-//
-// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Debug Library with empty functions"
-
-#string STR_MODULE_DESCRIPTION #language en-US "Debug Library with empty functions."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibNull/DebugLib.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibNull/DebugLib.c
deleted file mode 100644
index 4056af6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibNull/DebugLib.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/** @file
- Null Base Debug Library instance with empty functions.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-#include
-
-/**
- Prints a debug message to the debug output device if the specified error level is enabled.
-
- If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
- GetDebugPrintErrorLevel (), then print the message specified by Format and the
- associated variable argument list to the debug output device.
-
- If Format is NULL, then ASSERT().
-
- @param ErrorLevel The error level of the debug message.
- @param Format Format string for the debug message to print.
- @param ... Variable argument list whose contents are accessed
- based on the format string specified by Format.
-
-**/
-VOID
-EFIAPI
-DebugPrint (
- IN UINTN ErrorLevel,
- IN CONST CHAR8 *Format,
- ...
- )
-{
-}
-
-
-/**
- Prints an assert message containing a filename, line number, and description.
- This may be followed by a breakpoint or a dead loop.
-
- Print a message of the form "ASSERT (): \n"
- to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
- PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
- DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
- CpuDeadLoop() is called. If neither of these bits are set, then this function
- returns immediately after the message is printed to the debug output device.
- DebugAssert() must actively prevent recursion. If DebugAssert() is called while
- processing another DebugAssert(), then DebugAssert() must return immediately.
-
- If FileName is NULL, then a string of "(NULL) Filename" is printed.
- If Description is NULL, then a string of "(NULL) Description" is printed.
-
- @param FileName The pointer to the name of the source file that generated the assert condition.
- @param LineNumber The line number in the source file that generated the assert condition
- @param Description The pointer to the description of the assert condition.
-
-**/
-VOID
-EFIAPI
-DebugAssert (
- IN CONST CHAR8 *FileName,
- IN UINTN LineNumber,
- IN CONST CHAR8 *Description
- )
-{
-}
-
-
-/**
- Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the value specified by
- PcdDebugClearMemoryValue, and returns Buffer.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue.
- @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
-
- @return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue.
-
-**/
-VOID *
-EFIAPI
-DebugClearMemory (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- return Buffer;
-}
-
-
-/**
- Returns TRUE if ASSERT() macros are enabled.
-
- This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
- PcdDebugProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
- @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
- VOID
- )
-{
- return FALSE;
-}
-
-
-/**
- Returns TRUE if DEBUG() macros are enabled.
-
- This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
- PcdDebugProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
- @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
- VOID
- )
-{
- return FALSE;
-}
-
-
-/**
- Returns TRUE if DEBUG_CODE() macros are enabled.
-
- This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdDebugProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
- @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
- VOID
- )
-{
- return FALSE;
-}
-
-
-/**
- Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
- This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
- PcdDebugProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
- @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
- VOID
- )
-{
- return FALSE;
-}
-
-/**
- Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
- This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
- @retval TRUE Current ErrorLevel is supported.
- @retval FALSE Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
- IN CONST UINTN ErrorLevel
- )
-{
- return FALSE;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
deleted file mode 100644
index c938553..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+++ /dev/null
@@ -1,49 +0,0 @@
-## @file
-# Instance of Debug Library based on Serial Port Library.
-# It uses Print Library to produce formatted output strings to seiral port device.
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseDebugLibSerialPort
- MODULE_UNI_FILE = BaseDebugLibSerialPort.uni
- FILE_GUID = BB83F95F-EDBC-4884-A520-CD42AF388FAE
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = DebugLib
- CONSTRUCTOR = BaseDebugLibSerialPortConstructor
-
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC
-#
-
-[Sources]
- DebugLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- SerialPortLib
- BaseMemoryLib
- PcdLib
- PrintLib
- BaseLib
- DebugPrintErrorLevelLib
-
-[Pcd]
- gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.uni
deleted file mode 100644
index 4b90207..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.uni
+++ /dev/null
@@ -1,21 +0,0 @@
-// /** @file
-// Instance of Debug Library based on Serial Port Library.
-//
-// It uses Print Library to produce formatted output strings to seiral port device.
-//
-// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Instance of Debug Library based on Serial Port Library"
-
-#string STR_MODULE_DESCRIPTION #language en-US "It uses Print Library to produce formatted output strings to a serial port device."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
deleted file mode 100644
index 34b2793..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/** @file
- Base Debug library instance base on Serial Port library.
- It uses PrintLib to send debug messages to serial port device.
-
- NOTE: If the Serial Port library enables hardware flow control, then a call
- to DebugPrint() or DebugAssert() may hang if writes to the serial port are
- being blocked. This may occur if a key(s) are pressed in a terminal emulator
- used to monitor the DEBUG() and ASSERT() messages.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-//
-// Define the maximum debug and assert message length that this library supports
-//
-#define MAX_DEBUG_MESSAGE_LENGTH 0x100
-
-/**
- The constructor function initialize the Serial Port Library
-
- @retval EFI_SUCCESS The constructor always returns RETURN_SUCCESS.
-
-**/
-RETURN_STATUS
-EFIAPI
-BaseDebugLibSerialPortConstructor (
- VOID
- )
-{
- return SerialPortInitialize ();
-}
-
-/**
- Prints a debug message to the debug output device if the specified error level is enabled.
-
- If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
- GetDebugPrintErrorLevel (), then print the message specified by Format and the
- associated variable argument list to the debug output device.
-
- If Format is NULL, then ASSERT().
-
- @param ErrorLevel The error level of the debug message.
- @param Format Format string for the debug message to print.
- @param ... Variable argument list whose contents are accessed
- based on the format string specified by Format.
-
-**/
-VOID
-EFIAPI
-DebugPrint (
- IN UINTN ErrorLevel,
- IN CONST CHAR8 *Format,
- ...
- )
-{
- CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
- VA_LIST Marker;
-
- //
- // If Format is NULL, then ASSERT().
- //
- ASSERT (Format != NULL);
-
- //
- // Check driver debug mask value and global mask
- //
- if ((ErrorLevel & GetDebugPrintErrorLevel ()) == 0) {
- return;
- }
-
- //
- // Convert the DEBUG() message to an ASCII String
- //
- VA_START (Marker, Format);
- AsciiVSPrint (Buffer, sizeof (Buffer), Format, Marker);
- VA_END (Marker);
-
- //
- // Send the print string to a Serial Port
- //
- SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer));
-}
-
-
-/**
- Prints an assert message containing a filename, line number, and description.
- This may be followed by a breakpoint or a dead loop.
-
- Print a message of the form "ASSERT (): \n"
- to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
- PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
- DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
- CpuDeadLoop() is called. If neither of these bits are set, then this function
- returns immediately after the message is printed to the debug output device.
- DebugAssert() must actively prevent recursion. If DebugAssert() is called while
- processing another DebugAssert(), then DebugAssert() must return immediately.
-
- If FileName is NULL, then a string of "(NULL) Filename" is printed.
- If Description is NULL, then a string of "(NULL) Description" is printed.
-
- @param FileName The pointer to the name of the source file that generated the assert condition.
- @param LineNumber The line number in the source file that generated the assert condition
- @param Description The pointer to the description of the assert condition.
-
-**/
-VOID
-EFIAPI
-DebugAssert (
- IN CONST CHAR8 *FileName,
- IN UINTN LineNumber,
- IN CONST CHAR8 *Description
- )
-{
- CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
-
- //
- // Generate the ASSERT() message in Ascii format
- //
- AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT [%a] %a(%d): %a\n", gEfiCallerBaseName, FileName, LineNumber, Description);
-
- //
- // Send the print string to the Console Output device
- //
- SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer));
-
- //
- // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings
- //
- if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
- CpuBreakpoint ();
- } else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
- CpuDeadLoop ();
- }
-}
-
-
-/**
- Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the value specified by
- PcdDebugClearMemoryValue, and returns Buffer.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to be filled with PcdDebugClearMemoryValue.
- @param Length The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
-
- @return Buffer The pointer to the target buffer filled with PcdDebugClearMemoryValue.
-
-**/
-VOID *
-EFIAPI
-DebugClearMemory (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- //
- // If Buffer is NULL, then ASSERT().
- //
- ASSERT (Buffer != NULL);
-
- //
- // SetMem() checks for the the ASSERT() condition on Length and returns Buffer
- //
- return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
-}
-
-
-/**
- Returns TRUE if ASSERT() macros are enabled.
-
- This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
- PcdDebugProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
- @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugAssertEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if DEBUG() macros are enabled.
-
- This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
- PcdDebugProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
- @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if DEBUG_CODE() macros are enabled.
-
- This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdDebugProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
- @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
-
- This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of
- PcdDebugProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
- @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-DebugClearMemoryEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
-}
-
-/**
- Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
- This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel.
-
- @retval TRUE Current ErrorLevel is supported.
- @retval FALSE Current ErrorLevel is not supported.
-
-**/
-BOOLEAN
-EFIAPI
-DebugPrintLevelEnabled (
- IN CONST UINTN ErrorLevel
- )
-{
- return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.c
deleted file mode 100644
index ab26fc1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/** @file
- Debug Print Error Level library instance that retrieves the current error
- level from PcdDebugPrintErrorLevel. This generic library instance does not
- support the setting of the global debug print error level mask for the platform.
-
- Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-#include
-#include
-
-/**
- Returns the debug print error level mask for the current module.
-
- @return Debug print error level mask for the current module.
-
-**/
-UINT32
-EFIAPI
-GetDebugPrintErrorLevel (
- VOID
- )
-{
- //
- // Retrieve the current debug print error level mask from PcdDebugPrintErrorLevel.
- //
- return PcdGet32 (PcdDebugPrintErrorLevel);
-}
-
-/**
- Sets the global debug print error level mask fpr the entire platform.
-
- @param ErrorLevel Global debug print error level.
-
- @retval TRUE The debug print error level mask was sucessfully set.
- @retval FALSE The debug print error level mask could not be set.
-
-**/
-BOOLEAN
-EFIAPI
-SetDebugPrintErrorLevel (
- UINT32 ErrorLevel
- )
-{
- //
- // This library uinstance does not support setting the global debug print error
- // level mask.
- //
- return FALSE;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
deleted file mode 100644
index 4d30288..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
+++ /dev/null
@@ -1,40 +0,0 @@
-## @file
-# Debug Print Error Level library instance based on PcdDebugPrintErrorLevel.
-# It retrieves the current error level from PcdDebugPrintErrorLevel.
-#
-# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseDebugPrintErrorLevelLib
- MODULE_UNI_FILE = BaseDebugPrintErrorLevelLib.uni
- FILE_GUID = A2C09E18-E4D2-407e-AFCC-628B79113F72
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = DebugPrintErrorLevelLib
-
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC
-#
-
-[Sources]
- BaseDebugPrintErrorLevelLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- PcdLib
-
-[Pcd]
- gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel ## CONSUMES
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.uni
deleted file mode 100644
index 2b306d3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.uni
+++ /dev/null
@@ -1,21 +0,0 @@
-// /** @file
-// Debug Print Error Level library instance based on PcdDebugPrintErrorLevel.
-//
-// It retrieves the current error level from PcdDebugPrintErrorLevel.
-//
-// Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Debug Print Error Level library instance based on PcdDebugPrintErrorLevel"
-
-#string STR_MODULE_DESCRIPTION #language en-US "It retrieves the current error level from PcdDebugPrintErrorLevel."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.c
deleted file mode 100644
index a211df0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.c
+++ /dev/null
@@ -1,484 +0,0 @@
-/** @file
- Provide generic extract guided section functions.
-
- Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-
-#include
-#include
-#include
-#include
-
-#define EXTRACT_HANDLER_INFO_SIGNATURE SIGNATURE_32 ('E', 'G', 'S', 'I')
-
-typedef struct {
- UINT32 Signature;
- UINT32 NumberOfExtractHandler;
- GUID *ExtractHandlerGuidTable;
- EXTRACT_GUIDED_SECTION_DECODE_HANDLER *ExtractDecodeHandlerTable;
- EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *ExtractGetInfoHandlerTable;
-} EXTRACT_GUIDED_SECTION_HANDLER_INFO;
-
-/**
- HandlerInfo table address is set by PcdGuidedExtractHandlerTableAddress, which is used to store
- the registered guid and Handler list. When it is initialized, it will be directly returned.
- Or, HandlerInfo table will be initialized in this function.
-
- @param[in, out] InfoPointer The pointer to the handler information structure.
-
- @retval RETURN_SUCCESS HandlerInfo table can be used to store guid and function tables.
- @retval RETURN_OUT_OF_RESOURCES HandlerInfo table address is not writable.
-**/
-RETURN_STATUS
-GetExtractGuidedSectionHandlerInfo (
- IN OUT EXTRACT_GUIDED_SECTION_HANDLER_INFO **InfoPointer
- )
-{
- EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
-
- //
- // Set the available memory address to handler info.
- //
- HandlerInfo = (EXTRACT_GUIDED_SECTION_HANDLER_INFO*)(VOID*)(UINTN) PcdGet64 (PcdGuidedExtractHandlerTableAddress);
- if (HandlerInfo == NULL) {
- *InfoPointer = NULL;
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // First check whether the handler information structure is initialized.
- //
- if (HandlerInfo->Signature == EXTRACT_HANDLER_INFO_SIGNATURE) {
- //
- // The handler information has been initialized and is returned.
- //
- *InfoPointer = HandlerInfo;
- return RETURN_SUCCESS;
- }
-
- //
- // Try to initialize the handler information structure
- //
- HandlerInfo->Signature = EXTRACT_HANDLER_INFO_SIGNATURE;
- if (HandlerInfo->Signature != EXTRACT_HANDLER_INFO_SIGNATURE) {
- //
- // The handler information structure was not writeable because the memory is not ready.
- //
- *InfoPointer = NULL;
- return RETURN_OUT_OF_RESOURCES;
- }
-
- //
- // Init HandlerInfo structure
- //
- HandlerInfo->NumberOfExtractHandler = 0;
- HandlerInfo->ExtractHandlerGuidTable = (GUID *) (HandlerInfo + 1);
- HandlerInfo->ExtractDecodeHandlerTable = (EXTRACT_GUIDED_SECTION_DECODE_HANDLER *) (
- (UINT8 *)HandlerInfo->ExtractHandlerGuidTable +
- PcdGet32 (PcdMaximumGuidedExtractHandler) * sizeof (GUID)
- );
- HandlerInfo->ExtractGetInfoHandlerTable = (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *) (
- (UINT8 *)HandlerInfo->ExtractDecodeHandlerTable +
- PcdGet32 (PcdMaximumGuidedExtractHandler) *
- sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER)
- );
- *InfoPointer = HandlerInfo;
- return RETURN_SUCCESS;
-}
-
-/**
- Retrieve the list GUIDs that have been registered through ExtractGuidedSectionRegisterHandlers().
-
- Sets ExtractHandlerGuidTable so it points at a callee allocated array of registered GUIDs.
- The total number of GUIDs in the array are returned. Since the array of GUIDs is callee allocated
- and caller must treat this array of GUIDs as read-only data.
- If ExtractHandlerGuidTable is NULL, then ASSERT().
-
- @param[out] ExtractHandlerGuidTable A pointer to the array of GUIDs that have been registered through
- ExtractGuidedSectionRegisterHandlers().
-
- @return The number of the supported extract guided Handler.
-
-**/
-UINTN
-EFIAPI
-ExtractGuidedSectionGetGuidList (
- OUT GUID **ExtractHandlerGuidTable
- )
-{
- RETURN_STATUS Status;
- EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
-
- ASSERT (ExtractHandlerGuidTable != NULL);
-
- //
- // Get all registered handler information
- //
- Status = GetExtractGuidedSectionHandlerInfo (&HandlerInfo);
- if (RETURN_ERROR (Status)) {
- *ExtractHandlerGuidTable = NULL;
- return 0;
- }
-
- //
- // Get GuidTable and Table Number
- //
- ASSERT (HandlerInfo != NULL);
- *ExtractHandlerGuidTable = HandlerInfo->ExtractHandlerGuidTable;
- return HandlerInfo->NumberOfExtractHandler;
-}
-
-/**
- Registers handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and EXTRACT_GUIDED_SECTION_DECODE_HANDLER
- for a specific GUID section type.
-
- Registers the handlers specified by GetInfoHandler and DecodeHandler with the GUID specified by SectionGuid.
- If the GUID value specified by SectionGuid has already been registered, then return RETURN_ALREADY_STARTED.
- If there are not enough resources available to register the handlers then RETURN_OUT_OF_RESOURCES is returned.
-
- If SectionGuid is NULL, then ASSERT().
- If GetInfoHandler is NULL, then ASSERT().
- If DecodeHandler is NULL, then ASSERT().
-
- @param[in] SectionGuid A pointer to the GUID associated with the the handlers
- of the GUIDed section type being registered.
- @param[in] GetInfoHandler The pointer to a function that examines a GUIDed section and returns the
- size of the decoded buffer and the size of an optional scratch buffer
- required to actually decode the data in a GUIDed section.
- @param[in] DecodeHandler The pointer to a function that decodes a GUIDed section into a caller
- allocated output buffer.
-
- @retval RETURN_SUCCESS The handlers were registered.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to register the handlers.
-
-**/
-RETURN_STATUS
-EFIAPI
-ExtractGuidedSectionRegisterHandlers (
- IN CONST GUID *SectionGuid,
- IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER GetInfoHandler,
- IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER DecodeHandler
- )
-{
- UINT32 Index;
- RETURN_STATUS Status;
- EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
-
- //
- // Check input parameter
- //
- ASSERT (SectionGuid != NULL);
- ASSERT (GetInfoHandler != NULL);
- ASSERT (DecodeHandler != NULL);
-
- //
- // Get the registered handler information
- //
- Status = GetExtractGuidedSectionHandlerInfo (&HandlerInfo);
- if (RETURN_ERROR (Status)) {
- return Status;
- }
-
- //
- // Search the match registered GetInfo handler for the input guided section.
- //
- ASSERT (HandlerInfo != NULL);
- for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
- if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
- //
- // If the guided handler has been registered before, only update its handler.
- //
- HandlerInfo->ExtractDecodeHandlerTable [Index] = DecodeHandler;
- HandlerInfo->ExtractGetInfoHandlerTable [Index] = GetInfoHandler;
- return RETURN_SUCCESS;
- }
- }
-
- //
- // Check the global table is enough to contain new Handler.
- //
- if (HandlerInfo->NumberOfExtractHandler >= PcdGet32 (PcdMaximumGuidedExtractHandler)) {
- return RETURN_OUT_OF_RESOURCES;
- }
-
- //
- // Register new Handler and guid value.
- //
- CopyGuid (HandlerInfo->ExtractHandlerGuidTable + HandlerInfo->NumberOfExtractHandler, SectionGuid);
- HandlerInfo->ExtractDecodeHandlerTable [HandlerInfo->NumberOfExtractHandler] = DecodeHandler;
- HandlerInfo->ExtractGetInfoHandlerTable [HandlerInfo->NumberOfExtractHandler++] = GetInfoHandler;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Retrieves a GUID from a GUIDed section and uses that GUID to select an associated handler of type
- EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers().
- The selected handler is used to retrieve and return the size of the decoded buffer and the size of an
- optional scratch buffer required to actually decode the data in a GUIDed section.
-
- Examines a GUIDed section specified by InputSection.
- If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(),
- then RETURN_UNSUPPORTED is returned.
- If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler
- of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers()
- is used to retrieve the OututBufferSize, ScratchSize, and Attributes values. The return status from the handler of
- type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER is returned.
-
- If InputSection is NULL, then ASSERT().
- If OutputBufferSize is NULL, then ASSERT().
- If ScratchBufferSize is NULL, then ASSERT().
- If SectionAttribute is NULL, then ASSERT().
-
- @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.
- @param[out] OutputBufferSize A pointer to the size, in bytes, of an output buffer required if the buffer
- specified by InputSection were decoded.
- @param[out] ScratchBufferSize A pointer to the size, in bytes, required as scratch space if the buffer specified by
- InputSection were decoded.
- @param[out] SectionAttribute A pointer to the attributes of the GUIDed section. See the Attributes field of
- EFI_GUID_DEFINED_SECTION in the PI Specification.
-
- @retval RETURN_SUCCESS Successfully retrieved the required information.
- @retval RETURN_UNSUPPORTED The GUID from the section specified by InputSection does not match any of
- the GUIDs registered with ExtractGuidedSectionRegisterHandlers().
- @retval Others The return status from the handler associated with the GUID retrieved from
- the section specified by InputSection.
-
-**/
-RETURN_STATUS
-EFIAPI
-ExtractGuidedSectionGetInfo (
- IN CONST VOID *InputSection,
- OUT UINT32 *OutputBufferSize,
- OUT UINT32 *ScratchBufferSize,
- OUT UINT16 *SectionAttribute
- )
-{
- UINT32 Index;
- RETURN_STATUS Status;
- EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
- EFI_GUID *SectionDefinitionGuid;
-
- //
- // Check input parameter
- //
- ASSERT (InputSection != NULL);
- ASSERT (OutputBufferSize != NULL);
- ASSERT (ScratchBufferSize != NULL);
- ASSERT (SectionAttribute != NULL);
-
- //
- // Get all registered handler information.
- //
- Status = GetExtractGuidedSectionHandlerInfo (&HandlerInfo);
- if (RETURN_ERROR (Status)) {
- return Status;
- }
-
- if (IS_SECTION2 (InputSection)) {
- SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
- } else {
- SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
- }
-
- //
- // Search the match registered GetInfo handler for the input guided section.
- //
- ASSERT (HandlerInfo != NULL);
- for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
- if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {
- //
- // Call the match handler to get information for the input section data.
- //
- return HandlerInfo->ExtractGetInfoHandlerTable [Index] (
- InputSection,
- OutputBufferSize,
- ScratchBufferSize,
- SectionAttribute
- );
- }
- }
-
- //
- // Not found, the input guided section is not supported.
- //
- return RETURN_UNSUPPORTED;
-}
-
-/**
- Retrieves the GUID from a GUIDed section and uses that GUID to select an associated handler of type
- EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers().
- The selected handler is used to decode the data in a GUIDed section and return the result in a caller
- allocated output buffer.
-
- Decodes the GUIDed section specified by InputSection.
- If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(),
- then RETURN_UNSUPPORTED is returned.
- If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler
- of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers()
- is used to decode InputSection into the buffer specified by OutputBuffer and the authentication status of this
- decode operation is returned in AuthenticationStatus. If the decoded buffer is identical to the data in InputSection,
- then OutputBuffer is set to point at the data in InputSection. Otherwise, the decoded data will be placed in a caller
- allocated buffer specified by OutputBuffer. This function is responsible for computing the EFI_AUTH_STATUS_PLATFORM_OVERRIDE
- bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned.
-
- If InputSection is NULL, then ASSERT().
- If OutputBuffer is NULL, then ASSERT().
- If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT().
- If AuthenticationStatus is NULL, then ASSERT().
-
- @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.
- @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation.
- @param[in] ScratchBuffer A caller allocated buffer that may be required by this function as a scratch buffer to perform the decode operation.
- @param[out] AuthenticationStatus
- A pointer to the authentication status of the decoded output buffer. See the definition
- of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI section of the PI
- Specification.
-
- @retval RETURN_SUCCESS The buffer specified by InputSection was decoded.
- @retval RETURN_UNSUPPORTED The section specified by InputSection does not match the GUID this handler supports.
- @retval RETURN_INVALID_PARAMETER The section specified by InputSection can not be decoded.
-
-**/
-RETURN_STATUS
-EFIAPI
-ExtractGuidedSectionDecode (
- IN CONST VOID *InputSection,
- OUT VOID **OutputBuffer,
- IN VOID *ScratchBuffer, OPTIONAL
- OUT UINT32 *AuthenticationStatus
- )
-{
- UINT32 Index;
- RETURN_STATUS Status;
- EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
- EFI_GUID *SectionDefinitionGuid;
-
- //
- // Check input parameter
- //
- ASSERT (InputSection != NULL);
- ASSERT (OutputBuffer != NULL);
- ASSERT (AuthenticationStatus != NULL);
-
- //
- // Get all registered handler information.
- //
- Status = GetExtractGuidedSectionHandlerInfo (&HandlerInfo);
- if (RETURN_ERROR (Status)) {
- return Status;
- }
-
- if (IS_SECTION2 (InputSection)) {
- SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
- } else {
- SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
- }
-
- //
- // Search the match registered Extract handler for the input guided section.
- //
- ASSERT (HandlerInfo != NULL);
- for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
- if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionDefinitionGuid)) {
- //
- // Call the match handler to extract raw data for the input guided section.
- //
- return HandlerInfo->ExtractDecodeHandlerTable [Index] (
- InputSection,
- OutputBuffer,
- ScratchBuffer,
- AuthenticationStatus
- );
- }
- }
-
- //
- // Not found, the input guided section is not supported.
- //
- return RETURN_UNSUPPORTED;
-}
-
-/**
- Retrieves handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and
- EXTRACT_GUIDED_SECTION_DECODE_HANDLER for a specific GUID section type.
-
- Retrieves the handlers associated with SectionGuid and returns them in
- GetInfoHandler and DecodeHandler.
-
- If the GUID value specified by SectionGuid has not been registered, then
- return RETURN_NOT_FOUND.
-
- If SectionGuid is NULL, then ASSERT().
-
- @param[in] SectionGuid A pointer to the GUID associated with the handlersof the GUIDed
- section type being retrieved.
- @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns
- the size of the decoded buffer and the size of an optional scratch
- buffer required to actually decode the data in a GUIDed section.
- This is an optional parameter that may be NULL. If it is NULL, then
- the previously registered handler is not returned.
- @param[out] DecodeHandler Pointer to a function that decodes a GUIDed section into a caller
- allocated output buffer. This is an optional parameter that may be NULL.
- If it is NULL, then the previously registered handler is not returned.
-
- @retval RETURN_SUCCESS The handlers were retrieved.
- @retval RETURN_NOT_FOUND No handlers have been registered with the specified GUID.
-
-**/
-RETURN_STATUS
-EFIAPI
-ExtractGuidedSectionGetHandlers (
- IN CONST GUID *SectionGuid,
- OUT EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *GetInfoHandler, OPTIONAL
- OUT EXTRACT_GUIDED_SECTION_DECODE_HANDLER *DecodeHandler OPTIONAL
- )
-{
- UINT32 Index;
- RETURN_STATUS Status;
- EXTRACT_GUIDED_SECTION_HANDLER_INFO *HandlerInfo;
-
- //
- // Check input parameter
- //
- ASSERT (SectionGuid != NULL);
-
- //
- // Get the registered handler information
- //
- Status = GetExtractGuidedSectionHandlerInfo (&HandlerInfo);
- if (RETURN_ERROR (Status)) {
- return Status;
- }
-
- //
- // Search the match registered GetInfo handler for the input guided section.
- //
- ASSERT (HandlerInfo != NULL);
- for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
- if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
-
- //
- // If the guided handler has been registered before, then return the registered handlers.
- //
- if (GetInfoHandler != NULL) {
- *GetInfoHandler = HandlerInfo->ExtractGetInfoHandlerTable[Index];
- }
- if (DecodeHandler != NULL) {
- *DecodeHandler = HandlerInfo->ExtractDecodeHandlerTable[Index];
- }
- return RETURN_SUCCESS;
- }
- }
- return RETURN_NOT_FOUND;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf
deleted file mode 100644
index ce015fd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf
+++ /dev/null
@@ -1,54 +0,0 @@
-## @file
-# Base ExtractGuidedSection Library.
-# This instance can also be used in SEC phase only when the memory is ready in SEC phase.
-# PCD PcdGuidedExtractHandlerTableAddress points to the available pysical memory space
-# that is used to store Guided Extract Handlers.
-# Note: A driver of type DXE_RUNTIME_DRIVER can use this ExtractGuidedSectionLib
-# in their initialization without any issues. They only have to be careful in
-# the implementation of runtime services, because this BASE library instance doesn't
-# convert the address pointed by PcdGuidedExtractHandlerTableAddress to the virtual address.
-# And a driver should use this ExtractGuidedSectionLib to do implementation internally, also
-# this ExtractGuidedSectionLib couldn't be used for guided section extraction that is required
-# by PEI and DXE core for recovery or capsule image processing, etc.
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseExtractGuidedSectionLib
- MODULE_UNI_FILE = BaseExtractGuidedSectionLib.uni
- FILE_GUID = 4e3236e9-d1c8-4c04-a89f-26f1c44b2592
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ExtractGuidedSectionLib
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC (EBC is for build only)
-#
-
-[Sources]
- BaseExtractGuidedSectionLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- BaseMemoryLib
- DebugLib
- PcdLib
-
-[Pcd]
- gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler ## CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress ## CONSUMES
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.uni
deleted file mode 100644
index fcb7d65..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.uni
+++ /dev/null
@@ -1,27 +0,0 @@
-// /** @file
-// Base ExtractGuidedSection Library.
-//
-// This instance can also be used in SEC phase only when the memory is ready in SEC phase.
-// PCD PcdGuidedExtractHandlerTableAddress points to the available pysical memory space
-// that is used to store Guided Extract Handlers.
-// Note: A driver of type DXE_RUNTIME_DRIVER can use this ExtractGuidedSectionLib
-// in their initialization without any issues. They only have to be careful in
-// the implementation of runtime services, because this BASE library instance doesn't
-// convert the address pointed by PcdGuidedExtractHandlerTableAddress to the virtual address.
-//
-// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Base ExtractGuidedSection Library"
-
-#string STR_MODULE_DESCRIPTION #language en-US "This instance can also be used in the SEC phase only when the memory is ready in the SEC phase. PCD PcdGuidedExtractHandlerTableAddress points to the available physical memory space that is used to store Guided Extract Handlers. Note: A driver of type DXE_RUNTIME_DRIVER can use this ExtractGuidedSectionLib in its initialization without any issues. Be careful in the implementation of runtime services, because this BASE library instance doesn't convert the address pointed by PcdGuidedExtractHandlerTableAddress to the virtual address."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/AArch64/ArmVirtMmio.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/AArch64/ArmVirtMmio.S
deleted file mode 100644
index 85f5932..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/AArch64/ArmVirtMmio.S
+++ /dev/null
@@ -1,148 +0,0 @@
-#
-# Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-
-.text
-.align 3
-
-GCC_ASM_EXPORT(MmioRead8Internal)
-GCC_ASM_EXPORT(MmioWrite8Internal)
-GCC_ASM_EXPORT(MmioRead16Internal)
-GCC_ASM_EXPORT(MmioWrite16Internal)
-GCC_ASM_EXPORT(MmioRead32Internal)
-GCC_ASM_EXPORT(MmioWrite32Internal)
-GCC_ASM_EXPORT(MmioRead64Internal)
-GCC_ASM_EXPORT(MmioWrite64Internal)
-
-//
-// Reads an 8-bit MMIO register.
-//
-// Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
-// returned. This function must guarantee that all MMIO read and write
-// operations are serialized.
-//
-// @param Address The MMIO register to read.
-//
-// @return The value read.
-//
-ASM_PFX(MmioRead8Internal):
- ldrb w0, [x0]
- dmb ld
- ret
-
-//
-// Writes an 8-bit MMIO register.
-//
-// Writes the 8-bit MMIO register specified by Address with the value specified
-// by Value and returns Value. This function must guarantee that all MMIO read
-// and write operations are serialized.
-//
-// @param Address The MMIO register to write.
-// @param Value The value to write to the MMIO register.
-//
-ASM_PFX(MmioWrite8Internal):
- dmb st
- strb w1, [x0]
- ret
-
-//
-// Reads a 16-bit MMIO register.
-//
-// Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
-// returned. This function must guarantee that all MMIO read and write
-// operations are serialized.
-//
-// @param Address The MMIO register to read.
-//
-// @return The value read.
-//
-ASM_PFX(MmioRead16Internal):
- ldrh w0, [x0]
- dmb ld
- ret
-
-//
-// Writes a 16-bit MMIO register.
-//
-// Writes the 16-bit MMIO register specified by Address with the value specified
-// by Value and returns Value. This function must guarantee that all MMIO read
-// and write operations are serialized.
-//
-// @param Address The MMIO register to write.
-// @param Value The value to write to the MMIO register.
-//
-ASM_PFX(MmioWrite16Internal):
- dmb st
- strh w1, [x0]
- ret
-
-//
-// Reads a 32-bit MMIO register.
-//
-// Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
-// returned. This function must guarantee that all MMIO read and write
-// operations are serialized.
-//
-// @param Address The MMIO register to read.
-//
-// @return The value read.
-//
-ASM_PFX(MmioRead32Internal):
- ldr w0, [x0]
- dmb ld
- ret
-
-//
-// Writes a 32-bit MMIO register.
-//
-// Writes the 32-bit MMIO register specified by Address with the value specified
-// by Value and returns Value. This function must guarantee that all MMIO read
-// and write operations are serialized.
-//
-// @param Address The MMIO register to write.
-// @param Value The value to write to the MMIO register.
-//
-ASM_PFX(MmioWrite32Internal):
- dmb st
- str w1, [x0]
- ret
-
-//
-// Reads a 64-bit MMIO register.
-//
-// Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
-// returned. This function must guarantee that all MMIO read and write
-// operations are serialized.
-//
-// @param Address The MMIO register to read.
-//
-// @return The value read.
-//
-ASM_PFX(MmioRead64Internal):
- ldr x0, [x0]
- dmb ld
- ret
-
-//
-// Writes a 64-bit MMIO register.
-//
-// Writes the 64-bit MMIO register specified by Address with the value specified
-// by Value and returns Value. This function must guarantee that all MMIO read
-// and write operations are serialized.
-//
-// @param Address The MMIO register to write.
-// @param Value The value to write to the MMIO register.
-//
-ASM_PFX(MmioWrite64Internal):
- dmb st
- str x1, [x0]
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/AArch64/ArmVirtMmio.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/AArch64/ArmVirtMmio.asm
deleted file mode 100644
index bd235a5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/AArch64/ArmVirtMmio.asm
+++ /dev/null
@@ -1,149 +0,0 @@
-;
-; Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
-;
-; This program and the accompanying materials are licensed and made available
-; under the terms and conditions of the BSD License which accompanies this
-; distribution. The full text of the license may be found at
-; http:;opensource.org/licenses/bsd-license.php
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-
-
-AREA IoLibMmio, CODE, READONLY
-
-EXPORT MmioRead8Internal
-EXPORT MmioWrite8Internal
-EXPORT MmioRead16Internal
-EXPORT MmioWrite16Internal
-EXPORT MmioRead32Internal
-EXPORT MmioWrite32Internal
-EXPORT MmioRead64Internal
-EXPORT MmioWrite64Internal
-
-;
-; Reads an 8-bit MMIO register.
-;
-; Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
-; returned. This function must guarantee that all MMIO read and write
-; operations are serialized.
-;
-; @param Address The MMIO register to read.
-;
-; @return The value read.
-;
-MmioRead8Internal
- ldrb w0, [x0]
- dmb ld
- ret
-
-;
-; Writes an 8-bit MMIO register.
-;
-; Writes the 8-bit MMIO register specified by Address with the value specified
-; by Value and returns Value. This function must guarantee that all MMIO read
-; and write operations are serialized.
-;
-; @param Address The MMIO register to write.
-; @param Value The value to write to the MMIO register.
-;
-MmioWrite8Internal
- dmb st
- strb w1, [x0]
- ret
-
-;
-; Reads a 16-bit MMIO register.
-;
-; Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
-; returned. This function must guarantee that all MMIO read and write
-; operations are serialized.
-;
-; @param Address The MMIO register to read.
-;
-; @return The value read.
-;
-MmioRead16Internal
- ldrh w0, [x0]
- dmb ld
- ret
-
-;
-; Writes a 16-bit MMIO register.
-;
-; Writes the 16-bit MMIO register specified by Address with the value specified
-; by Value and returns Value. This function must guarantee that all MMIO read
-; and write operations are serialized.
-;
-; @param Address The MMIO register to write.
-; @param Value The value to write to the MMIO register.
-;
-MmioWrite16Internal
- dmb st
- strh w1, [x0]
- ret
-
-;
-; Reads a 32-bit MMIO register.
-;
-; Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
-; returned. This function must guarantee that all MMIO read and write
-; operations are serialized.
-;
-; @param Address The MMIO register to read.
-;
-; @return The value read.
-;
-MmioRead32Internal
- ldr w0, [x0]
- dmb ld
- ret
-
-;
-; Writes a 32-bit MMIO register.
-;
-; Writes the 32-bit MMIO register specified by Address with the value specified
-; by Value and returns Value. This function must guarantee that all MMIO read
-; and write operations are serialized.
-;
-; @param Address The MMIO register to write.
-; @param Value The value to write to the MMIO register.
-;
-MmioWrite32Internal
- dmb st
- str w1, [x0]
- ret
-
-;
-; Reads a 64-bit MMIO register.
-;
-; Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
-; returned. This function must guarantee that all MMIO read and write
-; operations are serialized.
-;
-; @param Address The MMIO register to read.
-;
-; @return The value read.
-;
-MmioRead64Internal
- ldr x0, [x0]
- dmb ld
- ret
-
-;
-; Writes a 64-bit MMIO register.
-;
-; Writes the 64-bit MMIO register specified by Address with the value specified
-; by Value and returns Value. This function must guarantee that all MMIO read
-; and write operations are serialized.
-;
-; @param Address The MMIO register to write.
-; @param Value The value to write to the MMIO register.
-;
-MmioWrite64Internal
- dmb st
- str x1, [x0]
- ret
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Arm/ArmVirtMmio.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Arm/ArmVirtMmio.S
deleted file mode 100644
index 0fa87fc..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Arm/ArmVirtMmio.S
+++ /dev/null
@@ -1,147 +0,0 @@
-#
-# Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-
-GCC_ASM_EXPORT(MmioRead8Internal)
-GCC_ASM_EXPORT(MmioWrite8Internal)
-GCC_ASM_EXPORT(MmioRead16Internal)
-GCC_ASM_EXPORT(MmioWrite16Internal)
-GCC_ASM_EXPORT(MmioRead32Internal)
-GCC_ASM_EXPORT(MmioWrite32Internal)
-GCC_ASM_EXPORT(MmioRead64Internal)
-GCC_ASM_EXPORT(MmioWrite64Internal)
-
-//
-// Reads an 8-bit MMIO register.
-//
-// Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
-// returned. This function must guarantee that all MMIO read and write
-// operations are serialized.
-//
-// @param Address The MMIO register to read.
-//
-// @return The value read.
-//
-ASM_PFX(MmioRead8Internal):
- ldrb r0, [r0]
- dmb
- bx lr
-
-//
-// Writes an 8-bit MMIO register.
-//
-// Writes the 8-bit MMIO register specified by Address with the value specified
-// by Value and returns Value. This function must guarantee that all MMIO read
-// and write operations are serialized.
-//
-// @param Address The MMIO register to write.
-// @param Value The value to write to the MMIO register.
-//
-ASM_PFX(MmioWrite8Internal):
- dmb st
- strb r1, [r0]
- bx lr
-
-//
-// Reads a 16-bit MMIO register.
-//
-// Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
-// returned. This function must guarantee that all MMIO read and write
-// operations are serialized.
-//
-// @param Address The MMIO register to read.
-//
-// @return The value read.
-//
-ASM_PFX(MmioRead16Internal):
- ldrh r0, [r0]
- dmb
- bx lr
-
-//
-// Writes a 16-bit MMIO register.
-//
-// Writes the 16-bit MMIO register specified by Address with the value specified
-// by Value and returns Value. This function must guarantee that all MMIO read
-// and write operations are serialized.
-//
-// @param Address The MMIO register to write.
-// @param Value The value to write to the MMIO register.
-//
-ASM_PFX(MmioWrite16Internal):
- dmb st
- strh r1, [r0]
- bx lr
-
-//
-// Reads a 32-bit MMIO register.
-//
-// Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
-// returned. This function must guarantee that all MMIO read and write
-// operations are serialized.
-//
-// @param Address The MMIO register to read.
-//
-// @return The value read.
-//
-ASM_PFX(MmioRead32Internal):
- ldr r0, [r0]
- dmb
- bx lr
-
-//
-// Writes a 32-bit MMIO register.
-//
-// Writes the 32-bit MMIO register specified by Address with the value specified
-// by Value and returns Value. This function must guarantee that all MMIO read
-// and write operations are serialized.
-//
-// @param Address The MMIO register to write.
-// @param Value The value to write to the MMIO register.
-//
-ASM_PFX(MmioWrite32Internal):
- dmb st
- str r1, [r0]
- bx lr
-
-//
-// Reads a 64-bit MMIO register.
-//
-// Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
-// returned. This function must guarantee that all MMIO read and write
-// operations are serialized.
-//
-// @param Address The MMIO register to read.
-//
-// @return The value read.
-//
-ASM_PFX(MmioRead64Internal):
- ldr r1, [r0, #4]
- ldr r0, [r0]
- dmb
- bx lr
-
-//
-// Writes a 64-bit MMIO register.
-//
-// Writes the 64-bit MMIO register specified by Address with the value specified
-// by Value and returns Value. This function must guarantee that all MMIO read
-// and write operations are serialized.
-//
-// @param Address The MMIO register to write.
-// @param Value The value to write to the MMIO register.
-//
-ASM_PFX(MmioWrite64Internal):
- dmb st
- str r2, [r0]
- str r3, [r0, #4]
- bx lr
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Arm/ArmVirtMmio.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Arm/ArmVirtMmio.asm
deleted file mode 100644
index c0c06c5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Arm/ArmVirtMmio.asm
+++ /dev/null
@@ -1,151 +0,0 @@
-;
-; Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
-;
-; This program and the accompanying materials are licensed and made available
-; under the terms and conditions of the BSD License which accompanies this
-; distribution. The full text of the license may be found at
-; http:;opensource.org/licenses/bsd-license.php
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-
-
-AREA IoLibMmio, CODE, READONLY
-
-EXPORT MmioRead8Internal
-EXPORT MmioWrite8Internal
-EXPORT MmioRead16Internal
-EXPORT MmioWrite16Internal
-EXPORT MmioRead32Internal
-EXPORT MmioWrite32Internal
-EXPORT MmioRead64Internal
-EXPORT MmioWrite64Internal
-
-;
-; Reads an 8-bit MMIO register.
-;
-; Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
-; returned. This function must guarantee that all MMIO read and write
-; operations are serialized.
-;
-; @param Address The MMIO register to read.
-;
-; @return The value read.
-;
-MmioRead8Internal
- ldrb r0, [r0]
- dmb
- bx lr
-
-;
-; Writes an 8-bit MMIO register.
-;
-; Writes the 8-bit MMIO register specified by Address with the value specified
-; by Value and returns Value. This function must guarantee that all MMIO read
-; and write operations are serialized.
-;
-; @param Address The MMIO register to write.
-; @param Value The value to write to the MMIO register.
-;
-MmioWrite8Internal
- dmb st
- strb r1, [r0]
- bx lr
-
-;
-; Reads a 16-bit MMIO register.
-;
-; Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
-; returned. This function must guarantee that all MMIO read and write
-; operations are serialized.
-;
-; @param Address The MMIO register to read.
-;
-; @return The value read.
-;
-MmioRead16Internal
- ldrh r0, [r0]
- dmb
- bx lr
-
-;
-; Writes a 16-bit MMIO register.
-;
-; Writes the 16-bit MMIO register specified by Address with the value specified
-; by Value and returns Value. This function must guarantee that all MMIO read
-; and write operations are serialized.
-;
-; @param Address The MMIO register to write.
-; @param Value The value to write to the MMIO register.
-;
-MmioWrite16Internal
- dmb st
- strh r1, [r0]
- bx lr
-
-;
-; Reads a 32-bit MMIO register.
-;
-; Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
-; returned. This function must guarantee that all MMIO read and write
-; operations are serialized.
-;
-; @param Address The MMIO register to read.
-;
-; @return The value read.
-;
-MmioRead32Internal
- ldr r0, [r0]
- dmb
- bx lr
-
-;
-; Writes a 32-bit MMIO register.
-;
-; Writes the 32-bit MMIO register specified by Address with the value specified
-; by Value and returns Value. This function must guarantee that all MMIO read
-; and write operations are serialized.
-;
-; @param Address The MMIO register to write.
-; @param Value The value to write to the MMIO register.
-;
-MmioWrite32Internal
- dmb st
- str r1, [r0]
- bx lr
-
-;
-; Reads a 64-bit MMIO register.
-;
-; Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
-; returned. This function must guarantee that all MMIO read and write
-; operations are serialized.
-;
-; @param Address The MMIO register to read.
-;
-; @return The value read.
-;
-MmioRead64Internal
- ldr r1, [r0, #4]
- ldr r0, [r0]
- dmb
- bx lr
-
-;
-; Writes a 64-bit MMIO register.
-;
-; Writes the 64-bit MMIO register specified by Address with the value specified
-; by Value and returns Value. This function must guarantee that all MMIO read
-; and write operations are serialized.
-;
-; @param Address The MMIO register to write.
-; @param Value The value to write to the MMIO register.
-;
-MmioWrite64Internal
- dmb st
- str r2, [r0]
- str r3, [r0, #4]
- bx lr
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
deleted file mode 100644
index fc51bb2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
+++ /dev/null
@@ -1,71 +0,0 @@
-## @file
-# Instance of I/O Library using compiler intrinsics.
-#
-# I/O Library that uses compiler intrinsics to perform IN and OUT instructions
-# for IA-32 and x64. On IPF, I/O port requests are translated into MMIO requests.
-# MMIO requests are forwarded directly to memory. For EBC, I/O port requests
-# ASSERT().
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Copyright (c) 2017, AMD Incorporated. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseIoLibIntrinsic
- MODULE_UNI_FILE = BaseIoLibIntrinsic.uni
- FILE_GUID = 926c9cd0-4bb8-479b-9ac4-8a2a23f85307
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = IoLib
-
-
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64
-#
-
-[Sources]
- IoLibMmioBuffer.c
- BaseIoLibIntrinsicInternal.h
- IoHighLevel.c
-
-[Sources.IA32]
- IoLibGcc.c | GCC
- IoLibMsc.c | MSFT
- IoLibIcc.c | INTEL
- IoLib.c
- Ia32/IoFifo.nasm
-
-[Sources.X64]
- IoLibGcc.c | GCC
- IoLibMsc.c | MSFT
- IoLibIcc.c | INTEL
- IoLib.c
- X64/IoFifo.nasm
-
-[Sources.EBC]
- IoLibEbc.c
- IoLib.c
-
-[Sources.ARM]
- IoLibArm.c
-
-[Sources.AARCH64]
- IoLibArm.c
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- DebugLib
- BaseLib
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.uni
deleted file mode 100644
index 3696eda..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.uni
+++ /dev/null
@@ -1,24 +0,0 @@
-// /** @file
-// Instance of I/O Library using compiler intrinsics.
-//
-// I/O Library that uses compiler intrinsics to perform IN and OUT instructions
-// for IA-32 and x64. On IPF, I/O port requests are translated into MMIO requests.
-// MMIO requests are forwarded directly to memory.
-//
-// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-// Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Instance of I/O Library using compiler intrinsics"
-
-#string STR_MODULE_DESCRIPTION #language en-US "I/O Library that uses compiler intrinsics to perform IN and OUT instructions for IA-32 and x64. On IPF, I/O port requests are translated into MMIO requests. MMIO requests are forwarded directly to memory."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.inf
deleted file mode 100644
index f9060c8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.inf
+++ /dev/null
@@ -1,52 +0,0 @@
-## @file
-# Instance of I/O Library using KVM/ARM safe assembler routines
-#
-# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Copyright (c) 2017, AMD Incorporated. All rights reserved.
-# Copyright (c) 2018, Linaro, Ltd. All rights reserved.
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x0001001A
- BASE_NAME = BaseIoLibIntrinsicArmVirt
- MODULE_UNI_FILE = BaseIoLibIntrinsicArmVirt.uni
- FILE_GUID = 217102b4-b465-4a1d-a2de-93dd385ec480
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = IoLib
-
-#
-# VALID_ARCHITECTURES = ARM AARCH64
-#
-
-[Sources]
- IoLibMmioBuffer.c
- BaseIoLibIntrinsicInternal.h
- IoHighLevel.c
-
-[Sources.ARM]
- IoLibArmVirt.c
- Arm/ArmVirtMmio.S | GCC
- Arm/ArmVirtMmio.asm | RVCT
-
-[Sources.AARCH64]
- IoLibArmVirt.c
- AArch64/ArmVirtMmio.S | GCC
- AArch64/ArmVirtMmio.asm | MSFT
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- DebugLib
- BaseLib
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.uni
deleted file mode 100644
index 7e510e6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.uni
+++ /dev/null
@@ -1,23 +0,0 @@
-// /** @file
-// Instance of I/O Library using KVM/ARM safe assembler routines
-//
-// Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
-// Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// Copyright (c) 2017, AMD Incorporated. All rights reserved.
-// Copyright (c) 2018, Linaro, Ltd. All rights reserved.
-//
-// This program and the accompanying materials are licensed and made available
-// under the terms and conditions of the BSD License which accompanies this
-// distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Instance of I/O Library using KVM/ARM safe assembler routines"
-
-#string STR_MODULE_DESCRIPTION #language en-US "I/O Library that uses assembler routines to perform MMIO accesses, to prevent link time code generation under LTO from emitting instructions that KVM on ARM cannot deal with."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h
deleted file mode 100644
index 9b20df0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/** @file
- Common header file shared by all source files.
-
- This file includes package header files, dependent library classes.
-
- Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#ifndef __BASEIOLIB_INTRINSIC_INTERNAL_H_
-#define __BASEIOLIB_INTRINSIC_INTERNAL_H_
-
-
-
-#include
-
-#include
-#include
-#include
-
-#endif
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
deleted file mode 100644
index 82f9b4a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
+++ /dev/null
@@ -1,59 +0,0 @@
-## @file
-# Instance of I/O Library using compiler intrinsics.
-#
-# I/O Library that uses compiler intrinsics to perform IN and OUT instructions
-# for IA-32 and x64.
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Copyright (c) 2017, AMD Incorporated. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseIoLibIntrinsicSev
- MODULE_UNI_FILE = BaseIoLibIntrinsic.uni
- FILE_GUID = 93742f95-6e71-4581-b600-8e1da443f95a
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = IoLib
-
-
-#
-# VALID_ARCHITECTURES = IA32 X64
-#
-
-[Sources]
- IoLibMmioBuffer.c
- BaseIoLibIntrinsicInternal.h
- IoHighLevel.c
-
-[Sources.IA32]
- IoLibGcc.c | GCC
- IoLibMsc.c | MSFT
- IoLibIcc.c | INTEL
- IoLib.c
- Ia32/IoFifoSev.nasm
-
-[Sources.X64]
- IoLibGcc.c | GCC
- IoLibMsc.c | MSFT
- IoLibIcc.c | INTEL
- IoLib.c
- X64/IoFifoSev.nasm
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- DebugLib
- BaseLib
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
deleted file mode 100644
index 102bbb8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifo.nasm
+++ /dev/null
@@ -1,137 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights reserved.
-;
-; This program and the accompanying materials are licensed and made available
-; under the terms and conditions of the BSD License which accompanies this
-; distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo8 (
-; IN UINTN Port,
-; IN UINTN Size,
-; OUT VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo8)
-ASM_PFX(IoReadFifo8):
- push edi
- cld
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov edi, [esp + 16]
-rep insb
- pop edi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo16 (
-; IN UINTN Port,
-; IN UINTN Size,
-; OUT VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo16)
-ASM_PFX(IoReadFifo16):
- push edi
- cld
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov edi, [esp + 16]
-rep insw
- pop edi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo32 (
-; IN UINTN Port,
-; IN UINTN Size,
-; OUT VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo32)
-ASM_PFX(IoReadFifo32):
- push edi
- cld
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov edi, [esp + 16]
-rep insd
- pop edi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo8 (
-; IN UINTN Port,
-; IN UINTN Size,
-; IN VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo8)
-ASM_PFX(IoWriteFifo8):
- push esi
- cld
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov esi, [esp + 16]
-rep outsb
- pop esi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo16 (
-; IN UINTN Port,
-; IN UINTN Size,
-; IN VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo16)
-ASM_PFX(IoWriteFifo16):
- push esi
- cld
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov esi, [esp + 16]
-rep outsw
- pop esi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo32 (
-; IN UINTN Port,
-; IN UINTN Size,
-; IN VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo32)
-ASM_PFX(IoWriteFifo32):
- push esi
- cld
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov esi, [esp + 16]
-rep outsd
- pop esi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifoSev.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifoSev.nasm
deleted file mode 100644
index 02551b6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/Ia32/IoFifoSev.nasm
+++ /dev/null
@@ -1,299 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights reserved.
-;
-; This program and the accompanying materials are licensed and made available
-; under the terms and conditions of the BSD License which accompanies this
-; distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; Check whether we need to unroll the String I/O under SEV guest
-;
-; Return // eax (1 - unroll, 0 - no unroll)
-;------------------------------------------------------------------------------
-global ASM_PFX(SevNoRepIo)
-ASM_PFX(SevNoRepIo):
-
- ; CPUID clobbers ebx, ecx and edx
- push ebx
- push ecx
- push edx
-
- ; Check if we are running under hypervisor
- ; CPUID(1).ECX Bit 31
- mov eax, 1
- cpuid
- bt ecx, 31
- jnc @UseRepIo
-
- ; Check if we have Memory encryption CPUID leaf
- mov eax, 0x80000000
- cpuid
- cmp eax, 0x8000001f
- jl @UseRepIo
-
- ; Check for memory encryption feature:
- ; CPUID Fn8000_001F[EAX] - Bit 1
- ;
- mov eax, 0x8000001f
- cpuid
- bt eax, 1
- jnc @UseRepIo
-
- ; Check if memory encryption is enabled
- ; MSR_0xC0010131 - Bit 0 (SEV enabled)
- ; MSR_0xC0010131 - Bit 1 (SEV-ES enabled)
- mov ecx, 0xc0010131
- rdmsr
-
- ; Check for (SevEsEnabled == 0 && SevEnabled == 1)
- and eax, 3
- cmp eax, 1
- je @SevNoRepIo_Done
-
-@UseRepIo:
- xor eax, eax
-
-@SevNoRepIo_Done:
- pop edx
- pop ecx
- pop ebx
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo8 (
-; IN UINTN Port,
-; IN UINTN Size,
-; OUT VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo8)
-ASM_PFX(IoReadFifo8):
- push edi
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov edi, [esp + 16]
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoReadFifo8_NoRep
-
- cld
- rep insb
- jmp @IoReadFifo8_Done
-
-@IoReadFifo8_NoRep:
- jecxz @IoReadFifo8_Done
-
-@IoReadFifo8_Loop:
- in al, dx
- mov byte [edi], al
- inc edi
- loop @IoReadFifo8_Loop
-
-@IoReadFifo8_Done:
- pop edi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo16 (
-; IN UINTN Port,
-; IN UINTN Size,
-; OUT VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo16)
-ASM_PFX(IoReadFifo16):
- push edi
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov edi, [esp + 16]
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoReadFifo16_NoRep
-
- cld
- rep insw
- jmp @IoReadFifo16_Done
-
-@IoReadFifo16_NoRep:
- jecxz @IoReadFifo16_Done
-
-@IoReadFifo16_Loop:
- in ax, dx
- mov word [edi], ax
- add edi, 2
- loop @IoReadFifo16_Loop
-
-@IoReadFifo16_Done:
- pop edi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo32 (
-; IN UINTN Port,
-; IN UINTN Size,
-; OUT VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo32)
-ASM_PFX(IoReadFifo32):
- push edi
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov edi, [esp + 16]
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoReadFifo32_NoRep
-
- cld
- rep insd
- jmp @IoReadFifo32_Done
-
-@IoReadFifo32_NoRep:
- jecxz @IoReadFifo32_Done
-
-@IoReadFifo32_Loop:
- in eax, dx
- mov dword [edi], eax
- add edi, 4
- loop @IoReadFifo32_Loop
-
-@IoReadFifo32_Done:
- pop edi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo8 (
-; IN UINTN Port,
-; IN UINTN Size,
-; IN VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo8)
-ASM_PFX(IoWriteFifo8):
- push esi
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov esi, [esp + 16]
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoWriteFifo8_NoRep
-
- cld
- rep outsb
- jmp @IoWriteFifo8_Done
-
-@IoWriteFifo8_NoRep:
- jecxz @IoWriteFifo8_Done
-
-@IoWriteFifo8_Loop:
- mov al, byte [esi]
- out dx, al
- inc esi
- loop @IoWriteFifo8_Loop
-
-@IoWriteFifo8_Done:
- pop esi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo16 (
-; IN UINTN Port,
-; IN UINTN Size,
-; IN VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo16)
-ASM_PFX(IoWriteFifo16):
- push esi
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov esi, [esp + 16]
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoWriteFifo16_NoRep
-
- cld
- rep outsw
- jmp @IoWriteFifo16_Done
-
-@IoWriteFifo16_NoRep:
- jecxz @IoWriteFifo16_Done
-
-@IoWriteFifo16_Loop:
- mov ax, word [esi]
- out dx, ax
- add esi, 2
- loop @IoWriteFifo16_Loop
-
-@IoWriteFifo16_Done:
- pop esi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo32 (
-; IN UINTN Port,
-; IN UINTN Size,
-; IN VOID *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo32)
-ASM_PFX(IoWriteFifo32):
- push esi
- mov dx, [esp + 8]
- mov ecx, [esp + 12]
- mov esi, [esp + 16]
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoWriteFifo32_NoRep
-
- cld
- rep outsd
- jmp @IoWriteFifo32_Done
-
-@IoWriteFifo32_NoRep:
- jecxz @IoWriteFifo32_Done
-
-@IoWriteFifo32_Loop:
- mov eax, dword [esi]
- out dx, eax
- add esi, 4
- loop @IoWriteFifo32_Loop
-
-@IoWriteFifo32_Done:
- pop esi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoHighLevel.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoHighLevel.c
deleted file mode 100644
index a5cc891..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoHighLevel.c
+++ /dev/null
@@ -1,2356 +0,0 @@
-/** @file
- High-level Io/Mmio functions.
-
- All assertions for bit field operations are handled bit field functions in the
- Base Library.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- The following IoLib instances contain the same copy of this file:
-
- BaseIoLibIntrinsic
- DxeIoLibCpuIo
- PeiIoLibCpuIo
-
-**/
-
-#include "BaseIoLibIntrinsicInternal.h"
-
-/**
- Reads an 8-bit I/O port, performs a bitwise OR, and writes the
- result back to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoOr8 (
- IN UINTN Port,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (Port, (UINT8) (IoRead8 (Port) | OrData));
-}
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
- to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoAnd8 (
- IN UINTN Port,
- IN UINT8 AndData
- )
-{
- return IoWrite8 (Port, (UINT8) (IoRead8 (Port) & AndData));
-}
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 8-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoAndThenOr8 (
- IN UINTN Port,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (Port, (UINT8) ((IoRead8 (Port) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in an 8-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldRead8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead8 (IoRead8 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value The new value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldWrite8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- return IoWrite8 (
- Port,
- BitFieldWrite8 (IoRead8 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra bits left in OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (
- Port,
- BitFieldOr8 (IoRead8 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra bits left in AndData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldAnd8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- return IoWrite8 (
- Port,
- BitFieldAnd8 (IoRead8 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 8-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra bits left in both
- AndData and OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldAndThenOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (
- Port,
- BitFieldAndThenOr8 (IoRead8 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 16-bit I/O port, performs a bitwise OR, and writes the
- result back to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoOr16 (
- IN UINTN Port,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (Port, (UINT16) (IoRead16 (Port) | OrData));
-}
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
- to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoAnd16 (
- IN UINTN Port,
- IN UINT16 AndData
- )
-{
- return IoWrite16 (Port, (UINT16) (IoRead16 (Port) & AndData));
-}
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 16-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoAndThenOr16 (
- IN UINTN Port,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (Port, (UINT16) ((IoRead16 (Port) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 16-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldRead16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead16 (IoRead16 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- bits left in Value are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value The new value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldWrite16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- return IoWrite16 (
- Port,
- BitFieldWrite16 (IoRead16 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra bits left in OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (
- Port,
- BitFieldOr16 (IoRead16 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra bits left in AndData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldAnd16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- return IoWrite16 (
- Port,
- BitFieldAnd16 (IoRead16 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 16-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra bits left in both
- AndData and OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldAndThenOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (
- Port,
- BitFieldAndThenOr16 (IoRead16 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 32-bit I/O port, performs a bitwise OR, and writes the
- result back to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoOr32 (
- IN UINTN Port,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (Port, IoRead32 (Port) | OrData);
-}
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
- to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoAnd32 (
- IN UINTN Port,
- IN UINT32 AndData
- )
-{
- return IoWrite32 (Port, IoRead32 (Port) & AndData);
-}
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 32-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoAndThenOr32 (
- IN UINTN Port,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (Port, (IoRead32 (Port) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 32-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldRead32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead32 (IoRead32 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- bits left in Value are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value The new value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldWrite32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- return IoWrite32 (
- Port,
- BitFieldWrite32 (IoRead32 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra bits left in OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (
- Port,
- BitFieldOr32 (IoRead32 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra bits left in AndData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldAnd32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- return IoWrite32 (
- Port,
- BitFieldAnd32 (IoRead32 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 32-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra bits left in both
- AndData and OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldAndThenOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (
- Port,
- BitFieldAndThenOr32 (IoRead32 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 64-bit I/O port, performs a bitwise OR, and writes the
- result back to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoOr64 (
- IN UINTN Port,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (Port, IoRead64 (Port) | OrData);
-}
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
- to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoAnd64 (
- IN UINTN Port,
- IN UINT64 AndData
- )
-{
- return IoWrite64 (Port, IoRead64 (Port) & AndData);
-}
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 64-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoAndThenOr64 (
- IN UINTN Port,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (Port, (IoRead64 (Port) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 64-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldRead64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead64 (IoRead64 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- bits left in Value are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value The new value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldWrite64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- )
-{
- return IoWrite64 (
- Port,
- BitFieldWrite64 (IoRead64 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra bits left in OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (
- Port,
- BitFieldOr64 (IoRead64 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra bits left in AndData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldAnd64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- )
-{
- return IoWrite64 (
- Port,
- BitFieldAnd64 (IoRead64 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra bits left in both
- AndData and OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldAndThenOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (
- Port,
- BitFieldAndThenOr64 (IoRead64 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise OR, and writes the
- result back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) | OrData));
-}
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- )
-{
- return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) & AndData));
-}
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 8-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (Address, (UINT8) ((MmioRead8 (Address) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in an 8-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address The MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead8 (MmioRead8 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 8-bit register is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value The new value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldWrite8 (MmioRead8 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra bits left in OrData
- are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldOr8 (MmioRead8 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra bits left in AndData are
- stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldAnd8 (MmioRead8 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, and writes the result back to the bit field in the
- 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 8-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra bits left in both AndData and OrData are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldAndThenOr8 (MmioRead8 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise OR, and writes the
- result back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) | OrData));
-}
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- )
-{
- return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) & AndData));
-}
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 16-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (Address, (UINT16) ((MmioRead16 (Address) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 16-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address The MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead16 (MmioRead16 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 16-bit register is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value The new value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldWrite16 (MmioRead16 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra bits left in OrData
- are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldOr16 (MmioRead16 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra bits left in AndData are
- stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldAnd16 (MmioRead16 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, and writes the result back to the bit field in the
- 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 16-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra bits left in both AndData and OrData are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldAndThenOr16 (MmioRead16 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise OR, and writes the
- result back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (Address, MmioRead32 (Address) | OrData);
-}
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- )
-{
- return MmioWrite32 (Address, MmioRead32 (Address) & AndData);
-}
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 32-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (Address, (MmioRead32 (Address) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 32-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address The MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead32 (MmioRead32 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 32-bit register is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value The new value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldWrite32 (MmioRead32 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra bits left in OrData
- are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldOr32 (MmioRead32 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra bits left in AndData are
- stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldAnd32 (MmioRead32 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, and writes the result back to the bit field in the
- 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 32-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra bits left in both AndData and OrData are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldAndThenOr32 (MmioRead32 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise OR, and writes the
- result back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioOr64 (
- IN UINTN Address,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (Address, MmioRead64 (Address) | OrData);
-}
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioAnd64 (
- IN UINTN Address,
- IN UINT64 AndData
- )
-{
- return MmioWrite64 (Address, MmioRead64 (Address) & AndData);
-}
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 64-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioAndThenOr64 (
- IN UINTN Address,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (Address, (MmioRead64 (Address) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 64-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address The MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldRead64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead64 (MmioRead64 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 64-bit register is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value The new value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldWrite64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldWrite64 (MmioRead64 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra bits left in OrData
- are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldOr64 (MmioRead64 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra bits left in AndData are
- stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldAnd64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldAnd64 (MmioRead64 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
- by a bitwise OR, and writes the result back to the bit field in the
- 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise OR between the read result and the value
- specified by AndData, and writes the result to the 64-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra bits left in both AndData and OrData are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Address The MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldAndThenOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldAndThenOr64 (MmioRead64 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLib.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLib.c
deleted file mode 100644
index 5091b2b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLib.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/** @file
- Common I/O Library routines.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseIoLibIntrinsicInternal.h"
-
-/**
- Reads a 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoRead64 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 64-bit I/O port.
-
- Writes the 64-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoWrite64 (
- IN UINTN Port,
- IN UINT64 Value
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-
-/**
- Reads an 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8 (
- IN UINTN Address
- )
-{
- UINT8 Value;
-
- MemoryFence ();
- Value = *(volatile UINT8*)Address;
- MemoryFence ();
-
- return Value;
-}
-
-/**
- Writes an 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
- @return Value.
-
-**/
-UINT8
-EFIAPI
-MmioWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- )
-{
- MemoryFence ();
- *(volatile UINT8*)Address = Value;
- MemoryFence ();
-
- return Value;
-}
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16 (
- IN UINTN Address
- )
-{
- UINT16 Value;
-
- ASSERT ((Address & 1) == 0);
-
- MemoryFence ();
- Value = *(volatile UINT16*)Address;
- MemoryFence ();
-
- return Value;
-}
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
- @return Value.
-
-**/
-UINT16
-EFIAPI
-MmioWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- )
-{
- ASSERT ((Address & 1) == 0);
-
- MemoryFence ();
- *(volatile UINT16*)Address = Value;
- MemoryFence ();
-
- return Value;
-}
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32 (
- IN UINTN Address
- )
-{
- UINT32 Value;
-
- ASSERT ((Address & 3) == 0);
-
- MemoryFence ();
- Value = *(volatile UINT32*)Address;
- MemoryFence ();
-
- return Value;
-}
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
- @return Value.
-
-**/
-UINT32
-EFIAPI
-MmioWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- )
-{
- ASSERT ((Address & 3) == 0);
-
- MemoryFence ();
- *(volatile UINT32*)Address = Value;
- MemoryFence ();
-
- return Value;
-}
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64 (
- IN UINTN Address
- )
-{
- UINT64 Value;
-
- ASSERT ((Address & 7) == 0);
-
- MemoryFence ();
- Value = *(volatile UINT64*)Address;
- MemoryFence ();
-
- return Value;
-}
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If Address is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioWrite64 (
- IN UINTN Address,
- IN UINT64 Value
- )
-{
- ASSERT ((Address & 7) == 0);
-
- MemoryFence ();
- *(volatile UINT64*)Address = Value;
- MemoryFence ();
-
- return Value;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibArm.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibArm.c
deleted file mode 100644
index 02e2d2a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibArm.c
+++ /dev/null
@@ -1,599 +0,0 @@
-/** @file
- I/O Library for ARM.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- Copyright (c) 2017, AMD Incorporated. All rights reserved.
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-//
-// Include common header file for this module.
-//
-#include "BaseIoLibIntrinsicInternal.h"
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoRead8 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- )
-{
- ASSERT (FALSE);
- return Value;
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoRead16 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- )
-{
- ASSERT (FALSE);
- return Value;
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoRead32 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- )
-{
- ASSERT (FALSE);
- return Value;
-}
-
-/**
- Reads a 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoRead64 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 64-bit I/O port.
-
- Writes the 64-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoWrite64 (
- IN UINTN Port,
- IN UINT64 Value
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Reads an 8-bit I/O port fifo into a block of memory.
-
- Reads the 8-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo8 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Writes a block of memory into an 8-bit I/O port fifo.
-
- Writes the 8-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo8 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Reads a 16-bit I/O port fifo into a block of memory.
-
- Reads the 16-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo16 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Writes a block of memory into a 16-bit I/O port fifo.
-
- Writes the 16-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo16 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Reads a 32-bit I/O port fifo into a block of memory.
-
- Reads the 32-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo32 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Writes a block of memory into a 32-bit I/O port fifo.
-
- Writes the 32-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo32 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Reads an 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8 (
- IN UINTN Address
- )
-{
- UINT8 Value;
-
- Value = *(volatile UINT8*)Address;
- return Value;
-}
-
-/**
- Writes an 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- )
-{
- *(volatile UINT8*)Address = Value;
- return Value;
-}
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16 (
- IN UINTN Address
- )
-{
- UINT16 Value;
-
- ASSERT ((Address & 1) == 0);
- Value = *(volatile UINT16*)Address;
- return Value;
-}
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- )
-{
- ASSERT ((Address & 1) == 0);
- *(volatile UINT16*)Address = Value;
- return Value;
-}
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32 (
- IN UINTN Address
- )
-{
- UINT32 Value;
-
- ASSERT ((Address & 3) == 0);
- Value = *(volatile UINT32*)Address;
- return Value;
-}
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- )
-{
- ASSERT ((Address & 3) == 0);
- *(volatile UINT32*)Address = Value;
- return Value;
-}
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64 (
- IN UINTN Address
- )
-{
- UINT64 Value;
-
- ASSERT ((Address & 7) == 0);
- Value = *(volatile UINT64*)Address;
- return Value;
-}
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioWrite64 (
- IN UINTN Address,
- IN UINT64 Value
- )
-{
- ASSERT ((Address & 7) == 0);
- *(volatile UINT64*)Address = Value;
- return Value;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibArmVirt.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibArmVirt.c
deleted file mode 100644
index aff58b4..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibArmVirt.c
+++ /dev/null
@@ -1,733 +0,0 @@
-/** @file
- I/O Library for ARM.
-
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- Copyright (c) 2017, AMD Incorporated. All rights reserved.
- Copyright (c) 2018, Linaro, Ltd. All rights reserved.
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseIoLibIntrinsicInternal.h"
-
-/**
- Reads an 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8Internal (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-VOID
-EFIAPI
-MmioWrite8Internal (
- IN UINTN Address,
- IN UINT8 Value
- );
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16Internal (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-VOID
-EFIAPI
-MmioWrite16Internal (
- IN UINTN Address,
- IN UINT16 Value
- );
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32Internal (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-VOID
-EFIAPI
-MmioWrite32Internal (
- IN UINTN Address,
- IN UINT32 Value
- );
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64Internal (
- IN UINTN Address
- );
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-VOID
-EFIAPI
-MmioWrite64Internal (
- IN UINTN Address,
- IN UINT64 Value
- );
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoRead8 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- )
-{
- ASSERT (FALSE);
- return Value;
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoRead16 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- )
-{
- ASSERT (FALSE);
- return Value;
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoRead32 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- )
-{
- ASSERT (FALSE);
- return Value;
-}
-
-/**
- Reads a 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoRead64 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 64-bit I/O port.
-
- Writes the 64-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoWrite64 (
- IN UINTN Port,
- IN UINT64 Value
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Reads an 8-bit I/O port fifo into a block of memory.
-
- Reads the 8-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo8 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Writes a block of memory into an 8-bit I/O port fifo.
-
- Writes the 8-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo8 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Reads a 16-bit I/O port fifo into a block of memory.
-
- Reads the 16-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo16 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Writes a block of memory into a 16-bit I/O port fifo.
-
- Writes the 16-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo16 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Reads a 32-bit I/O port fifo into a block of memory.
-
- Reads the 32-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo32 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Writes a block of memory into a 32-bit I/O port fifo.
-
- Writes the 32-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo32 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Reads an 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8 (
- IN UINTN Address
- )
-{
- return MmioRead8Internal (Address);
-}
-
-/**
- Writes an 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- )
-{
- MmioWrite8Internal (Address, Value);
- return Value;
-}
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16 (
- IN UINTN Address
- )
-{
- ASSERT ((Address & 1) == 0);
-
- return MmioRead16Internal (Address);
-}
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- )
-{
- ASSERT ((Address & 1) == 0);
-
- MmioWrite16Internal (Address, Value);
- return Value;
-}
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32 (
- IN UINTN Address
- )
-{
- ASSERT ((Address & 3) == 0);
-
- return MmioRead32Internal (Address);
-}
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- )
-{
- ASSERT ((Address & 3) == 0);
-
- MmioWrite32Internal (Address, Value);
- return Value;
-}
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64 (
- IN UINTN Address
- )
-{
- ASSERT ((Address & 7) == 0);
-
- return MmioRead64Internal (Address);
-}
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioWrite64 (
- IN UINTN Address,
- IN UINT64 Value
- )
-{
- ASSERT ((Address & 7) == 0);
-
- MmioWrite64Internal (Address, Value);
- return Value;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibEbc.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibEbc.c
deleted file mode 100644
index d000675..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibEbc.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/** @file
- I/O Library for EBC.
-
- EBC does not support port I/O. All APIs in this file ASSERT().
-
- Copyright (c) 2015, Intel Corporation. All rights reserved.
- Copyright (c) 2017, AMD Incorporated. All rights reserved.
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseIoLibIntrinsicInternal.h"
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoRead8 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoRead16 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoRead32 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Reads an 8-bit I/O port fifo into a block of memory.
-
- Reads the 8-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo8 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Writes a block of memory into an 8-bit I/O port fifo.
-
- Writes the 8-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo8 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Reads a 16-bit I/O port fifo into a block of memory.
-
- Reads the 16-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo16 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Writes a block of memory into a 16-bit I/O port fifo.
-
- Writes the 16-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo16 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Reads a 32-bit I/O port fifo into a block of memory.
-
- Reads the 32-bit I/O fifo port specified by Port.
- The port is read Count times, and the read data is
- stored in the provided Buffer.
-
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
- @param Count The number of times to read I/O port.
- @param Buffer The buffer to store the read data into.
-
-**/
-VOID
-EFIAPI
-IoReadFifo32 (
- IN UINTN Port,
- IN UINTN Count,
- OUT VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Writes a block of memory into a 32-bit I/O port fifo.
-
- Writes the 32-bit I/O fifo port specified by Port.
- The port is written Count times, and the write data is
- retrieved from the provided Buffer.
-
- This function must guarantee that all I/O write and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Count The number of times to write I/O port.
- @param Buffer The buffer to retrieve the write data from.
-
-**/
-VOID
-EFIAPI
-IoWriteFifo32 (
- IN UINTN Port,
- IN UINTN Count,
- IN VOID *Buffer
- )
-{
- ASSERT (FALSE);
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
deleted file mode 100644
index 5132d74..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/** @file
- I/O Library. This file has compiler specifics for GCC as there is no
- ANSI C standard for doing IO.
-
- GCC - uses EFIAPI assembler. __asm__ calls GAS. __volatile__ makes sure the
- compiler puts the assembler in this exact location. The complex GNUC
- operations are not optimzed. It would be possible to also write these
- with EFIAPI assembler.
-
- We don't advocate putting compiler specifics in libraries or drivers but there
- is no other way to make this work.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseIoLibIntrinsicInternal.h"
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-__inline__
-UINT8
-EFIAPI
-IoRead8 (
- IN UINTN Port
- )
-{
- UINT8 Data;
-
- __asm__ __volatile__ ("inb %w1,%b0" : "=a" (Data) : "d" ((UINT16)Port));
- return Data;
-}
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-__inline__
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- )
-{
- __asm__ __volatile__ ("outb %b0,%w1" : : "a" (Value), "d" ((UINT16)Port));
- return Value;;
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-__inline__
-UINT16
-EFIAPI
-IoRead16 (
- IN UINTN Port
- )
-{
- UINT16 Data;
-
- ASSERT ((Port & 1) == 0);
- __asm__ __volatile__ ("inw %w1,%w0" : "=a" (Data) : "d" ((UINT16)Port));
- return Data;
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-__inline__
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- )
-{
- ASSERT ((Port & 1) == 0);
- __asm__ __volatile__ ("outw %w0,%w1" : : "a" (Value), "d" ((UINT16)Port));
- return Value;;
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-__inline__
-UINT32
-EFIAPI
-IoRead32 (
- IN UINTN Port
- )
-{
- UINT32 Data;
-
- ASSERT ((Port & 3) == 0);
- __asm__ __volatile__ ("inl %w1,%0" : "=a" (Data) : "d" ((UINT16)Port));
- return Data;
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-__inline__
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- )
-{
- ASSERT ((Port & 3) == 0);
- __asm__ __volatile__ ("outl %0,%w1" : : "a" (Value), "d" ((UINT16)Port));
- return Value;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibIcc.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibIcc.c
deleted file mode 100644
index 3c92ebc..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibIcc.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/** @file
- I/O Library. This file has compiler specifics for ICC as there
- is no ANSI C standard for doing IO.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials are
- licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseIoLibIntrinsicInternal.h"
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoRead8 (
- IN UINTN Port
- )
-{
- UINT8 Data;
-
- __asm {
- mov dx, word ptr [Port]
- in al, dx
-
- mov Data, al
- }
- return Data;
-}
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- )
-{
- __asm {
- mov al, byte ptr [Value]
- mov dx, word ptr [Port]
- out dx, al
- }
- return Value;
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoRead16 (
- IN UINTN Port
- )
-{
- UINT16 Data;
-
- ASSERT ((Port & 1) == 0);
-
- __asm {
- mov dx, word ptr [Port]
- in ax, dx
- mov word ptr [Data], ax
- }
-
- return Data;
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- )
-{
- ASSERT ((Port & 1) == 0);
-
- __asm {
- mov ax, word ptr [Value]
- mov dx, word ptr [Port]
- out dx, ax
- }
-
- return Value;
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoRead32 (
- IN UINTN Port
- )
-{
- UINT32 Data;
-
- ASSERT ((Port & 3) == 0);
-
- __asm {
- mov dx, word ptr [Port]
- in eax, dx
- mov dword ptr [Data], eax
- }
-
- return Data;
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- )
-{
- ASSERT ((Port & 3) == 0);
-
- __asm {
- mov eax, dword ptr [Value]
- mov dx, word ptr [Port]
- out dx, eax
- }
-
- return Value;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibMmioBuffer.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibMmioBuffer.c
deleted file mode 100644
index f8de86c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibMmioBuffer.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/** @file
- I/O Library MMIO Buffer Functions.
-
- Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseIoLibIntrinsicInternal.h"
-
-/**
- Copy data from the MMIO region to system memory by using 8-bit access.
-
- Copy data from the MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 8-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
-
- @param StartAddress The starting address for the MMIO region to be copied from.
- @param Length The size, in bytes, of Buffer.
- @param Buffer The pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT8 *
-EFIAPI
-MmioReadBuffer8 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT8 *Buffer
- )
-{
- UINT8 *ReturnBuffer;
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
-
- ReturnBuffer = Buffer;
-
- while (Length-- != 0) {
- *(Buffer++) = MmioRead8 (StartAddress++);
- }
-
- return ReturnBuffer;
-}
-
-/**
- Copy data from the MMIO region to system memory by using 16-bit access.
-
- Copy data from the MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 16-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
-
- @param StartAddress The starting address for the MMIO region to be copied from.
- @param Length The size, in bytes, of Buffer.
- @param Buffer The pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT16 *
-EFIAPI
-MmioReadBuffer16 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT16 *Buffer
- )
-{
- UINT16 *ReturnBuffer;
-
- ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0);
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
-
- ASSERT ((Length & (sizeof (UINT16) - 1)) == 0);
- ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0);
-
- ReturnBuffer = Buffer;
-
- while (Length != 0) {
- *(Buffer++) = MmioRead16 (StartAddress);
- StartAddress += sizeof (UINT16);
- Length -= sizeof (UINT16);
- }
-
- return ReturnBuffer;
-}
-
-/**
- Copy data from the MMIO region to system memory by using 32-bit access.
-
- Copy data from the MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 32-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
-
- @param StartAddress The starting address for the MMIO region to be copied from.
- @param Length The size, in bytes, of Buffer.
- @param Buffer The pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT32 *
-EFIAPI
-MmioReadBuffer32 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT32 *Buffer
- )
-{
- UINT32 *ReturnBuffer;
-
- ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0);
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
-
- ASSERT ((Length & (sizeof (UINT32) - 1)) == 0);
- ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0);
-
- ReturnBuffer = Buffer;
-
- while (Length != 0) {
- *(Buffer++) = MmioRead32 (StartAddress);
- StartAddress += sizeof (UINT32);
- Length -= sizeof (UINT32);
- }
-
- return ReturnBuffer;
-}
-
-/**
- Copy data from the MMIO region to system memory by using 64-bit access.
-
- Copy data from the MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 64-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
-
- @param StartAddress The starting address for the MMIO region to be copied from.
- @param Length The size, in bytes, of Buffer.
- @param Buffer The pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT64 *
-EFIAPI
-MmioReadBuffer64 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT64 *Buffer
- )
-{
- UINT64 *ReturnBuffer;
-
- ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0);
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
-
- ASSERT ((Length & (sizeof (UINT64) - 1)) == 0);
- ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0);
-
- ReturnBuffer = Buffer;
-
- while (Length != 0) {
- *(Buffer++) = MmioRead64 (StartAddress);
- StartAddress += sizeof (UINT64);
- Length -= sizeof (UINT64);
- }
-
- return ReturnBuffer;
-}
-
-
-/**
- Copy data from system memory to the MMIO region by using 8-bit access.
-
- Copy data from system memory specified by Buffer to the MMIO region specified
- by starting address StartAddress by using 8-bit access. The total number
- of byte to be copied is specified by Length. Buffer is returned.
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
-
- @param StartAddress The starting address for the MMIO region to be copied to.
- @param Length The size, in bytes, of Buffer.
- @param Buffer The pointer to a system memory buffer containing the data to write.
-
- @return Buffer
-
-**/
-UINT8 *
-EFIAPI
-MmioWriteBuffer8 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT8 *Buffer
- )
-{
- VOID* ReturnBuffer;
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
-
- ReturnBuffer = (UINT8 *) Buffer;
-
- while (Length-- != 0) {
- MmioWrite8 (StartAddress++, *(Buffer++));
- }
-
- return ReturnBuffer;
-
-}
-
-/**
- Copy data from system memory to the MMIO region by using 16-bit access.
-
- Copy data from system memory specified by Buffer to the MMIO region specified
- by starting address StartAddress by using 16-bit access. The total number
- of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 16-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
-
- @param StartAddress The starting address for the MMIO region to be copied to.
- @param Length The size, in bytes, of Buffer.
- @param Buffer The pointer to a system memory buffer containing the data to write.
-
- @return Buffer
-
-**/
-UINT16 *
-EFIAPI
-MmioWriteBuffer16 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT16 *Buffer
- )
-{
- UINT16 *ReturnBuffer;
-
- ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0);
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
-
- ASSERT ((Length & (sizeof (UINT16) - 1)) == 0);
- ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0);
-
- ReturnBuffer = (UINT16 *) Buffer;
-
- while (Length != 0) {
- MmioWrite16 (StartAddress, *(Buffer++));
-
- StartAddress += sizeof (UINT16);
- Length -= sizeof (UINT16);
- }
-
- return ReturnBuffer;
-}
-
-
-/**
- Copy data from system memory to the MMIO region by using 32-bit access.
-
- Copy data from system memory specified by Buffer to the MMIO region specified
- by starting address StartAddress by using 32-bit access. The total number
- of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 32-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
-
- @param StartAddress The starting address for the MMIO region to be copied to.
- @param Length The size, in bytes, of Buffer.
- @param Buffer The pointer to a system memory buffer containing the data to write.
-
- @return Buffer
-
-**/
-UINT32 *
-EFIAPI
-MmioWriteBuffer32 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT32 *Buffer
- )
-{
- UINT32 *ReturnBuffer;
-
- ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0);
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
-
- ASSERT ((Length & (sizeof (UINT32) - 1)) == 0);
- ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0);
-
- ReturnBuffer = (UINT32 *) Buffer;
-
- while (Length != 0) {
- MmioWrite32 (StartAddress, *(Buffer++));
-
- StartAddress += sizeof (UINT32);
- Length -= sizeof (UINT32);
- }
-
- return ReturnBuffer;
-}
-
-/**
- Copy data from system memory to the MMIO region by using 64-bit access.
-
- Copy data from system memory specified by Buffer to the MMIO region specified
- by starting address StartAddress by using 64-bit access. The total number
- of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 64-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
-
- @param StartAddress The starting address for the MMIO region to be copied to.
- @param Length The size, in bytes, of Buffer.
- @param Buffer The pointer to a system memory buffer containing the data to write.
-
- @return Buffer
-
-**/
-UINT64 *
-EFIAPI
-MmioWriteBuffer64 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT64 *Buffer
- )
-{
- UINT64 *ReturnBuffer;
-
- ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0);
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - StartAddress));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN) Buffer));
-
- ASSERT ((Length & (sizeof (UINT64) - 1)) == 0);
- ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0);
-
- ReturnBuffer = (UINT64 *) Buffer;
-
- while (Length != 0) {
- MmioWrite64 (StartAddress, *(Buffer++));
-
- StartAddress += sizeof (UINT64);
- Length -= sizeof (UINT64);
- }
-
- return ReturnBuffer;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c
deleted file mode 100644
index 156ebbc..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/** @file
- I/O Library. This file has compiler specifics for Microsft C as there is no
- ANSI C standard for doing IO.
-
- MSC - uses intrinsic functions and the optimize will remove the function call
- overhead.
-
- We don't advocate putting compiler specifics in libraries or drivers but there
- is no other way to make this work.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-#include "BaseIoLibIntrinsicInternal.h"
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
-//
-
-int _inp (unsigned short port);
-unsigned short _inpw (unsigned short port);
-unsigned long _inpd (unsigned short port);
-int _outp (unsigned short port, int databyte );
-unsigned short _outpw (unsigned short port, unsigned short dataword );
-unsigned long _outpd (unsigned short port, unsigned long dataword );
-void _ReadWriteBarrier (void);
-
-#pragma intrinsic(_inp)
-#pragma intrinsic(_inpw)
-#pragma intrinsic(_inpd)
-#pragma intrinsic(_outp)
-#pragma intrinsic(_outpw)
-#pragma intrinsic(_outpd)
-#pragma intrinsic(_ReadWriteBarrier)
-
-//
-// _ReadWriteBarrier() forces memory reads and writes to complete at the point
-// in the call. This is only a hint to the compiler and does emit code.
-// In past versions of the compiler, _ReadWriteBarrier was enforced only
-// locally and did not affect functions up the call tree. In Visual C++
-// 2005, _ReadWriteBarrier is enforced all the way up the call tree.
-//
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoRead8 (
- IN UINTN Port
- )
-{
- UINT8 Value;
-
- _ReadWriteBarrier ();
- Value = (UINT8)_inp ((UINT16)Port);
- _ReadWriteBarrier ();
- return Value;
-}
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- )
-{
- _ReadWriteBarrier ();
- (UINT8)_outp ((UINT16)Port, Value);
- _ReadWriteBarrier ();
- return Value;
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoRead16 (
- IN UINTN Port
- )
-{
- UINT16 Value;
-
- ASSERT ((Port & 1) == 0);
- _ReadWriteBarrier ();
- Value = _inpw ((UINT16)Port);
- _ReadWriteBarrier ();
- return Value;
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- )
-{
- ASSERT ((Port & 1) == 0);
- _ReadWriteBarrier ();
- _outpw ((UINT16)Port, Value);
- _ReadWriteBarrier ();
- return Value;
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoRead32 (
- IN UINTN Port
- )
-{
- UINT32 Value;
-
- ASSERT ((Port & 3) == 0);
- _ReadWriteBarrier ();
- Value = _inpd ((UINT16)Port);
- _ReadWriteBarrier ();
- return Value;
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If Port is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- )
-{
- ASSERT ((Port & 3) == 0);
- _ReadWriteBarrier ();
- _outpd ((UINT16)Port, Value);
- _ReadWriteBarrier ();
- return Value;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm
deleted file mode 100644
index 27c97d2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifo.nasm
+++ /dev/null
@@ -1,126 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights reserved.
-;
-; This program and the accompanying materials are licensed and made available
-; under the terms and conditions of the BSD License which accompanies this
-; distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo8 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; OUT VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo8)
-ASM_PFX(IoReadFifo8):
- cld
- xchg rcx, rdx
- xchg rdi, r8 ; rdi: buffer address; r8: save rdi
-rep insb
- mov rdi, r8 ; restore rdi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo16 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; OUT VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo16)
-ASM_PFX(IoReadFifo16):
- cld
- xchg rcx, rdx
- xchg rdi, r8 ; rdi: buffer address; r8: save rdi
-rep insw
- mov rdi, r8 ; restore rdi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo32 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; OUT VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo32)
-ASM_PFX(IoReadFifo32):
- cld
- xchg rcx, rdx
- xchg rdi, r8 ; rdi: buffer address; r8: save rdi
-rep insd
- mov rdi, r8 ; restore rdi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo8 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; IN VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo8)
-ASM_PFX(IoWriteFifo8):
- cld
- xchg rcx, rdx
- xchg rsi, r8 ; rsi: buffer address; r8: save rsi
-rep outsb
- mov rsi, r8 ; restore rsi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo16 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; IN VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo16)
-ASM_PFX(IoWriteFifo16):
- cld
- xchg rcx, rdx
- xchg rsi, r8 ; rsi: buffer address; r8: save rsi
-rep outsw
- mov rsi, r8 ; restore rsi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo32 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; IN VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo32)
-ASM_PFX(IoWriteFifo32):
- cld
- xchg rcx, rdx
- xchg rsi, r8 ; rsi: buffer address; r8: save rsi
-rep outsd
- mov rsi, r8 ; restore rsi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifoSev.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifoSev.nasm
deleted file mode 100644
index 03337e0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseIoLibIntrinsic/X64/IoFifoSev.nasm
+++ /dev/null
@@ -1,288 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-; Copyright (c) 2017, AMD Incorporated. All rights reserved.
-;
-; This program and the accompanying materials are licensed and made available
-; under the terms and conditions of the BSD License which accompanies this
-; distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; Check whether we need to unroll the String I/O in SEV guest
-;
-; Return // eax (1 - unroll, 0 - no unroll)
-;------------------------------------------------------------------------------
-global ASM_PFX(SevNoRepIo)
-ASM_PFX(SevNoRepIo):
-
- ; CPUID clobbers ebx, ecx and edx
- push rbx
- push rcx
- push rdx
-
- ; Check if we are runing under hypervisor
- ; CPUID(1).ECX Bit 31
- mov eax, 1
- cpuid
- bt ecx, 31
- jnc @UseRepIo
-
- ; Check if we have Memory encryption CPUID leaf
- mov eax, 0x80000000
- cpuid
- cmp eax, 0x8000001f
- jl @UseRepIo
-
- ; Check for memory encryption feature:
- ; CPUID Fn8000_001F[EAX] - Bit 1
- ;
- mov eax, 0x8000001f
- cpuid
- bt eax, 1
- jnc @UseRepIo
-
- ; Check if memory encryption is enabled
- ; MSR_0xC0010131 - Bit 0 (SEV enabled)
- ; MSR_0xC0010131 - Bit 1 (SEV-ES enabled)
- mov ecx, 0xc0010131
- rdmsr
-
- ; Check for (SevEsEnabled == 0 && SevEnabled == 1)
- and eax, 3
- cmp eax, 1
- je @SevNoRepIo_Done
-
-@UseRepIo:
- xor eax, eax
-
-@SevNoRepIo_Done:
- pop rdx
- pop rcx
- pop rbx
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo8 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; OUT VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo8)
-ASM_PFX(IoReadFifo8):
- xchg rcx, rdx
- xchg rdi, r8 ; rdi: buffer address; r8: save rdi
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoReadFifo8_NoRep
-
- cld
- rep insb
- jmp @IoReadFifo8_Done
-
-@IoReadFifo8_NoRep:
- jrcxz @IoReadFifo8_Done
-
-@IoReadFifo8_Loop:
- in al, dx
- mov byte [rdi], al
- inc rdi
- loop @IoReadFifo8_Loop
-
-@IoReadFifo8_Done:
- mov rdi, r8 ; restore rdi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo16 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; OUT VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo16)
-ASM_PFX(IoReadFifo16):
- xchg rcx, rdx
- xchg rdi, r8 ; rdi: buffer address; r8: save rdi
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoReadFifo16_NoRep
-
- cld
- rep insw
- jmp @IoReadFifo16_Done
-
-@IoReadFifo16_NoRep:
- jrcxz @IoReadFifo16_Done
-
-@IoReadFifo16_Loop:
- in ax, dx
- mov word [rdi], ax
- add rdi, 2
- loop @IoReadFifo16_Loop
-
-@IoReadFifo16_Done:
- mov rdi, r8 ; restore rdi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoReadFifo32 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; OUT VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoReadFifo32)
-ASM_PFX(IoReadFifo32):
- xchg rcx, rdx
- xchg rdi, r8 ; rdi: buffer address; r8: save rdi
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoReadFifo32_NoRep
-
- cld
- rep insd
- jmp @IoReadFifo32_Done
-
-@IoReadFifo32_NoRep:
- jrcxz @IoReadFifo32_Done
-
-@IoReadFifo32_Loop:
- in eax, dx
- mov dword [rdi], eax
- add rdi, 4
- loop @IoReadFifo32_Loop
-
-@IoReadFifo32_Done:
- mov rdi, r8 ; restore rdi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo8 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; IN VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo8)
-ASM_PFX(IoWriteFifo8):
- xchg rcx, rdx
- xchg rsi, r8 ; rsi: buffer address; r8: save rsi
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoWriteFifo8_NoRep
-
- cld
- rep outsb
- jmp @IoWriteFifo8_Done
-
-@IoWriteFifo8_NoRep:
- jrcxz @IoWriteFifo8_Done
-
-@IoWriteFifo8_Loop:
- mov al, byte [rsi]
- out dx, al
- inc rsi
- loop @IoWriteFifo8_Loop
-
-@IoWriteFifo8_Done:
- mov rsi, r8 ; restore rsi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo16 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; IN VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo16)
-ASM_PFX(IoWriteFifo16):
- xchg rcx, rdx
- xchg rsi, r8 ; rsi: buffer address; r8: save rsi
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoWriteFifo16_NoRep
-
- cld
- rep outsw
- jmp @IoWriteFifo16_Done
-
-@IoWriteFifo16_NoRep:
- jrcxz @IoWriteFifo16_Done
-
-@IoWriteFifo16_Loop:
- mov ax, word [rsi]
- out dx, ax
- add rsi, 2
- loop @IoWriteFifo16_Loop
-
-@IoWriteFifo16_Done:
- mov rsi, r8 ; restore rsi
- ret
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; IoWriteFifo32 (
-; IN UINTN Port, // rcx
-; IN UINTN Size, // rdx
-; IN VOID *Buffer // r8
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(IoWriteFifo32)
-ASM_PFX(IoWriteFifo32):
- xchg rcx, rdx
- xchg rsi, r8 ; rsi: buffer address; r8: save rsi
-
- ; Check if we need to unroll String I/O
- call ASM_PFX(SevNoRepIo)
- test eax, eax
- jnz @IoWriteFifo32_NoRep
-
- cld
- rep outsd
- jmp @IoWriteFifo32_Done
-
-@IoWriteFifo32_NoRep:
- jrcxz @IoWriteFifo32_Done
-
-@IoWriteFifo32_Loop:
- mov eax, dword [rsi]
- out dx, eax
- add rsi, 4
- loop @IoWriteFifo32_Loop
-
-@IoWriteFifo32_Done:
- mov rsi, r8 ; restore rsi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.S
deleted file mode 100644
index 68bc055..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# CpuBreakpoint() for AArch64
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT(CpuBreakpoint)
-
-#/**
-# Generates a breakpoint on the CPU.
-#
-# Generates a breakpoint on the CPU. The breakpoint must be implemented such
-# that code can resume normal execution after the breakpoint.
-#
-#**/
-#VOID
-#EFIAPI
-#CpuBreakpoint (
-# VOID
-# );
-#
-ASM_PFX(CpuBreakpoint):
- svc 0xdbdb // Superviser exception. Takes 16bit arg -> Armv7 had 'swi' here.
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.asm
deleted file mode 100644
index fc4c720..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; CpuBreakpoint() for AArch64
-;
-; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
-
- EXPORT CpuBreakpoint
- AREA BaseLib_LowLevel, CODE, READONLY
-
-;/**
-; Generates a breakpoint on the CPU.
-;
-; Generates a breakpoint on the CPU. The breakpoint must be implemented such
-; that code can resume normal execution after the breakpoint.
-;
-;**/
-;VOID
-;EFIAPI
-;CpuBreakpoint (
-; VOID
-; );
-;
-CpuBreakpoint
- svc 0xdbdb // Superviser exception. Takes 16bit arg -> Armv7 had 'swi' here.
- ret
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/DisableInterrupts.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/DisableInterrupts.S
deleted file mode 100644
index 9d67d07..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/DisableInterrupts.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# DisableInterrupts() for AArch64
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT(DisableInterrupts)
-
-.set DAIF_WR_IRQ_BIT, (1 << 1)
-
-#/**
-# Disables CPU interrupts.
-#
-#**/
-#VOID
-#EFIAPI
-#DisableInterrupts (
-# VOID
-# );
-#
-ASM_PFX(DisableInterrupts):
- msr daifset, #DAIF_WR_IRQ_BIT
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm
deleted file mode 100644
index 90ddde5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/DisableInterrupts.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; DisableInterrupts() for AArch64
-;
-; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT DisableInterrupts
- AREA BaseLib_LowLevel, CODE, READONLY
-
-DAIF_WR_IRQ_BIT EQU (1 << 1)
-
-;/**
-; Disables CPU interrupts.
-;
-;**/
-;VOID
-;EFIAPI
-;DisableInterrupts (
-; VOID
-; );
-;
-DisableInterrupts
- msr daifset, #DAIF_WR_IRQ_BIT
- ret
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/EnableInterrupts.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/EnableInterrupts.S
deleted file mode 100644
index 14915ed..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/EnableInterrupts.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# EnableInterrupts() for AArch64
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT(EnableInterrupts)
-
-.set DAIF_WR_IRQ_BIT, (1 << 1)
-
-#/**
-# Enables CPU interrupts.
-#
-#**/
-#VOID
-#EFIAPI
-#EnableInterrupts (
-# VOID
-# );
-#
-ASM_PFX(EnableInterrupts):
- msr daifclr, #DAIF_WR_IRQ_BIT
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm
deleted file mode 100644
index 18b7c92..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/EnableInterrupts.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; EnableInterrupts() for AArch64
-;
-; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT EnableInterrupts
- AREA BaseLib_LowLevel, CODE, READONLY
-
-DAIF_WR_IRQ_BIT EQU (1 << 1)
-
-;/**
-; Enables CPU interrupts.
-;
-;**/
-;VOID
-;EFIAPI
-;EnableInterrupts (
-; VOID
-; );
-;
-EnableInterrupts
- msr daifclr, #DAIF_WR_IRQ_BIT
- ret
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/GetInterruptsState.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/GetInterruptsState.S
deleted file mode 100644
index 1818c62..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/GetInterruptsState.S
+++ /dev/null
@@ -1,45 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# GetInterruptState() function for AArch64
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT(GetInterruptState)
-
-.set DAIF_RD_IRQ_BIT, (1 << 7)
-
-#/**
-# Retrieves the current CPU interrupt state.
-#
-# Returns TRUE is interrupts are currently enabled. Otherwise
-# returns FALSE.
-#
-# @retval TRUE CPU interrupts are enabled.
-# @retval FALSE CPU interrupts are disabled.
-#
-#**/
-#
-#BOOLEAN
-#EFIAPI
-#GetInterruptState (
-# VOID
-# );
-#
-ASM_PFX(GetInterruptState):
- mrs x0, daif
- tst x0, #DAIF_RD_IRQ_BIT // Check IRQ mask; set Z=1 if clear/unmasked
- cset w0, eq // if Z=1 (eq) return 1, else 0
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm
deleted file mode 100644
index eff4036..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/GetInterruptsState.asm
+++ /dev/null
@@ -1,49 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; GetInterruptState() function for AArch64
-;
-; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT GetInterruptState
- AREA BaseLib_LowLevel, CODE, READONLY
-
-DAIF_RD_IRQ_BIT EQU (1 << 7)
-
-;/**
-; Retrieves the current CPU interrupt state.
-;
-; Returns TRUE is interrupts are currently enabled. Otherwise
-; returns FALSE.
-;
-; @retval TRUE CPU interrupts are enabled.
-; @retval FALSE CPU interrupts are disabled.
-;
-;**/
-;
-;BOOLEAN
-;EFIAPI
-;GetInterruptState (
-; VOID
-; );
-;
-GetInterruptState
- mrs x0, daif
- mov w0, wzr
- tst x0, #DAIF_RD_IRQ_BIT // Check IRQ mask; set Z=1 if clear/unmasked
- bne exit // if Z=1 (eq) return 1, else 0
- mov w0, #1
-exit
- ret
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/MemoryFence.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/MemoryFence.S
deleted file mode 100644
index 8dbd54a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/MemoryFence.S
+++ /dev/null
@@ -1,39 +0,0 @@
-##------------------------------------------------------------------------------
-#
-# MemoryFence() for AArch64
-#
-# Copyright (c) 2013, ARM Ltd. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##------------------------------------------------------------------------------
-
-.text
-.p2align 2
-
-GCC_ASM_EXPORT(MemoryFence)
-
-
-#/**
-# Used to serialize load and store operations.
-#
-# All loads and stores that proceed calls to this function are guaranteed to be
-# globally visible when this function returns.
-#
-#**/
-#VOID
-#EFIAPI
-#MemoryFence (
-# VOID
-# );
-#
-ASM_PFX(MemoryFence):
- // System wide Data Memory Barrier.
- dmb sy
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/MemoryFence.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/MemoryFence.asm
deleted file mode 100644
index 91bd0c8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/MemoryFence.asm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; MemoryFence() for AArch64
-;
-; Copyright (c) 2013, ARM Ltd. All rights reserved.
-;
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT MemoryFence
- AREA BaseLib_LowLevel, CODE, READONLY
-
-;/**
-; Used to serialize load and store operations.
-;
-; All loads and stores that proceed calls to this function are guaranteed to be
-; globally visible when this function returns.
-;
-;**/
-;VOID
-;EFIAPI
-;MemoryFence (
-; VOID
-; );
-;
-MemoryFence
- // System wide Data Memory Barrier.
- dmb sy
- ret
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S
deleted file mode 100644
index 9fa096e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S
+++ /dev/null
@@ -1,97 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2009-2013, ARM Ltd. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-.text
-.p2align 3
-
-GCC_ASM_EXPORT(SetJump)
-GCC_ASM_EXPORT(InternalLongJump)
-
-#define GPR_LAYOUT \
- REG_PAIR (x19, x20, 0); \
- REG_PAIR (x21, x22, 16); \
- REG_PAIR (x23, x24, 32); \
- REG_PAIR (x25, x26, 48); \
- REG_PAIR (x27, x28, 64); \
- REG_PAIR (x29, x30, 80);/*FP, LR*/ \
- REG_ONE (x16, 96) /*IP0*/
-
-#define FPR_LAYOUT \
- REG_PAIR ( d8, d9, 112); \
- REG_PAIR (d10, d11, 128); \
- REG_PAIR (d12, d13, 144); \
- REG_PAIR (d14, d15, 160);
-
-#/**
-# Saves the current CPU context that can be restored with a call to LongJump() and returns 0.#
-#
-# Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial
-# call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero
-# value to be returned by SetJump().
-#
-# If JumpBuffer is NULL, then ASSERT().
-# For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-#
-# @param JumpBuffer A pointer to CPU context buffer.
-#
-#**/
-#
-#UINTN
-#EFIAPI
-#SetJump (
-# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer // X0
-# );
-#
-ASM_PFX(SetJump):
- mov x16, sp // use IP0 so save SP
-#define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS]
-#define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS]
- GPR_LAYOUT
- FPR_LAYOUT
-#undef REG_PAIR
-#undef REG_ONE
- mov w0, #0
- ret
-
-#/**
-# Restores the CPU context that was saved with SetJump().#
-#
-# Restores the CPU context from the buffer specified by JumpBuffer.
-# This function never returns to the caller.
-# Instead is resumes execution based on the state of JumpBuffer.
-#
-# @param JumpBuffer A pointer to CPU context buffer.
-# @param Value The value to return when the SetJump() context is restored.
-#
-#**/
-#VOID
-#EFIAPI
-#InternalLongJump (
-# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, // X0
-# IN UINTN Value // X1
-# );
-#
-ASM_PFX(InternalLongJump):
-#define REG_PAIR(REG1, REG2, OFFS) ldp REG1, REG2, [x0, OFFS]
-#define REG_ONE(REG1, OFFS) ldr REG1, [x0, OFFS]
- GPR_LAYOUT
- FPR_LAYOUT
-#undef REG_PAIR
-#undef REG_ONE
- mov sp, x16
- cmp w1, #0
- mov w0, #1
- csel w0, w1, w0, ne
- // use br not ret, as ret is guaranteed to mispredict
- br x30
-
-ASM_FUNCTION_REMOVE_IF_UNREFERENCED
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm
deleted file mode 100644
index eec63e7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm
+++ /dev/null
@@ -1,101 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2009-2013, ARM Ltd. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT SetJump
- EXPORT InternalLongJump
- AREA BaseLib_LowLevel, CODE, READONLY
-
-#define GPR_LAYOUT \
- REG_PAIR (x19, x20, #0); \
- REG_PAIR (x21, x22, #16); \
- REG_PAIR (x23, x24, #32); \
- REG_PAIR (x25, x26, #48); \
- REG_PAIR (x27, x28, #64); \
- REG_PAIR (x29, x30, #80);/*FP, LR*/ \
- REG_ONE (x16, #96) /*IP0*/
-
-#define FPR_LAYOUT \
- REG_PAIR ( d8, d9, #112); \
- REG_PAIR (d10, d11, #128); \
- REG_PAIR (d12, d13, #144); \
- REG_PAIR (d14, d15, #160);
-
-;/**
-; Saves the current CPU context that can be restored with a call to LongJump() and returns 0.#
-;
-; Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial
-; call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero
-; value to be returned by SetJump().
-;
-; If JumpBuffer is NULL, then ASSERT().
-; For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-;
-; @param JumpBuffer A pointer to CPU context buffer.
-;
-;**/
-;
-;UINTN
-;EFIAPI
-;SetJump (
-; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer // X0
-; );
-;
-SetJump
- mov x16, sp // use IP0 so save SP
-#define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS]
-#define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS]
- GPR_LAYOUT
- FPR_LAYOUT
-#undef REG_PAIR
-#undef REG_ONE
- mov w0, #0
- ret
-
-;/**
-; Restores the CPU context that was saved with SetJump().#
-;
-; Restores the CPU context from the buffer specified by JumpBuffer.
-; This function never returns to the caller.
-; Instead is resumes execution based on the state of JumpBuffer.
-;
-; @param JumpBuffer A pointer to CPU context buffer.
-; @param Value The value to return when the SetJump() context is restored.
-;
-;**/
-;VOID
-;EFIAPI
-;InternalLongJump (
-; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, // X0
-; IN UINTN Value // X1
-; );
-;
-InternalLongJump
-#define REG_PAIR(REG1, REG2, OFFS) ldp REG1, REG2, [x0, OFFS]
-#define REG_ONE(REG1, OFFS) ldr REG1, [x0, OFFS]
- GPR_LAYOUT
- FPR_LAYOUT
-#undef REG_PAIR
-#undef REG_ONE
- mov sp, x16
- cmp w1, #0
- mov w0, #1
- beq exit
- mov w0, w1
-exit
- // use br not ret, as ret is guaranteed to mispredict
- br x30
-
-ASM_FUNCTION_REMOVE_IF_UNREFERENCED
-
- END
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SpeculationBarrier.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SpeculationBarrier.S
deleted file mode 100644
index c6e9d4d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SpeculationBarrier.S
+++ /dev/null
@@ -1,39 +0,0 @@
-##------------------------------------------------------------------------------
-#
-# SpeculationBarrier() for AArch64
-#
-# Copyright (c) 2019, Linaro Ltd. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##------------------------------------------------------------------------------
-
-.text
-.p2align 2
-
-GCC_ASM_EXPORT(SpeculationBarrier)
-
-
-#/**
-# Uses as a barrier to stop speculative execution.
-#
-# Ensures that no later instruction will execute speculatively, until all prior
-# instructions have completed.
-#
-#**/
-#VOID
-#EFIAPI
-#SpeculationBarrier (
-# VOID
-# );
-#
-ASM_PFX(SpeculationBarrier):
- dsb sy
- isb
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SpeculationBarrier.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SpeculationBarrier.asm
deleted file mode 100644
index 101bb1c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SpeculationBarrier.asm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; SpeculationBarrier() for AArch64
-;
-; Copyright (c) 2019, Linaro Ltd. All rights reserved.
-;
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT SpeculationBarrier
- AREA BaseLib_LowLevel, CODE, READONLY
-
-;/**
-; Uses as a barrier to stop speculative execution.
-;
-; Ensures that no later instruction will execute speculatively, until all prior
-; instructions have completed.
-;
-;**/
-;VOID
-;EFIAPI
-;SpeculationBarrier (
-; VOID
-; );
-;
-SpeculationBarrier
- dsb sy
- isb
- ret
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SwitchStack.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SwitchStack.S
deleted file mode 100644
index ea22ac9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SwitchStack.S
+++ /dev/null
@@ -1,71 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Portions copyright (c) 2011 - 2013, ARM Limited. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.align 5
-
-GCC_ASM_EXPORT(InternalSwitchStackAsm)
-GCC_ASM_EXPORT(CpuPause)
-
-#/**
-#
-# This allows the caller to switch the stack and goes to the new entry point
-#
-# @param EntryPoint The pointer to the location to enter
-# @param Context Parameter to pass in
-# @param Context2 Parameter2 to pass in
-# @param NewStack New Location of the stack
-#
-# @return Nothing. Goes to the Entry Point passing in the new parameters
-#
-#**/
-#VOID
-#EFIAPI
-#InternalSwitchStackAsm (
-# SWITCH_STACK_ENTRY_POINT EntryPoint,
-# VOID *Context,
-# VOID *Context2,
-# VOID *NewStack
-# );
-#
-ASM_PFX(InternalSwitchStackAsm):
- mov x29, #0
- mov x30, x0
- mov sp, x3
- mov x0, x1
- mov x1, x2
- ret
-
-#/**
-#
-# Requests CPU to pause for a short period of time.
-#
-# Requests CPU to pause for a short period of time. Typically used in MP
-# systems to prevent memory starvation while waiting for a spin lock.
-#
-#**/
-#VOID
-#EFIAPI
-#CpuPause (
-# VOID
-# )
-#
-ASM_PFX(CpuPause):
- nop
- nop
- nop
- nop
- nop
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SwitchStack.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SwitchStack.asm
deleted file mode 100644
index b97ffae..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/AArch64/SwitchStack.asm
+++ /dev/null
@@ -1,71 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; Portions copyright (c) 2011 - 2013, ARM Limited. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT InternalSwitchStackAsm
- EXPORT CpuPause
- AREA BaseLib_LowLevel, CODE, READONLY
-
-;/**
-;
-; This allows the caller to switch the stack and goes to the new entry point
-;
-; @param EntryPoint The pointer to the location to enter
-; @param Context Parameter to pass in
-; @param Context2 Parameter2 to pass in
-; @param NewStack New Location of the stack
-;
-; @return Nothing. Goes to the Entry Point passing in the new parameters
-;
-;**/
-;VOID
-;EFIAPI
-;InternalSwitchStackAsm (
-; SWITCH_STACK_ENTRY_POINT EntryPoint,
-; VOID *Context,
-; VOID *Context2,
-; VOID *NewStack
-; );
-;
-InternalSwitchStackAsm
- mov x29, #0
- mov x30, x0
- mov sp, x3
- mov x0, x1
- mov x1, x2
- ret
-
-;/**
-;
-; Requests CPU to pause for a short period of time.
-;
-; Requests CPU to pause for a short period of time. Typically used in MP
-; systems to prevent memory starvation while waiting for a spin lock.
-;
-;**/
-;VOID
-;EFIAPI
-;CpuPause (
-; VOID
-; )
-;
-CpuPause
- nop
- nop
- nop
- nop
- nop
- ret
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/ARShiftU64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/ARShiftU64.c
deleted file mode 100644
index be33df3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/ARShiftU64.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled
- with the original integer's bit 63. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to bit 63 of Operand. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-ARShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < 64);
- return InternalMathARShiftU64 (Operand, Count);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.S
deleted file mode 100644
index 977ec98..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# CpuBreakpoint() for ARM
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT(CpuBreakpoint)
-
-#/**
-# Generates a breakpoint on the CPU.
-#
-# Generates a breakpoint on the CPU. The breakpoint must be implemented such
-# that code can resume normal execution after the breakpoint.
-#
-#**/
-#VOID
-#EFIAPI
-#CpuBreakpoint (
-# VOID
-# );
-#
-ASM_PFX(CpuBreakpoint):
- swi 0xdbdbdb
- bx lr
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm
deleted file mode 100644
index 9eceea4..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/CpuBreakpoint.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; CpuBreakpoint() for ARM
-;
-; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT CpuBreakpoint
-
-; Force ARM mode for this section, as MSFT assembler defaults to THUMB
- AREA Cpu_Breakpoint, CODE, READONLY, ARM
-
- ARM
-
-;/**
-; Generates a breakpoint on the CPU.
-;
-; Generates a breakpoint on the CPU. The breakpoint must be implemented such
-; that code can resume normal execution after the breakpoint.
-;
-;**/
-;VOID
-;EFIAPI
-;CpuBreakpoint (
-; VOID
-; );
-;
-CpuBreakpoint
- swi 0xdbdbdb
- bx lr
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/CpuPause.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/CpuPause.asm
deleted file mode 100644
index 97c2944..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/CpuPause.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; CpuPause() for ARM
-;
-; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT CpuPause
- AREA cpu_pause, CODE, READONLY
-
-;/**
-; Requests CPU to pause for a short period of time.
-;
-; Requests CPU to pause for a short period of time. Typically used in MP
-; systems to prevent memory starvation while waiting for a spin lock.
-;
-;**/
-;VOID
-;EFIAPI
-;CpuPause (
-; VOID
-; );
-;
-CpuPause
- NOP
- NOP
- NOP
- NOP
- NOP
- BX LR
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/DisableInterrupts.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/DisableInterrupts.S
deleted file mode 100644
index 93e427c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/DisableInterrupts.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# DisableInterrupts() for ARM
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT(DisableInterrupts)
-
-#/**
-# Disables CPU interrupts.
-#
-#**/
-#VOID
-#EFIAPI
-#DisableInterrupts (
-# VOID
-# );
-#
-ASM_PFX(DisableInterrupts):
- mrs R0,CPSR
- orr R0,R0,#0x80 @Disable IRQ interrupts
- msr CPSR_c,R0
- bx LR
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/DisableInterrupts.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/DisableInterrupts.asm
deleted file mode 100644
index 728c98b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/DisableInterrupts.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; DisableInterrupts() for ARM
-;
-; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT DisableInterrupts
-
- AREA Interrupt_disable, CODE, READONLY
-
-;/**
-; Disables CPU interrupts.
-;
-;**/
-;VOID
-;EFIAPI
-;DisableInterrupts (
-; VOID
-; );
-;
-DisableInterrupts
- MRS R0,CPSR
- ORR R0,R0,#0x80 ;Disable IRQ interrupts
- MSR CPSR_c,R0
- BX LR
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/EnableInterrupts.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/EnableInterrupts.S
deleted file mode 100644
index 56e4f77..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/EnableInterrupts.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# EnableInterrupts() for ARM
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT(EnableInterrupts)
-
-
-#/**
-# Enables CPU interrupts.
-#
-#**/
-#VOID
-#EFIAPI
-#EnableInterrupts (
-# VOID
-# );
-#
-ASM_PFX(EnableInterrupts):
- mrs R0,CPSR
- bic R0,R0,#0x80 @Enable IRQ interrupts
- msr CPSR_c,R0
- bx LR
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/EnableInterrupts.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/EnableInterrupts.asm
deleted file mode 100644
index e1c3a6f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/EnableInterrupts.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; EnableInterrupts() for ARM
-;
-; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT EnableInterrupts
-
- AREA Interrupt_enable, CODE, READONLY
-
-;/**
-; Enables CPU interrupts.
-;
-;**/
-;VOID
-;EFIAPI
-;EnableInterrupts (
-; VOID
-; );
-;
-EnableInterrupts
- MRS R0,CPSR
- BIC R0,R0,#0x80 ;Enable IRQ interrupts
- MSR CPSR_c,R0
- BX LR
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/GetInterruptsState.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/GetInterruptsState.S
deleted file mode 100644
index cef88f1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/GetInterruptsState.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# GetInterruptState() function for ARM
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
-.text
-.p2align 2
-GCC_ASM_EXPORT (GetInterruptState)
-
-#/**
-# Retrieves the current CPU interrupt state.
-#
-# Returns TRUE is interrupts are currently enabled. Otherwise
-# returns FALSE.
-#
-# @retval TRUE CPU interrupts are enabled.
-# @retval FALSE CPU interrupts are disabled.
-#
-#**/
-#
-#BOOLEAN
-#EFIAPI
-#GetInterruptState (
-# VOID
-# );
-#
-ASM_PFX(GetInterruptState):
- mrs R0, CPSR
- tst R0, #0x80 @Check if IRQ is enabled.
- moveq R0, #1
- movne R0, #0
- bx LR
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/GetInterruptsState.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/GetInterruptsState.asm
deleted file mode 100644
index a9bf83b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/GetInterruptsState.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; GetInterruptState() function for ARM
-;
-; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT GetInterruptState
-
- AREA Interrupt_enable, CODE, READONLY
-
-;/**
-; Retrieves the current CPU interrupt state.
-;
-; Returns TRUE is interrupts are currently enabled. Otherwise
-; returns FALSE.
-;
-; @retval TRUE CPU interrupts are enabled.
-; @retval FALSE CPU interrupts are disabled.
-;
-;**/
-;
-;BOOLEAN
-;EFIAPI
-;GetInterruptState (
-; VOID
-; );
-;
-GetInterruptState
- MRS R0, CPSR
- TST R0, #0x80 ;Check if IRQ is enabled.
- MOVEQ R0, #1
- MOVNE R0, #0
- BX LR
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/InternalSwitchStack.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/InternalSwitchStack.c
deleted file mode 100644
index c731731..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/InternalSwitchStack.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/** @file
- SwitchStack() function for ARM.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Transfers control to a function starting with a new stack.
-
- This internal worker function transfers control to the function
- specified by EntryPoint using the new stack specified by NewStack,
- and passes in the parameters specified by Context1 and Context2.
- Context1 and Context2 are optional and may be NULL.
- The function EntryPoint must never return.
-
- @param EntryPoint The pointer to the function to enter.
- @param Context1 The first parameter to pass in.
- @param Context2 The second Parameter to pass in
- @param NewStack The new Location of the stack
-
-**/
-VOID
-EFIAPI
-InternalSwitchStackAsm (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- );
-
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the
- new stack specified by NewStack, and passes in the parameters specified
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return.
- Marker will be ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param Marker A VA_LIST marker for the variable argument list.
-
-**/
-VOID
-EFIAPI
-InternalSwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VA_LIST Marker
- )
-
-{
- InternalSwitchStackAsm (EntryPoint, Context1, Context2, NewStack);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/Math64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/Math64.S
deleted file mode 100644
index 632f050..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/Math64.S
+++ /dev/null
@@ -1,269 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Replacement for Math64.c that is coded to use older GCC intrinsics.
-# Doing this reduces the number of intrinsics that are required when
-# you port to a new version of gcc.
-#
-# Need to split this into multple files to size optimize the image.
-#
-# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
- .text
- .align 2
- GCC_ASM_EXPORT(InternalMathLShiftU64)
-
-ASM_PFX(InternalMathLShiftU64):
- stmfd sp!, {r4, r5, r6}
- mov r6, r1
- rsb ip, r2, #32
- mov r4, r6, asl r2
- subs r1, r2, #32
- orr r4, r4, r0, lsr ip
- mov r3, r0, asl r2
- movpl r4, r0, asl r1
- mov r5, r0
- mov r0, r3
- mov r1, r4
- ldmfd sp!, {r4, r5, r6}
- bx lr
-
- .align 2
- GCC_ASM_EXPORT(InternalMathRShiftU64)
-
-ASM_PFX(InternalMathRShiftU64):
- stmfd sp!, {r4, r5, r6}
- mov r5, r0
- rsb ip, r2, #32
- mov r3, r5, lsr r2
- subs r0, r2, #32
- orr r3, r3, r1, asl ip
- mov r4, r1, lsr r2
- movpl r3, r1, lsr r0
- mov r6, r1
- mov r0, r3
- mov r1, r4
- ldmfd sp!, {r4, r5, r6}
- bx lr
-
- .align 2
- GCC_ASM_EXPORT(InternalMathARShiftU64)
-
-ASM_PFX(InternalMathARShiftU64):
- stmfd sp!, {r4, r5, r6}
- mov r5, r0
- rsb ip, r2, #32
- mov r3, r5, lsr r2
- subs r0, r2, #32
- orr r3, r3, r1, asl ip
- mov r4, r1, asr r2
- movpl r3, r1, asr r0
- mov r6, r1
- mov r0, r3
- mov r1, r4
- ldmfd sp!, {r4, r5, r6}
- bx lr
-
- .align 2
- GCC_ASM_EXPORT(InternalMathLRotU64)
-
-ASM_PFX(InternalMathLRotU64):
- stmfd sp!, {r4, r5, r6, r7, lr}
- add r7, sp, #12
- mov r6, r1
- rsb ip, r2, #32
- mov r4, r6, asl r2
- rsb lr, r2, #64
- subs r1, r2, #32
- orr r4, r4, r0, lsr ip
- mov r3, r0, asl r2
- movpl r4, r0, asl r1
- sub ip, r2, #32
- mov r5, r0
- mov r0, r0, lsr lr
- rsbs r2, r2, #32
- orr r0, r0, r6, asl ip
- mov r1, r6, lsr lr
- movpl r0, r6, lsr r2
- orr r1, r1, r4
- orr r0, r0, r3
- ldmfd sp!, {r4, r5, r6, r7, pc}
-
-
- .align 2
- GCC_ASM_EXPORT(InternalMathRRotU64)
-
-ASM_PFX(InternalMathRRotU64):
- stmfd sp!, {r4, r5, r6, r7, lr}
- add r7, sp, #12
- mov r5, r0
- rsb ip, r2, #32
- mov r3, r5, lsr r2
- rsb lr, r2, #64
- subs r0, r2, #32
- orr r3, r3, r1, asl ip
- mov r4, r1, lsr r2
- movpl r3, r1, lsr r0
- sub ip, r2, #32
- mov r6, r1
- mov r1, r1, asl lr
- rsbs r2, r2, #32
- orr r1, r1, r5, lsr ip
- mov r0, r5, asl lr
- movpl r1, r5, asl r2
- orr r0, r0, r3
- orr r1, r1, r4
- ldmfd sp!, {r4, r5, r6, r7, pc}
-
- .align 2
- GCC_ASM_EXPORT(InternalMathMultU64x32)
-
-ASM_PFX(InternalMathMultU64x32):
- stmfd sp!, {r7, lr}
- add r7, sp, #0
- mov r3, #0
- mov ip, r0
- mov lr, r1
- umull r0, r1, ip, r2
- mla r1, lr, r2, r1
- mla r1, ip, r3, r1
- ldmfd sp!, {r7, pc}
-
- .align 2
- GCC_ASM_EXPORT(InternalMathMultU64x64)
-
-ASM_PFX(InternalMathMultU64x64):
- stmfd sp!, {r7, lr}
- add r7, sp, #0
- mov ip, r0
- mov lr, r1
- umull r0, r1, ip, r2
- mla r1, lr, r2, r1
- mla r1, ip, r3, r1
- ldmfd sp!, {r7, pc}
-
- .align 2
- GCC_ASM_EXPORT(InternalMathDivU64x32)
-
-ASM_PFX(InternalMathDivU64x32):
- stmfd sp!, {r7, lr}
- add r7, sp, #0
- mov r3, #0
- bl ASM_PFX(__udivdi3)
- ldmfd sp!, {r7, pc}
-
-
- .align 2
- GCC_ASM_EXPORT(InternalMathModU64x32)
-
-ASM_PFX(InternalMathModU64x32):
- stmfd sp!, {r7, lr}
- add r7, sp, #0
- mov r3, #0
- bl ASM_PFX(__umoddi3)
- ldmfd sp!, {r7, pc}
-
-
- .align 2
- GCC_ASM_EXPORT(InternalMathDivRemU64x32)
-
-ASM_PFX(InternalMathDivRemU64x32):
- stmfd sp!, {r4, r5, r6, r7, lr}
- add r7, sp, #12
- stmfd sp!, {r10, r11}
- subs r6, r3, #0
- mov r10, r0
- mov r11, r1
- moveq r4, r2
- moveq r5, #0
- beq L22
- mov r4, r2
- mov r5, #0
- mov r3, #0
- bl ASM_PFX(__umoddi3)
- str r0, [r6, #0]
-L22:
- mov r0, r10
- mov r1, r11
- mov r2, r4
- mov r3, r5
- bl ASM_PFX(__udivdi3)
- ldmfd sp!, {r10, r11}
- ldmfd sp!, {r4, r5, r6, r7, pc}
-
-
- .align 2
- GCC_ASM_EXPORT(InternalMathDivRemU64x64)
-
-ASM_PFX(InternalMathDivRemU64x64):
- stmfd sp!, {r4, r5, r6, r7, lr}
- add r7, sp, #12
- stmfd sp!, {r10, r11}
- ldr r6, [sp, #28]
- mov r4, r0
- cmp r6, #0
- mov r5, r1
- mov r10, r2
- mov r11, r3
- beq L26
- bl ASM_PFX(__umoddi3)
- stmia r6, {r0-r1}
-L26:
- mov r0, r4
- mov r1, r5
- mov r2, r10
- mov r3, r11
- bl ASM_PFX(__udivdi3)
- ldmfd sp!, {r10, r11}
- ldmfd sp!, {r4, r5, r6, r7, pc}
-
-
- .align 2
- GCC_ASM_EXPORT(InternalMathDivRemS64x64)
-
-ASM_PFX(InternalMathDivRemS64x64):
- stmfd sp!, {r4, r5, r6, r7, lr}
- add r7, sp, #12
- stmfd sp!, {r10, r11}
- ldr r6, [sp, #28]
- mov r4, r0
- cmp r6, #0
- mov r5, r1
- mov r10, r2
- mov r11, r3
- beq L30
- bl ASM_PFX(__moddi3)
- stmia r6, {r0-r1}
-L30:
- mov r0, r4
- mov r1, r5
- mov r2, r10
- mov r3, r11
- bl ASM_PFX(__divdi3)
- ldmfd sp!, {r10, r11}
- ldmfd sp!, {r4, r5, r6, r7, pc}
-
-
- .align 2
- GCC_ASM_EXPORT(InternalMathSwapBytes64)
-
-ASM_PFX(InternalMathSwapBytes64):
- stmfd sp!, {r4, r5, r7, lr}
- mov r5, r1
- bl ASM_PFX(SwapBytes32)
- mov r4, r0
- mov r0, r5
- bl ASM_PFX(SwapBytes32)
- mov r1, r4
- ldmfd sp!, {r4, r5, r7, pc}
-
-
-ASM_FUNCTION_REMOVE_IF_UNREFERENCED
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.S
deleted file mode 100644
index 2208dd3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.S
+++ /dev/null
@@ -1,39 +0,0 @@
-##------------------------------------------------------------------------------
-#
-# MemoryFence() for AArch64
-#
-# Copyright (c) 2013, ARM Ltd. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##------------------------------------------------------------------------------
-
-.text
-.p2align 2
-
-GCC_ASM_EXPORT(MemoryFence)
-
-
-#/**
-# Used to serialize load and store operations.
-#
-# All loads and stores that proceed calls to this function are guaranteed to be
-# globally visible when this function returns.
-#
-#**/
-#VOID
-#EFIAPI
-#MemoryFence (
-# VOID
-# );
-#
-ASM_PFX(MemoryFence):
- // System wide Data Memory Barrier.
- dmb
- bx lr
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.asm
deleted file mode 100644
index f1bc4eb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; MemoryFence() for AArch64
-;
-; Copyright (c) 2013, ARM Ltd. All rights reserved.
-;
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT MemoryFence
-
- AREA MemoryBarriers, CODE, READONLY
-
-;/**
-; Used to serialize load and store operations.
-;
-; All loads and stores that proceed calls to this function are guaranteed to be
-; globally visible when this function returns.
-;
-;**/
-;VOID
-;EFIAPI
-;MemoryFence (
-; VOID
-; );
-;
-MemoryFence FUNCTION
- dmb
- bx lr
- ENDFUNC
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S
deleted file mode 100644
index 78f1ec8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S
+++ /dev/null
@@ -1,70 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-.text
-.p2align 2
-
-GCC_ASM_EXPORT(SetJump)
-GCC_ASM_EXPORT(InternalLongJump)
-
-#/**
-# Saves the current CPU context that can be restored with a call to LongJump() and returns 0.#
-#
-# Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial
-# call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero
-# value to be returned by SetJump().
-#
-# If JumpBuffer is NULL, then ASSERT().
-# For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-#
-# @param JumpBuffer A pointer to CPU context buffer.
-#
-#**/
-#
-#UINTN
-#EFIAPI
-#SetJump (
-# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer // R0
-# );
-#
-ASM_PFX(SetJump):
- mov r3, r13
- stmia r0, {r3-r12,r14}
- eor r0, r0, r0
- bx lr
-
-#/**
-# Restores the CPU context that was saved with SetJump().#
-#
-# Restores the CPU context from the buffer specified by JumpBuffer.
-# This function never returns to the caller.
-# Instead is resumes execution based on the state of JumpBuffer.
-#
-# @param JumpBuffer A pointer to CPU context buffer.
-# @param Value The value to return when the SetJump() context is restored.
-#
-#**/
-#VOID
-#EFIAPI
-#InternalLongJump (
-# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, // R0
-# IN UINTN Value // R1
-# );
-#
-ASM_PFX(InternalLongJump):
- ldmia r0, {r3-r12,r14}
- mov r13, r3
- mov r0, r1
- bx lr
-
-ASM_FUNCTION_REMOVE_IF_UNREFERENCED
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
deleted file mode 100644
index 74c37be..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
+++ /dev/null
@@ -1,70 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT SetJump
- EXPORT InternalLongJump
-
- AREA BaseLib, CODE, READONLY
-
-;/**
-; Saves the current CPU context that can be restored with a call to LongJump() and returns 0.;
-;
-; Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial
-; call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero
-; value to be returned by SetJump().
-;
-; If JumpBuffer is NULL, then ASSERT().
-; For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-;
-; @param JumpBuffer A pointer to CPU context buffer.
-;
-;**/
-;
-;UINTN
-;EFIAPI
-;SetJump (
-; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer // R0
-; )
-;
-SetJump
- MOV R3, R13
- STM R0, {R3-R12,R14}
- EOR R0, R0
- BX LR
-
-;/**
-; Restores the CPU context that was saved with SetJump().;
-;
-; Restores the CPU context from the buffer specified by JumpBuffer.
-; This function never returns to the caller.
-; Instead is resumes execution based on the state of JumpBuffer.
-;
-; @param JumpBuffer A pointer to CPU context buffer.
-; @param Value The value to return when the SetJump() context is restored.
-;
-;**/
-;VOID
-;EFIAPI
-;InternalLongJump (
-; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, // R0
-; IN UINTN Value // R1
-; );
-;
-InternalLongJump
- LDM R0, {R3-R12,R14}
- MOV R13, R3
- MOV R0, R1
- BX LR
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SpeculationBarrier.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SpeculationBarrier.S
deleted file mode 100644
index bebb9ec..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SpeculationBarrier.S
+++ /dev/null
@@ -1,39 +0,0 @@
-##------------------------------------------------------------------------------
-#
-# SpeculationBarrier() for AArch64
-#
-# Copyright (c) 2019, Linaro Ltd. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##------------------------------------------------------------------------------
-
-.text
-.p2align 2
-
-GCC_ASM_EXPORT(SpeculationBarrier)
-
-
-#/**
-# Uses as a barrier to stop speculative execution.
-#
-# Ensures that no later instruction will execute speculatively, until all prior
-# instructions have completed.
-#
-#**/
-#VOID
-#EFIAPI
-#SpeculationBarrier (
-# VOID
-# );
-#
-ASM_PFX(SpeculationBarrier):
- dsb
- isb
- bx lr
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SpeculationBarrier.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SpeculationBarrier.asm
deleted file mode 100644
index 4a4fb90..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SpeculationBarrier.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; SpeculationBarrier() for AArch64
-;
-; Copyright (c) 2019, Linaro Ltd. All rights reserved.
-;
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT SpeculationBarrier
-
- AREA MemoryBarriers, CODE, READONLY
-
-;/**
-; Uses as a barrier to stop speculative execution.
-;
-; Ensures that no later instruction will execute speculatively, until all prior
-; instructions have completed.
-;
-;**/
-;VOID
-;EFIAPI
-;SpeculationBarrier (
-; VOID
-; );
-;
-SpeculationBarrier
- dsb
- isb
- bx lr
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SwitchStack.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SwitchStack.S
deleted file mode 100644
index 71e12b6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SwitchStack.S
+++ /dev/null
@@ -1,68 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-// Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// Portions copyright (c) 2011, ARM Limited. All rights reserved.
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-//------------------------------------------------------------------------------
-
-.text
-.align 5
-
-GCC_ASM_EXPORT(InternalSwitchStackAsm)
-GCC_ASM_EXPORT(CpuPause)
-
-/**
-//
-// This allows the caller to switch the stack and goes to the new entry point
-//
-// @param EntryPoint The pointer to the location to enter
-// @param Context Parameter to pass in
-// @param Context2 Parameter2 to pass in
-// @param NewStack New Location of the stack
-//
-// @return Nothing. Goes to the Entry Point passing in the new parameters
-//
-VOID
-EFIAPI
-InternalSwitchStackAsm (
- SWITCH_STACK_ENTRY_POINT EntryPoint,
- VOID *Context,
- VOID *Context2,
- VOID *NewStack
- );
-**/
-ASM_PFX(InternalSwitchStackAsm):
- MOV LR, R0
- MOV SP, R3
- MOV R0, R1
- MOV R1, R2
- BX LR
-
-/**
-//
-// Requests CPU to pause for a short period of time.
-//
-// Requests CPU to pause for a short period of time. Typically used in MP
-// systems to prevent memory starvation while waiting for a spin lock.
-//
-VOID
-EFIAPI
-CpuPause (
- VOID
- )
-**/
-ASM_PFX(CpuPause):
- nop
- nop
- nop
- nop
- nop
- BX LR
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SwitchStack.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SwitchStack.asm
deleted file mode 100644
index 728a56c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/SwitchStack.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT InternalSwitchStackAsm
-
- AREA Switch_Stack, CODE, READONLY
-
-;/**
-; This allows the caller to switch the stack and goes to the new entry point
-;
-; @param EntryPoint The pointer to the location to enter
-; @param Context Parameter to pass in
-; @param Context2 Parameter2 to pass in
-; @param NewStack New Location of the stack
-;
-; @return Nothing. Goes to the Entry Point passing in the new parameters
-;
-;**/
-;VOID
-;EFIAPI
-;InternalSwitchStackAsm (
-; SWITCH_STACK_ENTRY_POINT EntryPoint,
-; VOID *Context,
-; VOID *Context2,
-; VOID *NewStack
-; );
-;
-InternalSwitchStackAsm
- MOV LR, R0
- MOV SP, R3
- MOV R0, R1
- MOV R1, R2
- BX LR
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/Unaligned.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/Unaligned.c
deleted file mode 100644
index 2593e08..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Arm/Unaligned.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/** @file
- Unaligned access functions of BaseLib for ARM.
-
- volatile was added to work around optimization issues.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Reads a 16-bit value from memory that may be unaligned.
-
- This function returns the 16-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 16-bit value that may be unaligned.
-
- @return The 16-bit value read from Buffer.
-
-**/
-UINT16
-EFIAPI
-ReadUnaligned16 (
- IN CONST UINT16 *Buffer
- )
-{
- volatile UINT8 LowerByte;
- volatile UINT8 HigherByte;
-
- ASSERT (Buffer != NULL);
-
- LowerByte = ((UINT8*)Buffer)[0];
- HigherByte = ((UINT8*)Buffer)[1];
-
- return (UINT16)(LowerByte | (HigherByte << 8));
-}
-
-/**
- Writes a 16-bit value to memory that may be unaligned.
-
- This function writes the 16-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 16-bit value that may be unaligned.
- @param Value 16-bit value to write to Buffer.
-
- @return The 16-bit value to write to Buffer.
-
-**/
-UINT16
-EFIAPI
-WriteUnaligned16 (
- OUT UINT16 *Buffer,
- IN UINT16 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- ((volatile UINT8*)Buffer)[0] = (UINT8)Value;
- ((volatile UINT8*)Buffer)[1] = (UINT8)(Value >> 8);
-
- return Value;
-}
-
-/**
- Reads a 24-bit value from memory that may be unaligned.
-
- This function returns the 24-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 24-bit value that may be unaligned.
-
- @return The 24-bit value read from Buffer.
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned24 (
- IN CONST UINT32 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return (UINT32)(
- ReadUnaligned16 ((UINT16*)Buffer) |
- (((UINT8*)Buffer)[2] << 16)
- );
-}
-
-/**
- Writes a 24-bit value to memory that may be unaligned.
-
- This function writes the 24-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 24-bit value that may be unaligned.
- @param Value 24-bit value to write to Buffer.
-
- @return The 24-bit value to write to Buffer.
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned24 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- WriteUnaligned16 ((UINT16*)Buffer, (UINT16)Value);
- *(UINT8*)((UINT16*)Buffer + 1) = (UINT8)(Value >> 16);
- return Value;
-}
-
-/**
- Reads a 32-bit value from memory that may be unaligned.
-
- This function returns the 32-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 32-bit value that may be unaligned.
-
- @return The 32-bit value read from Buffer.
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned32 (
- IN CONST UINT32 *Buffer
- )
-{
- UINT16 LowerBytes;
- UINT16 HigherBytes;
-
- ASSERT (Buffer != NULL);
-
- LowerBytes = ReadUnaligned16 ((UINT16*) Buffer);
- HigherBytes = ReadUnaligned16 ((UINT16*) Buffer + 1);
-
- return (UINT32) (LowerBytes | (HigherBytes << 16));
-}
-
-/**
- Writes a 32-bit value to memory that may be unaligned.
-
- This function writes the 32-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 32-bit value that may be unaligned.
- @param Value 32-bit value to write to Buffer.
-
- @return The 32-bit value to write to Buffer.
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned32 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- WriteUnaligned16 ((UINT16*)Buffer, (UINT16)Value);
- WriteUnaligned16 ((UINT16*)Buffer + 1, (UINT16)(Value >> 16));
- return Value;
-}
-
-/**
- Reads a 64-bit value from memory that may be unaligned.
-
- This function returns the 64-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 64-bit value that may be unaligned.
-
- @return The 64-bit value read from Buffer.
-
-**/
-UINT64
-EFIAPI
-ReadUnaligned64 (
- IN CONST UINT64 *Buffer
- )
-{
- UINT32 LowerBytes;
- UINT32 HigherBytes;
-
- ASSERT (Buffer != NULL);
-
- LowerBytes = ReadUnaligned32 ((UINT32*) Buffer);
- HigherBytes = ReadUnaligned32 ((UINT32*) Buffer + 1);
-
- return (UINT64) (LowerBytes | LShiftU64 (HigherBytes, 32));
-}
-
-/**
- Writes a 64-bit value to memory that may be unaligned.
-
- This function writes the 64-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer The pointer to a 64-bit value that may be unaligned.
- @param Value 64-bit value to write to Buffer.
-
- @return The 64-bit value to write to Buffer.
-
-**/
-UINT64
-EFIAPI
-WriteUnaligned64 (
- OUT UINT64 *Buffer,
- IN UINT64 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- WriteUnaligned32 ((UINT32*)Buffer, (UINT32)Value);
- WriteUnaligned32 ((UINT32*)Buffer + 1, (UINT32)RShiftU64 (Value, 32));
- return Value;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BaseLib.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BaseLib.inf
deleted file mode 100644
index 0a0d3cd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BaseLib.inf
+++ /dev/null
@@ -1,626 +0,0 @@
-## @file
-# Base Library implementation.
-#
-# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseLib
- MODULE_UNI_FILE = BaseLib.uni
- FILE_GUID = 27d67720-ea68-48ae-93da-a3a074c90e30
- MODULE_TYPE = BASE
- VERSION_STRING = 1.1
- LIBRARY_CLASS = BaseLib
-
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64
-#
-
-[Sources]
- CheckSum.c
- SwitchStack.c
- SwapBytes64.c
- SwapBytes32.c
- SwapBytes16.c
- LongJump.c
- SetJump.c
- RShiftU64.c
- RRotU64.c
- RRotU32.c
- MultU64x64.c
- MultU64x32.c
- MultS64x64.c
- ModU64x32.c
- LShiftU64.c
- LRotU64.c
- LRotU32.c
- LowBitSet64.c
- LowBitSet32.c
- HighBitSet64.c
- HighBitSet32.c
- GetPowerOfTwo64.c
- GetPowerOfTwo32.c
- DivU64x64Remainder.c
- DivU64x32Remainder.c
- DivU64x32.c
- DivS64x64Remainder.c
- ARShiftU64.c
- BitField.c
- CpuDeadLoop.c
- Cpu.c
- LinkedList.c
- SafeString.c
- String.c
- FilePaths.c
- BaseLibInternals.h
-
-[Sources.Ia32]
- Ia32/WriteTr.nasm
- Ia32/Lfence.nasm
-
- Ia32/Wbinvd.c | MSFT
- Ia32/WriteMm7.c | MSFT
- Ia32/WriteMm6.c | MSFT
- Ia32/WriteMm5.c | MSFT
- Ia32/WriteMm4.c | MSFT
- Ia32/WriteMm3.c | MSFT
- Ia32/WriteMm2.c | MSFT
- Ia32/WriteMm1.c | MSFT
- Ia32/WriteMm0.c | MSFT
- Ia32/WriteLdtr.c | MSFT
- Ia32/WriteIdtr.c | MSFT
- Ia32/WriteGdtr.c | MSFT
- Ia32/WriteDr7.c | MSFT
- Ia32/WriteDr6.c | MSFT
- Ia32/WriteDr5.c | MSFT
- Ia32/WriteDr4.c | MSFT
- Ia32/WriteDr3.c | MSFT
- Ia32/WriteDr2.c | MSFT
- Ia32/WriteDr1.c | MSFT
- Ia32/WriteDr0.c | MSFT
- Ia32/WriteCr4.c | MSFT
- Ia32/WriteCr3.c | MSFT
- Ia32/WriteCr2.c | MSFT
- Ia32/WriteCr0.c | MSFT
- Ia32/WriteMsr64.c | MSFT
- Ia32/SwapBytes64.c | MSFT
- Ia32/SetJump.c | MSFT
- Ia32/RRotU64.c | MSFT
- Ia32/RShiftU64.c | MSFT
- Ia32/ReadPmc.c | MSFT
- Ia32/ReadTsc.c | MSFT
- Ia32/ReadLdtr.c | MSFT
- Ia32/ReadIdtr.c | MSFT
- Ia32/ReadGdtr.c | MSFT
- Ia32/ReadTr.c | MSFT
- Ia32/ReadSs.c | MSFT
- Ia32/ReadGs.c | MSFT
- Ia32/ReadFs.c | MSFT
- Ia32/ReadEs.c | MSFT
- Ia32/ReadDs.c | MSFT
- Ia32/ReadCs.c | MSFT
- Ia32/ReadMsr64.c | MSFT
- Ia32/ReadMm7.c | MSFT
- Ia32/ReadMm6.c | MSFT
- Ia32/ReadMm5.c | MSFT
- Ia32/ReadMm4.c | MSFT
- Ia32/ReadMm3.c | MSFT
- Ia32/ReadMm2.c | MSFT
- Ia32/ReadMm1.c | MSFT
- Ia32/ReadMm0.c | MSFT
- Ia32/ReadEflags.c | MSFT
- Ia32/ReadDr7.c | MSFT
- Ia32/ReadDr6.c | MSFT
- Ia32/ReadDr5.c | MSFT
- Ia32/ReadDr4.c | MSFT
- Ia32/ReadDr3.c | MSFT
- Ia32/ReadDr2.c | MSFT
- Ia32/ReadDr1.c | MSFT
- Ia32/ReadDr0.c | MSFT
- Ia32/ReadCr4.c | MSFT
- Ia32/ReadCr3.c | MSFT
- Ia32/ReadCr2.c | MSFT
- Ia32/ReadCr0.c | MSFT
- Ia32/Mwait.c | MSFT
- Ia32/Monitor.c | MSFT
- Ia32/ModU64x32.c | MSFT
- Ia32/MultU64x64.c | MSFT
- Ia32/MultU64x32.c | MSFT
- Ia32/LShiftU64.c | MSFT
- Ia32/LRotU64.c | MSFT
- Ia32/LongJump.c | MSFT
- Ia32/Invd.c | MSFT
- Ia32/FxRestore.c | MSFT
- Ia32/FxSave.c | MSFT
- Ia32/FlushCacheLine.c | MSFT
- Ia32/EnablePaging32.c | MSFT
- Ia32/EnableInterrupts.c | MSFT
- Ia32/EnableDisableInterrupts.c | MSFT
- Ia32/DivU64x64Remainder.nasm| MSFT
- Ia32/DivU64x32Remainder.c | MSFT
- Ia32/DivU64x32.c | MSFT
- Ia32/DisablePaging32.c | MSFT
- Ia32/DisableInterrupts.c | MSFT
- Ia32/CpuPause.c | MSFT
- Ia32/CpuIdEx.c | MSFT
- Ia32/CpuId.c | MSFT
- Ia32/CpuBreakpoint.c | MSFT
- Ia32/ARShiftU64.c | MSFT
- Ia32/Thunk16.nasm | MSFT
- Ia32/EnablePaging64.nasm| MSFT
- Ia32/EnableCache.c | MSFT
- Ia32/DisableCache.c | MSFT
- Ia32/RdRand.nasm| MSFT
-
- Ia32/Wbinvd.nasm| INTEL
- Ia32/WriteMm7.nasm| INTEL
- Ia32/WriteMm6.nasm| INTEL
- Ia32/WriteMm5.nasm| INTEL
- Ia32/WriteMm4.nasm| INTEL
- Ia32/WriteMm3.nasm| INTEL
- Ia32/WriteMm2.nasm| INTEL
- Ia32/WriteMm1.nasm| INTEL
- Ia32/WriteMm0.nasm| INTEL
- Ia32/WriteLdtr.nasm| INTEL
- Ia32/WriteIdtr.nasm| INTEL
- Ia32/WriteGdtr.nasm| INTEL
- Ia32/WriteDr7.nasm| INTEL
- Ia32/WriteDr6.nasm| INTEL
- Ia32/WriteDr5.nasm| INTEL
- Ia32/WriteDr4.nasm| INTEL
- Ia32/WriteDr3.nasm| INTEL
- Ia32/WriteDr2.nasm| INTEL
- Ia32/WriteDr1.nasm| INTEL
- Ia32/WriteDr0.nasm| INTEL
- Ia32/WriteCr4.nasm| INTEL
- Ia32/WriteCr3.nasm| INTEL
- Ia32/WriteCr2.nasm| INTEL
- Ia32/WriteCr0.nasm| INTEL
- Ia32/WriteMsr64.nasm| INTEL
- Ia32/SwapBytes64.nasm| INTEL
- Ia32/SetJump.nasm| INTEL
- Ia32/RRotU64.nasm| INTEL
- Ia32/RShiftU64.nasm| INTEL
- Ia32/ReadPmc.nasm| INTEL
- Ia32/ReadTsc.nasm| INTEL
- Ia32/ReadLdtr.nasm| INTEL
- Ia32/ReadIdtr.nasm| INTEL
- Ia32/ReadGdtr.nasm| INTEL
- Ia32/ReadTr.nasm| INTEL
- Ia32/ReadSs.nasm| INTEL
- Ia32/ReadGs.nasm| INTEL
- Ia32/ReadFs.nasm| INTEL
- Ia32/ReadEs.nasm| INTEL
- Ia32/ReadDs.nasm| INTEL
- Ia32/ReadCs.nasm| INTEL
- Ia32/ReadMsr64.nasm| INTEL
- Ia32/ReadMm7.nasm| INTEL
- Ia32/ReadMm6.nasm| INTEL
- Ia32/ReadMm5.nasm| INTEL
- Ia32/ReadMm4.nasm| INTEL
- Ia32/ReadMm3.nasm| INTEL
- Ia32/ReadMm2.nasm| INTEL
- Ia32/ReadMm1.nasm| INTEL
- Ia32/ReadMm0.nasm| INTEL
- Ia32/ReadEflags.nasm| INTEL
- Ia32/ReadDr7.nasm| INTEL
- Ia32/ReadDr6.nasm| INTEL
- Ia32/ReadDr5.nasm| INTEL
- Ia32/ReadDr4.nasm| INTEL
- Ia32/ReadDr3.nasm| INTEL
- Ia32/ReadDr2.nasm| INTEL
- Ia32/ReadDr1.nasm| INTEL
- Ia32/ReadDr0.nasm| INTEL
- Ia32/ReadCr4.nasm| INTEL
- Ia32/ReadCr3.nasm| INTEL
- Ia32/ReadCr2.nasm| INTEL
- Ia32/ReadCr0.nasm| INTEL
- Ia32/Mwait.nasm| INTEL
- Ia32/Monitor.nasm| INTEL
- Ia32/ModU64x32.nasm| INTEL
- Ia32/MultU64x64.nasm| INTEL
- Ia32/MultU64x32.nasm| INTEL
- Ia32/LShiftU64.nasm| INTEL
- Ia32/LRotU64.nasm| INTEL
- Ia32/LongJump.nasm| INTEL
- Ia32/Invd.nasm| INTEL
- Ia32/FxRestore.nasm| INTEL
- Ia32/FxSave.nasm| INTEL
- Ia32/FlushCacheLine.nasm| INTEL
- Ia32/EnablePaging32.nasm| INTEL
- Ia32/EnableInterrupts.nasm| INTEL
- Ia32/EnableDisableInterrupts.nasm| INTEL
- Ia32/DivU64x64Remainder.nasm| INTEL
- Ia32/DivU64x32Remainder.nasm| INTEL
- Ia32/DivU64x32.nasm| INTEL
- Ia32/DisablePaging32.nasm| INTEL
- Ia32/DisableInterrupts.nasm| INTEL
- Ia32/CpuPause.nasm| INTEL
- Ia32/CpuIdEx.nasm| INTEL
- Ia32/CpuId.nasm| INTEL
- Ia32/CpuBreakpoint.nasm| INTEL
- Ia32/ARShiftU64.nasm| INTEL
- Ia32/Thunk16.nasm | INTEL
- Ia32/EnablePaging64.nasm| INTEL
- Ia32/EnableCache.nasm| INTEL
- Ia32/DisableCache.nasm| INTEL
- Ia32/RdRand.nasm| INTEL
-
- Ia32/GccInline.c | GCC
- Ia32/Thunk16.nasm | GCC
- Ia32/Thunk16.S | XCODE
- Ia32/EnableDisableInterrupts.nasm| GCC
- Ia32/EnableDisableInterrupts.S | GCC
- Ia32/EnablePaging64.nasm| GCC
- Ia32/EnablePaging64.S | GCC
- Ia32/DisablePaging32.nasm| GCC
- Ia32/DisablePaging32.S | GCC
- Ia32/EnablePaging32.nasm| GCC
- Ia32/EnablePaging32.S | GCC
- Ia32/Mwait.nasm| GCC
- Ia32/Mwait.S | GCC
- Ia32/Monitor.nasm| GCC
- Ia32/Monitor.S | GCC
- Ia32/CpuIdEx.nasm| GCC
- Ia32/CpuIdEx.S | GCC
- Ia32/CpuId.nasm| GCC
- Ia32/CpuId.S | GCC
- Ia32/LongJump.nasm| GCC
- Ia32/LongJump.S | GCC
- Ia32/SetJump.nasm| GCC
- Ia32/SetJump.S | GCC
- Ia32/SwapBytes64.nasm| GCC
- Ia32/SwapBytes64.S | GCC
- Ia32/DivU64x64Remainder.nasm| GCC
- Ia32/DivU64x64Remainder.S | GCC
- Ia32/DivU64x32Remainder.nasm| GCC
- Ia32/DivU64x32Remainder.S | GCC
- Ia32/ModU64x32.nasm| GCC
- Ia32/ModU64x32.S | GCC
- Ia32/DivU64x32.nasm| GCC
- Ia32/DivU64x32.S | GCC
- Ia32/MultU64x64.nasm| GCC
- Ia32/MultU64x64.S | GCC
- Ia32/MultU64x32.nasm| GCC
- Ia32/MultU64x32.S | GCC
- Ia32/RRotU64.nasm| GCC
- Ia32/RRotU64.S | GCC
- Ia32/LRotU64.nasm| GCC
- Ia32/LRotU64.S | GCC
- Ia32/ARShiftU64.nasm| GCC
- Ia32/ARShiftU64.S | GCC
- Ia32/RShiftU64.nasm| GCC
- Ia32/RShiftU64.S | GCC
- Ia32/LShiftU64.nasm| GCC
- Ia32/LShiftU64.S | GCC
- Ia32/EnableCache.nasm| GCC
- Ia32/EnableCache.S | GCC
- Ia32/DisableCache.nasm| GCC
- Ia32/DisableCache.S | GCC
- Ia32/RdRand.nasm| GCC
- Ia32/RdRand.S | GCC
-
- Ia32/DivS64x64Remainder.c
- Ia32/InternalSwitchStack.c | MSFT
- Ia32/InternalSwitchStack.c | INTEL
- Ia32/InternalSwitchStack.S | GCC
- Ia32/InternalSwitchStack.nasm | GCC
- Ia32/Non-existing.c
- Unaligned.c
- X86WriteIdtr.c
- X86WriteGdtr.c
- X86Thunk.c
- X86ReadIdtr.c
- X86ReadGdtr.c
- X86Msr.c
- X86MemoryFence.c | MSFT
- X86MemoryFence.c | INTEL
- X86GetInterruptState.c
- X86FxSave.c
- X86FxRestore.c
- X86EnablePaging64.c
- X86EnablePaging32.c
- X86DisablePaging64.c
- X86DisablePaging32.c
- X86RdRand.c
- X86PatchInstruction.c
- X86SpeculationBarrier.c
-
-[Sources.X64]
- X64/Thunk16.nasm
- X64/CpuIdEx.nasm
- X64/CpuId.nasm
- X64/LongJump.nasm
- X64/SetJump.nasm
- X64/SwitchStack.nasm
- X64/EnableCache.nasm
- X64/DisableCache.nasm
- X64/WriteTr.nasm
- X64/Lfence.nasm
-
- X64/CpuBreakpoint.c | MSFT
- X64/WriteMsr64.c | MSFT
- X64/ReadMsr64.c | MSFT
- X64/RdRand.nasm| MSFT
- X64/CpuPause.nasm| MSFT
- X64/EnableDisableInterrupts.nasm| MSFT
- X64/DisableInterrupts.nasm| MSFT
- X64/EnableInterrupts.nasm| MSFT
- X64/FlushCacheLine.nasm| MSFT
- X64/Invd.nasm| MSFT
- X64/Wbinvd.nasm| MSFT
- X64/DisablePaging64.nasm| MSFT
- X64/Mwait.nasm| MSFT
- X64/Monitor.nasm| MSFT
- X64/ReadPmc.nasm| MSFT
- X64/ReadTsc.nasm| MSFT
- X64/WriteMm7.nasm| MSFT
- X64/WriteMm6.nasm| MSFT
- X64/WriteMm5.nasm| MSFT
- X64/WriteMm4.nasm| MSFT
- X64/WriteMm3.nasm| MSFT
- X64/WriteMm2.nasm| MSFT
- X64/WriteMm1.nasm| MSFT
- X64/WriteMm0.nasm| MSFT
- X64/ReadMm7.nasm| MSFT
- X64/ReadMm6.nasm| MSFT
- X64/ReadMm5.nasm| MSFT
- X64/ReadMm4.nasm| MSFT
- X64/ReadMm3.nasm| MSFT
- X64/ReadMm2.nasm| MSFT
- X64/ReadMm1.nasm| MSFT
- X64/ReadMm0.nasm| MSFT
- X64/FxRestore.nasm| MSFT
- X64/FxSave.nasm| MSFT
- X64/WriteLdtr.nasm| MSFT
- X64/ReadLdtr.nasm| MSFT
- X64/WriteIdtr.nasm| MSFT
- X64/ReadIdtr.nasm| MSFT
- X64/WriteGdtr.nasm| MSFT
- X64/ReadGdtr.nasm| MSFT
- X64/ReadTr.nasm| MSFT
- X64/ReadSs.nasm| MSFT
- X64/ReadGs.nasm| MSFT
- X64/ReadFs.nasm| MSFT
- X64/ReadEs.nasm| MSFT
- X64/ReadDs.nasm| MSFT
- X64/ReadCs.nasm| MSFT
- X64/WriteDr7.nasm| MSFT
- X64/WriteDr6.nasm| MSFT
- X64/WriteDr5.nasm| MSFT
- X64/WriteDr4.nasm| MSFT
- X64/WriteDr3.nasm| MSFT
- X64/WriteDr2.nasm| MSFT
- X64/WriteDr1.nasm| MSFT
- X64/WriteDr0.nasm| MSFT
- X64/ReadDr7.nasm| MSFT
- X64/ReadDr6.nasm| MSFT
- X64/ReadDr5.nasm| MSFT
- X64/ReadDr4.nasm| MSFT
- X64/ReadDr3.nasm| MSFT
- X64/ReadDr2.nasm| MSFT
- X64/ReadDr1.nasm| MSFT
- X64/ReadDr0.nasm| MSFT
- X64/WriteCr4.nasm| MSFT
- X64/WriteCr3.nasm| MSFT
- X64/WriteCr2.nasm| MSFT
- X64/WriteCr0.nasm| MSFT
- X64/ReadCr4.nasm| MSFT
- X64/ReadCr3.nasm| MSFT
- X64/ReadCr2.nasm| MSFT
- X64/ReadCr0.nasm| MSFT
- X64/ReadEflags.nasm| MSFT
-
- X64/CpuBreakpoint.nasm| INTEL
- X64/WriteMsr64.nasm| INTEL
- X64/ReadMsr64.nasm| INTEL
- X64/RdRand.nasm| INTEL
- X64/CpuPause.nasm| INTEL
- X64/EnableDisableInterrupts.nasm| INTEL
- X64/DisableInterrupts.nasm| INTEL
- X64/EnableInterrupts.nasm| INTEL
- X64/FlushCacheLine.nasm| INTEL
- X64/Invd.nasm| INTEL
- X64/Wbinvd.nasm| INTEL
- X64/DisablePaging64.nasm| INTEL
- X64/Mwait.nasm| INTEL
- X64/Monitor.nasm| INTEL
- X64/ReadPmc.nasm| INTEL
- X64/ReadTsc.nasm| INTEL
- X64/WriteMm7.nasm| INTEL
- X64/WriteMm6.nasm| INTEL
- X64/WriteMm5.nasm| INTEL
- X64/WriteMm4.nasm| INTEL
- X64/WriteMm3.nasm| INTEL
- X64/WriteMm2.nasm| INTEL
- X64/WriteMm1.nasm| INTEL
- X64/WriteMm0.nasm| INTEL
- X64/ReadMm7.nasm| INTEL
- X64/ReadMm6.nasm| INTEL
- X64/ReadMm5.nasm| INTEL
- X64/ReadMm4.nasm| INTEL
- X64/ReadMm3.nasm| INTEL
- X64/ReadMm2.nasm| INTEL
- X64/ReadMm1.nasm| INTEL
- X64/ReadMm0.nasm| INTEL
- X64/FxRestore.nasm| INTEL
- X64/FxSave.nasm| INTEL
- X64/WriteLdtr.nasm| INTEL
- X64/ReadLdtr.nasm| INTEL
- X64/WriteIdtr.nasm| INTEL
- X64/ReadIdtr.nasm| INTEL
- X64/WriteGdtr.nasm| INTEL
- X64/ReadGdtr.nasm| INTEL
- X64/ReadTr.nasm| INTEL
- X64/ReadSs.nasm| INTEL
- X64/ReadGs.nasm| INTEL
- X64/ReadFs.nasm| INTEL
- X64/ReadEs.nasm| INTEL
- X64/ReadDs.nasm| INTEL
- X64/ReadCs.nasm| INTEL
- X64/WriteDr7.nasm| INTEL
- X64/WriteDr6.nasm| INTEL
- X64/WriteDr5.nasm| INTEL
- X64/WriteDr4.nasm| INTEL
- X64/WriteDr3.nasm| INTEL
- X64/WriteDr2.nasm| INTEL
- X64/WriteDr1.nasm| INTEL
- X64/WriteDr0.nasm| INTEL
- X64/ReadDr7.nasm| INTEL
- X64/ReadDr6.nasm| INTEL
- X64/ReadDr5.nasm| INTEL
- X64/ReadDr4.nasm| INTEL
- X64/ReadDr3.nasm| INTEL
- X64/ReadDr2.nasm| INTEL
- X64/ReadDr1.nasm| INTEL
- X64/ReadDr0.nasm| INTEL
- X64/WriteCr4.nasm| INTEL
- X64/WriteCr3.nasm| INTEL
- X64/WriteCr2.nasm| INTEL
- X64/WriteCr0.nasm| INTEL
- X64/ReadCr4.nasm| INTEL
- X64/ReadCr3.nasm| INTEL
- X64/ReadCr2.nasm| INTEL
- X64/ReadCr0.nasm| INTEL
- X64/ReadEflags.nasm| INTEL
-
- X64/Non-existing.c
- Math64.c
- Unaligned.c
- X86WriteIdtr.c
- X86WriteGdtr.c
- X86Thunk.c
- X86ReadIdtr.c
- X86ReadGdtr.c
- X86Msr.c
- X86MemoryFence.c | MSFT
- X86MemoryFence.c | INTEL
- X86GetInterruptState.c
- X86FxSave.c
- X86FxRestore.c
- X86EnablePaging64.c
- X86EnablePaging32.c
- X86DisablePaging64.c
- X86DisablePaging32.c
- X86RdRand.c
- X86PatchInstruction.c
- X86SpeculationBarrier.c
- X64/GccInline.c | GCC
- X64/Thunk16.S | XCODE
- X64/SwitchStack.nasm| GCC
- X64/SwitchStack.S | GCC
- X64/SetJump.nasm| GCC
- X64/SetJump.S | GCC
- X64/LongJump.nasm| GCC
- X64/LongJump.S | GCC
- X64/EnableDisableInterrupts.nasm| GCC
- X64/EnableDisableInterrupts.S | GCC
- X64/DisablePaging64.nasm| GCC
- X64/DisablePaging64.S | GCC
- X64/CpuId.nasm| GCC
- X64/CpuId.S | GCC
- X64/CpuIdEx.nasm| GCC
- X64/CpuIdEx.S | GCC
- X64/EnableCache.nasm| GCC
- X64/EnableCache.S | GCC
- X64/DisableCache.nasm| GCC
- X64/DisableCache.S | GCC
- X64/RdRand.nasm| GCC
- X64/RdRand.S | GCC
- ChkStkGcc.c | GCC
-
-[Sources.EBC]
- Ebc/CpuBreakpoint.c
- Ebc/SetJumpLongJump.c
- Ebc/SwitchStack.c
- Ebc/SpeculationBarrier.c
- Unaligned.c
- Math64.c
-
-[Sources.ARM]
- Arm/InternalSwitchStack.c
- Arm/Unaligned.c
- Math64.c | RVCT
- Math64.c | MSFT
-
- Arm/SwitchStack.asm | RVCT
- Arm/SetJumpLongJump.asm | RVCT
- Arm/DisableInterrupts.asm | RVCT
- Arm/EnableInterrupts.asm | RVCT
- Arm/GetInterruptsState.asm | RVCT
- Arm/CpuPause.asm | RVCT
- Arm/CpuBreakpoint.asm | RVCT
- Arm/MemoryFence.asm | RVCT
- Arm/SpeculationBarrier.S | RVCT
-
- Arm/SwitchStack.asm | MSFT
- Arm/SetJumpLongJump.asm | MSFT
- Arm/DisableInterrupts.asm | MSFT
- Arm/EnableInterrupts.asm | MSFT
- Arm/GetInterruptsState.asm | MSFT
- Arm/CpuPause.asm | MSFT
- Arm/CpuBreakpoint.asm | MSFT
- Arm/MemoryFence.asm | MSFT
- Arm/SpeculationBarrier.asm | MSFT
-
- Arm/Math64.S | GCC
- Arm/SwitchStack.S | GCC
- Arm/EnableInterrupts.S | GCC
- Arm/DisableInterrupts.S | GCC
- Arm/GetInterruptsState.S | GCC
- Arm/SetJumpLongJump.S | GCC
- Arm/CpuBreakpoint.S | GCC
- Arm/MemoryFence.S | GCC
- Arm/SpeculationBarrier.S | GCC
-
-[Sources.AARCH64]
- Arm/InternalSwitchStack.c
- Arm/Unaligned.c
- Math64.c
-
- AArch64/MemoryFence.S | GCC
- AArch64/SwitchStack.S | GCC
- AArch64/EnableInterrupts.S | GCC
- AArch64/DisableInterrupts.S | GCC
- AArch64/GetInterruptsState.S | GCC
- AArch64/SetJumpLongJump.S | GCC
- AArch64/CpuBreakpoint.S | GCC
- AArch64/SpeculationBarrier.S | GCC
-
- AArch64/MemoryFence.asm | MSFT
- AArch64/SwitchStack.asm | MSFT
- AArch64/EnableInterrupts.asm | MSFT
- AArch64/DisableInterrupts.asm | MSFT
- AArch64/GetInterruptsState.asm | MSFT
- AArch64/SetJumpLongJump.asm | MSFT
- AArch64/CpuBreakpoint.asm | MSFT
- AArch64/SpeculationBarrier.asm | MSFT
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- PcdLib
- DebugLib
- BaseMemoryLib
-
-[Pcd]
- gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength ## SOMETIMES_CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength ## SOMETIMES_CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength ## SOMETIMES_CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdControlFlowEnforcementPropertyMask ## SOMETIMES_CONSUMES
-
-[FeaturePcd]
- gEfiMdePkgTokenSpaceGuid.PcdVerifyNodeInList ## CONSUMES
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BaseLib.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BaseLib.uni
deleted file mode 100644
index 6e4c32e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BaseLib.uni
+++ /dev/null
@@ -1,23 +0,0 @@
-// /** @file
-// Base Library implementation.
-//
-// Base Library implementation.
-//
-// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-// Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-// Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Base Library implementation"
-
-#string STR_MODULE_DESCRIPTION #language en-US "Base Library implementation."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BaseLibInternals.h b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BaseLibInternals.h
deleted file mode 100644
index d02feff..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BaseLibInternals.h
+++ /dev/null
@@ -1,875 +0,0 @@
-/** @file
- Declaration of internal functions in BaseLib.
-
- Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __BASE_LIB_INTERNALS__
-#define __BASE_LIB_INTERNALS__
-
-#include
-#include
-#include
-#include
-#include
-
-//
-// Math functions
-//
-
-/**
- Shifts a 64-bit integer left between 0 and 63 bits. The low bits
- are filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the left by Count bits. The
- low Count bits are set to zero. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift left.
- @param Count The number of bits to shift left.
-
- @return Operand << Count
-
-**/
-UINT64
-EFIAPI
-InternalMathLShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. The high bits
- are filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to zero. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-InternalMathRShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. The high bits
- are filled with original integer's bit 63. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to bit 63 of Operand. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand arithmetically shifted right by Count
-
-**/
-UINT64
-EFIAPI
-InternalMathARShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-/**
- Rotates a 64-bit integer left between 0 and 63 bits, filling
- the low bits with the high bits that were rotated.
-
- This function rotates the 64-bit value Operand to the left by Count bits. The
- low Count bits are filled with the high Count bits of Operand. The rotated
- value is returned.
-
- @param Operand The 64-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand <<< Count
-
-**/
-UINT64
-EFIAPI
-InternalMathLRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-/**
- Rotates a 64-bit integer right between 0 and 63 bits, filling
- the high bits with the high low bits that were rotated.
-
- This function rotates the 64-bit value Operand to the right by Count bits.
- The high Count bits are filled with the low Count bits of Operand. The rotated
- value is returned.
-
- @param Operand The 64-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >>> Count
-
-**/
-UINT64
-EFIAPI
-InternalMathRRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-/**
- Switches the endianess of a 64-bit integer.
-
- This function swaps the bytes in a 64-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 64-bit unsigned value.
-
- @return The byte swapped Operand.
-
-**/
-UINT64
-EFIAPI
-InternalMathSwapBytes64 (
- IN UINT64 Operand
- );
-
-/**
- Multiplies a 64-bit unsigned integer by a 32-bit unsigned integer
- and generates a 64-bit unsigned result.
-
- This function multiplies the 64-bit unsigned value Multiplicand by the 32-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 32-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-InternalMathMultU64x32 (
- IN UINT64 Multiplicand,
- IN UINT32 Multiplier
- );
-
-/**
- Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer
- and generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 64-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 64-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-InternalMathMultU64x64 (
- IN UINT64 Multiplicand,
- IN UINT64 Multiplier
- );
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. This
- function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- );
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 32-bit remainder. This function
- returns the 32-bit unsigned remainder.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend % Divisor
-
-**/
-UINT32
-EFIAPI
-InternalMathModU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- );
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
- @param Remainder A pointer to a 32-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivRemU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor,
- OUT UINT32 *Remainder OPTIONAL
- );
-
-/**
- Divides a 64-bit unsigned integer by a 64-bit unsigned integer and
- generates a 64-bit unsigned result and an optional 64-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 64-bit unsigned value.
- @param Remainder A pointer to a 64-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivRemU64x64 (
- IN UINT64 Dividend,
- IN UINT64 Divisor,
- OUT UINT64 *Remainder OPTIONAL
- );
-
-/**
- Divides a 64-bit signed integer by a 64-bit signed integer and
- generates a 64-bit signed result and an optional 64-bit signed remainder.
-
- This function divides the 64-bit signed value Dividend by the 64-bit
- signed value Divisor and generates a 64-bit signed quotient. If Remainder
- is not NULL, then the 64-bit signed remainder is returned in Remainder.
- This function returns the 64-bit signed quotient.
-
- @param Dividend A 64-bit signed value.
- @param Divisor A 64-bit signed value.
- @param Remainder A pointer to a 64-bit signed value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-INT64
-EFIAPI
-InternalMathDivRemS64x64 (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
- );
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the
- new stack specified by NewStack and passing in the parameters specified
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return.
- Marker will be ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param Marker VA_LIST marker for the variable argument list.
-
-**/
-VOID
-EFIAPI
-InternalSwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VA_LIST Marker
- );
-
-
-/**
- Worker function that returns a bit field from Operand.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
-
- @return The bit field read.
-
-**/
-UINTN
-EFIAPI
-BitFieldReadUint (
- IN UINTN Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Worker function that reads a bit field from Operand, performs a bitwise OR,
- and returns the result.
-
- Performs a bitwise OR between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new value is returned.
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
- @param OrData The value to OR with the read value from the value
-
- @return The new value.
-
-**/
-UINTN
-EFIAPI
-BitFieldOrUint (
- IN UINTN Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINTN OrData
- );
-
-
-/**
- Worker function that reads a bit field from Operand, performs a bitwise AND,
- and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new value is returned.
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
- @param AndData The value to And with the read value from the value
-
- @return The new value.
-
-**/
-UINTN
-EFIAPI
-BitFieldAndUint (
- IN UINTN Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINTN AndData
- );
-
-
-/**
- Worker function that checks ASSERT condition for JumpBuffer
-
- Checks ASSERT condition for JumpBuffer.
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
-
-**/
-VOID
-EFIAPI
-InternalAssertJumpBuffer (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- );
-
-
-/**
- Restores the CPU context that was saved with SetJump().
-
- Restores the CPU context from the buffer specified by JumpBuffer.
- This function never returns to the caller.
- Instead is resumes execution based on the state of JumpBuffer.
-
- @param JumpBuffer A pointer to CPU context buffer.
- @param Value The value to return when the SetJump() context is restored.
-
-**/
-VOID
-EFIAPI
-InternalLongJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
- IN UINTN Value
- );
-
-
-/**
- Check if a Unicode character is a decimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid decimal character is from
- L'0' to L'9'.
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a decmial character.
- @retval FALSE If the Char is not a decmial character.
-
-**/
-BOOLEAN
-EFIAPI
-InternalIsDecimalDigitCharacter (
- IN CHAR16 Char
- );
-
-
-/**
- Convert a Unicode character to numerical value.
-
- This internal function only deal with Unicode character
- which maps to a valid hexadecimal ASII character, i.e.
- L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other
- Unicode character, the value returned does not make sense.
-
- @param Char The character to convert.
-
- @return The numerical value converted.
-
-**/
-UINTN
-EFIAPI
-InternalHexCharToUintn (
- IN CHAR16 Char
- );
-
-
-/**
- Check if a Unicode character is a hexadecimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid hexadecimal character is
- L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
-
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a hexadecmial character.
- @retval FALSE If the Char is not a hexadecmial character.
-
-**/
-BOOLEAN
-EFIAPI
-InternalIsHexaDecimalDigitCharacter (
- IN CHAR16 Char
- );
-
-
-/**
- Check if a ASCII character is a decimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid decimal character is from
- '0' to '9'.
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a decmial character.
- @retval FALSE If the Char is not a decmial character.
-
-**/
-BOOLEAN
-EFIAPI
-InternalAsciiIsDecimalDigitCharacter (
- IN CHAR8 Char
- );
-
-
-/**
- Check if a ASCII character is a hexadecimal character.
-
- This internal function checks if a ASCII character is a
- decimal character. The valid hexadecimal character is
- L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
-
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a hexadecmial character.
- @retval FALSE If the Char is not a hexadecmial character.
-
-**/
-BOOLEAN
-EFIAPI
-InternalAsciiIsHexaDecimalDigitCharacter (
- IN CHAR8 Char
- );
-
-
-/**
- Convert a ASCII character to numerical value.
-
- This internal function only deal with Unicode character
- which maps to a valid hexadecimal ASII character, i.e.
- '0' to '9', 'a' to 'f' or 'A' to 'F'. For other
- ASCII character, the value returned does not make sense.
-
- @param Char The character to convert.
-
- @return The numerical value converted.
-
-**/
-UINTN
-EFIAPI
-InternalAsciiHexCharToUintn (
- IN CHAR8 Char
- );
-
-
-//
-// Ia32 and x64 specific functions
-//
-#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
-
-/**
- Reads the current Global Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current GDTR descriptor and returns it in Gdtr. This
- function is only available on IA-32 and x64.
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86ReadGdtr (
- OUT IA32_DESCRIPTOR *Gdtr
- );
-
-/**
- Writes the current Global Descriptor Table Register (GDTR) descriptor.
-
- Writes and the current GDTR descriptor specified by Gdtr. This function is
- only available on IA-32 and x64.
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86WriteGdtr (
- IN CONST IA32_DESCRIPTOR *Gdtr
- );
-
-/**
- Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current IDTR descriptor and returns it in Idtr. This
- function is only available on IA-32 and x64.
-
- @param Idtr The pointer to an IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86ReadIdtr (
- OUT IA32_DESCRIPTOR *Idtr
- );
-
-/**
- Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Writes the current IDTR descriptor and returns it in Idtr. This function is
- only available on IA-32 and x64.
-
- @param Idtr The pointer to an IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86WriteIdtr (
- IN CONST IA32_DESCRIPTOR *Idtr
- );
-
-/**
- Save the current floating point/SSE/SSE2 context to a buffer.
-
- Saves the current floating point/SSE/SSE2 state to the buffer specified by
- Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
- available on IA-32 and x64.
-
- @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-InternalX86FxSave (
- OUT IA32_FX_BUFFER *Buffer
- );
-
-/**
- Restores the current floating point/SSE/SSE2 context from a buffer.
-
- Restores the current floating point/SSE/SSE2 state from the buffer specified
- by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
- only available on IA-32 and x64.
-
- @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-InternalX86FxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- );
-
-/**
- Enables the 32-bit paging mode on the CPU.
-
- Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode. This function is
- only available on IA-32. After the 32-bit paging mode is enabled, control is
- transferred to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit protected mode with flat descriptors. This
- means all descriptors must have a base of 0 and a limit of 4GB.
- 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
- descriptors.
- 4) CR3 must point to valid page tables that will be used once the transition
- is complete, and those page tables must guarantee that the pages for this
- function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is enabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is enabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is enabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-InternalX86EnablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- );
-
-/**
- Disables the 32-bit paging mode on the CPU.
-
- Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 32-paged protected
- mode. This function is only available on IA-32. After the 32-bit paging mode
- is disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be NULL. The function EntryPoint must never return.
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit paged mode.
- 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
- 4) CR3 must point to valid page tables that guarantee that the pages for
- this function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is disabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is disabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is
- disabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-InternalX86DisablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- );
-
-/**
- Enables the 64-bit paging mode on the CPU.
-
- Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode with flat
- descriptors. This function is only available on IA-32. After the 64-bit
- paging mode is enabled, control is transferred to the function specified by
- EntryPoint using the new stack specified by NewStack and passing in the
- parameters specified by Context1 and Context2. Context1 and Context2 are
- optional and may be 0. The function EntryPoint must never return.
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for long mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is enabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is enabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is enabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-InternalX86EnablePaging64 (
- IN UINT16 Cs,
- IN UINT64 EntryPoint,
- IN UINT64 Context1, OPTIONAL
- IN UINT64 Context2, OPTIONAL
- IN UINT64 NewStack
- );
-
-/**
- Disables the 64-bit paging mode on the CPU.
-
- Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 64-paging mode.
- This function is only available on x64. After the 64-bit paging mode is
- disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be 0. The function EntryPoint must never return.
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for 32-bit protected mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is disabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is disabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is disabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-InternalX86DisablePaging64 (
- IN UINT16 Cs,
- IN UINT32 EntryPoint,
- IN UINT32 Context1, OPTIONAL
- IN UINT32 Context2, OPTIONAL
- IN UINT32 NewStack
- );
-
-/**
- Generates a 16-bit random number through RDRAND instruction.
-
- @param[out] Rand Buffer pointer to store the random result.
-
- @retval TRUE RDRAND call was successful.
- @retval FALSE Failed attempts to call RDRAND.
-
- **/
-BOOLEAN
-EFIAPI
-InternalX86RdRand16 (
- OUT UINT16 *Rand
- );
-
-/**
- Generates a 32-bit random number through RDRAND instruction.
-
- @param[out] Rand Buffer pointer to store the random result.
-
- @retval TRUE RDRAND call was successful.
- @retval FALSE Failed attempts to call RDRAND.
-
-**/
-BOOLEAN
-EFIAPI
-InternalX86RdRand32 (
- OUT UINT32 *Rand
- );
-
-/**
- Generates a 64-bit random number through RDRAND instruction.
-
-
- @param[out] Rand Buffer pointer to store the random result.
-
- @retval TRUE RDRAND call was successful.
- @retval FALSE Failed attempts to call RDRAND.
-
-**/
-BOOLEAN
-EFIAPI
-InternalX86RdRand64 (
- OUT UINT64 *Rand
- );
-
-#else
-
-#endif
-
-#endif
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BitField.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BitField.c
deleted file mode 100644
index 05dbe01..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/BitField.c
+++ /dev/null
@@ -1,1008 +0,0 @@
-/** @file
- Bit field functions of BaseLib.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Worker function that returns a bit field from Operand.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
-
- @return The bit field read.
-
-**/
-UINTN
-EFIAPI
-InternalBaseLibBitFieldReadUint (
- IN UINTN Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- //
- // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]
- // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.
- //
- return (Operand & ~((UINTN)-2 << EndBit)) >> StartBit;
-}
-
-/**
- Worker function that reads a bit field from Operand, performs a bitwise OR,
- and returns the result.
-
- Performs a bitwise OR between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new value is returned.
-
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
- @param OrData The value to OR with the read value from the value.
-
- @return The new value.
-
-**/
-UINTN
-EFIAPI
-InternalBaseLibBitFieldOrUint (
- IN UINTN Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINTN OrData
- )
-{
- //
- // Higher bits in OrData those are not used must be zero.
- //
- // EndBit - StartBit + 1 might be 32 while the result right shifting 32 on a 32bit integer is undefined,
- // So the logic is updated to right shift (EndBit - StartBit) bits and compare the last bit directly.
- //
- ASSERT ((OrData >> (EndBit - StartBit)) == ((OrData >> (EndBit - StartBit)) & 1));
-
- //
- // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]
- // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.
- //
- return Operand | ((OrData << StartBit) & ~((UINTN) -2 << EndBit));
-}
-
-/**
- Worker function that reads a bit field from Operand, performs a bitwise AND,
- and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new value is returned.
-
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
- @param AndData The value to And with the read value from the value.
-
- @return The new value.
-
-**/
-UINTN
-EFIAPI
-InternalBaseLibBitFieldAndUint (
- IN UINTN Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINTN AndData
- )
-{
- //
- // Higher bits in AndData those are not used must be zero.
- //
- // EndBit - StartBit + 1 might be 32 while the result right shifting 32 on a 32bit integer is undefined,
- // So the logic is updated to right shift (EndBit - StartBit) bits and compare the last bit directly.
- //
- ASSERT ((AndData >> (EndBit - StartBit)) == ((AndData >> (EndBit - StartBit)) & 1));
-
- //
- // ~((UINTN)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]
- // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.
- //
- return Operand & ~((~AndData << StartBit) & ~((UINTN)-2 << EndBit));
-}
-
-/**
- Returns a bit field from an 8-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The bit field read.
-
-**/
-UINT8
-EFIAPI
-BitFieldRead8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT (EndBit < 8);
- ASSERT (StartBit <= EndBit);
- return (UINT8)InternalBaseLibBitFieldReadUint (Operand, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an 8-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 8-bit value is
- returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value The new value of the bit field.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldWrite8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- ASSERT (EndBit < 8);
- ASSERT (StartBit <= EndBit);
- return BitFieldAndThenOr8 (Operand, StartBit, EndBit, 0, Value);
-}
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the read value from the value.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldOr8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- ASSERT (EndBit < 8);
- ASSERT (StartBit <= EndBit);
- return (UINT8)InternalBaseLibBitFieldOrUint (Operand, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the value.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldAnd8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- ASSERT (EndBit < 8);
- ASSERT (StartBit <= EndBit);
- return (UINT8)InternalBaseLibBitFieldAndUint (Operand, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- OR with value specified by OrData. All other bits in Operand are
- preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldAndThenOr8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- ASSERT (EndBit < 8);
- ASSERT (StartBit <= EndBit);
- return BitFieldOr8 (
- BitFieldAnd8 (Operand, StartBit, EndBit, AndData),
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Returns a bit field from a 16-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The bit field read.
-
-**/
-UINT16
-EFIAPI
-BitFieldRead16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT (EndBit < 16);
- ASSERT (StartBit <= EndBit);
- return (UINT16)InternalBaseLibBitFieldReadUint (Operand, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a 16-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 16-bit value is
- returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value The new value of the bit field.
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldWrite16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- ASSERT (EndBit < 16);
- ASSERT (StartBit <= EndBit);
- return BitFieldAndThenOr16 (Operand, StartBit, EndBit, 0, Value);
-}
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the read value from the value.
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldOr16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- ASSERT (EndBit < 16);
- ASSERT (StartBit <= EndBit);
- return (UINT16)InternalBaseLibBitFieldOrUint (Operand, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the value.
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldAnd16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- ASSERT (EndBit < 16);
- ASSERT (StartBit <= EndBit);
- return (UINT16)InternalBaseLibBitFieldAndUint (Operand, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- OR with value specified by OrData. All other bits in Operand are
- preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldAndThenOr16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- ASSERT (EndBit < 16);
- ASSERT (StartBit <= EndBit);
- return BitFieldOr16 (
- BitFieldAnd16 (Operand, StartBit, EndBit, AndData),
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Returns a bit field from a 32-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The bit field read.
-
-**/
-UINT32
-EFIAPI
-BitFieldRead32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT (EndBit < 32);
- ASSERT (StartBit <= EndBit);
- return (UINT32)InternalBaseLibBitFieldReadUint (Operand, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a 32-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 32-bit value is
- returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value The new value of the bit field.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldWrite32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- ASSERT (EndBit < 32);
- ASSERT (StartBit <= EndBit);
- return BitFieldAndThenOr32 (Operand, StartBit, EndBit, 0, Value);
-}
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the value.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldOr32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- ASSERT (EndBit < 32);
- ASSERT (StartBit <= EndBit);
- return (UINT32)InternalBaseLibBitFieldOrUint (Operand, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the value.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldAnd32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- ASSERT (EndBit < 32);
- ASSERT (StartBit <= EndBit);
- return (UINT32)InternalBaseLibBitFieldAndUint (Operand, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- OR with value specified by OrData. All other bits in Operand are
- preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldAndThenOr32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- ASSERT (EndBit < 32);
- ASSERT (StartBit <= EndBit);
- return BitFieldOr32 (
- BitFieldAnd32 (Operand, StartBit, EndBit, AndData),
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Returns a bit field from a 64-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The bit field read.
-
-**/
-UINT64
-EFIAPI
-BitFieldRead64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT (EndBit < 64);
- ASSERT (StartBit <= EndBit);
- return RShiftU64 (Operand & ~LShiftU64 ((UINT64)-2, EndBit), StartBit);
-}
-
-/**
- Writes a bit field to a 64-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 64-bit value is
- returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value The new value of the bit field.
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldWrite64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- )
-{
- ASSERT (EndBit < 64);
- ASSERT (StartBit <= EndBit);
- return BitFieldAndThenOr64 (Operand, StartBit, EndBit, 0, Value);
-}
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the value
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldOr64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- )
-{
- UINT64 Value1;
- UINT64 Value2;
-
- ASSERT (EndBit < 64);
- ASSERT (StartBit <= EndBit);
- //
- // Higher bits in OrData those are not used must be zero.
- //
- // EndBit - StartBit + 1 might be 64 while the result right shifting 64 on RShiftU64() API is invalid,
- // So the logic is updated to right shift (EndBit - StartBit) bits and compare the last bit directly.
- //
- ASSERT (RShiftU64 (OrData, EndBit - StartBit) == (RShiftU64 (OrData, EndBit - StartBit) & 1));
-
- Value1 = LShiftU64 (OrData, StartBit);
- Value2 = LShiftU64 ((UINT64) - 2, EndBit);
-
- return Operand | (Value1 & ~Value2);
-}
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the value.
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldAnd64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- )
-{
- UINT64 Value1;
- UINT64 Value2;
-
- ASSERT (EndBit < 64);
- ASSERT (StartBit <= EndBit);
- //
- // Higher bits in AndData those are not used must be zero.
- //
- // EndBit - StartBit + 1 might be 64 while the right shifting 64 on RShiftU64() API is invalid,
- // So the logic is updated to right shift (EndBit - StartBit) bits and compare the last bit directly.
- //
- ASSERT (RShiftU64 (AndData, EndBit - StartBit) == (RShiftU64 (AndData, EndBit - StartBit) & 1));
-
- Value1 = LShiftU64 (~AndData, StartBit);
- Value2 = LShiftU64 ((UINT64)-2, EndBit);
-
- return Operand & ~(Value1 & ~Value2);
-}
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- OR with value specified by OrData. All other bits in Operand are
- preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldAndThenOr64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- ASSERT (EndBit < 64);
- ASSERT (StartBit <= EndBit);
- return BitFieldOr64 (
- BitFieldAnd64 (Operand, StartBit, EndBit, AndData),
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Reads a bit field from a 32-bit value, counts and returns
- the number of set bits.
-
- Counts the number of set bits in the bit field specified by
- StartBit and EndBit in Operand. The count is returned.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The number of bits set between StartBit and EndBit.
-
-**/
-UINT8
-EFIAPI
-BitFieldCountOnes32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- UINT32 Count;
-
- ASSERT (EndBit < 32);
- ASSERT (StartBit <= EndBit);
-
- Count = BitFieldRead32 (Operand, StartBit, EndBit);
- Count -= ((Count >> 1) & 0x55555555);
- Count = (Count & 0x33333333) + ((Count >> 2) & 0x33333333);
- Count += Count >> 4;
- Count &= 0x0F0F0F0F;
- Count += Count >> 8;
- Count += Count >> 16;
-
- return (UINT8) Count & 0x3F;
-}
-
-/**
- Reads a bit field from a 64-bit value, counts and returns
- the number of set bits.
-
- Counts the number of set bits in the bit field specified by
- StartBit and EndBit in Operand. The count is returned.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The number of bits set between StartBit and EndBit.
-
-**/
-UINT8
-EFIAPI
-BitFieldCountOnes64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- UINT64 BitField;
- UINT8 Count;
-
- ASSERT (EndBit < 64);
- ASSERT (StartBit <= EndBit);
-
- BitField = BitFieldRead64 (Operand, StartBit, EndBit);
- Count = BitFieldCountOnes32 ((UINT32) BitField, 0, 31);
- Count += BitFieldCountOnes32 ((UINT32) RShiftU64(BitField, 32), 0, 31);
-
- return Count;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/CheckSum.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/CheckSum.c
deleted file mode 100644
index 92f0930..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/CheckSum.c
+++ /dev/null
@@ -1,632 +0,0 @@
-/** @file
- Utility functions to generate checksum based on 2's complement
- algorithm.
-
- Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the sum of all elements in a buffer in unit of UINT8.
- During calculation, the carry bits are dropped.
-
- This function calculates the sum of all elements in a buffer
- in unit of UINT8. The carry bits in result of addition are dropped.
- The result is returned as UINT8. If Length is Zero, then Zero is
- returned.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT8
-EFIAPI
-CalculateSum8 (
- IN CONST UINT8 *Buffer,
- IN UINTN Length
- )
-{
- UINT8 Sum;
- UINTN Count;
-
- ASSERT (Buffer != NULL);
- ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
-
- for (Sum = 0, Count = 0; Count < Length; Count++) {
- Sum = (UINT8) (Sum + *(Buffer + Count));
- }
-
- return Sum;
-}
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer
- of 8-bit values.
-
- This function first calculates the sum of the 8-bit values in the
- buffer specified by Buffer and Length. The carry bits in the result
- of addition are dropped. Then, the two's complement of the sum is
- returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT8
-EFIAPI
-CalculateCheckSum8 (
- IN CONST UINT8 *Buffer,
- IN UINTN Length
- )
-{
- UINT8 CheckSum;
-
- CheckSum = CalculateSum8 (Buffer, Length);
-
- //
- // Return the checksum based on 2's complement.
- //
- return (UINT8) (0x100 - CheckSum);
-}
-
-/**
- Returns the sum of all elements in a buffer of 16-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 16-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 16-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT16
-EFIAPI
-CalculateSum16 (
- IN CONST UINT16 *Buffer,
- IN UINTN Length
- )
-{
- UINT16 Sum;
- UINTN Count;
- UINTN Total;
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN) Buffer & 0x1) == 0);
- ASSERT ((Length & 0x1) == 0);
- ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
-
- Total = Length / sizeof (*Buffer);
- for (Sum = 0, Count = 0; Count < Total; Count++) {
- Sum = (UINT16) (Sum + *(Buffer + Count));
- }
-
- return Sum;
-}
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 16-bit values.
-
- This function first calculates the sum of the 16-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT16
-EFIAPI
-CalculateCheckSum16 (
- IN CONST UINT16 *Buffer,
- IN UINTN Length
- )
-{
- UINT16 CheckSum;
-
- CheckSum = CalculateSum16 (Buffer, Length);
-
- //
- // Return the checksum based on 2's complement.
- //
- return (UINT16) (0x10000 - CheckSum);
-}
-
-
-/**
- Returns the sum of all elements in a buffer of 32-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 32-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 32-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT32
-EFIAPI
-CalculateSum32 (
- IN CONST UINT32 *Buffer,
- IN UINTN Length
- )
-{
- UINT32 Sum;
- UINTN Count;
- UINTN Total;
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN) Buffer & 0x3) == 0);
- ASSERT ((Length & 0x3) == 0);
- ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
-
- Total = Length / sizeof (*Buffer);
- for (Sum = 0, Count = 0; Count < Total; Count++) {
- Sum = Sum + *(Buffer + Count);
- }
-
- return Sum;
-}
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 32-bit values.
-
- This function first calculates the sum of the 32-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT32
-EFIAPI
-CalculateCheckSum32 (
- IN CONST UINT32 *Buffer,
- IN UINTN Length
- )
-{
- UINT32 CheckSum;
-
- CheckSum = CalculateSum32 (Buffer, Length);
-
- //
- // Return the checksum based on 2's complement.
- //
- return (UINT32) ((UINT32)(-1) - CheckSum + 1);
-}
-
-
-/**
- Returns the sum of all elements in a buffer of 64-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 64-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 64-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT64
-EFIAPI
-CalculateSum64 (
- IN CONST UINT64 *Buffer,
- IN UINTN Length
- )
-{
- UINT64 Sum;
- UINTN Count;
- UINTN Total;
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN) Buffer & 0x7) == 0);
- ASSERT ((Length & 0x7) == 0);
- ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
-
- Total = Length / sizeof (*Buffer);
- for (Sum = 0, Count = 0; Count < Total; Count++) {
- Sum = Sum + *(Buffer + Count);
- }
-
- return Sum;
-}
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 64-bit values.
-
- This function first calculates the sum of the 64-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT64
-EFIAPI
-CalculateCheckSum64 (
- IN CONST UINT64 *Buffer,
- IN UINTN Length
- )
-{
- UINT64 CheckSum;
-
- CheckSum = CalculateSum64 (Buffer, Length);
-
- //
- // Return the checksum based on 2's complement.
- //
- return (UINT64) ((UINT64)(-1) - CheckSum + 1);
-}
-
-GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT32 mCrcTable[256] = {
- 0x00000000,
- 0x77073096,
- 0xEE0E612C,
- 0x990951BA,
- 0x076DC419,
- 0x706AF48F,
- 0xE963A535,
- 0x9E6495A3,
- 0x0EDB8832,
- 0x79DCB8A4,
- 0xE0D5E91E,
- 0x97D2D988,
- 0x09B64C2B,
- 0x7EB17CBD,
- 0xE7B82D07,
- 0x90BF1D91,
- 0x1DB71064,
- 0x6AB020F2,
- 0xF3B97148,
- 0x84BE41DE,
- 0x1ADAD47D,
- 0x6DDDE4EB,
- 0xF4D4B551,
- 0x83D385C7,
- 0x136C9856,
- 0x646BA8C0,
- 0xFD62F97A,
- 0x8A65C9EC,
- 0x14015C4F,
- 0x63066CD9,
- 0xFA0F3D63,
- 0x8D080DF5,
- 0x3B6E20C8,
- 0x4C69105E,
- 0xD56041E4,
- 0xA2677172,
- 0x3C03E4D1,
- 0x4B04D447,
- 0xD20D85FD,
- 0xA50AB56B,
- 0x35B5A8FA,
- 0x42B2986C,
- 0xDBBBC9D6,
- 0xACBCF940,
- 0x32D86CE3,
- 0x45DF5C75,
- 0xDCD60DCF,
- 0xABD13D59,
- 0x26D930AC,
- 0x51DE003A,
- 0xC8D75180,
- 0xBFD06116,
- 0x21B4F4B5,
- 0x56B3C423,
- 0xCFBA9599,
- 0xB8BDA50F,
- 0x2802B89E,
- 0x5F058808,
- 0xC60CD9B2,
- 0xB10BE924,
- 0x2F6F7C87,
- 0x58684C11,
- 0xC1611DAB,
- 0xB6662D3D,
- 0x76DC4190,
- 0x01DB7106,
- 0x98D220BC,
- 0xEFD5102A,
- 0x71B18589,
- 0x06B6B51F,
- 0x9FBFE4A5,
- 0xE8B8D433,
- 0x7807C9A2,
- 0x0F00F934,
- 0x9609A88E,
- 0xE10E9818,
- 0x7F6A0DBB,
- 0x086D3D2D,
- 0x91646C97,
- 0xE6635C01,
- 0x6B6B51F4,
- 0x1C6C6162,
- 0x856530D8,
- 0xF262004E,
- 0x6C0695ED,
- 0x1B01A57B,
- 0x8208F4C1,
- 0xF50FC457,
- 0x65B0D9C6,
- 0x12B7E950,
- 0x8BBEB8EA,
- 0xFCB9887C,
- 0x62DD1DDF,
- 0x15DA2D49,
- 0x8CD37CF3,
- 0xFBD44C65,
- 0x4DB26158,
- 0x3AB551CE,
- 0xA3BC0074,
- 0xD4BB30E2,
- 0x4ADFA541,
- 0x3DD895D7,
- 0xA4D1C46D,
- 0xD3D6F4FB,
- 0x4369E96A,
- 0x346ED9FC,
- 0xAD678846,
- 0xDA60B8D0,
- 0x44042D73,
- 0x33031DE5,
- 0xAA0A4C5F,
- 0xDD0D7CC9,
- 0x5005713C,
- 0x270241AA,
- 0xBE0B1010,
- 0xC90C2086,
- 0x5768B525,
- 0x206F85B3,
- 0xB966D409,
- 0xCE61E49F,
- 0x5EDEF90E,
- 0x29D9C998,
- 0xB0D09822,
- 0xC7D7A8B4,
- 0x59B33D17,
- 0x2EB40D81,
- 0xB7BD5C3B,
- 0xC0BA6CAD,
- 0xEDB88320,
- 0x9ABFB3B6,
- 0x03B6E20C,
- 0x74B1D29A,
- 0xEAD54739,
- 0x9DD277AF,
- 0x04DB2615,
- 0x73DC1683,
- 0xE3630B12,
- 0x94643B84,
- 0x0D6D6A3E,
- 0x7A6A5AA8,
- 0xE40ECF0B,
- 0x9309FF9D,
- 0x0A00AE27,
- 0x7D079EB1,
- 0xF00F9344,
- 0x8708A3D2,
- 0x1E01F268,
- 0x6906C2FE,
- 0xF762575D,
- 0x806567CB,
- 0x196C3671,
- 0x6E6B06E7,
- 0xFED41B76,
- 0x89D32BE0,
- 0x10DA7A5A,
- 0x67DD4ACC,
- 0xF9B9DF6F,
- 0x8EBEEFF9,
- 0x17B7BE43,
- 0x60B08ED5,
- 0xD6D6A3E8,
- 0xA1D1937E,
- 0x38D8C2C4,
- 0x4FDFF252,
- 0xD1BB67F1,
- 0xA6BC5767,
- 0x3FB506DD,
- 0x48B2364B,
- 0xD80D2BDA,
- 0xAF0A1B4C,
- 0x36034AF6,
- 0x41047A60,
- 0xDF60EFC3,
- 0xA867DF55,
- 0x316E8EEF,
- 0x4669BE79,
- 0xCB61B38C,
- 0xBC66831A,
- 0x256FD2A0,
- 0x5268E236,
- 0xCC0C7795,
- 0xBB0B4703,
- 0x220216B9,
- 0x5505262F,
- 0xC5BA3BBE,
- 0xB2BD0B28,
- 0x2BB45A92,
- 0x5CB36A04,
- 0xC2D7FFA7,
- 0xB5D0CF31,
- 0x2CD99E8B,
- 0x5BDEAE1D,
- 0x9B64C2B0,
- 0xEC63F226,
- 0x756AA39C,
- 0x026D930A,
- 0x9C0906A9,
- 0xEB0E363F,
- 0x72076785,
- 0x05005713,
- 0x95BF4A82,
- 0xE2B87A14,
- 0x7BB12BAE,
- 0x0CB61B38,
- 0x92D28E9B,
- 0xE5D5BE0D,
- 0x7CDCEFB7,
- 0x0BDBDF21,
- 0x86D3D2D4,
- 0xF1D4E242,
- 0x68DDB3F8,
- 0x1FDA836E,
- 0x81BE16CD,
- 0xF6B9265B,
- 0x6FB077E1,
- 0x18B74777,
- 0x88085AE6,
- 0xFF0F6A70,
- 0x66063BCA,
- 0x11010B5C,
- 0x8F659EFF,
- 0xF862AE69,
- 0x616BFFD3,
- 0x166CCF45,
- 0xA00AE278,
- 0xD70DD2EE,
- 0x4E048354,
- 0x3903B3C2,
- 0xA7672661,
- 0xD06016F7,
- 0x4969474D,
- 0x3E6E77DB,
- 0xAED16A4A,
- 0xD9D65ADC,
- 0x40DF0B66,
- 0x37D83BF0,
- 0xA9BCAE53,
- 0xDEBB9EC5,
- 0x47B2CF7F,
- 0x30B5FFE9,
- 0xBDBDF21C,
- 0xCABAC28A,
- 0x53B39330,
- 0x24B4A3A6,
- 0xBAD03605,
- 0xCDD70693,
- 0x54DE5729,
- 0x23D967BF,
- 0xB3667A2E,
- 0xC4614AB8,
- 0x5D681B02,
- 0x2A6F2B94,
- 0xB40BBE37,
- 0xC30C8EA1,
- 0x5A05DF1B,
- 0x2D02EF8D
-};
-
-/**
- Computes and returns a 32-bit CRC for a data buffer.
- CRC32 value bases on ITU-T V.42.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param[in] Buffer A pointer to the buffer on which the 32-bit CRC is to be computed.
- @param[in] Length The number of bytes in the buffer Data.
-
- @retval Crc32 The 32-bit CRC was computed for the data buffer.
-
-**/
-UINT32
-EFIAPI
-CalculateCrc32(
- IN VOID *Buffer,
- IN UINTN Length
- )
-{
- UINTN Index;
- UINT32 Crc;
- UINT8 *Ptr;
-
- ASSERT (Buffer != NULL);
- ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
-
- //
- // Compute CRC
- //
- Crc = 0xffffffff;
- for (Index = 0, Ptr = Buffer; Index < Length; Index++, Ptr++) {
- Crc = (Crc >> 8) ^ mCrcTable[(UINT8) Crc ^ *Ptr];
- }
-
- return Crc ^ 0xffffffff;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/ChkStkGcc.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/ChkStkGcc.c
deleted file mode 100644
index 099fb95..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/ChkStkGcc.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @file
- Provides hack function for passng GCC build.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Hack function for passing GCC build.
-**/
-VOID
-__chkstk()
-{
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Cpu.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Cpu.c
deleted file mode 100644
index 38bab1e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Cpu.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/** @file
- Base Library CPU Functions for all architectures.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-
-/**
- Disables CPU interrupts and returns the interrupt state prior to the disable
- operation.
-
- @retval TRUE CPU interrupts were enabled on entry to this call.
- @retval FALSE CPU interrupts were disabled on entry to this call.
-
-**/
-BOOLEAN
-EFIAPI
-SaveAndDisableInterrupts (
- VOID
- )
-{
- BOOLEAN InterruptState;
-
- InterruptState = GetInterruptState ();
- DisableInterrupts ();
- return InterruptState;
-}
-
-/**
- Set the current CPU interrupt state.
-
- Sets the current CPU interrupt state to the state specified by
- InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
- InterruptState is FALSE, then interrupts are disabled. InterruptState is
- returned.
-
- @param InterruptState TRUE if interrupts should be enabled. FALSE if
- interrupts should be disabled.
-
- @return InterruptState
-
-**/
-BOOLEAN
-EFIAPI
-SetInterruptState (
- IN BOOLEAN InterruptState
- )
-{
- if (InterruptState) {
- EnableInterrupts ();
- } else {
- DisableInterrupts ();
- }
- return InterruptState;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/CpuDeadLoop.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/CpuDeadLoop.c
deleted file mode 100644
index 21c6f39..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/CpuDeadLoop.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- Base Library CPU Functions for all architectures.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-#include
-#include
-
-/**
- Executes an infinite loop.
-
- Forces the CPU to execute an infinite loop. A debugger may be used to skip
- past the loop and the code that follows the loop must execute properly. This
- implies that the infinite loop must not cause the code that follow it to be
- optimized away.
-
-**/
-VOID
-EFIAPI
-CpuDeadLoop (
- VOID
- )
-{
- volatile UINTN Index;
-
- for (Index = 0; Index == 0;);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivS64x64Remainder.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivS64x64Remainder.c
deleted file mode 100644
index 9b8abbd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivS64x64Remainder.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Divides a 64-bit signed integer by a 64-bit signed integer and generates a
- 64-bit signed result and a optional 64-bit signed remainder.
-
- This function divides the 64-bit signed value Dividend by the 64-bit signed
- value Divisor and generates a 64-bit signed quotient. If Remainder is not
- NULL, then the 64-bit signed remainder is returned in Remainder. This
- function returns the 64-bit signed quotient.
-
- It is the caller's responsibility to not call this function with a Divisor of 0.
- If Divisor is 0, then the quotient and remainder should be assumed to be
- the largest negative integer.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit signed value.
- @param Divisor A 64-bit signed value.
- @param Remainder A pointer to a 64-bit signed value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-INT64
-EFIAPI
-DivS64x64Remainder (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
- )
-{
- ASSERT (Divisor != 0);
- return InternalMathDivRemS64x64 (Dividend, Divisor, Remainder);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivU64x32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivU64x32.c
deleted file mode 100644
index 501adda..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivU64x32.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 64-bit unsigned result.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. This
- function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-DivU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- ASSERT (Divisor != 0);
- return InternalMathDivU64x32 (Dividend, Divisor);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivU64x32Remainder.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivU64x32Remainder.c
deleted file mode 100644
index e18a0a2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivU64x32Remainder.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 64-bit unsigned result and an optional 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
- @param Remainder A pointer to a 32-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-DivU64x32Remainder (
- IN UINT64 Dividend,
- IN UINT32 Divisor,
- OUT UINT32 *Remainder OPTIONAL
- )
-{
- ASSERT (Divisor != 0);
- return InternalMathDivRemU64x32 (Dividend, Divisor, Remainder);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivU64x64Remainder.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivU64x64Remainder.c
deleted file mode 100644
index 13509b8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/DivU64x64Remainder.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates
- a 64-bit unsigned result and an optional 64-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 64-bit unsigned value.
- @param Remainder A pointer to a 64-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-DivU64x64Remainder (
- IN UINT64 Dividend,
- IN UINT64 Divisor,
- OUT UINT64 *Remainder OPTIONAL
- )
-{
- ASSERT (Divisor != 0);
- return InternalMathDivRemU64x64 (Dividend, Divisor, Remainder);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/CpuBreakpoint.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/CpuBreakpoint.c
deleted file mode 100644
index 4f33bd8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/CpuBreakpoint.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/** @file
- Base Library CPU Functions for EBC
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-extern
-UINT64
-_break (
- CHAR8 BreakCode
- );
-
-/**
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-**/
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- )
-{
- _break (3);
-}
-
-/**
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-**/
-VOID
-EFIAPI
-MemoryFence (
- VOID
- )
-{
-}
-
-/**
- Disables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-DisableInterrupts (
- VOID
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Enables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-EnableInterrupts (
- VOID
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Retrieves the current CPU interrupt state.
-
- Returns TRUE means interrupts are currently enabled. Otherwise,
- returns FALSE.
-
- @retval TRUE CPU interrupts are enabled.
- @retval FALSE CPU interrupts are disabled.
-
-**/
-BOOLEAN
-EFIAPI
-GetInterruptState (
- VOID
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
-**/
-VOID
-EFIAPI
-EnableDisableInterrupts (
- VOID
- )
-{
- EnableInterrupts ();
- DisableInterrupts ();
-}
-
-/**
- Requests CPU to pause for a short period of time.
-
- Requests CPU to pause for a short period of time. Typically used in MP
- systems to prevent memory starvation while waiting for a spin lock.
-
-**/
-VOID
-EFIAPI
-CpuPause (
- VOID
- )
-{
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c
deleted file mode 100644
index 3c26c78..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/** @file
- Implementation of SetJump() and LongJump() on EBC.
-
- SetJump() and LongJump() are not currently supported for the EBC processor type.
- Implementation for EBC just returns 0 for SetJump(), and ASSERT() for LongJump().
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Saves the current CPU context that can be restored with a call to LongJump() and returns 0.
-
- Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial
- call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero
- value to be returned by SetJump().
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
-
- @retval 0 Indicates a return from SetJump().
-
-**/
-RETURNS_TWICE
-UINTN
-EFIAPI
-SetJump (
- OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- )
-{
- InternalAssertJumpBuffer (JumpBuffer);
- return 0;
-}
-
-/**
- Restores the CPU context that was saved with SetJump().
-
- Restores the CPU context from the buffer specified by JumpBuffer.
- This function never returns to the caller.
- Instead it resumes execution based on the state of JumpBuffer.
-
- @param JumpBuffer A pointer to CPU context buffer.
- @param Value The value to return when the SetJump() context is restored.
-
-**/
-VOID
-EFIAPI
-InternalLongJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
- IN UINTN Value
- )
-{
- //
- // This function cannot work on EBC
- //
- ASSERT (FALSE);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/SpeculationBarrier.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/SpeculationBarrier.c
deleted file mode 100644
index 25a9116..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/SpeculationBarrier.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/** @file
- SpeculationBarrier() function for EBC.
-
- Copyright (C) 2018, Intel Corporation. All rights reserved.
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
- WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-/**
- Uses as a barrier to stop speculative execution.
-
- Ensures that no later instruction will execute speculatively, until all prior
- instructions have completed.
-
-**/
-VOID
-EFIAPI
-SpeculationBarrier (
- VOID
- )
-{
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/SwitchStack.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/SwitchStack.c
deleted file mode 100644
index c90b07a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ebc/SwitchStack.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/** @file
- Switch Stack functions.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the
- new stack specified by NewStack and passing in the parameters specified
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return.
- Marker will be ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param Marker A VA_LIST marker for the variable argument list.
-
-**/
-VOID
-EFIAPI
-InternalSwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VA_LIST Marker
- )
-
-{
- //
- // This version of this function does not actually change the stack pointer
- // This is to support compilation of CPU types that do not support assemblers
- // such as EBC
- //
- EntryPoint (Context1, Context2);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/FilePaths.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/FilePaths.c
deleted file mode 100644
index ebba690..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/FilePaths.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/** @file
- Defines file-path manipulation functions.
-
- Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
- Copyright (c) 2018, Dell Technologies. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-#include
-#include
-
-/**
- Removes the last directory or file entry in a path. For a path which is
- like L"fs0:startup.nsh", it's converted to L"fs0:".
-
- @param[in,out] Path A pointer to the path to modify.
-
- @retval FALSE Nothing was found to remove.
- @retval TRUE A directory or file was removed.
-**/
-BOOLEAN
-EFIAPI
-PathRemoveLastItem(
- IN OUT CHAR16 *Path
- )
-{
- CHAR16 *Walker;
- CHAR16 *LastSlash;
- //
- // get directory name from path... ('chop' off extra)
- //
- for ( Walker = Path, LastSlash = NULL
- ; Walker != NULL && *Walker != CHAR_NULL
- ; Walker++
- ){
- if (*Walker == L'\\' && *(Walker + 1) != CHAR_NULL) {
- LastSlash = Walker+1;
- } else if (*Walker == L':' && *(Walker + 1) != L'\\' && *(Walker + 1) != CHAR_NULL) {
- LastSlash = Walker+1;
- }
- }
- if (LastSlash != NULL) {
- *LastSlash = CHAR_NULL;
- return (TRUE);
- }
- return (FALSE);
-}
-
-/**
- Function to clean up paths.
-
- - Single periods in the path are removed.
- - Double periods in the path are removed along with a single parent directory.
- - Forward slashes L'/' are converted to backward slashes L'\'.
-
- This will be done inline and the existing buffer may be larger than required
- upon completion.
-
- @param[in] Path The pointer to the string containing the path.
-
- @return Returns Path, otherwise returns NULL to indicate that an error has occured.
-**/
-CHAR16*
-EFIAPI
-PathCleanUpDirectories(
- IN CHAR16 *Path
-)
-{
- CHAR16 *TempString;
-
- if (Path == NULL) {
- return NULL;
- }
-
- //
- // Replace the '/' with '\'
- //
- for (TempString = Path; *TempString != CHAR_NULL; TempString++) {
- if (*TempString == L'/') {
- *TempString = L'\\';
- }
- }
-
- //
- // Replace the "\\" with "\"
- //
- while ((TempString = StrStr (Path, L"\\\\")) != NULL) {
- CopyMem (TempString, TempString + 1, StrSize (TempString + 1));
- }
-
- //
- // Remove all the "\.". E.g.: fs0:\abc\.\def\.
- //
- while ((TempString = StrStr (Path, L"\\.\\")) != NULL) {
- CopyMem (TempString, TempString + 2, StrSize (TempString + 2));
- }
- if ((StrLen (Path) >= 2) && (StrCmp (Path + StrLen (Path) - 2, L"\\.") == 0)) {
- Path[StrLen (Path) - 1] = CHAR_NULL;
- }
-
- //
- // Remove all the "\..". E.g.: fs0:\abc\..\def\..
- //
- while (((TempString = StrStr(Path, L"\\..")) != NULL) &&
- ((*(TempString + 3) == L'\\') || (*(TempString + 3) == CHAR_NULL))
- ) {
- *(TempString + 1) = CHAR_NULL;
- PathRemoveLastItem(Path);
- if (*(TempString + 3) != CHAR_NULL) {
- CopyMem (Path + StrLen (Path), TempString + 4, StrSize (TempString + 4));
- }
- }
-
- return Path;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/GetPowerOfTwo32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/GetPowerOfTwo32.c
deleted file mode 100644
index 67b64d6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/GetPowerOfTwo32.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the value of the highest bit set in a 32-bit value. Equivalent to
- 1 << log2(x).
-
- This function computes the value of the highest bit set in the 32-bit value
- specified by Operand. If Operand is zero, then zero is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @return 1 << HighBitSet32(Operand)
- @retval 0 Operand is zero.
-
-**/
-UINT32
-EFIAPI
-GetPowerOfTwo32 (
- IN UINT32 Operand
- )
-{
- if (0 == Operand) {
- return 0;
- }
-
- return 1ul << HighBitSet32 (Operand);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/GetPowerOfTwo64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/GetPowerOfTwo64.c
deleted file mode 100644
index 021b30e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/GetPowerOfTwo64.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the value of the highest bit set in a 64-bit value. Equivalent to
- 1 << log2(x).
-
- This function computes the value of the highest bit set in the 64-bit value
- specified by Operand. If Operand is zero, then zero is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @return 1 << HighBitSet64(Operand)
- @retval 0 Operand is zero.
-
-**/
-UINT64
-EFIAPI
-GetPowerOfTwo64 (
- IN UINT64 Operand
- )
-{
- if (Operand == 0) {
- return 0;
- }
-
- return LShiftU64 (1, (UINTN) HighBitSet64 (Operand));
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/HighBitSet32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/HighBitSet32.c
deleted file mode 100644
index 7d73398..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/HighBitSet32.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the bit position of the highest bit set in a 32-bit value. Equivalent
- to log2(x).
-
- This function computes the bit position of the highest bit set in the 32-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 31 is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @retval 0..31 Position of the highest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-HighBitSet32 (
- IN UINT32 Operand
- )
-{
- INTN BitIndex;
-
- if (Operand == 0) {
- return - 1;
- }
- for (BitIndex = 31; (INT32)Operand > 0; BitIndex--, Operand <<= 1);
- return BitIndex;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/HighBitSet64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/HighBitSet64.c
deleted file mode 100644
index 4fc96fd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/HighBitSet64.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the bit position of the highest bit set in a 64-bit value. Equivalent
- to log2(x).
-
- This function computes the bit position of the highest bit set in the 64-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 63 is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @retval 0..63 Position of the highest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-HighBitSet64 (
- IN UINT64 Operand
- )
-{
- if (Operand == (UINT32)Operand) {
- //
- // Operand is just a 32-bit integer
- //
- return HighBitSet32 ((UINT32)Operand);
- }
-
- //
- // Operand is really a 64-bit integer
- //
- if (sizeof (UINTN) == sizeof (UINT32)) {
- return HighBitSet32 (((UINT32*)&Operand)[1]) + 32;
- } else {
- return HighBitSet32 ((UINT32)RShiftU64 (Operand, 32)) + 32;
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ARShiftU64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ARShiftU64.S
deleted file mode 100644
index aeaadd7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ARShiftU64.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ARShiftU64.S
-#
-# Abstract:
-#
-# 64-bit arithmetic right shift function for IA-32
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMathARShiftU64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathARShiftU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathARShiftU64):
- movb 12(%esp), %cl
- movl 8(%esp), %eax
- cltd
- testb $32, %cl
- jnz L0
- movl %eax, %edx
- movl 4(%esp), %eax
-L0:
- shrdl %cl, %edx, %eax
- sar %cl, %edx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ARShiftU64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ARShiftU64.c
deleted file mode 100644
index c2ebaeb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ARShiftU64.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/** @file
- 64-bit arithmetic right shift function for IA-32.
-
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. The high bits
- are filled with original integer's bit 63. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to bit 63 of Operand. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand arithmetically shifted right by Count.
-
-**/
-UINT64
-EFIAPI
-InternalMathARShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- _asm {
- mov cl, byte ptr [Count]
- mov eax, dword ptr [Operand + 4]
- cdq
- test cl, 32
- jnz L0
- mov edx, eax
- mov eax, dword ptr [Operand + 0]
-L0:
- shrd eax, edx, cl
- sar edx, cl
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ARShiftU64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ARShiftU64.nasm
deleted file mode 100644
index 448e3ab..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ARShiftU64.nasm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ARShiftU64.nasm
-;
-; Abstract:
-;
-; 64-bit arithmetic right shift function for IA-32
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathARShiftU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathARShiftU64)
-ASM_PFX(InternalMathARShiftU64):
- mov cl, [esp + 12]
- mov eax, [esp + 8]
- cdq
- test cl, 32
- jnz .0
- mov edx, eax
- mov eax, [esp + 4]
-.0:
- shrd eax, edx, cl
- sar edx, cl
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
deleted file mode 100644
index e933313..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file
- CpuBreakpoint function.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
-**/
-
-void __debugbreak (VOID);
-
-#pragma intrinsic(__debugbreak)
-
-/**
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-**/
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- )
-{
- __debugbreak ();
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.nasm
deleted file mode 100644
index 4f91895..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.nasm
+++ /dev/null
@@ -1,36 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuBreakpoint.Asm
-;
-; Abstract:
-;
-; CpuBreakpoint function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuBreakpoint (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(CpuBreakpoint)
-ASM_PFX(CpuBreakpoint):
- int 3
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuId.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuId.S
deleted file mode 100644
index 6f9e10c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuId.S
+++ /dev/null
@@ -1,63 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuId.S
-#
-# Abstract:
-#
-# AsmCpuid function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmCpuid)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmCpuid (
-# IN UINT32 RegisterInEax,
-# OUT UINT32 *RegisterOutEax OPTIONAL,
-# OUT UINT32 *RegisterOutEbx OPTIONAL,
-# OUT UINT32 *RegisterOutEcx OPTIONAL,
-# OUT UINT32 *RegisterOutEdx OPTIONAL
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(AsmCpuid):
- push %ebx
- push %ebp
- movl %esp, %ebp
- movl 12(%ebp), %eax
- cpuid
- push %ecx
- movl 16(%ebp), %ecx
- jecxz L1
- movl %eax, (%ecx)
-L1:
- movl 20(%ebp), %ecx
- jecxz L2
- movl %ebx, (%ecx)
-L2:
- movl 24(%ebp), %ecx
- jecxz L3
- popl (%ecx)
-L3:
- movl 28(%ebp), %ecx
- jecxz L4
- movl %edx, (%ecx)
-L4:
- movl 12(%ebp), %eax
- leave
- pop %ebx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuId.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuId.c
deleted file mode 100644
index d9c7266..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuId.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/** @file
- AsmCpuid function.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Retrieves CPUID information.
-
- Executes the CPUID instruction with EAX set to the value specified by Index.
- This function always returns Index.
- If Eax is not NULL, then the value of EAX after CPUID is returned in Eax.
- If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx.
- If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx.
- If Edx is not NULL, then the value of EDX after CPUID is returned in Edx.
- This function is only available on IA-32 and x64.
-
- @param Index The 32-bit value to load into EAX prior to invoking the CPUID
- instruction.
- @param RegisterEax A pointer to the 32-bit EAX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
- @param RegisterEbx A pointer to the 32-bit EBX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
- @param RegisterEcx A pointer to the 32-bit ECX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
- @param RegisterEdx A pointer to the 32-bit EDX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
-
- @return Index.
-
-**/
-UINT32
-EFIAPI
-AsmCpuid (
- IN UINT32 Index,
- OUT UINT32 *RegisterEax, OPTIONAL
- OUT UINT32 *RegisterEbx, OPTIONAL
- OUT UINT32 *RegisterEcx, OPTIONAL
- OUT UINT32 *RegisterEdx OPTIONAL
- )
-{
- _asm {
- mov eax, Index
- cpuid
- push ecx
- mov ecx, RegisterEax
- jecxz SkipEax
- mov [ecx], eax
-SkipEax:
- mov ecx, RegisterEbx
- jecxz SkipEbx
- mov [ecx], ebx
-SkipEbx:
- pop eax
- mov ecx, RegisterEcx
- jecxz SkipEcx
- mov [ecx], eax
-SkipEcx:
- mov ecx, RegisterEdx
- jecxz SkipEdx
- mov [ecx], edx
-SkipEdx:
- mov eax, Index
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuId.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuId.nasm
deleted file mode 100644
index 5996b92..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuId.nasm
+++ /dev/null
@@ -1,65 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuId.Asm
-;
-; Abstract:
-;
-; AsmCpuid function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmCpuid (
-; IN UINT32 RegisterInEax,
-; OUT UINT32 *RegisterOutEax OPTIONAL,
-; OUT UINT32 *RegisterOutEbx OPTIONAL,
-; OUT UINT32 *RegisterOutEcx OPTIONAL,
-; OUT UINT32 *RegisterOutEdx OPTIONAL
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmCpuid)
-ASM_PFX(AsmCpuid):
- push ebx
- push ebp
- mov ebp, esp
- mov eax, [ebp + 12]
- cpuid
- push ecx
- mov ecx, [ebp + 16]
- jecxz .0
- mov [ecx], eax
-.0:
- mov ecx, [ebp + 20]
- jecxz .1
- mov [ecx], ebx
-.1:
- mov ecx, [ebp + 24]
- jecxz .2
- pop DWORD [ecx]
-.2:
- mov ecx, [ebp + 28]
- jecxz .3
- mov [ecx], edx
-.3:
- mov eax, [ebp + 12]
- leave
- pop ebx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuIdEx.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuIdEx.S
deleted file mode 100644
index edcaa89..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuIdEx.S
+++ /dev/null
@@ -1,67 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuIdEx.S
-#
-# Abstract:
-#
-# AsmCpuidEx function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
- .code:
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# AsmCpuidEx (
-# IN UINT32 RegisterInEax,
-# IN UINT32 RegisterInEcx,
-# OUT UINT32 *RegisterOutEax OPTIONAL,
-# OUT UINT32 *RegisterOutEbx OPTIONAL,
-# OUT UINT32 *RegisterOutEcx OPTIONAL,
-# OUT UINT32 *RegisterOutEdx OPTIONAL
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmCpuidEx)
-ASM_PFX(AsmCpuidEx):
- push %ebx
- push %ebp
- movl %esp, %ebp
- movl 12(%ebp), %eax
- movl 16(%ebp), %ecx
- cpuid
- push %ecx
- movl 20(%ebp), %ecx
- jecxz L1
- movl %eax, (%ecx)
-L1:
- movl 24(%ebp), %ecx
- jecxz L2
- movl %ebx, (%ecx)
-L2:
- movl 32(%ebp), %ecx
- jecxz L3
- movl %edx, (%ecx)
-L3:
- movl 28(%ebp), %ecx
- jecxz L4
- popl (%ecx)
-L4:
- movl 12(%ebp), %eax
- leave
- pop %ebx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuIdEx.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuIdEx.c
deleted file mode 100644
index 1b3d91d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuIdEx.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/** @file
- AsmCpuidEx function.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Retrieves CPUID information using an extended leaf identifier.
-
- Executes the CPUID instruction with EAX set to the value specified by Index
- and ECX set to the value specified by SubIndex. This function always returns
- Index. This function is only available on IA-32 and x64.
-
- If Eax is not NULL, then the value of EAX after CPUID is returned in Eax.
- If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx.
- If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx.
- If Edx is not NULL, then the value of EDX after CPUID is returned in Edx.
-
- @param Index The 32-bit value to load into EAX prior to invoking the
- CPUID instruction.
- @param SubIndex The 32-bit value to load into ECX prior to invoking the
- CPUID instruction.
- @param RegisterEax A pointer to the 32-bit EAX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
- @param RegisterEbx A pointer to the 32-bit EBX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
- @param RegisterEcx A pointer to the 32-bit ECX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
- @param RegisterEdx A pointer to the 32-bit EDX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
-
- @return Index.
-
-**/
-UINT32
-EFIAPI
-AsmCpuidEx (
- IN UINT32 Index,
- IN UINT32 SubIndex,
- OUT UINT32 *RegisterEax, OPTIONAL
- OUT UINT32 *RegisterEbx, OPTIONAL
- OUT UINT32 *RegisterEcx, OPTIONAL
- OUT UINT32 *RegisterEdx OPTIONAL
- )
-{
- _asm {
- mov eax, Index
- mov ecx, SubIndex
- cpuid
- push ecx
- mov ecx, RegisterEax
- jecxz SkipEax
- mov [ecx], eax
-SkipEax:
- mov ecx, RegisterEbx
- jecxz SkipEbx
- mov [ecx], ebx
-SkipEbx:
- pop eax
- mov ecx, RegisterEcx
- jecxz SkipEcx
- mov [ecx], eax
-SkipEcx:
- mov ecx, RegisterEdx
- jecxz SkipEdx
- mov [ecx], edx
-SkipEdx:
- mov eax, Index
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuIdEx.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuIdEx.nasm
deleted file mode 100644
index e3d16ec..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuIdEx.nasm
+++ /dev/null
@@ -1,67 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuIdEx.Asm
-;
-; Abstract:
-;
-; AsmCpuidEx function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; AsmCpuidEx (
-; IN UINT32 RegisterInEax,
-; IN UINT32 RegisterInEcx,
-; OUT UINT32 *RegisterOutEax OPTIONAL,
-; OUT UINT32 *RegisterOutEbx OPTIONAL,
-; OUT UINT32 *RegisterOutEcx OPTIONAL,
-; OUT UINT32 *RegisterOutEdx OPTIONAL
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmCpuidEx)
-ASM_PFX(AsmCpuidEx):
- push ebx
- push ebp
- mov ebp, esp
- mov eax, [ebp + 12]
- mov ecx, [ebp + 16]
- cpuid
- push ecx
- mov ecx, [ebp + 20]
- jecxz .0
- mov [ecx], eax
-.0:
- mov ecx, [ebp + 24]
- jecxz .1
- mov [ecx], ebx
-.1:
- mov ecx, [ebp + 32]
- jecxz .2
- mov [ecx], edx
-.2:
- mov ecx, [ebp + 28]
- jecxz .3
- pop DWORD [ecx]
-.3:
- mov eax, [ebp + 12]
- leave
- pop ebx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuPause.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuPause.c
deleted file mode 100644
index e3094e2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuPause.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file
- CpuPause function.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Requests CPU to pause for a short period of time.
-
- Requests CPU to pause for a short period of time. Typically used in MP
- systems to prevent memory starvation while waiting for a spin lock.
-
-**/
-VOID
-EFIAPI
-CpuPause (
- VOID
- )
-{
- _asm {
- pause
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuPause.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuPause.nasm
deleted file mode 100644
index fb92687..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/CpuPause.nasm
+++ /dev/null
@@ -1,36 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuPause.Asm
-;
-; Abstract:
-;
-; CpuPause function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuPause (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(CpuPause)
-ASM_PFX(CpuPause):
- pause
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableCache.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableCache.S
deleted file mode 100644
index cadfa7a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableCache.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# DisableCache.S
-#
-# Abstract:
-#
-# Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a
-# WBINVD instruction.
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmDisableCache (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmDisableCache)
-ASM_PFX(AsmDisableCache):
- movl %cr0, %eax
- btsl $30, %eax
- btrl $29, %eax
- movl %eax, %cr0
- wbinvd
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableCache.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableCache.c
deleted file mode 100644
index 5980639..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableCache.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file
- AsmDisableCache function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Set CD bit and clear NW bit of CR0 followed by a WBINVD.
-
- Disables the caches by setting the CD bit of CR0 to 1, clearing the NW bit of CR0 to 0,
- and executing a WBINVD instruction. This function is only available on IA-32 and x64.
-
-**/
-VOID
-EFIAPI
-AsmDisableCache (
- VOID
- )
-{
- _asm {
- mov eax, cr0
- bts eax, 30
- btr eax, 29
- mov cr0, eax
- wbinvd
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableCache.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableCache.nasm
deleted file mode 100644
index c956b72..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableCache.nasm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; DisableCache.Asm
-;
-; Abstract:
-;
-; Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a
-; WBINVD instruction.
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmDisableCache (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmDisableCache)
-ASM_PFX(AsmDisableCache):
- mov eax, cr0
- bts eax, 30
- btr eax, 29
- mov cr0, eax
- wbinvd
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c
deleted file mode 100644
index a20b3d3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
- DisableInterrupts function.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Disables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-DisableInterrupts (
- VOID
- )
-{
- _asm {
- cli
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.nasm
deleted file mode 100644
index ccf69b0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisableInterrupts.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; DisableInterrupts.Asm
-;
-; Abstract:
-;
-; DisableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; DisableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(DisableInterrupts)
-ASM_PFX(DisableInterrupts):
- cli
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisablePaging32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisablePaging32.S
deleted file mode 100644
index 08b3cc6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisablePaging32.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# DisablePaging32.S
-#
-# Abstract:
-#
-# InternalX86DisablePaging32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalX86DisablePaging32)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86DisablePaging32 (
-# IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-# IN VOID *Context1, OPTIONAL
-# IN VOID *Context2, OPTIONAL
-# IN VOID *NewStack
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86DisablePaging32):
- movl 4(%esp), %ebx
- movl 8(%esp), %ecx
- movl 12(%esp), %edx
- pushfl
- pop %edi # save EFLAGS to edi
- cli
- movl %cr0, %eax
- btrl $31, %eax
- movl 16(%esp), %esp
- movl %eax, %cr0
- push %edi
- popfl # restore EFLAGS from edi
- push %edx
- push %ecx
- call *%ebx
- jmp . # EntryPoint() should not return
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisablePaging32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisablePaging32.c
deleted file mode 100644
index eb75566..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisablePaging32.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/** @file
- AsmDisablePaging32 function.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Disables the 32-bit paging mode on the CPU.
-
- Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 32-paged protected
- mode. This function is only available on IA-32. After the 32-bit paging mode
- is disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be NULL. The function EntryPoint must never return.
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit paged mode.
- 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
- 4) CR3 must point to valid page tables that guarantee that the pages for
- this function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is disabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is disabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is
- disabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is disabled.
-
-**/
-__declspec (naked)
-VOID
-EFIAPI
-InternalX86DisablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- _asm {
- push ebp
- mov ebp, esp
- mov ebx, EntryPoint
- mov ecx, Context1
- mov edx, Context2
- pushfd
- pop edi // save EFLAGS to edi
- cli
- mov eax, cr0
- btr eax, 31
- mov esp, NewStack
- mov cr0, eax
- push edi
- popfd // restore EFLAGS from edi
- push edx
- push ecx
- call ebx
- jmp $ // EntryPoint() should not return
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisablePaging32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisablePaging32.nasm
deleted file mode 100644
index 62813c9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DisablePaging32.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; DisablePaging32.Asm
-;
-; Abstract:
-;
-; AsmDisablePaging32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86DisablePaging32 (
-; IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-; IN VOID *Context1, OPTIONAL
-; IN VOID *Context2, OPTIONAL
-; IN VOID *NewStack
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86DisablePaging32)
-ASM_PFX(InternalX86DisablePaging32):
- mov ebx, [esp + 4]
- mov ecx, [esp + 8]
- mov edx, [esp + 12]
- pushfd
- pop edi ; save EFLAGS to edi
- cli
- mov eax, cr0
- btr eax, 31
- mov esp, [esp + 16]
- mov cr0, eax
- push edi
- popfd ; restore EFLAGS from edi
- push edx
- push ecx
- call ebx
- jmp $ ; EntryPoint() should not return
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c
deleted file mode 100644
index 90c1042..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/** @file
- Integer division worker functions for Ia32.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Worker function that Divides a 64-bit signed integer by a 64-bit signed integer and
- generates a 64-bit signed result and a optional 64-bit signed remainder.
-
- This function divides the 64-bit signed value Dividend by the 64-bit
- signed value Divisor and generates a 64-bit signed quotient. If Remainder
- is not NULL, then the 64-bit signed remainder is returned in Remainder.
- This function returns the 64-bit signed quotient.
-
- @param Dividend A 64-bit signed value.
- @param Divisor A 64-bit signed value.
- @param Remainder A pointer to a 64-bit signed value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-INT64
-EFIAPI
-InternalMathDivRemS64x64 (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
- )
-{
- INT64 Quot;
-
- Quot = InternalMathDivRemU64x64 (
- (UINT64) (Dividend >= 0 ? Dividend : -Dividend),
- (UINT64) (Divisor >= 0 ? Divisor : -Divisor),
- (UINT64 *) Remainder
- );
- if (Remainder != NULL && Dividend < 0) {
- *Remainder = -*Remainder;
- }
- return (Dividend ^ Divisor) >= 0 ? Quot : -Quot;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32.S
deleted file mode 100644
index 55a6854..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# DivU64x32.S
-#
-# Abstract:
-#
-# Calculate the quotient of a 64-bit integer by a 32-bit integer
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMathDivU64x32)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathDivU64x32 (
-# IN UINT64 Dividend,
-# IN UINT32 Divisor
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathDivU64x32):
- movl 8(%esp), %eax
- movl 12(%esp), %ecx
- xorl %edx, %edx
- divl %ecx
- push %eax # save quotient on stack
- movl 8(%esp), %eax
- divl %ecx
- pop %edx # restore high-order dword of the quotient
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32.c
deleted file mode 100644
index e680bf2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/** @file
- Calculate the quotient of a 64-bit integer by a 32-bit integer
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. This
- function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- _asm {
- mov eax, dword ptr [Dividend + 4]
- mov ecx, Divisor
- xor edx, edx
- div ecx
- push eax ; save quotient on stack
- mov eax, dword ptr [Dividend]
- div ecx
- pop edx ; restore high-order dword of the quotient
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32.nasm
deleted file mode 100644
index 6b96f82..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32.nasm
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; DivU64x32.nasm
-;
-; Abstract:
-;
-; Calculate the quotient of a 64-bit integer by a 32-bit integer
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathDivU64x32 (
-; IN UINT64 Dividend,
-; IN UINT32 Divisor
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathDivU64x32)
-ASM_PFX(InternalMathDivU64x32):
- mov eax, [esp + 8]
- mov ecx, [esp + 12]
- xor edx, edx
- div ecx
- push eax ; save quotient on stack
- mov eax, [esp + 8]
- div ecx
- pop edx ; restore high-order dword of the quotient
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.S
deleted file mode 100644
index 743abf2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# DivError.S
-#
-# Abstract:
-#
-# Set error flag for all division functions
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMathDivRemU64x32)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathDivRemU64x32 (
-# IN UINT64 Dividend,
-# IN UINT32 Divisor,
-# OUT UINT32 *Remainder
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathDivRemU64x32):
- movl 12(%esp), %ecx # ecx <- divisor
- movl 8(%esp), %eax # eax <- dividend[32..63]
- xorl %edx, %edx
- divl %ecx # eax <- quotient[32..63], edx <- remainder
- push %eax
- movl 8(%esp), %eax # eax <- dividend[0..31]
- divl %ecx # eax <- quotient[0..31]
- movl 20(%esp), %ecx # ecx <- Remainder
- jecxz L1 # abandon remainder if Remainder == NULL
- movl %edx, (%ecx)
-L1:
- pop %edx # edx <- quotient[32..63]
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c
deleted file mode 100644
index 87f9352..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/** @file
- Set error flag for all division functions
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
- @param Remainder A pointer to a 32-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivRemU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor,
- OUT UINT32 *Remainder
- )
-{
- _asm {
- mov ecx, Divisor
- mov eax, dword ptr [Dividend + 4]
- xor edx, edx
- div ecx
- push eax
- mov eax, dword ptr [Dividend + 0]
- div ecx
- mov ecx, Remainder
- jecxz RemainderNull // abandon remainder if Remainder == NULL
- mov [ecx], edx
-RemainderNull:
- pop edx
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.nasm
deleted file mode 100644
index 1ccc4de..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.nasm
+++ /dev/null
@@ -1,48 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; DivError.asm
-;
-; Abstract:
-;
-; Set error flag for all division functions
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathDivRemU64x32 (
-; IN UINT64 Dividend,
-; IN UINT32 Divisor,
-; OUT UINT32 *Remainder
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathDivRemU64x32)
-ASM_PFX(InternalMathDivRemU64x32):
- mov ecx, [esp + 12] ; ecx <- divisor
- mov eax, [esp + 8] ; eax <- dividend[32..63]
- xor edx, edx
- div ecx ; eax <- quotient[32..63], edx <- remainder
- push eax
- mov eax, [esp + 8] ; eax <- dividend[0..31]
- div ecx ; eax <- quotient[0..31]
- mov ecx, [esp + 20] ; ecx <- Remainder
- jecxz .0 ; abandon remainder if Remainder == NULL
- mov [ecx], edx
-.0:
- pop edx ; edx <- quotient[32..63]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S
deleted file mode 100644
index 709c69f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.S
+++ /dev/null
@@ -1,89 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# DivU64x64Remainder.S
-#
-# Abstract:
-#
-# Calculate the quotient of a 64-bit integer by a 64-bit integer and returns
-# both the quotient and the remainder
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMathDivRemU64x32), ASM_PFX(InternalMathDivRemU64x64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathDivRemU64x64 (
-# IN UINT64 Dividend,
-# IN UINT64 Divisor,
-# OUT UINT64 *Remainder OPTIONAL
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathDivRemU64x64):
- movl 16(%esp), %ecx # ecx <- divisor[32..63]
- testl %ecx, %ecx
- jnz Hard # call _@DivRemU64x64 if Divisor > 2^32
- movl 20(%esp), %ecx
- jecxz L1
- andl $0, 4(%ecx) # zero high dword of remainder
- movl %ecx, 16(%esp) # set up stack frame to match DivRemU64x32
-L1:
- jmp ASM_PFX(InternalMathDivRemU64x32)
-Hard:
- push %ebx
- push %esi
- push %edi
- mov 20(%esp), %edx
- mov 16(%esp), %eax # edx:eax <- dividend
- movl %edx, %edi
- movl %eax, %esi # edi:esi <- dividend
- mov 24(%esp), %ebx # ecx:ebx <- divisor
-L2:
- shrl %edx
- rcrl $1, %eax
- shrdl $1, %ecx, %ebx
- shrl %ecx
- jnz L2
- divl %ebx
- movl %eax, %ebx # ebx <- quotient
- movl 28(%esp), %ecx # ecx <- high dword of divisor
- mull 24(%esp) # edx:eax <- quotient * divisor[0..31]
- imull %ebx, %ecx # ecx <- quotient * divisor[32..63]
- addl %ecx, %edx # edx <- (quotient * divisor)[32..63]
- mov 32(%esp), %ecx # ecx <- addr for Remainder
- jc TooLarge # product > 2^64
- cmpl %edx, %edi # compare high 32 bits
- ja Correct
- jb TooLarge # product > dividend
- cmpl %eax, %esi
- jae Correct # product <= dividend
-TooLarge:
- decl %ebx # adjust quotient by -1
- jecxz Return # return if Remainder == NULL
- sub 24(%esp), %eax
- sbb 28(%esp), %edx # edx:eax <- (quotient - 1) * divisor
-Correct:
- jecxz Return
- subl %eax, %esi
- sbbl %edx, %edi # edi:esi <- remainder
- movl %esi, (%ecx)
- movl %edi, 4(%ecx)
-Return:
- movl %ebx, %eax # eax <- quotient
- xorl %edx, %edx # quotient is 32 bits long
- pop %edi
- pop %esi
- pop %ebx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.nasm
deleted file mode 100644
index c70e129..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/DivU64x64Remainder.nasm
+++ /dev/null
@@ -1,94 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; DivU64x64Remainder.nasm
-;
-; Abstract:
-;
-; Calculate the quotient of a 64-bit integer by a 64-bit integer and returns
-; both the quotient and the remainder
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-extern ASM_PFX(InternalMathDivRemU64x32)
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathDivRemU64x64 (
-; IN UINT64 Dividend,
-; IN UINT64 Divisor,
-; OUT UINT64 *Remainder OPTIONAL
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathDivRemU64x64)
-ASM_PFX(InternalMathDivRemU64x64):
- mov ecx, [esp + 16] ; ecx <- divisor[32..63]
- test ecx, ecx
- jnz _@DivRemU64x64 ; call _@DivRemU64x64 if Divisor > 2^32
- mov ecx, [esp + 20]
- jecxz .0
- and dword [ecx + 4], 0 ; zero high dword of remainder
- mov [esp + 16], ecx ; set up stack frame to match DivRemU64x32
-.0:
- jmp ASM_PFX(InternalMathDivRemU64x32)
-
-_@DivRemU64x64:
- push ebx
- push esi
- push edi
- mov edx, dword [esp + 20]
- mov eax, dword [esp + 16] ; edx:eax <- dividend
- mov edi, edx
- mov esi, eax ; edi:esi <- dividend
- mov ebx, dword [esp + 24] ; ecx:ebx <- divisor
-.1:
- shr edx, 1
- rcr eax, 1
- shrd ebx, ecx, 1
- shr ecx, 1
- jnz .1
- div ebx
- mov ebx, eax ; ebx <- quotient
- mov ecx, [esp + 28] ; ecx <- high dword of divisor
- mul dword [esp + 24] ; edx:eax <- quotient * divisor[0..31]
- imul ecx, ebx ; ecx <- quotient * divisor[32..63]
- add edx, ecx ; edx <- (quotient * divisor)[32..63]
- mov ecx, dword [esp + 32] ; ecx <- addr for Remainder
- jc @TooLarge ; product > 2^64
- cmp edi, edx ; compare high 32 bits
- ja @Correct
- jb @TooLarge ; product > dividend
- cmp esi, eax
- jae @Correct ; product <= dividend
-@TooLarge:
- dec ebx ; adjust quotient by -1
- jecxz @Return ; return if Remainder == NULL
- sub eax, dword [esp + 24]
- sbb edx, dword [esp + 28] ; edx:eax <- (quotient - 1) * divisor
-@Correct:
- jecxz @Return
- sub esi, eax
- sbb edi, edx ; edi:esi <- remainder
- mov [ecx], esi
- mov [ecx + 4], edi
-@Return:
- mov eax, ebx ; eax <- quotient
- xor edx, edx ; quotient is 32 bits long
- pop edi
- pop esi
- pop ebx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableCache.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableCache.S
deleted file mode 100644
index da60eeb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableCache.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# EnableCache.S
-#
-# Abstract:
-#
-# Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear
-# the NW bit of CR0 to 0
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmEnableCache (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmEnableCache)
-ASM_PFX(AsmEnableCache):
- wbinvd
- movl %cr0, %eax
- btrl $30, %eax
- btrl $29, %eax
- movl %eax, %cr0
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableCache.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableCache.c
deleted file mode 100644
index 912defb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableCache.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file
- AsmEnableCache function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Perform a WBINVD and clear both the CD and NW bits of CR0.
-
- Enables the caches by executing a WBINVD instruction and then clear both the CD and NW
- bits of CR0 to 0. This function is only available on IA-32 and x64.
-
-**/
-VOID
-EFIAPI
-AsmEnableCache (
- VOID
- )
-{
- _asm {
- wbinvd
- mov eax, cr0
- btr eax, 30
- btr eax, 29
- mov cr0, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableCache.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableCache.nasm
deleted file mode 100644
index 63c605d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableCache.nasm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; EnableCache.Asm
-;
-; Abstract:
-;
-; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear
-; the NW bit of CR0 to 0
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmEnableCache (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmEnableCache)
-ASM_PFX(AsmEnableCache):
- wbinvd
- mov eax, cr0
- btr eax, 29
- btr eax, 30
- mov cr0, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.S
deleted file mode 100644
index 446c36b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# EnableDisableInterrupts.S
-#
-# Abstract:
-#
-# EnableDisableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(EnableDisableInterrupts)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# EnableDisableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EnableDisableInterrupts):
- sti
- cli
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c
deleted file mode 100644
index d351afb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file
- EnableDisableInterrupts function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
-**/
-VOID
-EFIAPI
-EnableDisableInterrupts (
- VOID
- )
-{
- _asm {
- sti
- nop
- nop
- cli
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.nasm
deleted file mode 100644
index d5cb3e6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableDisableInterrupts.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; EnableDisableInterrupts.Asm
-;
-; Abstract:
-;
-; EnableDisableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; EnableDisableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(EnableDisableInterrupts)
-ASM_PFX(EnableDisableInterrupts):
- sti
- cli
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c
deleted file mode 100644
index 7fe14cb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
- EnableInterrupts function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Enables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-EnableInterrupts (
- VOID
- )
-{
- _asm {
- sti
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.nasm
deleted file mode 100644
index f4a4111..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnableInterrupts.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; EnableInterrupts.Asm
-;
-; Abstract:
-;
-; EnableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; EnableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(EnableInterrupts)
-ASM_PFX(EnableInterrupts):
- sti
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging32.S
deleted file mode 100644
index 2449556..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging32.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# EnablePaging32.S
-#
-# Abstract:
-#
-# InternalX86EnablePaging32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalX86EnablePaging32)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86EnablePaging32 (
-# IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-# IN VOID *Context1, OPTIONAL
-# IN VOID *Context2, OPTIONAL
-# IN VOID *NewStack
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86EnablePaging32):
- movl 4(%esp), %ebx
- movl 8(%esp), %ecx
- movl 12(%esp), %edx
- pushfl
- pop %edi # save flags in edi
- cli
- movl %cr0, %eax
- btsl $31, %eax
- movl 16(%esp), %esp
- movl %eax, %cr0
- push %edi
- popfl # restore flags
- push %edx
- push %ecx
- call *%ebx
- jmp .
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging32.c
deleted file mode 100644
index 18e9d11..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging32.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/** @file
- AsmEnablePaging32 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Enables the 32-bit paging mode on the CPU.
-
- Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode. This function is
- only available on IA-32. After the 32-bit paging mode is enabled, control is
- transferred to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit protected mode with flat descriptors. This
- means all descriptors must have a base of 0 and a limit of 4GB.
- 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
- descriptors.
- 4) CR3 must point to valid page tables that will be used once the transition
- is complete, and those page tables must guarantee that the pages for this
- function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is enabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is enabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is enabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is enabled.
-
-**/
-__declspec (naked)
-VOID
-EFIAPI
-InternalX86EnablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- _asm {
- push ebp
- mov ebp, esp
- mov ebx, EntryPoint
- mov ecx, Context1
- mov edx, Context2
- pushfd
- pop edi
- cli
- mov eax, cr0
- bts eax, 31
- mov esp, NewStack
- mov cr0, eax
- push edi
- popfd
- push edx
- push ecx
- call ebx
- jmp $
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging32.nasm
deleted file mode 100644
index f0949be..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging32.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; EnablePaging32.Asm
-;
-; Abstract:
-;
-; AsmEnablePaging32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86EnablePaging32 (
-; IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-; IN VOID *Context1, OPTIONAL
-; IN VOID *Context2, OPTIONAL
-; IN VOID *NewStack
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86EnablePaging32)
-ASM_PFX(InternalX86EnablePaging32):
- mov ebx, [esp + 4]
- mov ecx, [esp + 8]
- mov edx, [esp + 12]
- pushfd
- pop edi ; save flags in edi
- cli
- mov eax, cr0
- bts eax, 31
- mov esp, [esp + 16]
- mov cr0, eax
- push edi
- popfd ; restore flags
- push edx
- push ecx
- call ebx
- jmp $
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging64.S
deleted file mode 100644
index e1c7f60..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging64.S
+++ /dev/null
@@ -1,63 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# EnablePaging64.S
-#
-# Abstract:
-#
-# InternalX86EnablePaging64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalX86EnablePaging64)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86EnablePaging64 (
-# IN UINT16 CodeSelector,
-# IN UINT64 EntryPoint,
-# IN UINT64 Context1, OPTIONAL
-# IN UINT64 Context2, OPTIONAL
-# IN UINT64 NewStack
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86EnablePaging64):
- cli
- movl $LongStart, (%esp) # offset for far retf, seg is the 1st arg
- movl %cr4, %eax
- orb $0x20, %al
- movl %eax, %cr4 # enable PAE
- movl $0xc0000080, %ecx
- rdmsr
- orb $1, %ah # set LME
- wrmsr
- movl %cr0, %eax
- btsl $31, %eax # set PG
- movl %eax, %cr0 # enable paging
- lret # topmost 2 dwords hold the address
-LongStart: # long mode starts here
- .byte 0x67, 0x48 # 32-bit address size, 64-bit operand size
- movl (%esp), %ebx # mov rbx, [esp]
- .byte 0x67, 0x48
- movl 8(%esp), %ecx # mov rcx, [esp + 8]
- .byte 0x67, 0x48
- movl 0x10(%esp), %edx # mov rdx, [esp + 10h]
- .byte 0x67, 0x48
- movl 0x18(%esp), %esp # mov rsp, [esp + 18h]
- .byte 0x48
- addl $-0x20, %esp # add rsp, -20h
- call *%ebx # call rbx
- jmp . # no one should get here
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm
deleted file mode 100644
index 91c89ee..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/EnablePaging64.nasm
+++ /dev/null
@@ -1,65 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; EnablePaging64.Asm
-;
-; Abstract:
-;
-; AsmEnablePaging64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86EnablePaging64 (
-; IN UINT16 Cs,
-; IN UINT64 EntryPoint,
-; IN UINT64 Context1, OPTIONAL
-; IN UINT64 Context2, OPTIONAL
-; IN UINT64 NewStack
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86EnablePaging64)
-ASM_PFX(InternalX86EnablePaging64):
- cli
- mov DWORD [esp], .0 ; offset for far retf, seg is the 1st arg
- mov eax, cr4
- or al, (1 << 5)
- mov cr4, eax ; enable PAE
- mov ecx, 0xc0000080
- rdmsr
- or ah, 1 ; set LME
- wrmsr
- mov eax, cr0
- bts eax, 31 ; set PG
- mov cr0, eax ; enable paging
- retf ; topmost 2 dwords hold the address
-.0:
- DB 0x67, 0x48 ; 32-bit address size, 64-bit operand size
- mov ebx, [esp] ; mov rbx, [esp]
- DB 0x67, 0x48
- mov ecx, [esp + 8] ; mov rcx, [esp + 8]
- DB 0x67, 0x48
- mov edx, [esp + 0x10] ; mov rdx, [esp + 10h]
- DB 0x67, 0x48
- mov esp, [esp + 0x18] ; mov rsp, [esp + 18h]
- DB 0x48
- add esp, -0x20 ; add rsp, -20h
- call ebx ; call rbx
- hlt ; no one should get here
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c
deleted file mode 100644
index bd6d2bf..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/** @file
- AsmFlushCacheLine function
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Flushes a cache line from all the instruction and data caches within the
- coherency domain of the CPU.
-
- Flushed the cache line specified by LinearAddress, and returns LinearAddress.
- This function is only available on IA-32 and x64.
-
- @param LinearAddress The address of the cache line to flush. If the CPU is
- in a physical addressing mode, then LinearAddress is a
- physical address. If the CPU is in a virtual
- addressing mode, then LinearAddress is a virtual
- address.
-
- @return LinearAddress
-**/
-VOID *
-EFIAPI
-AsmFlushCacheLine (
- IN VOID *LinearAddress
- )
-{
- //
- // If the CPU does not support CLFLUSH instruction,
- // then promote flush range to flush entire cache.
- //
- _asm {
- mov eax, 1
- cpuid
- test edx, BIT19
- jz NoClflush
- mov eax, dword ptr [LinearAddress]
- clflush [eax]
- jmp Done
-NoClflush:
- wbinvd
-Done:
- }
-
- return LinearAddress;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.nasm
deleted file mode 100644
index 088b7aa..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.nasm
+++ /dev/null
@@ -1,51 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; FlushCacheLine.Asm
-;
-; Abstract:
-;
-; AsmFlushCacheLine function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; AsmFlushCacheLine (
-; IN VOID *LinearAddress
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmFlushCacheLine)
-ASM_PFX(AsmFlushCacheLine):
- ;
- ; If the CPU does not support CLFLUSH instruction,
- ; then promote flush range to flush entire cache.
- ;
- mov eax, 1
- push ebx
- cpuid
- pop ebx
- mov eax, [esp + 4]
- test edx, BIT19
- jz .0
- clflush [eax]
- ret
-.0:
- wbinvd
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxRestore.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxRestore.c
deleted file mode 100644
index b64284a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxRestore.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
- AsmFxRestore function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-/**
- Restores the current floating point/SSE/SSE2 context from a buffer.
-
- Restores the current floating point/SSE/SSE2 state from the buffer specified
- by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
- only available on IA-32 and x64.
-
- @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-InternalX86FxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- )
-{
- _asm {
- mov eax, Buffer
- fxrstor [eax]
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxRestore.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxRestore.nasm
deleted file mode 100644
index 5c33747..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxRestore.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; FxRestore.Asm
-;
-; Abstract:
-;
-; AsmFxRestore function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86FxRestore (
-; IN CONST IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86FxRestore)
-ASM_PFX(InternalX86FxRestore):
- mov eax, [esp + 4] ; Buffer must be 16-byte aligned
- fxrstor [eax]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxSave.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxSave.c
deleted file mode 100644
index 0de252f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxSave.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
- AsmFxSave function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-/**
- Save the current floating point/SSE/SSE2 context to a buffer.
-
- Saves the current floating point/SSE/SSE2 state to the buffer specified by
- Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
- available on IA-32 and x64.
-
- @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-InternalX86FxSave (
- OUT IA32_FX_BUFFER *Buffer
- )
-{
- _asm {
- mov eax, Buffer
- fxsave [eax]
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxSave.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxSave.nasm
deleted file mode 100644
index f22e19e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/FxSave.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; FxSave.Asm
-;
-; Abstract:
-;
-; AsmFxSave function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86FxSave (
-; OUT IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86FxSave)
-ASM_PFX(InternalX86FxSave):
- mov eax, [esp + 4] ; Buffer must be 16-byte aligned
- fxsave [eax]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/GccInline.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/GccInline.c
deleted file mode 100644
index e46a6c6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/GccInline.c
+++ /dev/null
@@ -1,1771 +0,0 @@
-/** @file
- GCC inline implementation of BaseLib processor specific functions.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-
-/**
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-**/
-VOID
-EFIAPI
-MemoryFence (
- VOID
- )
-{
- // This is a little bit of overkill and it is more about the compiler that it is
- // actually processor synchronization. This is like the _ReadWriteBarrier
- // Microsoft specific intrinsic
- __asm__ __volatile__ ("":::"memory");
-}
-
-
-/**
- Enables CPU interrupts.
-
- Enables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-EnableInterrupts (
- VOID
- )
-{
- __asm__ __volatile__ ("sti"::: "memory");
-}
-
-
-/**
- Disables CPU interrupts.
-
- Disables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-DisableInterrupts (
- VOID
- )
-{
- __asm__ __volatile__ ("cli"::: "memory");
-}
-
-
-
-
-/**
- Requests CPU to pause for a short period of time.
-
- Requests CPU to pause for a short period of time. Typically used in MP
- systems to prevent memory starvation while waiting for a spin lock.
-
-**/
-VOID
-EFIAPI
-CpuPause (
- VOID
- )
-{
- __asm__ __volatile__ ("pause");
-}
-
-
-/**
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-**/
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- )
-{
- __asm__ __volatile__ ("int $3");
-}
-
-
-
-/**
- Returns a 64-bit Machine Specific Register(MSR).
-
- Reads and returns the 64-bit MSR specified by Index. No parameter checking is
- performed on Index, and some Index values may cause CPU exceptions. The
- caller must either guarantee that Index is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and X64.
-
- @param Index The 32-bit MSR index to read.
-
- @return The value of the MSR identified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadMsr64 (
- IN UINT32 Index
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "rdmsr"
- : "=A" (Data) // %0
- : "c" (Index) // %1
- );
-
- return Data;
-}
-
-/**
- Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
- value.
-
- Writes the 64-bit value specified by Value to the MSR specified by Index. The
- 64-bit value written to the MSR is returned. No parameter checking is
- performed on Index or Value, and some of these may cause CPU exceptions. The
- caller must either guarantee that Index and Value are valid, or the caller
- must establish proper exception handlers. This function is only available on
- IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param Value The 64-bit value to write to the MSR.
-
- @return Value
-
-**/
-UINT64
-EFIAPI
-AsmWriteMsr64 (
- IN UINT32 Index,
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "wrmsr"
- :
- : "c" (Index),
- "A" (Value)
- );
-
- return Value;
-}
-
-
-
-/**
- Reads the current value of the EFLAGS register.
-
- Reads and returns the current value of the EFLAGS register. This function is
- only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a
- 64-bit value on X64.
-
- @return EFLAGS on IA-32 or RFLAGS on X64.
-
-**/
-UINTN
-EFIAPI
-AsmReadEflags (
- VOID
- )
-{
- UINTN Eflags;
-
- __asm__ __volatile__ (
- "pushfl \n\t"
- "popl %0 "
- : "=r" (Eflags)
- );
-
- return Eflags;
-}
-
-
-
-/**
- Reads the current value of the Control Register 0 (CR0).
-
- Reads and returns the current value of CR0. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 0 (CR0).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr0 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%cr0,%0"
- : "=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of the Control Register 2 (CR2).
-
- Reads and returns the current value of CR2. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 2 (CR2).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr2 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%cr2, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-/**
- Reads the current value of the Control Register 3 (CR3).
-
- Reads and returns the current value of CR3. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 3 (CR3).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr3 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%cr3, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of the Control Register 4 (CR4).
-
- Reads and returns the current value of CR4. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 4 (CR4).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr4 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%cr4, %0"
- : "=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Writes a value to Control Register 0 (CR0).
-
- Writes and returns a new value to CR0. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr0 The value to write to CR0.
-
- @return The value written to CR0.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr0 (
- UINTN Cr0
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%cr0"
- :
- : "r" (Cr0)
- );
- return Cr0;
-}
-
-
-/**
- Writes a value to Control Register 2 (CR2).
-
- Writes and returns a new value to CR2. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr2 The value to write to CR2.
-
- @return The value written to CR2.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr2 (
- UINTN Cr2
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%cr2"
- :
- : "r" (Cr2)
- );
- return Cr2;
-}
-
-
-/**
- Writes a value to Control Register 3 (CR3).
-
- Writes and returns a new value to CR3. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr3 The value to write to CR3.
-
- @return The value written to CR3.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr3 (
- UINTN Cr3
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%cr3"
- :
- : "r" (Cr3)
- );
- return Cr3;
-}
-
-
-/**
- Writes a value to Control Register 4 (CR4).
-
- Writes and returns a new value to CR4. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr4 The value to write to CR4.
-
- @return The value written to CR4.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr4 (
- UINTN Cr4
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%cr4"
- :
- : "r" (Cr4)
- );
- return Cr4;
-}
-
-
-/**
- Reads the current value of Debug Register 0 (DR0).
-
- Reads and returns the current value of DR0. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 0 (DR0).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr0 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%dr0, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 1 (DR1).
-
- Reads and returns the current value of DR1. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 1 (DR1).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr1 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%dr1, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 2 (DR2).
-
- Reads and returns the current value of DR2. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 2 (DR2).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr2 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%dr2, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 3 (DR3).
-
- Reads and returns the current value of DR3. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 3 (DR3).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr3 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%dr3, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 4 (DR4).
-
- Reads and returns the current value of DR4. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 4 (DR4).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr4 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%dr4, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 5 (DR5).
-
- Reads and returns the current value of DR5. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 5 (DR5).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr5 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%dr5, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 6 (DR6).
-
- Reads and returns the current value of DR6. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 6 (DR6).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr6 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%dr6, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 7 (DR7).
-
- Reads and returns the current value of DR7. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 7 (DR7).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr7 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "movl %%dr7, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Writes a value to Debug Register 0 (DR0).
-
- Writes and returns a new value to DR0. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr0 The value to write to Dr0.
-
- @return The value written to Debug Register 0 (DR0).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr0 (
- UINTN Dr0
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%dr0"
- :
- : "r" (Dr0)
- );
- return Dr0;
-}
-
-
-/**
- Writes a value to Debug Register 1 (DR1).
-
- Writes and returns a new value to DR1. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr1 The value to write to Dr1.
-
- @return The value written to Debug Register 1 (DR1).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr1 (
- UINTN Dr1
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%dr1"
- :
- : "r" (Dr1)
- );
- return Dr1;
-}
-
-
-/**
- Writes a value to Debug Register 2 (DR2).
-
- Writes and returns a new value to DR2. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr2 The value to write to Dr2.
-
- @return The value written to Debug Register 2 (DR2).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr2 (
- UINTN Dr2
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%dr2"
- :
- : "r" (Dr2)
- );
- return Dr2;
-}
-
-
-/**
- Writes a value to Debug Register 3 (DR3).
-
- Writes and returns a new value to DR3. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr3 The value to write to Dr3.
-
- @return The value written to Debug Register 3 (DR3).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr3 (
- UINTN Dr3
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%dr3"
- :
- : "r" (Dr3)
- );
- return Dr3;
-}
-
-
-/**
- Writes a value to Debug Register 4 (DR4).
-
- Writes and returns a new value to DR4. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr4 The value to write to Dr4.
-
- @return The value written to Debug Register 4 (DR4).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr4 (
- UINTN Dr4
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%dr4"
- :
- : "r" (Dr4)
- );
- return Dr4;
-}
-
-
-/**
- Writes a value to Debug Register 5 (DR5).
-
- Writes and returns a new value to DR5. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr5 The value to write to Dr5.
-
- @return The value written to Debug Register 5 (DR5).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr5 (
- UINTN Dr5
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%dr5"
- :
- : "r" (Dr5)
- );
- return Dr5;
-}
-
-
-/**
- Writes a value to Debug Register 6 (DR6).
-
- Writes and returns a new value to DR6. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr6 The value to write to Dr6.
-
- @return The value written to Debug Register 6 (DR6).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr6 (
- UINTN Dr6
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%dr6"
- :
- : "r" (Dr6)
- );
- return Dr6;
-}
-
-
-/**
- Writes a value to Debug Register 7 (DR7).
-
- Writes and returns a new value to DR7. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr7 The value to write to Dr7.
-
- @return The value written to Debug Register 7 (DR7).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr7 (
- UINTN Dr7
- )
-{
- __asm__ __volatile__ (
- "movl %0, %%dr7"
- :
- : "r" (Dr7)
- );
- return Dr7;
-}
-
-
-/**
- Reads the current value of Code Segment Register (CS).
-
- Reads and returns the current value of CS. This function is only available on
- IA-32 and X64.
-
- @return The current value of CS.
-
-**/
-UINT16
-EFIAPI
-AsmReadCs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%cs, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Data Segment Register (DS).
-
- Reads and returns the current value of DS. This function is only available on
- IA-32 and X64.
-
- @return The current value of DS.
-
-**/
-UINT16
-EFIAPI
-AsmReadDs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%ds, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Extra Segment Register (ES).
-
- Reads and returns the current value of ES. This function is only available on
- IA-32 and X64.
-
- @return The current value of ES.
-
-**/
-UINT16
-EFIAPI
-AsmReadEs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%es, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of FS Data Segment Register (FS).
-
- Reads and returns the current value of FS. This function is only available on
- IA-32 and X64.
-
- @return The current value of FS.
-
-**/
-UINT16
-EFIAPI
-AsmReadFs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%fs, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of GS Data Segment Register (GS).
-
- Reads and returns the current value of GS. This function is only available on
- IA-32 and X64.
-
- @return The current value of GS.
-
-**/
-UINT16
-EFIAPI
-AsmReadGs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%gs, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Stack Segment Register (SS).
-
- Reads and returns the current value of SS. This function is only available on
- IA-32 and X64.
-
- @return The current value of SS.
-
-**/
-UINT16
-EFIAPI
-AsmReadSs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%ds, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Task Register (TR).
-
- Reads and returns the current value of TR. This function is only available on
- IA-32 and X64.
-
- @return The current value of TR.
-
-**/
-UINT16
-EFIAPI
-AsmReadTr (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "str %0"
- : "=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current Global Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current GDTR descriptor and returns it in Gdtr. This
- function is only available on IA-32 and X64.
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86ReadGdtr (
- OUT IA32_DESCRIPTOR *Gdtr
- )
-{
- __asm__ __volatile__ (
- "sgdt %0"
- : "=m" (*Gdtr)
- );
-}
-
-
-/**
- Writes the current Global Descriptor Table Register (GDTR) descriptor.
-
- Writes and the current GDTR descriptor specified by Gdtr. This function is
- only available on IA-32 and X64.
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86WriteGdtr (
- IN CONST IA32_DESCRIPTOR *Gdtr
- )
-{
- __asm__ __volatile__ (
- "lgdt %0"
- :
- : "m" (*Gdtr)
- );
-
-}
-
-
-/**
- Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current IDTR descriptor and returns it in Idtr. This
- function is only available on IA-32 and X64.
-
- @param Idtr The pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86ReadIdtr (
- OUT IA32_DESCRIPTOR *Idtr
- )
-{
- __asm__ __volatile__ (
- "sidt %0"
- : "=m" (*Idtr)
- );
-}
-
-
-/**
- Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Writes the current IDTR descriptor and returns it in Idtr. This function is
- only available on IA-32 and X64.
-
- @param Idtr The pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86WriteIdtr (
- IN CONST IA32_DESCRIPTOR *Idtr
- )
-{
- __asm__ __volatile__ (
- "lidt %0"
- :
- : "m" (*Idtr)
- );
-}
-
-
-/**
- Reads the current Local Descriptor Table Register(LDTR) selector.
-
- Reads and returns the current 16-bit LDTR descriptor value. This function is
- only available on IA-32 and X64.
-
- @return The current selector of LDT.
-
-**/
-UINT16
-EFIAPI
-AsmReadLdtr (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "sldt %0"
- : "=g" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Writes the current Local Descriptor Table Register (GDTR) selector.
-
- Writes and the current LDTR descriptor specified by Ldtr. This function is
- only available on IA-32 and X64.
-
- @param Ldtr 16-bit LDTR selector value.
-
-**/
-VOID
-EFIAPI
-AsmWriteLdtr (
- IN UINT16 Ldtr
- )
-{
- __asm__ __volatile__ (
- "lldtw %0"
- :
- : "g" (Ldtr) // %0
- );
-}
-
-
-/**
- Save the current floating point/SSE/SSE2 context to a buffer.
-
- Saves the current floating point/SSE/SSE2 state to the buffer specified by
- Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
- available on IA-32 and X64.
-
- @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-InternalX86FxSave (
- OUT IA32_FX_BUFFER *Buffer
- )
-{
- __asm__ __volatile__ (
- "fxsave %0"
- :
- : "m" (*Buffer) // %0
- );
-}
-
-
-/**
- Restores the current floating point/SSE/SSE2 context from a buffer.
-
- Restores the current floating point/SSE/SSE2 state from the buffer specified
- by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
- only available on IA-32 and X64.
-
- @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-InternalX86FxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- )
-{
- __asm__ __volatile__ (
- "fxrstor %0"
- :
- : "m" (*Buffer) // %0
- );
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #0 (MM0).
-
- Reads and returns the current value of MM0. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM0.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm0 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "push %%eax \n\t"
- "push %%eax \n\t"
- "movq %%mm0, (%%esp)\n\t"
- "pop %%eax \n\t"
- "pop %%edx \n\t"
- : "=A" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #1 (MM1).
-
- Reads and returns the current value of MM1. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM1.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm1 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "push %%eax \n\t"
- "push %%eax \n\t"
- "movq %%mm1, (%%esp)\n\t"
- "pop %%eax \n\t"
- "pop %%edx \n\t"
- : "=A" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #2 (MM2).
-
- Reads and returns the current value of MM2. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM2.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm2 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "push %%eax \n\t"
- "push %%eax \n\t"
- "movq %%mm2, (%%esp)\n\t"
- "pop %%eax \n\t"
- "pop %%edx \n\t"
- : "=A" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #3 (MM3).
-
- Reads and returns the current value of MM3. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM3.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm3 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "push %%eax \n\t"
- "push %%eax \n\t"
- "movq %%mm3, (%%esp)\n\t"
- "pop %%eax \n\t"
- "pop %%edx \n\t"
- : "=A" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #4 (MM4).
-
- Reads and returns the current value of MM4. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM4.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm4 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "push %%eax \n\t"
- "push %%eax \n\t"
- "movq %%mm4, (%%esp)\n\t"
- "pop %%eax \n\t"
- "pop %%edx \n\t"
- : "=A" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #5 (MM5).
-
- Reads and returns the current value of MM5. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM5.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm5 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "push %%eax \n\t"
- "push %%eax \n\t"
- "movq %%mm5, (%%esp)\n\t"
- "pop %%eax \n\t"
- "pop %%edx \n\t"
- : "=A" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #6 (MM6).
-
- Reads and returns the current value of MM6. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM6.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm6 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "push %%eax \n\t"
- "push %%eax \n\t"
- "movq %%mm6, (%%esp)\n\t"
- "pop %%eax \n\t"
- "pop %%edx \n\t"
- : "=A" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #7 (MM7).
-
- Reads and returns the current value of MM7. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM7.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm7 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "push %%eax \n\t"
- "push %%eax \n\t"
- "movq %%mm7, (%%esp)\n\t"
- "pop %%eax \n\t"
- "pop %%edx \n\t"
- : "=A" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #0 (MM0).
-
- Writes the current value of MM0. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM0.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm0 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movq %0, %%mm0" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #1 (MM1).
-
- Writes the current value of MM1. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM1.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm1 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movq %0, %%mm1" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #2 (MM2).
-
- Writes the current value of MM2. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM2.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm2 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movq %0, %%mm2" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #3 (MM3).
-
- Writes the current value of MM3. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM3.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm3 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movq %0, %%mm3" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #4 (MM4).
-
- Writes the current value of MM4. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM4.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm4 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movq %0, %%mm4" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #5 (MM5).
-
- Writes the current value of MM5. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM5.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm5 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movq %0, %%mm5" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #6 (MM6).
-
- Writes the current value of MM6. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM6.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm6 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movq %0, %%mm6" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #7 (MM7).
-
- Writes the current value of MM7. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM7.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm7 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movq %0, %%mm7" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Reads the current value of Time Stamp Counter (TSC).
-
- Reads and returns the current value of TSC. This function is only available
- on IA-32 and X64.
-
- @return The current value of TSC
-
-**/
-UINT64
-EFIAPI
-AsmReadTsc (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "rdtsc"
- : "=A" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of a Performance Counter (PMC).
-
- Reads and returns the current value of performance counter specified by
- Index. This function is only available on IA-32 and X64.
-
- @param Index The 32-bit Performance Counter index to read.
-
- @return The value of the PMC specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmc (
- IN UINT32 Index
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "rdpmc"
- : "=A" (Data)
- : "c" (Index)
- );
-
- return Data;
-}
-
-
-
-
-/**
- Executes a WBINVD instruction.
-
- Executes a WBINVD instruction. This function is only available on IA-32 and
- X64.
-
-**/
-VOID
-EFIAPI
-AsmWbinvd (
- VOID
- )
-{
- __asm__ __volatile__ ("wbinvd":::"memory");
-}
-
-
-/**
- Executes a INVD instruction.
-
- Executes a INVD instruction. This function is only available on IA-32 and
- X64.
-
-**/
-VOID
-EFIAPI
-AsmInvd (
- VOID
- )
-{
- __asm__ __volatile__ ("invd":::"memory");
-
-}
-
-
-/**
- Flushes a cache line from all the instruction and data caches within the
- coherency domain of the CPU.
-
- Flushed the cache line specified by LinearAddress, and returns LinearAddress.
- This function is only available on IA-32 and X64.
-
- @param LinearAddress The address of the cache line to flush. If the CPU is
- in a physical addressing mode, then LinearAddress is a
- physical address. If the CPU is in a virtual
- addressing mode, then LinearAddress is a virtual
- address.
-
- @return LinearAddress
-**/
-VOID *
-EFIAPI
-AsmFlushCacheLine (
- IN VOID *LinearAddress
- )
-{
- UINT32 RegEdx;
-
- //
- // If the CPU does not support CLFLUSH instruction,
- // then promote flush range to flush entire cache.
- //
- AsmCpuid (0x01, NULL, NULL, NULL, &RegEdx);
- if ((RegEdx & BIT19) == 0) {
- __asm__ __volatile__ ("wbinvd":::"memory");
- return LinearAddress;
- }
-
-
- __asm__ __volatile__ (
- "clflush (%0)"
- : "+a" (LinearAddress)
- :
- : "memory"
- );
-
- return LinearAddress;
-}
-
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.S
deleted file mode 100644
index cf732b0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# Portions copyright (c) 2011, Apple Inc. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# InternalSwitchStack.S
-#
-# Abstract:
-#
-# Implementation of a stack switch on IA-32.
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalSwitchStack)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalSwitchStack (
-# IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-# IN VOID *Context1, OPTIONAL
-# IN VOID *Context2, OPTIONAL
-# IN VOID *NewStack
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalSwitchStack):
- pushl %ebp
- movl %esp, %ebp
-
- movl 20(%ebp), %esp # switch stack
- subl $8, %esp
-
- movl 16(%ebp), %eax
- movl %eax, 4(%esp)
- movl 12(%ebp), %eax
- movl %eax, (%esp)
- pushl $0 # keeps gdb from unwinding stack
- jmp *8(%ebp) # call and never return
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.c
deleted file mode 100644
index 182b0b0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @file
- SwitchStack() function for IA-32.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the
- new stack specified by NewStack and passing in the parameters specified
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return.
- Marker will be ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param Marker VA_LIST marker for the variable argument list.
-
-**/
-VOID
-EFIAPI
-InternalSwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VA_LIST Marker
- )
-{
- BASE_LIBRARY_JUMP_BUFFER JumpBuffer;
-
- JumpBuffer.Eip = (UINTN)EntryPoint;
- JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);
- JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2);
- ((VOID**)JumpBuffer.Esp)[1] = Context1;
- ((VOID**)JumpBuffer.Esp)[2] = Context2;
-
- LongJump (&JumpBuffer, (UINTN)-1);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.nasm
deleted file mode 100644
index b3c4f7b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/InternalSwitchStack.nasm
+++ /dev/null
@@ -1,47 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2016, Intel Corporation. All rights reserved.
-; Portions copyright (c) 2011, Apple Inc. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; InternalSwitchStack.nasm
-;
-; Abstract:
-;
-; Implementation of a stack switch on IA-32.
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalSwitchStack (
-; IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-; IN VOID *Context1, OPTIONAL
-; IN VOID *Context2, OPTIONAL
-; IN VOID *NewStack
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalSwitchStack)
-ASM_PFX(InternalSwitchStack):
- push ebp
- mov ebp, esp
-
- mov esp, [ebp + 20] ; switch stack
- sub esp, 8
- mov eax, [ebp + 16]
- mov [esp + 4], eax
- mov eax, [ebp + 12]
- mov [esp], eax
- push 0 ; keeps gdb from unwinding stack
- jmp dword [ebp + 8] ; call and never return
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Invd.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Invd.c
deleted file mode 100644
index e5c29b6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Invd.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file
- AsmInvd function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Executes a INVD instruction.
-
- Executes a INVD instruction. This function is only available on IA-32 and
- x64.
-
-**/
-VOID
-EFIAPI
-AsmInvd (
- VOID
- )
-{
- _asm {
- invd
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Invd.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Invd.nasm
deleted file mode 100644
index 13b8795..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Invd.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Invd.Asm
-;
-; Abstract:
-;
-; AsmInvd function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmInvd (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmInvd)
-ASM_PFX(AsmInvd):
- invd
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LRotU64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LRotU64.S
deleted file mode 100644
index 451f527..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LRotU64.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# LRotU64.S
-#
-# Abstract:
-#
-# 64-bit left rotation for Ia32
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMathLRotU64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathLRotU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathLRotU64):
- push %ebx
- movb 16(%esp), %cl
- movl 12(%esp), %edx
- movl 8(%esp), %eax
- shldl %cl, %edx, %ebx
- shldl %cl, %eax, %edx
- rorl %cl, %ebx
- shldl %cl, %ebx, %eax
- testb $32, %cl # Count >= 32?
- jz L0
- movl %eax, %ecx
- movl %edx, %eax
- movl %ecx, %edx
-L0:
- pop %ebx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LRotU64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LRotU64.c
deleted file mode 100644
index 1dfef3b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LRotU64.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/** @file
- 64-bit left rotation for Ia32
-
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Rotates a 64-bit integer left between 0 and 63 bits, filling
- the low bits with the high bits that were rotated.
-
- This function rotates the 64-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- @param Operand The 64-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand <<< Count
-
-**/
-UINT64
-EFIAPI
-InternalMathLRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- _asm {
- mov cl, byte ptr [Count]
- mov edx, dword ptr [Operand + 4]
- mov eax, dword ptr [Operand + 0]
- shld ebx, edx, cl
- shld edx, eax, cl
- ror ebx, cl
- shld eax, ebx, cl
- test cl, 32 ; Count >= 32?
- jz L0
- mov ecx, eax
- mov eax, edx
- mov edx, ecx
-L0:
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LRotU64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LRotU64.nasm
deleted file mode 100644
index e3dc015..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LRotU64.nasm
+++ /dev/null
@@ -1,50 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; LRotU64.nasm
-;
-; Abstract:
-;
-; 64-bit left rotation for Ia32
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathLRotU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathLRotU64)
-ASM_PFX(InternalMathLRotU64):
- push ebx
- mov cl, [esp + 16]
- mov edx, [esp + 12]
- mov eax, [esp + 8]
- shld ebx, edx, cl
- shld edx, eax, cl
- ror ebx, cl
- shld eax, ebx, cl
- test cl, 32 ; Count >= 32?
- jz .0
- mov ecx, eax
- mov eax, edx
- mov edx, ecx
-.0:
- pop ebx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LShiftU64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LShiftU64.S
deleted file mode 100644
index 15394ab..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LShiftU64.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# LShiftU64.S
-#
-# Abstract:
-#
-# 64-bit left shift function for IA-32
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMathLShiftU64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathLShiftU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathLShiftU64):
- movb 12(%esp), %cl
- xorl %eax, %eax
- movl 4(%esp), %edx
- testb $32, %cl # Count >= 32?
- jnz L0
- movl %edx, %eax
- movl 0x8(%esp), %edx
-L0:
- shld %cl, %eax, %edx
- shl %cl, %eax
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LShiftU64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LShiftU64.c
deleted file mode 100644
index 08266f7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LShiftU64.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/** @file
- 64-bit left shift function for IA-32.
-
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Shifts a 64-bit integer left between 0 and 63 bits. The low bits
- are filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the left by Count bits. The
- low Count bits are set to zero. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift left.
- @param Count The number of bits to shift left.
-
- @return Operand << Count
-
-**/
-UINT64
-EFIAPI
-InternalMathLShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- _asm {
- mov cl, byte ptr [Count]
- xor eax, eax
- mov edx, dword ptr [Operand + 0]
- test cl, 32 // Count >= 32?
- jnz L0
- mov eax, edx
- mov edx, dword ptr [Operand + 4]
-L0:
- shld edx, eax, cl
- shl eax, cl
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LShiftU64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LShiftU64.nasm
deleted file mode 100644
index 93de11d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LShiftU64.nasm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; LShiftU64.nasm
-;
-; Abstract:
-;
-; 64-bit left shift function for IA-32
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathLShiftU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathLShiftU64)
-ASM_PFX(InternalMathLShiftU64):
- mov cl, [esp + 12]
- xor eax, eax
- mov edx, [esp + 4]
- test cl, 32 ; Count >= 32?
- jnz .0
- mov eax, edx
- mov edx, [esp + 8]
-.0:
- shld edx, eax, cl
- shl eax, cl
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Lfence.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Lfence.nasm
deleted file mode 100644
index 7802a5f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Lfence.nasm
+++ /dev/null
@@ -1,36 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2018, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Lfence.nasm
-;
-; Abstract:
-;
-; Performs a serializing operation on all load-from-memory instructions that
-; were issued prior to the call of this function.
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmLfence (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmLfence)
-ASM_PFX(AsmLfence):
- lfence
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LongJump.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LongJump.S
deleted file mode 100644
index dfd52f2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LongJump.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# LongJump.S
-#
-# Abstract:
-#
-# Implementation of _LongJump() on IA-32.
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalLongJump)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalLongJump (
-# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalLongJump):
- pop %eax # skip return address
- pop %edx # edx <- JumpBuffer
- pop %eax # eax <- Value
- movl (%edx), %ebx
- movl 4(%edx), %esi
- movl 8(%edx), %edi
- movl 12(%edx), %ebp
- movl 16(%edx), %esp
- jmp *20(%edx) # restore "eip"
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LongJump.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LongJump.c
deleted file mode 100644
index 9d271ad..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LongJump.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
- Implementation of _LongJump() on IA-32.
-
- Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-/**
- Restores the CPU context that was saved with SetJump().
-
- Restores the CPU context from the buffer specified by JumpBuffer.
- This function never returns to the caller.
- Instead is resumes execution based on the state of JumpBuffer.
-
- @param JumpBuffer A pointer to CPU context buffer.
- @param Value The value to return when the SetJump() context is restored.
-
-**/
-__declspec (naked)
-VOID
-EFIAPI
-InternalLongJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
- IN UINTN Value
- )
-{
- _asm {
- mov eax, [PcdGet32 (PcdControlFlowEnforcementPropertyMask)]
- test eax, eax
- jz CetDone
- _emit 0x0F
- _emit 0x20
- _emit 0xE0 ; mov eax, cr4
- bt eax, 23 ; check if CET is enabled
- jnc CetDone
-
- mov edx, [esp + 4] ; edx = JumpBuffer
- mov edx, [edx + 24] ; edx = target SSP
- _emit 0xF3
- _emit 0x0F
- _emit 0x1E
- _emit 0xC8 ; READSSP EAX
- sub edx, eax ; edx = delta
- mov eax, edx ; eax = delta
-
- shr eax, 2 ; eax = delta/sizeof(UINT32)
- _emit 0xF3
- _emit 0x0F
- _emit 0xAE
- _emit 0xE8 ; INCSSP EAX
-
-CetDone:
-
- pop eax ; skip return address
- pop edx ; edx <- JumpBuffer
- pop eax ; eax <- Value
- mov ebx, [edx]
- mov esi, [edx + 4]
- mov edi, [edx + 8]
- mov ebp, [edx + 12]
- mov esp, [edx + 16]
- jmp dword ptr [edx + 20]
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LongJump.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LongJump.nasm
deleted file mode 100644
index 1af52ee..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/LongJump.nasm
+++ /dev/null
@@ -1,66 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; LongJump.Asm
-;
-; Abstract:
-;
-; Implementation of _LongJump() on IA-32.
-;
-;------------------------------------------------------------------------------
-
-%include "Nasm.inc"
-
- SECTION .text
-
-extern ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalLongJump (
-; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalLongJump)
-ASM_PFX(InternalLongJump):
-
- mov eax, [ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))]
- test eax, eax
- jz CetDone
- mov eax, cr4
- bt eax, 23 ; check if CET is enabled
- jnc CetDone
-
- mov edx, [esp + 4] ; edx = JumpBuffer
- mov edx, [edx + 24] ; edx = target SSP
- READSSP_EAX
- sub edx, eax ; edx = delta
- mov eax, edx ; eax = delta
-
- shr eax, 2 ; eax = delta/sizeof(UINT32)
- INCSSP_EAX
-
-CetDone:
-
- pop eax ; skip return address
- pop edx ; edx <- JumpBuffer
- pop eax ; eax <- Value
- mov ebx, [edx]
- mov esi, [edx + 4]
- mov edi, [edx + 8]
- mov ebp, [edx + 12]
- mov esp, [edx + 16]
- jmp dword [edx + 20] ; restore "eip"
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ModU64x32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ModU64x32.S
deleted file mode 100644
index 91ea463..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ModU64x32.S
+++ /dev/null
@@ -1,40 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# DivU64x32.S
-#
-# Abstract:
-#
-# Calculate the remainder of a 64-bit integer by a 32-bit integer
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMathModU64x32)
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InternalMathModU64x32 (
-# IN UINT64 Dividend,
-# IN UINT32 Divisor
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathModU64x32):
- movl 8(%esp), %eax
- movl 12(%esp), %ecx
- xorl %edx, %edx
- divl %ecx
- movl 4(%esp), %eax
- divl %ecx
- movl %edx, %eax
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ModU64x32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ModU64x32.c
deleted file mode 100644
index 3186ccb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ModU64x32.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file
- Calculate the remainder of a 64-bit integer by a 32-bit integer
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 32-bit remainder. This function
- returns the 32-bit unsigned remainder.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend % Divisor
-
-**/
-UINT32
-EFIAPI
-InternalMathModU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- _asm {
- mov eax, dword ptr [Dividend + 4]
- mov ecx, Divisor
- xor edx, edx
- div ecx
- mov eax, dword ptr [Dividend + 0]
- div ecx
- mov eax, edx
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ModU64x32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ModU64x32.nasm
deleted file mode 100644
index cb3681c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ModU64x32.nasm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; DivU64x32.asm
-;
-; Abstract:
-;
-; Calculate the remainder of a 64-bit integer by a 32-bit integer
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; InternalMathModU64x32 (
-; IN UINT64 Dividend,
-; IN UINT32 Divisor
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathModU64x32)
-ASM_PFX(InternalMathModU64x32):
- mov eax, [esp + 8]
- mov ecx, [esp + 12]
- xor edx, edx
- div ecx
- mov eax, [esp + 4]
- div ecx
- mov eax, edx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Monitor.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Monitor.S
deleted file mode 100644
index b6bfbee..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Monitor.S
+++ /dev/null
@@ -1,40 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# Monitor.S
-#
-# Abstract:
-#
-# AsmMonitor function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmMonitor)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmMonitor (
-# IN UINTN Eax,
-# IN UINTN Ecx,
-# IN UINTN Edx
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmMonitor):
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- movl 12(%esp), %edx
- monitor %eax, %ecx, %edx # monitor
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Monitor.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Monitor.c
deleted file mode 100644
index d9c9325..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Monitor.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file
- AsmMonitor function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Sets up a monitor buffer that is used by AsmMwait().
-
- Executes a MONITOR instruction with the register state specified by Eax, Ecx
- and Edx. Returns Eax. This function is only available on IA-32 and x64.
-
- @param RegisterEax The value to load into EAX or RAX before executing the MONITOR
- instruction.
- @param RegisterEcx The value to load into ECX or RCX before executing the MONITOR
- instruction.
- @param RegisterEdx The value to load into EDX or RDX before executing the MONITOR
- instruction.
-
- @return RegisterEax
-
-**/
-UINTN
-EFIAPI
-AsmMonitor (
- IN UINTN RegisterEax,
- IN UINTN RegisterEcx,
- IN UINTN RegisterEdx
- )
-{
- _asm {
- mov eax, RegisterEax
- mov ecx, RegisterEcx
- mov edx, RegisterEdx
- _emit 0x0f // monitor
- _emit 0x01
- _emit 0xc8
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Monitor.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Monitor.nasm
deleted file mode 100644
index 6cf8ffd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Monitor.nasm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Monitor.Asm
-;
-; Abstract:
-;
-; AsmMonitor function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmMonitor (
-; IN UINTN Eax,
-; IN UINTN Ecx,
-; IN UINTN Edx
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmMonitor)
-ASM_PFX(AsmMonitor):
- mov eax, [esp + 4]
- mov ecx, [esp + 8]
- mov edx, [esp + 12]
- DB 0xf, 1, 0xc8 ; monitor
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x32.S
deleted file mode 100644
index 245687a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x32.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# MultU64x32.S
-#
-# Abstract:
-#
-# Calculate the product of a 64-bit integer and a 32-bit integer
-#
-#------------------------------------------------------------------------------
-
-
- .code:
-
-ASM_GLOBAL ASM_PFX(InternalMathMultU64x32)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathMultU64x32 (
-# IN UINT64 Multiplicand,
-# IN UINT32 Multiplier
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathMultU64x32):
- movl 12(%esp), %ecx
- movl %ecx, %eax
- imull 8(%esp), %ecx # overflow not detectable
- mull 0x4(%esp)
- addl %ecx, %edx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x32.c
deleted file mode 100644
index 8b534aa..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x32.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file
- Calculate the product of a 64-bit integer and a 32-bit integer
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Multiples a 64-bit unsigned integer by a 32-bit unsigned integer
- and generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 32-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 32-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-InternalMathMultU64x32 (
- IN UINT64 Multiplicand,
- IN UINT32 Multiplier
- )
-{
- _asm {
- mov ecx, Multiplier
- mov eax, ecx
- imul ecx, dword ptr [Multiplicand + 4] // overflow not detectable
- mul dword ptr [Multiplicand + 0]
- add edx, ecx
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x32.nasm
deleted file mode 100644
index d4c9e51..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x32.nasm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; MultU64x32.nasm
-;
-; Abstract:
-;
-; Calculate the product of a 64-bit integer and a 32-bit integer
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathMultU64x32 (
-; IN UINT64 Multiplicand,
-; IN UINT32 Multiplier
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathMultU64x32)
-ASM_PFX(InternalMathMultU64x32):
- mov ecx, [esp + 12]
- mov eax, ecx
- imul ecx, [esp + 8] ; overflow not detectable
- mul dword [esp + 4]
- add edx, ecx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x64.S
deleted file mode 100644
index a3a8ec7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x64.S
+++ /dev/null
@@ -1,44 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# MultU64x64.S
-#
-# Abstract:
-#
-# Calculate the product of a 64-bit integer and another 64-bit integer
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMathMultU64x64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathMultU64x64 (
-# IN UINT64 Multiplicand,
-# IN UINT64 Multiplier
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathMultU64x64):
- push %ebx
- movl 8(%esp), %ebx # ebx <- M1[0..31]
- movl 16(%esp), %edx # edx <- M2[0..31]
- movl %ebx, %ecx
- movl %edx, %eax
- imull 20(%esp), %ebx # ebx <- M1[0..31] * M2[32..63]
- imull 12(%esp), %edx # edx <- M1[32..63] * M2[0..31]
- addl %edx, %ebx # carries are abandoned
- mull %ecx # edx:eax <- M1[0..31] * M2[0..31]
- addl %ebx, %edx # carries are abandoned
- pop %ebx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x64.c
deleted file mode 100644
index 5f10486..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x64.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/** @file
- Calculate the product of a 64-bit integer and another 64-bit integer
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer
- and generates a 64-bit unsigned result.
-
- This function multiplies the 64-bit unsigned value Multiplicand by the 64-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 64-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-InternalMathMultU64x64 (
- IN UINT64 Multiplicand,
- IN UINT64 Multiplier
- )
-{
- _asm {
- mov ebx, dword ptr [Multiplicand + 0]
- mov edx, dword ptr [Multiplier + 0]
- mov ecx, ebx
- mov eax, edx
- imul ebx, dword ptr [Multiplier + 4]
- imul edx, dword ptr [Multiplicand + 4]
- add ebx, edx
- mul ecx
- add edx, ebx
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x64.nasm
deleted file mode 100644
index 4fdbf86..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/MultU64x64.nasm
+++ /dev/null
@@ -1,46 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; MultU64x64.nasm
-;
-; Abstract:
-;
-; Calculate the product of a 64-bit integer and another 64-bit integer
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathMultU64x64 (
-; IN UINT64 Multiplicand,
-; IN UINT64 Multiplier
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathMultU64x64)
-ASM_PFX(InternalMathMultU64x64):
- push ebx
- mov ebx, [esp + 8] ; ebx <- M1[0..31]
- mov edx, [esp + 16] ; edx <- M2[0..31]
- mov ecx, ebx
- mov eax, edx
- imul ebx, [esp + 20] ; ebx <- M1[0..31] * M2[32..63]
- imul edx, [esp + 12] ; edx <- M1[32..63] * M2[0..31]
- add ebx, edx ; carries are abandoned
- mul ecx ; edx:eax <- M1[0..31] * M2[0..31]
- add edx, ebx ; carries are abandoned
- pop ebx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Mwait.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Mwait.S
deleted file mode 100644
index 1b8ef9b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Mwait.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# Mwait.S
-#
-# Abstract:
-#
-# AsmMwait function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(AsmMwait)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmMwait (
-# IN UINTN Eax,
-# IN UINTN Ecx
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmMwait):
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- mwait
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Mwait.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Mwait.c
deleted file mode 100644
index 0cac0ac..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Mwait.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @file
- AsmMwait function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Executes an MWAIT instruction.
-
- Executes an MWAIT instruction with the register state specified by Eax and
- Ecx. Returns Eax. This function is only available on IA-32 and x64.
-
- @param RegisterEax The value to load into EAX or RAX before executing the MONITOR
- instruction.
- @param RegisterEcx The value to load into ECX or RCX before executing the MONITOR
- instruction.
-
- @return RegisterEax
-
-**/
-UINTN
-EFIAPI
-AsmMwait (
- IN UINTN RegisterEax,
- IN UINTN RegisterEcx
- )
-{
- _asm {
- mov eax, RegisterEax
- mov ecx, RegisterEcx
- _emit 0x0f // mwait
- _emit 0x01
- _emit 0xC9
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Mwait.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Mwait.nasm
deleted file mode 100644
index 1a369d3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Mwait.nasm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Mwait.Asm
-;
-; Abstract:
-;
-; AsmMwait function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmMwait (
-; IN UINTN Eax,
-; IN UINTN Ecx
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmMwait)
-ASM_PFX(AsmMwait):
- mov eax, [esp + 4]
- mov ecx, [esp + 8]
- DB 0xf, 1, 0xc9 ; mwait
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Non-existing.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Non-existing.c
deleted file mode 100644
index 20146c0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Non-existing.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/** @file
- Non-existing BaseLib functions on Ia32
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-
-/**
- Disables the 64-bit paging mode on the CPU.
-
- Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 64-paging mode.
- This function is only available on x64. After the 64-bit paging mode is
- disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be 0. The function EntryPoint must never return.
-
- @param CodeSelector The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for 32-bit protected mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is disabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is disabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is disabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-InternalX86DisablePaging64 (
- IN UINT16 CodeSelector,
- IN UINT32 EntryPoint,
- IN UINT32 Context1, OPTIONAL
- IN UINT32 Context2, OPTIONAL
- IN UINT32 NewStack
- )
-{
- //
- // This function cannot work on IA32 platform
- //
- ASSERT (FALSE);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RRotU64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RRotU64.S
deleted file mode 100644
index ddb2029..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RRotU64.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# RRotU64.S
-#
-# Abstract:
-#
-# 64-bit right rotation for Ia32
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMathRRotU64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathRRotU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathRRotU64):
- push %ebx
- movb 16(%esp), %cl
- movl 8(%esp), %eax
- movl 12(%esp), %edx
- shrdl %cl, %eax, %ebx
- shrdl %cl, %edx, %eax
- roll %cl, %ebx
- shrdl %cl, %ebx, %edx
- testb $32, %cl # Count >= 32?
- jz L0
- movl %eax, %ecx # switch eax & edx if Count >= 32
- movl %edx, %eax
- movl %ecx, %edx
-L0:
- pop %ebx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RRotU64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RRotU64.c
deleted file mode 100644
index bbf0146..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RRotU64.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/** @file
- 64-bit right rotation for Ia32
-
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Rotates a 64-bit integer right between 0 and 63 bits, filling
- the high bits with the high low bits that were rotated.
-
- This function rotates the 64-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- @param Operand The 64-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >>> Count
-
-**/
-UINT64
-EFIAPI
-InternalMathRRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- _asm {
- mov cl, byte ptr [Count]
- mov eax, dword ptr [Operand + 0]
- mov edx, dword ptr [Operand + 4]
- shrd ebx, eax, cl
- shrd eax, edx, cl
- rol ebx, cl
- shrd edx, ebx, cl
- test cl, 32 // Count >= 32?
- jz L0
- mov ecx, eax
- mov eax, edx
- mov edx, ecx
-L0:
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RRotU64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RRotU64.nasm
deleted file mode 100644
index 5946b3d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RRotU64.nasm
+++ /dev/null
@@ -1,50 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; RRotU64.nasm
-;
-; Abstract:
-;
-; 64-bit right rotation for Ia32
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathRRotU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathRRotU64)
-ASM_PFX(InternalMathRRotU64):
- push ebx
- mov cl, [esp + 16]
- mov eax, [esp + 8]
- mov edx, [esp + 12]
- shrd ebx, eax, cl
- shrd eax, edx, cl
- rol ebx, cl
- shrd edx, ebx, cl
- test cl, 32 ; Count >= 32?
- jz .0
- mov ecx, eax ; switch eax & edx if Count >= 32
- mov eax, edx
- mov edx, ecx
-.0:
- pop ebx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RShiftU64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RShiftU64.S
deleted file mode 100644
index 607ec2e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RShiftU64.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# RShiftU64.S
-#
-# Abstract:
-#
-# 64-bit logical right shift function for IA-32
-#
-#------------------------------------------------------------------------------
-
-
- .code:
-
-ASM_GLOBAL ASM_PFX(InternalMathRShiftU64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathRShiftU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathRShiftU64):
- movb 12(%esp), %cl # cl <- Count
- xorl %edx, %edx
- movl 8(%esp), %eax
- testb $32, %cl # Count >= 32?
- jnz L0
- movl %eax, %edx
- movl 0x4(%esp), %eax
-L0:
- shrdl %cl, %edx, %eax
- shr %cl, %edx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RShiftU64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RShiftU64.c
deleted file mode 100644
index 2db0d97..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RShiftU64.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/** @file
- 64-bit logical right shift function for IA-32
-
- Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. This high bits
- are filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to zero. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-InternalMathRShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- _asm {
- mov cl, byte ptr [Count]
- xor edx, edx
- mov eax, dword ptr [Operand + 4]
- test cl, 32
- jnz L0
- mov edx, eax
- mov eax, dword ptr [Operand + 0]
-L0:
- shrd eax, edx, cl
- shr edx, cl
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RShiftU64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RShiftU64.nasm
deleted file mode 100644
index 67de7ee..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RShiftU64.nasm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; RShiftU64.nasm
-;
-; Abstract:
-;
-; 64-bit logical right shift function for IA-32
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathRShiftU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathRShiftU64)
-ASM_PFX(InternalMathRShiftU64):
- mov cl, [esp + 12] ; cl <- Count
- xor edx, edx
- mov eax, [esp + 8]
- test cl, 32 ; Count >= 32?
- jnz .0
- mov edx, eax
- mov eax, [esp + 4]
-.0:
- shrd eax, edx, cl
- shr edx, cl
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RdRand.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RdRand.S
deleted file mode 100644
index 92048b3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RdRand.S
+++ /dev/null
@@ -1,80 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# RdRand.S
-#
-# Abstract:
-#
-# Generates random number through CPU RdRand instruction under 32-bit platform.
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// Generates a 16 bit random number through RDRAND instruction.
-// Return TRUE if Rand generated successfully, or FALSE if not.
-//
-// BOOLEAN EFIAPI InternalX86RdRand16 (UINT16 *Rand);
-//------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86RdRand16)
-ASM_PFX(InternalX86RdRand16):
- .byte 0x0f, 0xc7, 0xf0 // rdrand r16: "0f c7 /6 ModRM:r/m(w)"
- jc rn16_ok // jmp if CF=1
- xor %eax, %eax // reg=0 if CF=0
- ret // return with failure status
-rn16_ok:
- mov 0x4(%esp), %edx
- mov %ax, (%edx)
- mov $0x1, %eax
- ret
-
-//------------------------------------------------------------------------------
-// Generates a 32 bit random number through RDRAND instruction.
-// Return TRUE if Rand generated successfully, or FALSE if not.
-//
-// BOOLEAN EFIAPI InternalX86RdRand32 (UINT32 *Rand);
-//------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86RdRand32)
-ASM_PFX(InternalX86RdRand32):
- .byte 0x0f, 0xc7, 0xf0 // rdrand r32: "0f c7 /6 ModRM:r/m(w)"
- jc rn32_ok // jmp if CF=1
- xor %eax, %eax // reg=0 if CF=0
- ret // return with failure status
-rn32_ok:
- mov 0x4(%esp), %edx
- mov %eax, (%edx)
- mov $0x1, %eax
- ret
-
-//------------------------------------------------------------------------------
-// Generates a 64 bit random number through RDRAND instruction.
-// Return TRUE if Rand generated successfully, or FALSE if not.
-//
-// BOOLEAN EFIAPI InternalX86RdRand64 (UINT64 *Rand);
-//------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86RdRand64)
-ASM_PFX(InternalX86RdRand64):
- .byte 0x0f, 0xc7, 0xf0 // rdrand r32: "0f c7 /6 ModRM:r/m(w)"
- jnc rn64_ret // jmp if CF=0
- mov 0x4(%esp), %edx
- mov %eax, (%edx)
-
- .byte 0x0f, 0xc7, 0xf0 // generate another 32 bit RN
- jnc rn64_ret // jmp if CF=0
- mov %eax, 0x4(%edx)
-
- mov $0x1, %eax
- ret
-rn64_ret:
- xor %eax, %eax
- ret // return with failure status
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RdRand.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RdRand.nasm
deleted file mode 100644
index 0668f43..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/RdRand.nasm
+++ /dev/null
@@ -1,90 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; RdRand.nasm
-;
-; Abstract:
-;
-; Generates random number through CPU RdRand instruction under 32-bit platform.
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
-SECTION .text
-
-;------------------------------------------------------------------------------
-; Generates a 16 bit random number through RDRAND instruction.
-; Return TRUE if Rand generated successfully, or FALSE if not.
-;
-; BOOLEAN EFIAPI InternalX86RdRand16 (UINT16 *Rand);
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86RdRand16)
-ASM_PFX(InternalX86RdRand16):
- ; rdrand ax ; generate a 16 bit RN into ax
- ; CF=1 if RN generated ok, otherwise CF=0
- db 0xf, 0xc7, 0xf0 ; rdrand r16: "0f c7 /6 ModRM:r/m(w)"
- jc rn16_ok ; jmp if CF=1
- xor eax, eax ; reg=0 if CF=0
- ret ; return with failure status
-rn16_ok:
- mov edx, dword [esp + 4]
- mov [edx], ax
- mov eax, 1
- ret
-
-;------------------------------------------------------------------------------
-; Generates a 32 bit random number through RDRAND instruction.
-; Return TRUE if Rand generated successfully, or FALSE if not.
-;
-; BOOLEAN EFIAPI InternalX86RdRand32 (UINT32 *Rand);
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86RdRand32)
-ASM_PFX(InternalX86RdRand32):
- ; rdrand eax ; generate a 32 bit RN into eax
- ; CF=1 if RN generated ok, otherwise CF=0
- db 0xf, 0xc7, 0xf0 ; rdrand r32: "0f c7 /6 ModRM:r/m(w)"
- jc rn32_ok ; jmp if CF=1
- xor eax, eax ; reg=0 if CF=0
- ret ; return with failure status
-rn32_ok:
- mov edx, dword [esp + 4]
- mov [edx], eax
- mov eax, 1
- ret
-
-;------------------------------------------------------------------------------
-; Generates a 64 bit random number through RDRAND instruction.
-; Return TRUE if Rand generated successfully, or FALSE if not.
-;
-; BOOLEAN EFIAPI InternalX86RdRand64 (UINT64 *Rand);
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86RdRand64)
-ASM_PFX(InternalX86RdRand64):
- ; rdrand eax ; generate a 32 bit RN into eax
- ; CF=1 if RN generated ok, otherwise CF=0
- db 0xf, 0xc7, 0xf0 ; rdrand r32: "0f c7 /6 ModRM:r/m(w)"
- jnc rn64_ret ; jmp if CF=0
- mov edx, dword [esp + 4]
- mov [edx], eax
-
- db 0xf, 0xc7, 0xf0 ; generate another 32 bit RN
- jnc rn64_ret ; jmp if CF=0
- mov [edx + 4], eax
-
- mov eax, 1
- ret
-rn64_ret:
- xor eax, eax
- ret ; return with failure status
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr0.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr0.c
deleted file mode 100644
index 0e39ee7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr0.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmReadCr0 function
-
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of the Control Register 0 (CR0).
-
- Reads and returns the current value of CR0. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of the Control Register 0 (CR0).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr0 (
- VOID
- )
-{
- __asm {
- mov eax, cr0
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr0.nasm
deleted file mode 100644
index d09ceea..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr0.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadCr0.Asm
-;
-; Abstract:
-;
-; AsmReadCr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadCr0)
-ASM_PFX(AsmReadCr0):
- mov eax, cr0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr2.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr2.c
deleted file mode 100644
index e75b950..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr2.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadCr2 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of the Control Register 2 (CR2).
-
- Reads and returns the current value of CR2. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of the Control Register 2 (CR2).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr2 (
- VOID
- )
-{
- __asm {
- mov eax, cr2
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr2.nasm
deleted file mode 100644
index 5b83d89..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr2.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadCr2.Asm
-;
-; Abstract:
-;
-; AsmReadCr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadCr2)
-ASM_PFX(AsmReadCr2):
- mov eax, cr2
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr3.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr3.c
deleted file mode 100644
index 2f01731..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr3.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadCr3 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of the Control Register 3 (CR3).
-
- Reads and returns the current value of CR3. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of the Control Register 3 (CR3).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr3 (
- VOID
- )
-{
- __asm {
- mov eax, cr3
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr3.nasm
deleted file mode 100644
index 366e4cc..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr3.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadCr3.Asm
-;
-; Abstract:
-;
-; AsmReadCr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadCr3)
-ASM_PFX(AsmReadCr3):
- mov eax, cr3
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr4.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr4.c
deleted file mode 100644
index d12bf5c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr4.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
- AsmReadCr4 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of the Control Register 4 (CR4).
-
- Reads and returns the current value of CR4. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of the Control Register 4 (CR4).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr4 (
- VOID
- )
-{
- __asm {
- _emit 0x0f // mov eax, cr4
- _emit 0x20
- _emit 0xE0
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr4.nasm
deleted file mode 100644
index 7276092..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCr4.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadCr4.Asm
-;
-; Abstract:
-;
-; AsmReadCr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadCr4)
-ASM_PFX(AsmReadCr4):
- mov eax, cr4
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCs.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCs.c
deleted file mode 100644
index fe10702..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadCs function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Code Segment Register (CS).
-
- Reads and returns the current value of CS. This function is only available on
- IA-32 and x64.
-
- @return The current value of CS.
-
-**/
-UINT16
-EFIAPI
-AsmReadCs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, cs
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCs.nasm
deleted file mode 100644
index 3bfa816..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadCs.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadCs.Asm
-;
-; Abstract:
-;
-; AsmReadCs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadCs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadCs)
-ASM_PFX(AsmReadCs):
- mov eax, cs
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr0.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr0.c
deleted file mode 100644
index a3a9387..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr0.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadDr0 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Debug Register 0 (DR0).
-
- Reads and returns the current value of DR0. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 0 (DR0).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr0 (
- VOID
- )
-{
- __asm {
- mov eax, dr0
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr0.nasm
deleted file mode 100644
index 28a846e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr0.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr0.Asm
-;
-; Abstract:
-;
-; AsmReadDr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr0)
-ASM_PFX(AsmReadDr0):
- mov eax, dr0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr1.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr1.c
deleted file mode 100644
index 7adbd78..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr1.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadDr1 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Debug Register 1 (DR1).
-
- Reads and returns the current value of DR1. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 1 (DR1).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr1 (
- VOID
- )
-{
- __asm {
- mov eax, dr1
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr1.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr1.nasm
deleted file mode 100644
index 63c3341..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr1.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr1.Asm
-;
-; Abstract:
-;
-; AsmReadDr1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr1 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr1)
-ASM_PFX(AsmReadDr1):
- mov eax, dr1
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr2.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr2.c
deleted file mode 100644
index 5ec9695..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr2.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadDr2 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Debug Register 2 (DR2).
-
- Reads and returns the current value of DR2. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 2 (DR2).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr2 (
- VOID
- )
-{
- __asm {
- mov eax, dr2
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr2.nasm
deleted file mode 100644
index 49f16bb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr2.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr2.Asm
-;
-; Abstract:
-;
-; AsmReadDr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr2)
-ASM_PFX(AsmReadDr2):
- mov eax, dr2
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr3.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr3.c
deleted file mode 100644
index 07b587c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr3.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadDr3 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Debug Register 3 (DR3).
-
- Reads and returns the current value of DR3. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 3 (DR3).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr3 (
- VOID
- )
-{
- __asm {
- mov eax, dr3
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr3.nasm
deleted file mode 100644
index c09b2a1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr3.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr3.Asm
-;
-; Abstract:
-;
-; AsmReadDr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr3)
-ASM_PFX(AsmReadDr3):
- mov eax, dr3
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr4.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr4.c
deleted file mode 100644
index c42fb1c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr4.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
- AsmReadDr4 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Debug Register 4 (DR4).
-
- Reads and returns the current value of DR4. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 4 (DR4).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr4 (
- VOID
- )
-{
- __asm {
- _emit 0x0f
- _emit 0x21
- _emit 0xe0
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr4.nasm
deleted file mode 100644
index 5d784df..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr4.nasm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr4.Asm
-;
-; Abstract:
-;
-; AsmReadDr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr4)
-ASM_PFX(AsmReadDr4):
- ;
- ; DR4 is alias to DR6 only if DE (in CR4) is cleared. Otherwise, reading
- ; this register will cause a #UD exception.
- ;
- ; MS assembler doesn't support this instruction since no one would use it
- ; under normal circustances. Here opcode is used.
- ;
- DB 0xf, 0x21, 0xe0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr5.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr5.c
deleted file mode 100644
index 9743fe2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr5.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
- AsmReadDr5 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Debug Register 5 (DR5).
-
- Reads and returns the current value of DR5. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 5 (DR5).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr5 (
- VOID
- )
-{
- __asm {
- _emit 0x0f
- _emit 0x21
- _emit 0xe8
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr5.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr5.nasm
deleted file mode 100644
index a12ecb6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr5.nasm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr5.Asm
-;
-; Abstract:
-;
-; AsmReadDr5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr5 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr5)
-ASM_PFX(AsmReadDr5):
- ;
- ; DR5 is alias to DR7 only if DE (in CR4) is cleared. Otherwise, reading
- ; this register will cause a #UD exception.
- ;
- ; MS assembler doesn't support this instruction since no one would use it
- ; under normal circustances. Here opcode is used.
- ;
- DB 0xf, 0x21, 0xe8
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr6.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr6.c
deleted file mode 100644
index da04965..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr6.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadDr6 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Debug Register 6 (DR6).
-
- Reads and returns the current value of DR6. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 6 (DR6).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr6 (
- VOID
- )
-{
- __asm {
- mov eax, dr6
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr6.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr6.nasm
deleted file mode 100644
index 1daa361..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr6.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr6.Asm
-;
-; Abstract:
-;
-; AsmReadDr6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr6 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr6)
-ASM_PFX(AsmReadDr6):
- mov eax, dr6
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr7.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr7.c
deleted file mode 100644
index e3ec1eb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr7.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadDr7 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Debug Register 7 (DR7).
-
- Reads and returns the current value of DR7. This function is only available
- on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on
- x64.
-
- @return The value of Debug Register 7 (DR7).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr7 (
- VOID
- )
-{
- __asm {
- mov eax, dr7
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr7.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr7.nasm
deleted file mode 100644
index 2777a11..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDr7.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr7.Asm
-;
-; Abstract:
-;
-; AsmReadDr7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr7 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr7)
-ASM_PFX(AsmReadDr7):
- mov eax, dr7
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDs.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDs.c
deleted file mode 100644
index a73aa2e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadDs function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Data Segment Register (DS).
-
- Reads and returns the current value of DS. This function is only available on
- IA-32 and x64.
-
- @return The current value of DS.
-
-**/
-UINT16
-EFIAPI
-AsmReadDs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, ds
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDs.nasm
deleted file mode 100644
index f9b194c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadDs.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDs.Asm
-;
-; Abstract:
-;
-; AsmReadDs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadDs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDs)
-ASM_PFX(AsmReadDs):
- mov eax, ds
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEflags.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEflags.c
deleted file mode 100644
index f537474..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEflags.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- AsmReadEflags function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of the EFLAGS register.
-
- Reads and returns the current value of the EFLAGS register. This function is
- only available on IA-32 and x64. This returns a 32-bit value on IA-32 and a
- 64-bit value on x64.
-
- @return EFLAGS on IA-32 or RFLAGS on x64.
-
-**/
-UINTN
-EFIAPI
-AsmReadEflags (
- VOID
- )
-{
- __asm {
- pushfd
- pop eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEflags.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEflags.nasm
deleted file mode 100644
index 51c5202..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEflags.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadEflags.Asm
-;
-; Abstract:
-;
-; AsmReadEflags function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadEflags (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadEflags)
-ASM_PFX(AsmReadEflags):
- pushfd
- pop eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEs.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEs.c
deleted file mode 100644
index d537fcd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadEs function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of ES Data Segment Register (ES).
-
- Reads and returns the current value of ES. This function is only available on
- IA-32 and x64.
-
- @return The current value of ES.
-
-**/
-UINT16
-EFIAPI
-AsmReadEs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, es
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEs.nasm
deleted file mode 100644
index 497c647..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadEs.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadEs.Asm
-;
-; Abstract:
-;
-; AsmReadEs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadEs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadEs)
-ASM_PFX(AsmReadEs):
- mov eax, es
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadFs.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadFs.c
deleted file mode 100644
index 9cc92b5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadFs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadFs function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of FS Data Segment Register (FS).
-
- Reads and returns the current value of FS. This function is only available on
- IA-32 and x64.
-
- @return The current value of FS.
-
-**/
-UINT16
-EFIAPI
-AsmReadFs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, fs
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadFs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadFs.nasm
deleted file mode 100644
index 2de6296..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadFs.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadFs.Asm
-;
-; Abstract:
-;
-; AsmReadFs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadFs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadFs)
-ASM_PFX(AsmReadFs):
- mov eax, fs
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGdtr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGdtr.c
deleted file mode 100644
index 01d0a72..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGdtr.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- AsmReadGdtr function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-/**
- Reads the current Global Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current GDTR descriptor and returns it in Gdtr. This
- function is only available on IA-32 and x64.
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86ReadGdtr (
- OUT IA32_DESCRIPTOR *Gdtr
- )
-{
- _asm {
- mov eax, Gdtr
- sgdt fword ptr [eax]
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGdtr.nasm
deleted file mode 100644
index 2637cbd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGdtr.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadGdtr.Asm
-;
-; Abstract:
-;
-; AsmReadGdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86ReadGdtr (
-; OUT IA32_DESCRIPTOR *Gdtr
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86ReadGdtr)
-ASM_PFX(InternalX86ReadGdtr):
- mov eax, [esp + 4]
- sgdt [eax]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGs.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGs.c
deleted file mode 100644
index 53eab43..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadGs function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of GS Data Segment Register (GS).
-
- Reads and returns the current value of GS. This function is only available on
- IA-32 and x64.
-
- @return The current value of GS.
-
-**/
-UINT16
-EFIAPI
-AsmReadGs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, gs
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGs.nasm
deleted file mode 100644
index 9c6fcee..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadGs.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadGs.Asm
-;
-; Abstract:
-;
-; AsmReadGs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadGs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadGs)
-ASM_PFX(AsmReadGs):
- mov eax, gs
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadIdtr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadIdtr.c
deleted file mode 100644
index 42d9aab..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadIdtr.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadIdtr function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-/**
- Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current IDTR descriptor and returns it in Idtr. This
- function is only available on IA-32 and x64.
-
- @param Idtr The pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86ReadIdtr (
- OUT IA32_DESCRIPTOR *Idtr
- )
-{
- _asm {
- mov eax, Idtr
- sidt fword ptr [eax]
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadIdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadIdtr.nasm
deleted file mode 100644
index 3ee40e5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadIdtr.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadIdtr.Asm
-;
-; Abstract:
-;
-; AsmReadIdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86ReadIdtr (
-; OUT IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86ReadIdtr)
-ASM_PFX(InternalX86ReadIdtr):
- mov eax, [esp + 4]
- sidt [eax]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadLdtr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadLdtr.c
deleted file mode 100644
index d185572..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadLdtr.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmReadLdtr function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current Local Descriptor Table Register(LDTR) selector.
-
- Reads and returns the current 16-bit LDTR descriptor value. This function is
- only available on IA-32 and x64.
-
- @return The current selector of LDT.
-
-**/
-UINT16
-EFIAPI
-AsmReadLdtr (
- VOID
- )
-{
- _asm {
- sldt ax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadLdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadLdtr.nasm
deleted file mode 100644
index 29eddf2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadLdtr.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadLdtr.Asm
-;
-; Abstract:
-;
-; AsmReadLdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadLdtr (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadLdtr)
-ASM_PFX(AsmReadLdtr):
- sldt ax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm0.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm0.c
deleted file mode 100644
index 8db4ca5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm0.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- AsmReadMm0 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of 64-bit MMX Register #0 (MM0).
-
- Reads and returns the current value of MM0. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM0.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm0 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm0
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm0.nasm
deleted file mode 100644
index 1330c71..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm0.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm0.Asm
-;
-; Abstract:
-;
-; AsmReadMm0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm0)
-ASM_PFX(AsmReadMm0):
- push eax
- push eax
- movq [esp], mm0
- pop eax
- pop edx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm1.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm1.c
deleted file mode 100644
index f0750f4..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm1.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- AsmReadMm1 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of 64-bit MMX Register #1 (MM1).
-
- Reads and returns the current value of MM1. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM1.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm1 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm1
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm1.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm1.nasm
deleted file mode 100644
index e411df8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm1.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm1.Asm
-;
-; Abstract:
-;
-; AsmReadMm1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm1 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm1)
-ASM_PFX(AsmReadMm1):
- push eax
- push eax
- movq [esp], mm1
- pop eax
- pop edx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm2.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm2.c
deleted file mode 100644
index 17929b2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm2.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- AsmReadMm2 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of 64-bit MMX Register #2 (MM2).
-
- Reads and returns the current value of MM2. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM2.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm2 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm2
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm2.nasm
deleted file mode 100644
index 4190119..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm2.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm2.Asm
-;
-; Abstract:
-;
-; AsmReadMm2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm2)
-ASM_PFX(AsmReadMm2):
- push eax
- push eax
- movq [esp], mm2
- pop eax
- pop edx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm3.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm3.c
deleted file mode 100644
index a505f18..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm3.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- AsmReadMm3 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of 64-bit MMX Register #3 (MM3).
-
- Reads and returns the current value of MM3. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM3.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm3 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm3
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm3.nasm
deleted file mode 100644
index 89125e8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm3.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm3.Asm
-;
-; Abstract:
-;
-; AsmReadMm3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm3)
-ASM_PFX(AsmReadMm3):
- push eax
- push eax
- movq [esp], mm3
- pop eax
- pop edx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm4.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm4.c
deleted file mode 100644
index ecc3896..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm4.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- AsmReadMm4 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of 64-bit MMX Register #4 (MM4).
-
- Reads and returns the current value of MM4. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM4.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm4 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm4
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm4.nasm
deleted file mode 100644
index a0e8d16..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm4.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm4.Asm
-;
-; Abstract:
-;
-; AsmReadMm4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm4)
-ASM_PFX(AsmReadMm4):
- push eax
- push eax
- movq [esp], mm4
- pop eax
- pop edx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm5.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm5.c
deleted file mode 100644
index e974717..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm5.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- AsmReadMm5 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of 64-bit MMX Register #5 (MM5).
-
- Reads and returns the current value of MM5. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM5.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm5 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm5
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm5.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm5.nasm
deleted file mode 100644
index 2c96bfa..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm5.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm5.Asm
-;
-; Abstract:
-;
-; AsmReadMm5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm5 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm5)
-ASM_PFX(AsmReadMm5):
- push eax
- push eax
- movq [esp], mm5
- pop eax
- pop edx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm6.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm6.c
deleted file mode 100644
index a64cf50..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm6.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- AsmReadMm6 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of 64-bit MMX Register #6 (MM6).
-
- Reads and returns the current value of MM6. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM6.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm6 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm6
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm6.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm6.nasm
deleted file mode 100644
index f6a6047..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm6.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm6.Asm
-;
-; Abstract:
-;
-; AsmReadMm6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm6 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm6)
-ASM_PFX(AsmReadMm6):
- push eax
- push eax
- movq [esp], mm6
- pop eax
- pop edx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm7.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm7.c
deleted file mode 100644
index 0cea219..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm7.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- AsmReadMm7 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of 64-bit MMX Register #7 (MM7).
-
- Reads and returns the current value of MM7. This function is only available
- on IA-32 and x64.
-
- @return The current value of MM7.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm7 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm7
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm7.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm7.nasm
deleted file mode 100644
index 655aa40..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMm7.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm7.Asm
-;
-; Abstract:
-;
-; AsmReadMm7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm7 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm7)
-ASM_PFX(AsmReadMm7):
- push eax
- push eax
- movq [esp], mm7
- pop eax
- pop edx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
deleted file mode 100644
index e16c917..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/** @file
- AsmReadMsr64 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Returns a 64-bit Machine Specific Register(MSR).
-
- Reads and returns the 64-bit MSR specified by Index. No parameter checking is
- performed on Index, and some Index values may cause CPU exceptions. The
- caller must either guarantee that Index is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and x64.
-
- @param Index The 32-bit MSR index to read.
-
- @return The value of the MSR identified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadMsr64 (
- IN UINT32 Index
- )
-{
- _asm {
- mov ecx, Index
- rdmsr
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMsr64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMsr64.nasm
deleted file mode 100644
index f1dbd41..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadMsr64.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMsr64.Asm
-;
-; Abstract:
-;
-; AsmReadMsr64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMsr64 (
-; IN UINT64 Index
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMsr64)
-ASM_PFX(AsmReadMsr64):
- mov ecx, [esp + 4]
- rdmsr
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadPmc.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadPmc.c
deleted file mode 100644
index faa1f56..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadPmc.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmReadPmc function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Reads the current value of a Performance Counter (PMC).
-
- Reads and returns the current value of performance counter specified by
- Index. This function is only available on IA-32 and x64.
-
- @param Index The 32-bit Performance Counter index to read.
-
- @return The value of the PMC specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmc (
- IN UINT32 Index
- )
-{
- _asm {
- mov ecx, Index
- rdpmc
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadPmc.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadPmc.nasm
deleted file mode 100644
index 8eb0501..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadPmc.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadPmc.Asm
-;
-; Abstract:
-;
-; AsmReadPmc function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadPmc (
-; IN UINT32 PmcIndex
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadPmc)
-ASM_PFX(AsmReadPmc):
- mov ecx, [esp + 4]
- rdpmc
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadSs.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadSs.c
deleted file mode 100644
index f1ced5e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadSs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmReadSs function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Stack Segment Register (SS).
-
- Reads and returns the current value of SS. This function is only available on
- IA-32 and x64.
-
- @return The current value of SS.
-
-**/
-UINT16
-EFIAPI
-AsmReadSs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, ss
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadSs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadSs.nasm
deleted file mode 100644
index 6b3da79..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadSs.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadSs.Asm
-;
-; Abstract:
-;
-; AsmReadSs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadSs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadSs)
-ASM_PFX(AsmReadSs):
- mov eax, ss
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTr.c
deleted file mode 100644
index 23273f3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTr.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmReadTr function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Task Register (TR).
-
- Reads and returns the current value of TR. This function is only available on
- IA-32 and x64.
-
- @return The current value of TR.
-
-**/
-UINT16
-EFIAPI
-AsmReadTr (
- VOID
- )
-{
- _asm {
- str ax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTr.nasm
deleted file mode 100644
index 811153c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTr.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadTr.Asm
-;
-; Abstract:
-;
-; AsmReadTr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadTr (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadTr)
-ASM_PFX(AsmReadTr):
- str ax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTsc.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTsc.c
deleted file mode 100644
index 79f676e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTsc.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmReadTsc function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Reads the current value of Time Stamp Counter (TSC).
-
- Reads and returns the current value of TSC. This function is only available
- on IA-32 and x64.
-
- @return The current value of TSC
-
-**/
-UINT64
-EFIAPI
-AsmReadTsc (
- VOID
- )
-{
- _asm {
- rdtsc
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTsc.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTsc.nasm
deleted file mode 100644
index f28e20e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/ReadTsc.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadTsc.Asm
-;
-; Abstract:
-;
-; AsmReadTsc function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadTsc (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadTsc)
-ASM_PFX(AsmReadTsc):
- rdtsc
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SetJump.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SetJump.S
deleted file mode 100644
index 744a77e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SetJump.S
+++ /dev/null
@@ -1,44 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetJump.S
-#
-# Abstract:
-#
-# Implementation of SetJump() on IA-32.
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(SetJump), ASM_PFX(InternalAssertJumpBuffer)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# SetJump (
-# OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(SetJump):
- pushl 0x4(%esp)
- call ASM_PFX(InternalAssertJumpBuffer) # To validate JumpBuffer
- pop %ecx
- pop %ecx # ecx <- return address
- movl (%esp), %edx
- movl %ebx, (%edx)
- movl %esi, 4(%edx)
- movl %edi, 8(%edx)
- movl %ebp, 12(%edx)
- movl %esp, 16(%edx)
- movl %ecx, 20(%edx) # eip value to restore in LongJump
- xorl %eax, %eax
- jmp *%ecx
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SetJump.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SetJump.c
deleted file mode 100644
index 3bb9ac9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SetJump.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/** @file
- Implementation of SetJump() on IA-32.
-
- Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-/**
- Worker function that checks ASSERT condition for JumpBuffer
-
- Checks ASSERT condition for JumpBuffer.
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
-
-**/
-VOID
-EFIAPI
-InternalAssertJumpBuffer (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- );
-
-/**
- Saves the current CPU context that can be restored with a call to LongJump()
- and returns 0.
-
- Saves the current CPU context in the buffer specified by JumpBuffer and
- returns 0. The initial call to SetJump() must always return 0. Subsequent
- calls to LongJump() cause a non-zero value to be returned by SetJump().
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
-
- @retval 0 Indicates a return from SetJump().
-
-**/
-_declspec (naked)
-RETURNS_TWICE
-UINTN
-EFIAPI
-SetJump (
- OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- )
-{
- _asm {
- push [esp + 4]
- call InternalAssertJumpBuffer
- pop ecx
- pop ecx
- mov edx, [esp]
-
- xor eax, eax
- mov [edx + 24], eax ; save 0 to SSP
-
- mov eax, [PcdGet32 (PcdControlFlowEnforcementPropertyMask)]
- test eax, eax
- jz CetDone
- _emit 0x0F
- _emit 0x20
- _emit 0xE0 ; mov eax, cr4
- bt eax, 23 ; check if CET is enabled
- jnc CetDone
-
- mov eax, 1
- _emit 0xF3
- _emit 0x0F
- _emit 0xAE
- _emit 0xE8 ; INCSSP EAX to read original SSP
- _emit 0xF3
- _emit 0x0F
- _emit 0x1E
- _emit 0xC8 ; READSSP EAX
- mov [edx + 0x24], eax ; save SSP
-
-CetDone:
-
- mov [edx], ebx
- mov [edx + 4], esi
- mov [edx + 8], edi
- mov [edx + 12], ebp
- mov [edx + 16], esp
- mov [edx + 20], ecx
- xor eax, eax
- jmp ecx
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SetJump.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SetJump.nasm
deleted file mode 100644
index 820ffec..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SetJump.nasm
+++ /dev/null
@@ -1,69 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetJump.Asm
-;
-; Abstract:
-;
-; Implementation of SetJump() on IA-32.
-;
-;------------------------------------------------------------------------------
-
-%include "Nasm.inc"
-
- SECTION .text
-
-extern ASM_PFX(InternalAssertJumpBuffer)
-extern ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; SetJump (
-; OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(SetJump)
-ASM_PFX(SetJump):
- push DWORD [esp + 4]
- call ASM_PFX(InternalAssertJumpBuffer) ; To validate JumpBuffer
- pop ecx
- pop ecx ; ecx <- return address
- mov edx, [esp]
-
- xor eax, eax
- mov [edx + 24], eax ; save 0 to SSP
-
- mov eax, [ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))]
- test eax, eax
- jz CetDone
- mov eax, cr4
- bt eax, 23 ; check if CET is enabled
- jnc CetDone
-
- mov eax, 1
- INCSSP_EAX ; to read original SSP
- READSSP_EAX
- mov [edx + 0x24], eax ; save SSP
-
-CetDone:
-
- mov [edx], ebx
- mov [edx + 4], esi
- mov [edx + 8], edi
- mov [edx + 12], ebp
- mov [edx + 16], esp
- mov [edx + 20], ecx ; eip value to restore in LongJump
- xor eax, eax
- jmp ecx
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SwapBytes64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SwapBytes64.S
deleted file mode 100644
index 265b6b7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SwapBytes64.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuId.S
-#
-# Abstract:
-#
-# AsmCpuid function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathSwapBytes64 (
-# IN UINT64 Operand
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMathSwapBytes64)
-ASM_PFX(InternalMathSwapBytes64):
- movl 8(%esp), %eax # eax <- upper 32 bits
- movl 4(%esp), %edx # edx <- lower 32 bits
- bswapl %eax
- bswapl %edx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SwapBytes64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SwapBytes64.c
deleted file mode 100644
index 3e03b65..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SwapBytes64.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/** @file
- Implementation of 64-bit swap bytes
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Switches the endianess of a 64-bit integer.
-
- This function swaps the bytes in a 64-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 64-bit unsigned value.
-
- @return The byte swaped Operand.
-
-**/
-UINT64
-EFIAPI
-InternalMathSwapBytes64 (
- IN UINT64 Operand
- )
-{
- _asm {
- mov eax, dword ptr [Operand + 4]
- mov edx, dword ptr [Operand + 0]
- bswap eax
- bswap edx
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SwapBytes64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SwapBytes64.nasm
deleted file mode 100644
index 32fc1a6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/SwapBytes64.nasm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuId.Asm
-;
-; Abstract:
-;
-; AsmCpuid function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathSwapBytes64 (
-; IN UINT64 Operand
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMathSwapBytes64)
-ASM_PFX(InternalMathSwapBytes64):
- mov eax, [esp + 8] ; eax <- upper 32 bits
- mov edx, [esp + 4] ; edx <- lower 32 bits
- bswap eax
- bswap edx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.S
deleted file mode 100644
index f5189d0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.S
+++ /dev/null
@@ -1,222 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# Thunk16.S
-#
-# Abstract:
-#
-# Real mode thunk
-#
-#------------------------------------------------------------------------------
-
-#include
-
-ASM_GLOBAL ASM_PFX(m16Start), ASM_PFX(m16Size), ASM_PFX(mThunk16Attr), ASM_PFX(m16Gdt), ASM_PFX(m16GdtrBase), ASM_PFX(mTransition)
-ASM_GLOBAL ASM_PFX(InternalAsmThunk16)
-
-# define the structure of IA32_REGS
-.set _EDI, 0 #size 4
-.set _ESI, 4 #size 4
-.set _EBP, 8 #size 4
-.set _ESP, 12 #size 4
-.set _EBX, 16 #size 4
-.set _EDX, 20 #size 4
-.set _ECX, 24 #size 4
-.set _EAX, 28 #size 4
-.set _DS, 32 #size 2
-.set _ES, 34 #size 2
-.set _FS, 36 #size 2
-.set _GS, 38 #size 2
-.set _EFLAGS, 40 #size 4
-.set _EIP, 44 #size 4
-.set _CS, 48 #size 2
-.set _SS, 50 #size 2
-.set IA32_REGS_SIZE, 52
-
- .text
- .code16
-
-ASM_PFX(m16Start):
-
-SavedGdt: .space 6
-
-ASM_PFX(BackFromUserCode):
- push %ss
- push %cs
-
- calll L_Base1 # push eip
-L_Base1:
- pushfl
- cli # disable interrupts
- push %gs
- push %fs
- push %es
- push %ds
- pushal
- .byte 0x66, 0xba # mov edx, imm32
-ASM_PFX(ThunkAttr): .space 4
- testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15, %dl
- jz 1f
- movw $0x2401, %ax
- int $0x15
- cli # disable interrupts
- jnc 2f
-1:
- testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl
- jz 2f
- inb $0x92, %al
- orb $2, %al
- outb %al, $0x92 # deactivate A20M#
-2:
- xorl %eax, %eax
- movw %ss, %ax
- leal IA32_REGS_SIZE(%esp), %ebp
- mov %ebp, (_ESP - IA32_REGS_SIZE)(%bp)
- mov (_EIP - IA32_REGS_SIZE)(%bp), %bx
- shll $4, %eax
- addl %eax, %ebp
- .byte 0x66, 0xb8 # mov eax, imm32
-SavedCr4: .space 4
- movl %eax, %cr4
- lgdtl %cs:(SavedGdt - L_Base1)(%bx)
- .byte 0x66, 0xb8 # mov eax, imm32
-SavedCr0: .space 4
- movl %eax, %cr0
- .byte 0xb8 # mov ax, imm16
-SavedSs: .space 2
- movl %eax, %ss
- .byte 0x66, 0xbc # mov esp, imm32
-SavedEsp: .space 4
- lretl # return to protected mode
-
-_EntryPoint: .long ASM_PFX(ToUserCode) - ASM_PFX(m16Start)
- .word 0x8
-_16Idtr: .word 0x3ff
- .long 0
-_16Gdtr: .word GdtEnd - _NullSegDesc - 1
-_16GdtrBase: .long _NullSegDesc
-
-ASM_PFX(ToUserCode):
- movw %ss, %dx
- movw %cx, %ss # set new segment selectors
- movw %cx, %ds
- movw %cx, %es
- movw %cx, %fs
- movw %cx, %gs
- movl %eax, %cr0 # real mode starts at next instruction
- # which (per SDM) *must* be a far JMP.
- ljmpw $0,$0 # will be filled in by InternalAsmThunk16
-L_Base: # to point here.
- movl %ebp, %cr4
- movw %si, %ss # set up 16-bit stack segment
- xchgl %ebx, %esp # set up 16-bit stack pointer
-
- movw IA32_REGS_SIZE(%esp), %bp # get BackToUserCode address from stack
- mov %dx, %cs:(SavedSs - ASM_PFX(BackFromUserCode))(%bp)
- mov %ebx, %cs:(SavedEsp - ASM_PFX(BackFromUserCode))(%bp)
- lidtl %cs:(_16Idtr - ASM_PFX(BackFromUserCode))(%bp)
- popal
- pop %ds
- pop %es
- pop %fs
- pop %gs
- popfl
- lretl # transfer control to user code
-
-_NullSegDesc: .quad 0
-_16CsDesc:
- .word -1
- .word 0
- .byte 0
- .byte 0x9b
- .byte 0x8f # 16-bit segment, 4GB limit
- .byte 0
-_16DsDesc:
- .word -1
- .word 0
- .byte 0
- .byte 0x93
- .byte 0x8f # 16-bit segment, 4GB limit
- .byte 0
-GdtEnd:
-
- .code32
-#
-# @param RegSet The pointer to a IA32_DWORD_REGS structure
-# @param Transition The pointer to the transition code
-# @return The address of the 16-bit stack after returning from user code
-#
-ASM_PFX(InternalAsmThunk16):
- push %ebp
- push %ebx
- push %esi
- push %edi
- push %ds
- push %es
- push %fs
- push %gs
- movl 36(%esp), %esi # esi <- RegSet
- movzwl _SS(%esi), %edx
- mov _ESP(%esi), %edi
- add $(-(IA32_REGS_SIZE + 4)), %edi
- movl %edi, %ebx # ebx <- stack offset
- imul $0x10, %edx, %eax
- push $(IA32_REGS_SIZE / 4)
- addl %eax, %edi # edi <- linear address of 16-bit stack
- pop %ecx
- rep
- movsl # copy RegSet
- movl 40(%esp), %eax # eax <- address of transition code
- movl %edx, %esi # esi <- 16-bit stack segment
- lea (SavedCr0 - ASM_PFX(m16Start))(%eax), %edx
- movl %eax, %ecx
- andl $0xf, %ecx
- shll $12, %eax
- lea (ASM_PFX(BackFromUserCode) - ASM_PFX(m16Start))(%ecx), %ecx
- movw %cx, %ax
- stosl # [edi] <- return address of user code
- addl $(L_Base - ASM_PFX(BackFromUserCode)), %eax
- movl %eax, (L_Base - SavedCr0 - 4)(%edx)
- sgdtl (SavedGdt - SavedCr0)(%edx)
- sidtl 0x24(%esp)
- movl %cr0, %eax
- movl %eax, (%edx) # save CR0 in SavedCr0
- andl $0x7ffffffe, %eax # clear PE, PG bits
- movl %cr4, %ebp
- mov %ebp, (SavedCr4 - SavedCr0)(%edx)
- andl $0xffffffcf, %ebp # clear PAE, PSE bits
- pushl $0x10
- pop %ecx # ecx <- selector for data segments
- lgdtl (_16Gdtr - SavedCr0)(%edx)
- pushfl
- lcall *(_EntryPoint - SavedCr0)(%edx)
- popfl
- lidtl 0x24(%esp)
- lea -IA32_REGS_SIZE(%ebp), %eax
- pop %gs
- pop %fs
- pop %es
- pop %ds
- pop %edi
- pop %esi
- pop %ebx
- pop %ebp
- ret
-
- .const:
-
-ASM_PFX(m16Size): .word ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start)
-ASM_PFX(mThunk16Attr): .word ASM_PFX(ThunkAttr) - ASM_PFX(m16Start)
-ASM_PFX(m16Gdt): .word _NullSegDesc - ASM_PFX(m16Start)
-ASM_PFX(m16GdtrBase): .word _16GdtrBase - ASM_PFX(m16Start)
-ASM_PFX(mTransition): .word _EntryPoint - ASM_PFX(m16Start)
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.nasm
deleted file mode 100644
index 1c02140..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Thunk16.nasm
+++ /dev/null
@@ -1,263 +0,0 @@
-
-#include "BaseLibInternals.h"
-
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Thunk.asm
-;
-; Abstract:
-;
-; Real mode thunk
-;
-;------------------------------------------------------------------------------
-
-global ASM_PFX(m16Size)
-global ASM_PFX(mThunk16Attr)
-global ASM_PFX(m16Gdt)
-global ASM_PFX(m16GdtrBase)
-global ASM_PFX(mTransition)
-global ASM_PFX(m16Start)
-
-struc IA32_REGS
-
- ._EDI: resd 1
- ._ESI: resd 1
- ._EBP: resd 1
- ._ESP: resd 1
- ._EBX: resd 1
- ._EDX: resd 1
- ._ECX: resd 1
- ._EAX: resd 1
- ._DS: resw 1
- ._ES: resw 1
- ._FS: resw 1
- ._GS: resw 1
- ._EFLAGS: resd 1
- ._EIP: resd 1
- ._CS: resw 1
- ._SS: resw 1
- .size:
-
-endstruc
-
-;; .const
-
-SECTION .data
-
-;
-; These are global constant to convey information to C code.
-;
-ASM_PFX(m16Size) DW ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start)
-ASM_PFX(mThunk16Attr) DW _BackFromUserCode.ThunkAttrEnd - 4 - ASM_PFX(m16Start)
-ASM_PFX(m16Gdt) DW _NullSegDesc - ASM_PFX(m16Start)
-ASM_PFX(m16GdtrBase) DW _16GdtrBase - ASM_PFX(m16Start)
-ASM_PFX(mTransition) DW _EntryPoint - ASM_PFX(m16Start)
-
-SECTION .text
-
-ASM_PFX(m16Start):
-
-SavedGdt:
- dw 0
- dd 0
-
-;------------------------------------------------------------------------------
-; _BackFromUserCode() takes control in real mode after 'retf' has been executed
-; by user code. It will be shadowed to somewhere in memory below 1MB.
-;------------------------------------------------------------------------------
-_BackFromUserCode:
- ;
- ; The order of saved registers on the stack matches the order they appears
- ; in IA32_REGS structure. This facilitates wrapper function to extract them
- ; into that structure.
- ;
-BITS 16
- push ss
- push cs
- ;
- ; Note: We can't use o32 on the next instruction because of a bug
- ; in NASM 2.09.04 through 2.10rc1.
- ;
- call dword .Base ; push eip
-.Base:
- pushfd
- cli ; disable interrupts
- push gs
- push fs
- push es
- push ds
- pushad
- mov edx, strict dword 0
-.ThunkAttrEnd:
- test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15
- jz .1
- mov ax, 2401h
- int 15h
- cli ; disable interrupts
- jnc .2
-.1:
- test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL
- jz .2
- in al, 92h
- or al, 2
- out 92h, al ; deactivate A20M#
-.2:
- xor eax, eax
- mov ax, ss
- lea ebp, [esp + IA32_REGS.size]
- mov [bp - IA32_REGS.size + IA32_REGS._ESP], ebp
- mov bx, [bp - IA32_REGS.size + IA32_REGS._EIP]
- shl eax, 4 ; shl eax, 4
- add ebp, eax ; add ebp, eax
- mov eax, strict dword 0
-.SavedCr4End:
- mov cr4, eax
-o32 lgdt [cs:bx + (SavedGdt - .Base)]
- mov eax, strict dword 0
-.SavedCr0End:
- mov cr0, eax
- mov ax, strict word 0
-.SavedSsEnd:
- mov ss, eax
- mov esp, strict dword 0
-.SavedEspEnd:
-o32 retf ; return to protected mode
-
-_EntryPoint:
- DD _ToUserCode - ASM_PFX(m16Start)
- DW 8h
-_16Idtr:
- DW (1 << 10) - 1
- DD 0
-_16Gdtr:
- DW GdtEnd - _NullSegDesc - 1
-_16GdtrBase:
- DD 0
-
-;------------------------------------------------------------------------------
-; _ToUserCode() takes control in real mode before passing control to user code.
-; It will be shadowed to somewhere in memory below 1MB.
-;------------------------------------------------------------------------------
-_ToUserCode:
-BITS 16
- mov dx, ss
- mov ss, cx ; set new segment selectors
- mov ds, cx
- mov es, cx
- mov fs, cx
- mov gs, cx
- mov cr0, eax ; real mode starts at next instruction
- ; which (per SDM) *must* be a far JMP.
- jmp 0:strict word 0
-.RealAddrEnd:
- mov cr4, ebp
- mov ss, si ; set up 16-bit stack segment
- xchg esp, ebx ; set up 16-bit stack pointer
- mov bp, [esp + IA32_REGS.size]
- mov [cs:bp + (_BackFromUserCode.SavedSsEnd - 2 - _BackFromUserCode)], dx
- mov [cs:bp + (_BackFromUserCode.SavedEspEnd - 4 - _BackFromUserCode)], ebx
- lidt [cs:bp + (_16Idtr - _BackFromUserCode)]
-
- popad
- pop ds
- pop es
- pop fs
- pop gs
- popfd
-
-o32 retf ; transfer control to user code
-
-ALIGN 16
-_NullSegDesc DQ 0
-_16CsDesc:
- DW -1
- DW 0
- DB 0
- DB 9bh
- DB 8fh ; 16-bit segment, 4GB limit
- DB 0
-_16DsDesc:
- DW -1
- DW 0
- DB 0
- DB 93h
- DB 8fh ; 16-bit segment, 4GB limit
- DB 0
-GdtEnd:
-
-;------------------------------------------------------------------------------
-; IA32_REGISTER_SET *
-; EFIAPI
-; InternalAsmThunk16 (
-; IN IA32_REGISTER_SET *RegisterSet,
-; IN OUT VOID *Transition
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalAsmThunk16)
-ASM_PFX(InternalAsmThunk16):
-BITS 32
- push ebp
- push ebx
- push esi
- push edi
- push ds
- push es
- push fs
- push gs
- mov esi, [esp + 36] ; esi <- RegSet, the 1st parameter
- movzx edx, word [esi + IA32_REGS._SS]
- mov edi, [esi + IA32_REGS._ESP]
- add edi, - (IA32_REGS.size + 4) ; reserve stack space
- mov ebx, edi ; ebx <- stack offset
- imul eax, edx, 16 ; eax <- edx * 16
- push IA32_REGS.size / 4
- add edi, eax ; edi <- linear address of 16-bit stack
- pop ecx
- rep movsd ; copy RegSet
- mov eax, [esp + 40] ; eax <- address of transition code
- mov esi, edx ; esi <- 16-bit stack segment
- lea edx, [eax + (_BackFromUserCode.SavedCr0End - ASM_PFX(m16Start))]
- mov ecx, eax
- and ecx, 0fh
- shl eax, 12
- lea ecx, [ecx + (_BackFromUserCode - ASM_PFX(m16Start))]
- mov ax, cx
- stosd ; [edi] <- return address of user code
- add eax, _ToUserCode.RealAddrEnd - _BackFromUserCode
- mov [edx + (_ToUserCode.RealAddrEnd - 4 - _BackFromUserCode.SavedCr0End)], eax
- sgdt [edx + (SavedGdt - _BackFromUserCode.SavedCr0End)]
- sidt [esp + 36] ; save IDT stack in argument space
- mov eax, cr0
- mov [edx - 4], eax ; save CR0 in _BackFromUserCode.SavedCr0End - 4
- and eax, 7ffffffeh ; clear PE, PG bits
- mov ebp, cr4
- mov [edx + (_BackFromUserCode.SavedCr4End - 4 - _BackFromUserCode.SavedCr0End)], ebp
- and ebp, ~30h ; clear PAE, PSE bits
- push 10h
- pop ecx ; ecx <- selector for data segments
- lgdt [edx + (_16Gdtr - _BackFromUserCode.SavedCr0End)]
- pushfd ; Save df/if indeed
- call dword far [edx + (_EntryPoint - _BackFromUserCode.SavedCr0End)]
- popfd
- lidt [esp + 36] ; restore protected mode IDTR
- lea eax, [ebp - IA32_REGS.size] ; eax <- the address of IA32_REGS
- pop gs
- pop fs
- pop es
- pop ds
- pop edi
- pop esi
- pop ebx
- pop ebp
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Wbinvd.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Wbinvd.c
deleted file mode 100644
index 16b9cf7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Wbinvd.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file
- AsmWbinvd function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Executes a WBINVD instruction.
-
- Executes a WBINVD instruction. This function is only available on IA-32 and
- x64.
-
-**/
-VOID
-EFIAPI
-AsmWbinvd (
- VOID
- )
-{
- _asm {
- wbinvd
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Wbinvd.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Wbinvd.nasm
deleted file mode 100644
index 7bdf793..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/Wbinvd.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Wbinvd.Asm
-;
-; Abstract:
-;
-; AsmWbinvd function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWbinvd (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWbinvd)
-ASM_PFX(AsmWbinvd):
- wbinvd
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr0.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr0.c
deleted file mode 100644
index 177da80..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr0.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteCr0 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Control Register 0 (CR0).
-
- Writes and returns a new value to CR0. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to CR0.
-
- @return The value written to CR0.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr0 (
- UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov cr0, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr0.nasm
deleted file mode 100644
index 0c0ea5c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr0.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteCr0.Asm
-;
-; Abstract:
-;
-; AsmWriteCr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr0 (
-; UINTN Cr0
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteCr0)
-ASM_PFX(AsmWriteCr0):
- mov eax, [esp + 4]
- mov cr0, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr2.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr2.c
deleted file mode 100644
index efbdf63..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr2.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteCr2 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Control Register 2 (CR2).
-
- Writes and returns a new value to CR2. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to CR2.
-
- @return The value written to CR2.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr2 (
- UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov cr2, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr2.nasm
deleted file mode 100644
index 2b7afa8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr2.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteCr2.Asm
-;
-; Abstract:
-;
-; AsmWriteCr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr2 (
-; UINTN Cr2
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteCr2)
-ASM_PFX(AsmWriteCr2):
- mov eax, [esp + 4]
- mov cr2, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr3.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr3.c
deleted file mode 100644
index 6aeb0f2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr3.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteCr3 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Control Register 3 (CR3).
-
- Writes and returns a new value to CR3. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to CR3.
-
- @return The value written to CR3.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr3 (
- UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov cr3, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr3.nasm
deleted file mode 100644
index 90a2219..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr3.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteCr3.Asm
-;
-; Abstract:
-;
-; AsmWriteCr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr3 (
-; UINTN Cr3
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteCr3)
-ASM_PFX(AsmWriteCr3):
- mov eax, [esp + 4]
- mov cr3, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr4.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr4.c
deleted file mode 100644
index f145564..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr4.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- AsmWriteCr4 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Control Register 4 (CR4).
-
- Writes and returns a new value to CR4. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to CR4.
-
- @return The value written to CR4.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr4 (
- UINTN Value
- )
-{
- _asm {
- mov eax, Value
- _emit 0x0f // mov cr4, eax
- _emit 0x22
- _emit 0xE0
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr4.nasm
deleted file mode 100644
index 486fe24..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteCr4.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteCr4.Asm
-;
-; Abstract:
-;
-; AsmWriteCr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr4 (
-; UINTN Cr4
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteCr4)
-ASM_PFX(AsmWriteCr4):
- mov eax, [esp + 4]
- mov cr4, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr0.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr0.c
deleted file mode 100644
index bd5e101..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr0.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteDr0 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Debug Register 0 (DR0).
-
- Writes and returns a new value to DR0. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to Dr0.
-
- @return The value written to Debug Register 0 (DR0).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr0 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr0, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr0.nasm
deleted file mode 100644
index 5c2af94..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr0.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr0.Asm
-;
-; Abstract:
-;
-; AsmWriteDr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr0 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr0)
-ASM_PFX(AsmWriteDr0):
- mov eax, [esp + 4]
- mov dr0, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr1.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr1.c
deleted file mode 100644
index 695f346..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr1.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteDr1 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Debug Register 1 (DR1).
-
- Writes and returns a new value to DR1. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to Dr1.
-
- @return The value written to Debug Register 1 (DR1).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr1 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr1, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr1.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr1.nasm
deleted file mode 100644
index a35389e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr1.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr1.Asm
-;
-; Abstract:
-;
-; AsmWriteDr1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr1 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr1)
-ASM_PFX(AsmWriteDr1):
- mov eax, [esp + 4]
- mov dr1, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr2.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr2.c
deleted file mode 100644
index 8a24b94..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr2.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteDr2 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Debug Register 2 (DR2).
-
- Writes and returns a new value to DR2. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to Dr2.
-
- @return The value written to Debug Register 2 (DR2).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr2 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr2, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr2.nasm
deleted file mode 100644
index 936cefc..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr2.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr2.Asm
-;
-; Abstract:
-;
-; AsmWriteDr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr2 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr2)
-ASM_PFX(AsmWriteDr2):
- mov eax, [esp + 4]
- mov dr2, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr3.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr3.c
deleted file mode 100644
index 3a0921b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr3.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteDr3 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Debug Register 3 (DR3).
-
- Writes and returns a new value to DR3. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to Dr3.
-
- @return The value written to Debug Register 3 (DR3).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr3 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr3, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr3.nasm
deleted file mode 100644
index d7a58cf..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr3.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr3.Asm
-;
-; Abstract:
-;
-; AsmWriteDr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr3 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr3)
-ASM_PFX(AsmWriteDr3):
- mov eax, [esp + 4]
- mov dr3, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr4.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr4.c
deleted file mode 100644
index acfe93f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr4.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- AsmWriteDr4 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Debug Register 4 (DR4).
-
- Writes and returns a new value to DR4. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to Dr4.
-
- @return The value written to Debug Register 4 (DR4).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr4 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- _emit 0x0f // mov dr4, eax
- _emit 0x23
- _emit 0xe0
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr4.nasm
deleted file mode 100644
index 95c6d06..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr4.nasm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr4.Asm
-;
-; Abstract:
-;
-; AsmWriteDr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr4 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr4)
-ASM_PFX(AsmWriteDr4):
- mov eax, [esp + 4]
- ;
- ; DR4 is alias to DR6 only if DE (in CR4) is cleared. Otherwise, writing to
- ; this register will cause a #UD exception.
- ;
- ; MS assembler doesn't support this instruction since no one would use it
- ; under normal circustances. Here opcode is used.
- ;
- DB 0xf, 0x23, 0xe0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr5.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr5.c
deleted file mode 100644
index 4e00ceb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr5.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- AsmWriteDr5 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Debug Register 5 (DR5).
-
- Writes and returns a new value to DR5. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to Dr5.
-
- @return The value written to Debug Register 5 (DR5).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr5 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- _emit 0x0f // mov dr5, eax
- _emit 0x23
- _emit 0xe8
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr5.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr5.nasm
deleted file mode 100644
index a6256ef..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr5.nasm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr5.Asm
-;
-; Abstract:
-;
-; AsmWriteDr5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr5 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr5)
-ASM_PFX(AsmWriteDr5):
- mov eax, [esp + 4]
- ;
- ; DR5 is alias to DR7 only if DE (in CR4) is cleared. Otherwise, writing to
- ; this register will cause a #UD exception.
- ;
- ; MS assembler doesn't support this instruction since no one would use it
- ; under normal circustances. Here opcode is used.
- ;
- DB 0xf, 0x23, 0xe8
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr6.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr6.c
deleted file mode 100644
index 29ab483..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr6.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteDr6 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Debug Register 6 (DR6).
-
- Writes and returns a new value to DR6. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to Dr6.
-
- @return The value written to Debug Register 6 (DR6).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr6 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr6, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr6.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr6.nasm
deleted file mode 100644
index 75ae84b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr6.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr6.Asm
-;
-; Abstract:
-;
-; AsmWriteDr6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr6 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr6)
-ASM_PFX(AsmWriteDr6):
- mov eax, [esp + 4]
- mov dr6, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr7.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr7.c
deleted file mode 100644
index aa2286f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr7.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteDr7 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Writes a value to Debug Register 7 (DR7).
-
- Writes and returns a new value to DR7. This function is only available on
- IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64.
-
- @param Value The value to write to Dr7.
-
- @return The value written to Debug Register 7 (DR7).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr7 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr7, eax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr7.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr7.nasm
deleted file mode 100644
index 06539e3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteDr7.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr7.Asm
-;
-; Abstract:
-;
-; AsmWriteDr7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr7 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr7)
-ASM_PFX(AsmWriteDr7):
- mov eax, [esp + 4]
- mov dr7, eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteGdtr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteGdtr.c
deleted file mode 100644
index 905d585..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteGdtr.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- AsmWriteGdtr function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-/**
- Writes the current Global Descriptor Table Register (GDTR) descriptor.
-
- Writes and the current GDTR descriptor specified by Gdtr. This function is
- only available on IA-32 and x64.
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86WriteGdtr (
- IN CONST IA32_DESCRIPTOR *Gdtr
- )
-{
- _asm {
- mov eax, Gdtr
- lgdt fword ptr [eax]
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteGdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteGdtr.nasm
deleted file mode 100644
index 4f4f590..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteGdtr.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteGdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteGdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86WriteGdtr (
-; IN CONST IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86WriteGdtr)
-ASM_PFX(InternalX86WriteGdtr):
- mov eax, [esp + 4]
- lgdt [eax]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteIdtr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteIdtr.c
deleted file mode 100644
index ceef0e8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteIdtr.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file
- AsmWriteIdtr function
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-/**
- Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Writes the current IDTR descriptor and returns it in Idtr. This function is
- only available on IA-32 and x64.
-
- @param Idtr The pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86WriteIdtr (
- IN CONST IA32_DESCRIPTOR *Idtr
- )
-{
- _asm {
- mov eax, Idtr
- pushfd
- cli
- lidt fword ptr [eax]
- popfd
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteIdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteIdtr.nasm
deleted file mode 100644
index f82f3a8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteIdtr.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteIdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteIdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86WriteIdtr (
-; IN CONST IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86WriteIdtr)
-ASM_PFX(InternalX86WriteIdtr):
- mov eax, [esp + 4]
- pushfd
- cli
- lidt [eax]
- popfd
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteLdtr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteLdtr.c
deleted file mode 100644
index fe9ad0f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteLdtr.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- AsmWriteLdtr function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Writes the current Local Descriptor Table Register (GDTR) selector.
-
- Writes and the current LDTR descriptor specified by Ldtr. This function is
- only available on IA-32 and x64.
-
- @param Ldtr 16-bit LDTR selector value.
-
-**/
-VOID
-EFIAPI
-AsmWriteLdtr (
- IN UINT16 Ldtr
- )
-{
- _asm {
- xor eax, eax
- mov ax, Ldtr
- lldt ax
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteLdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteLdtr.nasm
deleted file mode 100644
index e3d9e0d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteLdtr.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteLdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteLdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteLdtr (
-; IN UINT16 Ldtr
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteLdtr)
-ASM_PFX(AsmWriteLdtr):
- mov eax, [esp + 4]
- lldt ax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm0.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm0.c
deleted file mode 100644
index 076ccd9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm0.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmWriteMm0 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Writes the current value of 64-bit MMX Register #0 (MM0).
-
- Writes the current value of MM0. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM0.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm0 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm0, qword ptr [Value]
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm0.nasm
deleted file mode 100644
index c43005b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm0.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm0.Asm
-;
-; Abstract:
-;
-; AsmWriteMm0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm0 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm0)
-ASM_PFX(AsmWriteMm0):
- movq mm0, [esp + 4]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm1.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm1.c
deleted file mode 100644
index dadf7c1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm1.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmWriteMm1 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Writes the current value of 64-bit MMX Register #1 (MM1).
-
- Writes the current value of MM1. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM1.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm1 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm1, qword ptr [Value]
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm1.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm1.nasm
deleted file mode 100644
index b3171b6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm1.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm1.Asm
-;
-; Abstract:
-;
-; AsmWriteMm1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm1 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm1)
-ASM_PFX(AsmWriteMm1):
- movq mm1, [esp + 4]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm2.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm2.c
deleted file mode 100644
index 830a03e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm2.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmWriteMm2 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Writes the current value of 64-bit MMX Register #2 (MM2).
-
- Writes the current value of MM2. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM2.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm2 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm2, qword ptr [Value]
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm2.nasm
deleted file mode 100644
index ff7bcee..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm2.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm2.Asm
-;
-; Abstract:
-;
-; AsmWriteMm2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm2 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm2)
-ASM_PFX(AsmWriteMm2):
- movq mm2, [esp + 4]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm3.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm3.c
deleted file mode 100644
index c9c6476..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm3.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmWriteMm3 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Writes the current value of 64-bit MMX Register #3 (MM3).
-
- Writes the current value of MM3. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM3.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm3 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm3, qword ptr [Value]
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm3.nasm
deleted file mode 100644
index 0e60af5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm3.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm3.Asm
-;
-; Abstract:
-;
-; AsmWriteMm3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm3 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm3)
-ASM_PFX(AsmWriteMm3):
- movq mm3, [esp + 4]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm4.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm4.c
deleted file mode 100644
index 1822811..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm4.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteMm4 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Writes the current value of 64-bit MMX Register #4 (MM4).
-
- Writes the current value of MM4. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM4.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm4 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm4, qword ptr [Value]
- emms
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm4.nasm
deleted file mode 100644
index 26552fb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm4.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm4.Asm
-;
-; Abstract:
-;
-; AsmWriteMm4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm4 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm4)
-ASM_PFX(AsmWriteMm4):
- movq mm4, [esp + 4]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm5.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm5.c
deleted file mode 100644
index f6ad0e0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm5.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
- AsmWriteMm5 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Writes the current value of 64-bit MMX Register #5 (MM5).
-
- Writes the current value of MM5. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM5.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm5 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm5, qword ptr [Value]
- emms
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm5.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm5.nasm
deleted file mode 100644
index 8bf690c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm5.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm5.Asm
-;
-; Abstract:
-;
-; AsmWriteMm5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm5 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm5)
-ASM_PFX(AsmWriteMm5):
- movq mm5, [esp + 4]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm6.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm6.c
deleted file mode 100644
index 28e06b5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm6.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmWriteMm6 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Writes the current value of 64-bit MMX Register #6 (MM6).
-
- Writes the current value of MM6. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM6.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm6 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm6, qword ptr [Value]
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm6.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm6.nasm
deleted file mode 100644
index 6234135..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm6.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm6.Asm
-;
-; Abstract:
-;
-; AsmWriteMm6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm6 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm6)
-ASM_PFX(AsmWriteMm6):
- movq mm6, [esp + 4]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm7.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm7.c
deleted file mode 100644
index d7350bf..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm7.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- AsmWriteMm7 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Writes the current value of 64-bit MMX Register #7 (MM7).
-
- Writes the current value of MM7. This function is only available on IA32 and
- x64.
-
- @param Value The 64-bit value to write to MM7.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm7 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm7, qword ptr [Value]
- emms
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm7.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm7.nasm
deleted file mode 100644
index c4afbe5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMm7.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm7.Asm
-;
-; Abstract:
-;
-; AsmWriteMm7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm7 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm7)
-ASM_PFX(AsmWriteMm7):
- movq mm7, [esp + 4]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c
deleted file mode 100644
index 39a792b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/** @file
- AsmWriteMsr64 function
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
- value.
-
- Writes the 64-bit value specified by Value to the MSR specified by Index. The
- 64-bit value written to the MSR is returned. No parameter checking is
- performed on Index or Value, and some of these may cause CPU exceptions. The
- caller must either guarantee that Index and Value are valid, or the caller
- must establish proper exception handlers. This function is only available on
- IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param Value The 64-bit value to write to the MSR.
-
- @return Value
-
-**/
-UINT64
-EFIAPI
-AsmWriteMsr64 (
- IN UINT32 Index,
- IN UINT64 Value
- )
-{
- _asm {
- mov edx, dword ptr [Value + 4]
- mov eax, dword ptr [Value + 0]
- mov ecx, Index
- wrmsr
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMsr64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMsr64.nasm
deleted file mode 100644
index 4eb9706..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteMsr64.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMsr64.Asm
-;
-; Abstract:
-;
-; AsmWriteMsr64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmWriteMsr64 (
-; IN UINT32 Index,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMsr64)
-ASM_PFX(AsmWriteMsr64):
- mov edx, [esp + 12]
- mov eax, [esp + 8]
- mov ecx, [esp + 4]
- wrmsr
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteTr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteTr.nasm
deleted file mode 100644
index 1fc18e1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Ia32/WriteTr.nasm
+++ /dev/null
@@ -1,36 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2017, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteTr.nasm
-;
-; Abstract:
-;
-; Write TR register
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; AsmWriteTr (
-; UINT16 Selector
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteTr)
-ASM_PFX(AsmWriteTr):
- mov eax, [esp+4]
- ltr ax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LRotU32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LRotU32.c
deleted file mode 100644
index 573c30c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LRotU32.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits
- with the high bits that were rotated.
-
- This function rotates the 32-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 31, then ASSERT().
-
- @param Operand The 32-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand << Count
-
-**/
-UINT32
-EFIAPI
-LRotU32 (
- IN UINT32 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < 32);
- return (Operand << Count) | (Operand >> (32 - Count));
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LRotU64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LRotU64.c
deleted file mode 100644
index c938456..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LRotU64.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits
- with the high bits that were rotated.
-
- This function rotates the 64-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand << Count
-
-**/
-UINT64
-EFIAPI
-LRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < 64);
- return InternalMathLRotU64 (Operand, Count);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LShiftU64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LShiftU64.c
deleted file mode 100644
index e3be23f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LShiftU64.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled
- with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the left by Count bits. The
- low Count bits are set to zero. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift left.
- @param Count The number of bits to shift left.
-
- @return Operand << Count.
-
-**/
-UINT64
-EFIAPI
-LShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < 64);
- return InternalMathLShiftU64 (Operand, Count);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LinkedList.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LinkedList.c
deleted file mode 100644
index 0c7cd83..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LinkedList.c
+++ /dev/null
@@ -1,605 +0,0 @@
-/** @file
- Linked List Library Functions.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- If PcdVerifyNodeInList is TRUE, ASSERTs when SecondEntry is or is not part of
- the same doubly-linked list as FirstEntry depending on the value of InList.
- Independent of PcdVerifyNodeInList, ASSERTs when FirstEntry is not part of a
- valid list.
-
- If FirstEntry is NULL, then ASSERT().
- If FirstEntry->ForwardLink is NULL, then ASSERT().
- If FirstEntry->BackLink is NULL, then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and List contains more than
- PcdMaximumLinkedListLength nodes, then ASSERT().
- If PcdVerifyNodeInList is TRUE and SecondEntry is NULL, then ASSERT().
-
- @param FirstEntry A pointer to a node in a linked list.
- @param SecondEntry A pointer to the node to locate.
- @param InList Defines whether to check if SecondEntry is or is not part
- of the same doubly-linked list as FirstEntry.
-
-**/
-#if !defined (MDEPKG_NDEBUG)
- #define ASSERT_VERIFY_NODE_IN_VALID_LIST(FirstEntry, SecondEntry, InList) \
- do { \
- if (FeaturePcdGet (PcdVerifyNodeInList)) { \
- ASSERT (InList == IsNodeInList ((FirstEntry), (SecondEntry))); \
- } else { \
- ASSERT (InternalBaseLibIsListValid (FirstEntry)); \
- } \
- } while (FALSE)
-#else
- #define ASSERT_VERIFY_NODE_IN_VALID_LIST(FirstEntry, SecondEntry, InList)
-#endif
-
-/**
- Worker function that verifies the validity of this list.
-
- If List is NULL, then ASSERT().
- If List->ForwardLink is NULL, then ASSERT().
- If List->BackLink is NULL, then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and List contains more than
- PcdMaximumLinkedListLength nodes, then ASSERT().
-
- @param List A pointer to a node in a linked list.
-
- @retval TRUE if PcdVerifyNodeInList is FALSE
- @retval TRUE if DoMembershipCheck is FALSE
- @retval TRUE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE
- and Node is a member of List.
- @retval FALSE if PcdVerifyNodeInList is TRUE and DoMembershipCheck is TRUE
- and Node is in not a member of List.
-
-**/
-BOOLEAN
-EFIAPI
-InternalBaseLibIsListValid (
- IN CONST LIST_ENTRY *List
- )
-{
- UINTN Count;
- CONST LIST_ENTRY *Ptr;
-
- //
- // Test the validity of List and Node
- //
- ASSERT (List != NULL);
- ASSERT (List->ForwardLink != NULL);
- ASSERT (List->BackLink != NULL);
-
- if (PcdGet32 (PcdMaximumLinkedListLength) > 0) {
- Count = 0;
- Ptr = List;
-
- //
- // Count the total number of nodes in List.
- // Exit early if the number of nodes in List >= PcdMaximumLinkedListLength
- //
- do {
- Ptr = Ptr->ForwardLink;
- Count++;
- } while ((Ptr != List) && (Count < PcdGet32 (PcdMaximumLinkedListLength)));
-
- //
- // return whether linked list is too long
- //
- return (BOOLEAN)(Count < PcdGet32 (PcdMaximumLinkedListLength));
- }
-
- return TRUE;
-}
-
-/**
- Checks whether FirstEntry and SecondEntry are part of the same doubly-linked
- list.
-
- If FirstEntry is NULL, then ASSERT().
- If FirstEntry->ForwardLink is NULL, then ASSERT().
- If FirstEntry->BackLink is NULL, then ASSERT().
- If SecondEntry is NULL, then ASSERT();
- If PcdMaximumLinkedListLength is not zero, and List contains more than
- PcdMaximumLinkedListLength nodes, then ASSERT().
-
- @param FirstEntry A pointer to a node in a linked list.
- @param SecondEntry A pointer to the node to locate.
-
- @retval TRUE SecondEntry is in the same doubly-linked list as FirstEntry.
- @retval FALSE SecondEntry isn't in the same doubly-linked list as FirstEntry,
- or FirstEntry is invalid.
-
-**/
-BOOLEAN
-EFIAPI
-IsNodeInList (
- IN CONST LIST_ENTRY *FirstEntry,
- IN CONST LIST_ENTRY *SecondEntry
- )
-{
- UINTN Count;
- CONST LIST_ENTRY *Ptr;
-
- //
- // ASSERT List not too long
- //
- ASSERT (InternalBaseLibIsListValid (FirstEntry));
-
- ASSERT (SecondEntry != NULL);
-
- Count = 0;
- Ptr = FirstEntry;
-
- //
- // Check to see if SecondEntry is a member of FirstEntry.
- // Exit early if the number of nodes in List >= PcdMaximumLinkedListLength
- //
- do {
- Ptr = Ptr->ForwardLink;
- if (PcdGet32 (PcdMaximumLinkedListLength) > 0) {
- Count++;
-
- //
- // Return if the linked list is too long
- //
- if (Count == PcdGet32 (PcdMaximumLinkedListLength)) {
- return (BOOLEAN)(Ptr == SecondEntry);
- }
- }
-
- if (Ptr == SecondEntry) {
- return TRUE;
- }
- } while (Ptr != FirstEntry);
-
- return FALSE;
-}
-
-/**
- Initializes the head node of a doubly-linked list, and returns the pointer to
- the head node of the doubly-linked list.
-
- Initializes the forward and backward links of a new linked list. After
- initializing a linked list with this function, the other linked list
- functions may be used to add and remove nodes from the linked list. It is up
- to the caller of this function to allocate the memory for ListHead.
-
- If ListHead is NULL, then ASSERT().
-
- @param ListHead A pointer to the head node of a new doubly-linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-InitializeListHead (
- IN OUT LIST_ENTRY *ListHead
- )
-
-{
- ASSERT (ListHead != NULL);
-
- ListHead->ForwardLink = ListHead;
- ListHead->BackLink = ListHead;
- return ListHead;
-}
-
-/**
- Adds a node to the beginning of a doubly-linked list, and returns the pointer
- to the head node of the doubly-linked list.
-
- Adds the node Entry at the beginning of the doubly-linked list denoted by
- ListHead, and returns ListHead.
-
- If ListHead is NULL, then ASSERT().
- If Entry is NULL, then ASSERT().
- If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and prior to insertion the number
- of nodes in ListHead, including the ListHead node, is greater than or
- equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly-linked list.
- @param Entry A pointer to a node that is to be inserted at the beginning
- of a doubly-linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-InsertHeadList (
- IN OUT LIST_ENTRY *ListHead,
- IN OUT LIST_ENTRY *Entry
- )
-{
- //
- // ASSERT List not too long and Entry is not one of the nodes of List
- //
- ASSERT_VERIFY_NODE_IN_VALID_LIST (ListHead, Entry, FALSE);
-
- Entry->ForwardLink = ListHead->ForwardLink;
- Entry->BackLink = ListHead;
- Entry->ForwardLink->BackLink = Entry;
- ListHead->ForwardLink = Entry;
- return ListHead;
-}
-
-/**
- Adds a node to the end of a doubly-linked list, and returns the pointer to
- the head node of the doubly-linked list.
-
- Adds the node Entry to the end of the doubly-linked list denoted by ListHead,
- and returns ListHead.
-
- If ListHead is NULL, then ASSERT().
- If Entry is NULL, then ASSERT().
- If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and prior to insertion the number
- of nodes in ListHead, including the ListHead node, is greater than or
- equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly-linked list.
- @param Entry A pointer to a node that is to be added at the end of the
- doubly-linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-InsertTailList (
- IN OUT LIST_ENTRY *ListHead,
- IN OUT LIST_ENTRY *Entry
- )
-{
- //
- // ASSERT List not too long and Entry is not one of the nodes of List
- //
- ASSERT_VERIFY_NODE_IN_VALID_LIST (ListHead, Entry, FALSE);
-
- Entry->ForwardLink = ListHead;
- Entry->BackLink = ListHead->BackLink;
- Entry->BackLink->ForwardLink = Entry;
- ListHead->BackLink = Entry;
- return ListHead;
-}
-
-/**
- Retrieves the first node of a doubly-linked list.
-
- Returns the first node of a doubly-linked list. List must have been
- initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
- If List is empty, then List is returned.
-
- If List is NULL, then ASSERT().
- If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param List A pointer to the head node of a doubly-linked list.
-
- @return The first node of a doubly-linked list.
- @retval List The list is empty.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GetFirstNode (
- IN CONST LIST_ENTRY *List
- )
-{
- //
- // ASSERT List not too long
- //
- ASSERT (InternalBaseLibIsListValid (List));
-
- return List->ForwardLink;
-}
-
-/**
- Retrieves the next node of a doubly-linked list.
-
- Returns the node of a doubly-linked list that follows Node.
- List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()
- or InitializeListHead(). If List is empty, then List is returned.
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and List contains more than
- PcdMaximumLinkedListLength nodes, then ASSERT().
- If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
-
- @param List A pointer to the head node of a doubly-linked list.
- @param Node A pointer to a node in the doubly-linked list.
-
- @return A pointer to the next node if one exists. Otherwise List is returned.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GetNextNode (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- )
-{
- //
- // ASSERT List not too long and Node is one of the nodes of List
- //
- ASSERT_VERIFY_NODE_IN_VALID_LIST (List, Node, TRUE);
-
- return Node->ForwardLink;
-}
-
-/**
- Retrieves the previous node of a doubly-linked list.
-
- Returns the node of a doubly-linked list that precedes Node.
- List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE()
- or InitializeListHead(). If List is empty, then List is returned.
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and List contains more than
- PcdMaximumLinkedListLength nodes, then ASSERT().
- If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
-
- @param List A pointer to the head node of a doubly-linked list.
- @param Node A pointer to a node in the doubly-linked list.
-
- @return A pointer to the previous node if one exists. Otherwise List is returned.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GetPreviousNode (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- )
-{
- //
- // ASSERT List not too long and Node is one of the nodes of List
- //
- ASSERT_VERIFY_NODE_IN_VALID_LIST (List, Node, TRUE);
-
- return Node->BackLink;
-}
-
-/**
- Checks to see if a doubly-linked list is empty or not.
-
- Checks to see if the doubly-linked list is empty. If the linked list contains
- zero nodes, this function returns TRUE. Otherwise, it returns FALSE.
-
- If ListHead is NULL, then ASSERT().
- If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly-linked list.
-
- @retval TRUE The linked list is empty.
- @retval FALSE The linked list is not empty.
-
-**/
-BOOLEAN
-EFIAPI
-IsListEmpty (
- IN CONST LIST_ENTRY *ListHead
- )
-{
- //
- // ASSERT List not too long
- //
- ASSERT (InternalBaseLibIsListValid (ListHead));
-
- return (BOOLEAN)(ListHead->ForwardLink == ListHead);
-}
-
-/**
- Determines if a node in a doubly-linked list is the head node of a the same
- doubly-linked list. This function is typically used to terminate a loop that
- traverses all the nodes in a doubly-linked list starting with the head node.
-
- Returns TRUE if Node is equal to List. Returns FALSE if Node is one of the
- nodes in the doubly-linked list specified by List. List must have been
- initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(),
- then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
- If PcdVerifyNodeInList is TRUE and Node is not a node in List and Node is not
- equal to List, then ASSERT().
-
- @param List A pointer to the head node of a doubly-linked list.
- @param Node A pointer to a node in the doubly-linked list.
-
- @retval TRUE Node is the head of the doubly-linked list pointed by List.
- @retval FALSE Node is not the head of the doubly-linked list pointed by List.
-
-**/
-BOOLEAN
-EFIAPI
-IsNull (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- )
-{
- //
- // ASSERT List not too long and Node is one of the nodes of List
- //
- ASSERT_VERIFY_NODE_IN_VALID_LIST (List, Node, TRUE);
-
- return (BOOLEAN)(Node == List);
-}
-
-/**
- Determines if a node the last node in a doubly-linked list.
-
- Returns TRUE if Node is the last node in the doubly-linked list specified by
- List. Otherwise, FALSE is returned. List must have been initialized with
- INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or
- InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
- If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT().
-
- @param List A pointer to the head node of a doubly-linked list.
- @param Node A pointer to a node in the doubly-linked list.
-
- @retval TRUE Node is the last node in the linked list.
- @retval FALSE Node is not the last node in the linked list.
-
-**/
-BOOLEAN
-EFIAPI
-IsNodeAtEnd (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- )
-{
- //
- // ASSERT List not too long and Node is one of the nodes of List
- //
- ASSERT_VERIFY_NODE_IN_VALID_LIST (List, Node, TRUE);
-
- return (BOOLEAN)(!IsNull (List, Node) && List->BackLink == Node);
-}
-
-/**
- Swaps the location of two nodes in a doubly-linked list, and returns the
- first node after the swap.
-
- If FirstEntry is identical to SecondEntry, then SecondEntry is returned.
- Otherwise, the location of the FirstEntry node is swapped with the location
- of the SecondEntry node in a doubly-linked list. SecondEntry must be in the
- same double linked list as FirstEntry and that double linked list must have
- been initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead().
- SecondEntry is returned after the nodes are swapped.
-
- If FirstEntry is NULL, then ASSERT().
- If SecondEntry is NULL, then ASSERT().
- If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the
- same linked list, then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes in the
- linked list containing the FirstEntry and SecondEntry nodes, including
- the FirstEntry and SecondEntry nodes, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param FirstEntry A pointer to a node in a linked list.
- @param SecondEntry A pointer to another node in the same linked list.
-
- @return SecondEntry.
-
-**/
-LIST_ENTRY *
-EFIAPI
-SwapListEntries (
- IN OUT LIST_ENTRY *FirstEntry,
- IN OUT LIST_ENTRY *SecondEntry
- )
-{
- LIST_ENTRY *Ptr;
-
- if (FirstEntry == SecondEntry) {
- return SecondEntry;
- }
-
- //
- // ASSERT Entry1 and Entry2 are in the same linked list
- //
- ASSERT_VERIFY_NODE_IN_VALID_LIST (FirstEntry, SecondEntry, TRUE);
-
- //
- // Ptr is the node pointed to by FirstEntry->ForwardLink
- //
- Ptr = RemoveEntryList (FirstEntry);
-
- //
- // If FirstEntry immediately follows SecondEntry, FirstEntry will be placed
- // immediately in front of SecondEntry
- //
- if (Ptr->BackLink == SecondEntry) {
- return InsertTailList (SecondEntry, FirstEntry);
- }
-
- //
- // Ptr == SecondEntry means SecondEntry immediately follows FirstEntry,
- // then there are no further steps necessary
- //
- if (Ptr == InsertHeadList (SecondEntry, FirstEntry)) {
- return Ptr;
- }
-
- //
- // Move SecondEntry to the front of Ptr
- //
- RemoveEntryList (SecondEntry);
- InsertTailList (Ptr, SecondEntry);
- return SecondEntry;
-}
-
-/**
- Removes a node from a doubly-linked list, and returns the node that follows
- the removed node.
-
- Removes the node Entry from a doubly-linked list. It is up to the caller of
- this function to release the memory used by this node if that is required. On
- exit, the node following Entry in the doubly-linked list is returned. If
- Entry is the only node in the linked list, then the head node of the linked
- list is returned.
-
- If Entry is NULL, then ASSERT().
- If Entry is the head node of an empty list, then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes in the
- linked list containing Entry, including the Entry node, is greater than
- or equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param Entry A pointer to a node in a linked list.
-
- @return Entry.
-
-**/
-LIST_ENTRY *
-EFIAPI
-RemoveEntryList (
- IN CONST LIST_ENTRY *Entry
- )
-{
- ASSERT (!IsListEmpty (Entry));
-
- Entry->ForwardLink->BackLink = Entry->BackLink;
- Entry->BackLink->ForwardLink = Entry->ForwardLink;
- return Entry->ForwardLink;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LongJump.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LongJump.c
deleted file mode 100644
index f432cfd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LongJump.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file
- Long Jump functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Restores the CPU context that was saved with SetJump().
-
- Restores the CPU context from the buffer specified by JumpBuffer. This
- function never returns to the caller. Instead is resumes execution based on
- the state of JumpBuffer.
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
- If Value is 0, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
- @param Value The value to return when the SetJump() context is
- restored and must be non-zero.
-
-**/
-VOID
-EFIAPI
-LongJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
- IN UINTN Value
- )
-{
- InternalAssertJumpBuffer (JumpBuffer);
- ASSERT (Value != 0);
-
- InternalLongJump (JumpBuffer, Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LowBitSet32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LowBitSet32.c
deleted file mode 100644
index b613cd2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LowBitSet32.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the bit position of the lowest bit set in a 32-bit value.
-
- This function computes the bit position of the lowest bit set in the 32-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 31 is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @retval 0..31 The lowest bit set in Operand was found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-LowBitSet32 (
- IN UINT32 Operand
- )
-{
- INTN BitIndex;
-
- if (Operand == 0) {
- return -1;
- }
-
- for (BitIndex = 0; 0 == (Operand & 1); BitIndex++, Operand >>= 1);
- return BitIndex;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LowBitSet64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LowBitSet64.c
deleted file mode 100644
index 911fbda..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/LowBitSet64.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the bit position of the lowest bit set in a 64-bit value.
-
- This function computes the bit position of the lowest bit set in the 64-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 63 is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @retval 0..63 The lowest bit set in Operand was found.
- @retval -1 Operand is zero.
-
-
-**/
-INTN
-EFIAPI
-LowBitSet64 (
- IN UINT64 Operand
- )
-{
- INTN BitIndex;
-
- if (Operand == 0) {
- return -1;
- }
-
- for (BitIndex = 0;
- (Operand & 1) == 0;
- BitIndex++, Operand = RShiftU64 (Operand, 1));
- return BitIndex;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Math64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Math64.c
deleted file mode 100644
index 662d559..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Math64.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/** @file
- Leaf math worker functions that require 64-bit arithmetic support from the
- compiler.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Shifts a 64-bit integer left between 0 and 63 bits. The low bits
- are filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the left by Count bits. The
- low Count bits are set to zero. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift left.
- @param Count The number of bits to shift left.
-
- @return Operand << Count.
-
-**/
-UINT64
-EFIAPI
-InternalMathLShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- return Operand << Count;
-}
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. This high bits
- are filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to zero. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count.
-
-**/
-UINT64
-EFIAPI
-InternalMathRShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- return Operand >> Count;
-}
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. The high bits
- are filled with original integer's bit 63. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to bit 63 of Operand. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand arithmetically shifted right by Count.
-
-**/
-UINT64
-EFIAPI
-InternalMathARShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- INTN TestValue;
-
- //
- // Test if this compiler supports arithmetic shift
- //
- TestValue = (INTN)((INT64)(1ULL << 63) >> 63);
- if (TestValue == -1) {
- //
- // Arithmetic shift is supported
- //
- return (UINT64)((INT64)Operand >> Count);
- }
-
- //
- // Arithmetic is not supported
- //
- return (Operand >> Count) |
- ((INTN)Operand < 0 ? ~((UINTN)-1 >> Count) : 0);
-}
-
-
-/**
- Rotates a 64-bit integer left between 0 and 63 bits, filling
- the low bits with the high bits that were rotated.
-
- This function rotates the 64-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- @param Operand The 64-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand <<< Count.
-
-**/
-UINT64
-EFIAPI
-InternalMathLRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- return (Operand << Count) | (Operand >> (64 - Count));
-}
-
-/**
- Rotates a 64-bit integer right between 0 and 63 bits, filling
- the high bits with the high low bits that were rotated.
-
- This function rotates the 64-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- @param Operand The 64-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >>> Count.
-
-**/
-UINT64
-EFIAPI
-InternalMathRRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- return (Operand >> Count) | (Operand << (64 - Count));
-}
-
-/**
- Switches the endianess of a 64-bit integer.
-
- This function swaps the bytes in a 64-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 64-bit unsigned value.
-
- @return The byte swapped Operand.
-
-**/
-UINT64
-EFIAPI
-InternalMathSwapBytes64 (
- IN UINT64 Operand
- )
-{
- UINT64 LowerBytes;
- UINT64 HigherBytes;
-
- LowerBytes = (UINT64) SwapBytes32 ((UINT32) Operand);
- HigherBytes = (UINT64) SwapBytes32 ((UINT32) (Operand >> 32));
-
- return (LowerBytes << 32 | HigherBytes);
-}
-
-/**
- Multiplies a 64-bit unsigned integer by a 32-bit unsigned integer
- and generates a 64-bit unsigned result.
-
- This function multiplies the 64-bit unsigned value Multiplicand by the 32-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 32-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-InternalMathMultU64x32 (
- IN UINT64 Multiplicand,
- IN UINT32 Multiplier
- )
-{
- return Multiplicand * Multiplier;
-}
-
-
-/**
- Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer
- and generates a 64-bit unsigned result.
-
- This function multiplies the 64-bit unsigned value Multiplicand by the 64-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 64-bit unsigned value.
-
- @return Multiplicand * Multiplier.
-
-**/
-UINT64
-EFIAPI
-InternalMathMultU64x64 (
- IN UINT64 Multiplicand,
- IN UINT64 Multiplier
- )
-{
- return Multiplicand * Multiplier;
-}
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. This
- function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend / Divisor.
-
-**/
-UINT64
-EFIAPI
-InternalMathDivU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- return Dividend / Divisor;
-}
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 32-bit remainder. This function
- returns the 32-bit unsigned remainder.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend % Divisor.
-
-**/
-UINT32
-EFIAPI
-InternalMathModU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- return (UINT32)(Dividend % Divisor);
-}
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
- @param Remainder A pointer to a 32-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor.
-
-**/
-UINT64
-EFIAPI
-InternalMathDivRemU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor,
- OUT UINT32 *Remainder OPTIONAL
- )
-{
- if (Remainder != NULL) {
- *Remainder = (UINT32)(Dividend % Divisor);
- }
- return Dividend / Divisor;
-}
-
-/**
- Divides a 64-bit unsigned integer by a 64-bit unsigned integer and
- generates a 64-bit unsigned result and an optional 64-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 64-bit unsigned value.
- @param Remainder A pointer to a 64-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivRemU64x64 (
- IN UINT64 Dividend,
- IN UINT64 Divisor,
- OUT UINT64 *Remainder OPTIONAL
- )
-{
- if (Remainder != NULL) {
- *Remainder = Dividend % Divisor;
- }
- return Dividend / Divisor;
-}
-
-/**
- Divides a 64-bit signed integer by a 64-bit signed integer and
- generates a 64-bit signed result and an optional 64-bit signed remainder.
-
- This function divides the 64-bit signed value Dividend by the 64-bit
- signed value Divisor and generates a 64-bit signed quotient. If Remainder
- is not NULL, then the 64-bit signed remainder is returned in Remainder.
- This function returns the 64-bit signed quotient.
-
- @param Dividend A 64-bit signed value.
- @param Divisor A 64-bit signed value.
- @param Remainder A pointer to a 64-bit signed value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor.
-
-**/
-INT64
-EFIAPI
-InternalMathDivRemS64x64 (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
- )
-{
- if (Remainder != NULL) {
- *Remainder = Dividend % Divisor;
- }
- return Dividend / Divisor;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/ModU64x32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/ModU64x32.c
deleted file mode 100644
index 57c3e41..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/ModU64x32.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 32-bit remainder. This function
- returns the 32-bit unsigned remainder.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend % Divisor.
-
-**/
-UINT32
-EFIAPI
-ModU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- ASSERT (Divisor != 0);
- return InternalMathModU64x32 (Dividend, Divisor);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/MultS64x64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/MultS64x64.c
deleted file mode 100644
index c953b0d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/MultS64x64.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Multiplies a 64-bit signed integer by a 64-bit signed integer and generates a
- 64-bit signed result.
-
- This function multiplies the 64-bit signed value Multiplicand by the 64-bit
- signed value Multiplier and generates a 64-bit signed result. This 64-bit
- signed result is returned.
-
- @param Multiplicand A 64-bit signed value.
- @param Multiplier A 64-bit signed value.
-
- @return Multiplicand * Multiplier.
-
-**/
-INT64
-EFIAPI
-MultS64x64 (
- IN INT64 Multiplicand,
- IN INT64 Multiplier
- )
-{
- return (INT64)MultU64x64 ((UINT64) Multiplicand, (UINT64) Multiplier);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/MultU64x32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/MultU64x32.c
deleted file mode 100644
index 1c49106..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/MultU64x32.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Multiplies a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function multiplies the 64-bit unsigned value Multiplicand by the 32-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 32-bit unsigned value.
-
- @return Multiplicand * Multiplier.
-
-**/
-UINT64
-EFIAPI
-MultU64x32 (
- IN UINT64 Multiplicand,
- IN UINT32 Multiplier
- )
-{
- UINT64 Result;
-
- Result = InternalMathMultU64x32 (Multiplicand, Multiplier);
-
- return Result;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/MultU64x64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/MultU64x64.c
deleted file mode 100644
index fee7f00..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/MultU64x64.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function multiplies the 64-bit unsigned value Multiplicand by the 64-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 64-bit unsigned value.
-
- @return Multiplicand * Multiplier.
-
-**/
-UINT64
-EFIAPI
-MultU64x64 (
- IN UINT64 Multiplicand,
- IN UINT64 Multiplier
- )
-{
- UINT64 Result;
-
- Result = InternalMathMultU64x64 (Multiplicand, Multiplier);
-
- return Result;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/RRotU32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/RRotU32.c
deleted file mode 100644
index 64fdd76..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/RRotU32.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits
- with the low bits that were rotated.
-
- This function rotates the 32-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 31, then ASSERT().
-
- @param Operand The 32-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >> Count.
-
-**/
-UINT32
-EFIAPI
-RRotU32 (
- IN UINT32 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < 32);
- return (Operand >> Count) | (Operand << (32 - Count));
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/RRotU64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/RRotU64.c
deleted file mode 100644
index 28fdf41..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/RRotU64.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits
- with the high low bits that were rotated.
-
- This function rotates the 64-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >> Count.
-
-**/
-UINT64
-EFIAPI
-RRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < 64);
- return InternalMathRRotU64 (Operand, Count);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/RShiftU64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/RShiftU64.c
deleted file mode 100644
index 3494c32..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/RShiftU64.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. This high bits are
- filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to zero. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count.
-
-**/
-UINT64
-EFIAPI
-RShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < 64);
- return InternalMathRShiftU64 (Operand, Count);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SafeString.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SafeString.c
deleted file mode 100644
index baf6e41..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SafeString.c
+++ /dev/null
@@ -1,3650 +0,0 @@
-/** @file
- Safe String functions.
-
- Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-#define RSIZE_MAX (PcdGet32 (PcdMaximumUnicodeStringLength))
-
-#define ASCII_RSIZE_MAX (PcdGet32 (PcdMaximumAsciiStringLength))
-
-#define SAFE_STRING_CONSTRAINT_CHECK(Expression, Status) \
- do { \
- ASSERT (Expression); \
- if (!(Expression)) { \
- return Status; \
- } \
- } while (FALSE)
-
-/**
- Returns if 2 memory blocks are overlapped.
-
- @param Base1 Base address of 1st memory block.
- @param Size1 Size of 1st memory block.
- @param Base2 Base address of 2nd memory block.
- @param Size2 Size of 2nd memory block.
-
- @retval TRUE 2 memory blocks are overlapped.
- @retval FALSE 2 memory blocks are not overlapped.
-**/
-BOOLEAN
-InternalSafeStringIsOverlap (
- IN VOID *Base1,
- IN UINTN Size1,
- IN VOID *Base2,
- IN UINTN Size2
- )
-{
- if ((((UINTN)Base1 >= (UINTN)Base2) && ((UINTN)Base1 < (UINTN)Base2 + Size2)) ||
- (((UINTN)Base2 >= (UINTN)Base1) && ((UINTN)Base2 < (UINTN)Base1 + Size1))) {
- return TRUE;
- }
- return FALSE;
-}
-
-/**
- Returns if 2 Unicode strings are not overlapped.
-
- @param Str1 Start address of 1st Unicode string.
- @param Size1 The number of char in 1st Unicode string,
- including terminating null char.
- @param Str2 Start address of 2nd Unicode string.
- @param Size2 The number of char in 2nd Unicode string,
- including terminating null char.
-
- @retval TRUE 2 Unicode strings are NOT overlapped.
- @retval FALSE 2 Unicode strings are overlapped.
-**/
-BOOLEAN
-InternalSafeStringNoStrOverlap (
- IN CHAR16 *Str1,
- IN UINTN Size1,
- IN CHAR16 *Str2,
- IN UINTN Size2
- )
-{
- return !InternalSafeStringIsOverlap (Str1, Size1 * sizeof(CHAR16), Str2, Size2 * sizeof(CHAR16));
-}
-
-/**
- Returns if 2 Ascii strings are not overlapped.
-
- @param Str1 Start address of 1st Ascii string.
- @param Size1 The number of char in 1st Ascii string,
- including terminating null char.
- @param Str2 Start address of 2nd Ascii string.
- @param Size2 The number of char in 2nd Ascii string,
- including terminating null char.
-
- @retval TRUE 2 Ascii strings are NOT overlapped.
- @retval FALSE 2 Ascii strings are overlapped.
-**/
-BOOLEAN
-InternalSafeStringNoAsciiStrOverlap (
- IN CHAR8 *Str1,
- IN UINTN Size1,
- IN CHAR8 *Str2,
- IN UINTN Size2
- )
-{
- return !InternalSafeStringIsOverlap (Str1, Size1, Str2, Size2);
-}
-
-/**
- Returns the length of a Null-terminated Unicode string.
-
- This function is similar as strlen_s defined in C11.
-
- If String is not aligned on a 16-bit boundary, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
- @param MaxSize The maximum number of Destination Unicode
- char, including terminating null char.
-
- @retval 0 If String is NULL.
- @retval MaxSize If there is no null character in the first MaxSize characters of String.
- @return The number of characters that percede the terminating null character.
-
-**/
-UINTN
-EFIAPI
-StrnLenS (
- IN CONST CHAR16 *String,
- IN UINTN MaxSize
- )
-{
- UINTN Length;
-
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // If String is a null pointer or MaxSize is 0, then the StrnLenS function returns zero.
- //
- if ((String == NULL) || (MaxSize == 0)) {
- return 0;
- }
-
- //
- // Otherwise, the StrnLenS function returns the number of characters that precede the
- // terminating null character. If there is no null character in the first MaxSize characters of
- // String then StrnLenS returns MaxSize. At most the first MaxSize characters of String shall
- // be accessed by StrnLenS.
- //
- Length = 0;
- while (String[Length] != 0) {
- if (Length >= MaxSize - 1) {
- return MaxSize;
- }
- Length++;
- }
- return Length;
-}
-
-/**
- Returns the size of a Null-terminated Unicode string in bytes, including the
- Null terminator.
-
- This function returns the size of the Null-terminated Unicode string
- specified by String in bytes, including the Null terminator.
-
- If String is not aligned on a 16-bit boundary, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
- @param MaxSize The maximum number of Destination Unicode
- char, including the Null terminator.
-
- @retval 0 If String is NULL.
- @retval (sizeof (CHAR16) * (MaxSize + 1))
- If there is no Null terminator in the first MaxSize characters of
- String.
- @return The size of the Null-terminated Unicode string in bytes, including
- the Null terminator.
-
-**/
-UINTN
-EFIAPI
-StrnSizeS (
- IN CONST CHAR16 *String,
- IN UINTN MaxSize
- )
-{
- //
- // If String is a null pointer, then the StrnSizeS function returns zero.
- //
- if (String == NULL) {
- return 0;
- }
-
- //
- // Otherwise, the StrnSizeS function returns the size of the Null-terminated
- // Unicode string in bytes, including the Null terminator. If there is no
- // Null terminator in the first MaxSize characters of String, then StrnSizeS
- // returns (sizeof (CHAR16) * (MaxSize + 1)) to keep a consistent map with
- // the StrnLenS function.
- //
- return (StrnLenS (String, MaxSize) + 1) * sizeof (*String);
-}
-
-/**
- Copies the string pointed to by Source (including the terminating null char)
- to the array pointed to by Destination.
-
- This function is similar as strcpy_s defined in C11.
-
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Unicode string.
-
- @retval RETURN_SUCCESS String is copied.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-StrCpyS (
- OUT CHAR16 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR16 *Source
- )
-{
- UINTN SourceLen;
-
- ASSERT (((UINTN) Destination & BIT0) == 0);
- ASSERT (((UINTN) Source & BIT0) == 0);
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. DestMax shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. DestMax shall be greater than StrnLenS(Source, DestMax).
- //
- SourceLen = StrnLenS (Source, DestMax);
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax > SourceLen), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 5. Copying shall not take place between objects that overlap.
- //
- SAFE_STRING_CONSTRAINT_CHECK (InternalSafeStringNoStrOverlap (Destination, DestMax, (CHAR16 *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- //
- // The StrCpyS function copies the string pointed to by Source (including the terminating
- // null character) into the array pointed to by Destination.
- //
- while (*Source != 0) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Copies not more than Length successive char from the string pointed to by
- Source to the array pointed to by Destination. If no null char is copied from
- Source, then Destination[Length] is always set to null.
-
- This function is similar as strncpy_s defined in C11.
-
- If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to copy.
-
- @retval RETURN_SUCCESS String is copied.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
- MIN(StrLen(Source), Length).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-StrnCpyS (
- OUT CHAR16 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- )
-{
- UINTN SourceLen;
-
- ASSERT (((UINTN) Destination & BIT0) == 0);
- ASSERT (((UINTN) Source & BIT0) == 0);
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. Neither DestMax nor Length shall be greater than RSIZE_MAX
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. If Length is not less than DestMax, then DestMax shall be greater than StrnLenS(Source, DestMax).
- //
- SourceLen = StrnLenS (Source, MIN (DestMax, Length));
- if (Length >= DestMax) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax > SourceLen), RETURN_BUFFER_TOO_SMALL);
- }
-
- //
- // 5. Copying shall not take place between objects that overlap.
- //
- if (SourceLen > Length) {
- SourceLen = Length;
- }
- SAFE_STRING_CONSTRAINT_CHECK (InternalSafeStringNoStrOverlap (Destination, DestMax, (CHAR16 *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- //
- // The StrnCpyS function copies not more than Length successive characters (characters that
- // follow a null character are not copied) from the array pointed to by Source to the array
- // pointed to by Destination. If no null character was copied from Source, then Destination[Length] is set to a null
- // character.
- //
- while ((SourceLen > 0) && (*Source != 0)) {
- *(Destination++) = *(Source++);
- SourceLen--;
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Appends a copy of the string pointed to by Source (including the terminating
- null char) to the end of the string pointed to by Destination.
-
- This function is similar as strcat_s defined in C11.
-
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Unicode string.
-
- @retval RETURN_SUCCESS String is appended.
- @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
- StrLen(Destination).
- @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
- greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-StrCatS (
- IN OUT CHAR16 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR16 *Source
- )
-{
- UINTN DestLen;
- UINTN CopyLen;
- UINTN SourceLen;
-
- ASSERT (((UINTN) Destination & BIT0) == 0);
- ASSERT (((UINTN) Source & BIT0) == 0);
-
- //
- // Let CopyLen denote the value DestMax - StrnLenS(Destination, DestMax) upon entry to StrCatS.
- //
- DestLen = StrnLenS (Destination, DestMax);
- CopyLen = DestMax - DestLen;
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. DestMax shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. CopyLen shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((CopyLen != 0), RETURN_BAD_BUFFER_SIZE);
-
- //
- // 5. CopyLen shall be greater than StrnLenS(Source, CopyLen).
- //
- SourceLen = StrnLenS (Source, CopyLen);
- SAFE_STRING_CONSTRAINT_CHECK ((CopyLen > SourceLen), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 6. Copying shall not take place between objects that overlap.
- //
- SAFE_STRING_CONSTRAINT_CHECK (InternalSafeStringNoStrOverlap (Destination, DestMax, (CHAR16 *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- //
- // The StrCatS function appends a copy of the string pointed to by Source (including the
- // terminating null character) to the end of the string pointed to by Destination. The initial character
- // from Source overwrites the null character at the end of Destination.
- //
- Destination = Destination + DestLen;
- while (*Source != 0) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Appends not more than Length successive char from the string pointed to by
- Source to the end of the string pointed to by Destination. If no null char is
- copied from Source, then Destination[StrLen(Destination) + Length] is always
- set to null.
-
- This function is similar as strncat_s defined in C11.
-
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to copy.
-
- @retval RETURN_SUCCESS String is appended.
- @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
- StrLen(Destination).
- @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
- greater than MIN(StrLen(Source), Length).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-StrnCatS (
- IN OUT CHAR16 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- )
-{
- UINTN DestLen;
- UINTN CopyLen;
- UINTN SourceLen;
-
- ASSERT (((UINTN) Destination & BIT0) == 0);
- ASSERT (((UINTN) Source & BIT0) == 0);
-
- //
- // Let CopyLen denote the value DestMax - StrnLenS(Destination, DestMax) upon entry to StrnCatS.
- //
- DestLen = StrnLenS (Destination, DestMax);
- CopyLen = DestMax - DestLen;
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. Neither DestMax nor Length shall be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. CopyLen shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((CopyLen != 0), RETURN_BAD_BUFFER_SIZE);
-
- //
- // 5. If Length is not less than CopyLen, then CopyLen shall be greater than StrnLenS(Source, CopyLen).
- //
- SourceLen = StrnLenS (Source, MIN (CopyLen, Length));
- if (Length >= CopyLen) {
- SAFE_STRING_CONSTRAINT_CHECK ((CopyLen > SourceLen), RETURN_BUFFER_TOO_SMALL);
- }
-
- //
- // 6. Copying shall not take place between objects that overlap.
- //
- if (SourceLen > Length) {
- SourceLen = Length;
- }
- SAFE_STRING_CONSTRAINT_CHECK (InternalSafeStringNoStrOverlap (Destination, DestMax, (CHAR16 *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- //
- // The StrnCatS function appends not more than Length successive characters (characters
- // that follow a null character are not copied) from the array pointed to by Source to the end of
- // the string pointed to by Destination. The initial character from Source overwrites the null character at
- // the end of Destination. If no null character was copied from Source, then Destination[DestMax-CopyLen+Length] is set to
- // a null character.
- //
- Destination = Destination + DestLen;
- while ((SourceLen > 0) && (*Source != 0)) {
- *(Destination++) = *(Source++);
- SourceLen--;
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of type UINTN.
-
- This function outputs a value of type UINTN by interpreting the contents of
- the Unicode string specified by String as a decimal number. The format of the
- input Unicode string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before
- [decimal digits]. The running zero in the beginning of [decimal digits] will
- be ignored. Then, the function stops at the first character that is a not a
- valid decimal character or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- If String has no valid decimal digits in the above format, then 0 is stored
- at the location pointed to by Data.
- If the number represented by String exceeds the range defined by UINTN, then
- MAX_UINTN is stored at the location pointed to by Data.
-
- If EndPointer is not NULL, a pointer to the character that stopped the scan
- is stored at the location pointed to by EndPointer. If String has no valid
- decimal digits right after the optional pad spaces, the value of String is
- stored at the location pointed to by EndPointer.
-
- @param String Pointer to a Null-terminated Unicode string.
- @param EndPointer Pointer to character that stops scan.
- @param Data Pointer to the converted value.
-
- @retval RETURN_SUCCESS Value is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If PcdMaximumUnicodeStringLength is not
- zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINTN.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrDecimalToUintnS (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT UINTN *Data
- )
-{
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. Neither String nor Data shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Data != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. The length of String shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((StrnLenS (String, RSIZE_MAX + 1) <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- *Data = 0;
-
- while (InternalIsDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according to the range
- // defined by UINTN, then MAX_UINTN is stored in *Data and
- // RETURN_UNSUPPORTED is returned.
- //
- if (*Data > ((MAX_UINTN - (*String - L'0')) / 10)) {
- *Data = MAX_UINTN;
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_UNSUPPORTED;
- }
-
- *Data = *Data * 10 + (*String - L'0');
- String++;
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of type UINT64.
-
- This function outputs a value of type UINT64 by interpreting the contents of
- the Unicode string specified by String as a decimal number. The format of the
- input Unicode string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before
- [decimal digits]. The running zero in the beginning of [decimal digits] will
- be ignored. Then, the function stops at the first character that is a not a
- valid decimal character or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- If String has no valid decimal digits in the above format, then 0 is stored
- at the location pointed to by Data.
- If the number represented by String exceeds the range defined by UINT64, then
- MAX_UINT64 is stored at the location pointed to by Data.
-
- If EndPointer is not NULL, a pointer to the character that stopped the scan
- is stored at the location pointed to by EndPointer. If String has no valid
- decimal digits right after the optional pad spaces, the value of String is
- stored at the location pointed to by EndPointer.
-
- @param String Pointer to a Null-terminated Unicode string.
- @param EndPointer Pointer to character that stops scan.
- @param Data Pointer to the converted value.
-
- @retval RETURN_SUCCESS Value is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If PcdMaximumUnicodeStringLength is not
- zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINT64.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrDecimalToUint64S (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT UINT64 *Data
- )
-{
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. Neither String nor Data shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Data != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. The length of String shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((StrnLenS (String, RSIZE_MAX + 1) <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- *Data = 0;
-
- while (InternalIsDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according to the range
- // defined by UINT64, then MAX_UINT64 is stored in *Data and
- // RETURN_UNSUPPORTED is returned.
- //
- if (*Data > DivU64x32 (MAX_UINT64 - (*String - L'0'), 10)) {
- *Data = MAX_UINT64;
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_UNSUPPORTED;
- }
-
- *Data = MultU64x32 (*Data, 10) + (*String - L'0');
- String++;
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type
- UINTN.
-
- This function outputs a value of type UINTN by interpreting the contents of
- the Unicode string specified by String as a hexadecimal number. The format of
- the input Unicode string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
- If "x" appears in the input string, it must be prefixed with at least one 0.
- The function will ignore the pad space, which includes spaces or tab
- characters, before [zeros], [x] or [hexadecimal digit]. The running zero
- before [x] or [hexadecimal digit] will be ignored. Then, the decoding starts
- after [x] or the first valid hexadecimal digit. Then, the function stops at
- the first character that is a not a valid hexadecimal character or NULL,
- whichever one comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- If String has no valid hexadecimal digits in the above format, then 0 is
- stored at the location pointed to by Data.
- If the number represented by String exceeds the range defined by UINTN, then
- MAX_UINTN is stored at the location pointed to by Data.
-
- If EndPointer is not NULL, a pointer to the character that stopped the scan
- is stored at the location pointed to by EndPointer. If String has no valid
- hexadecimal digits right after the optional pad spaces, the value of String
- is stored at the location pointed to by EndPointer.
-
- @param String Pointer to a Null-terminated Unicode string.
- @param EndPointer Pointer to character that stops scan.
- @param Data Pointer to the converted value.
-
- @retval RETURN_SUCCESS Value is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If PcdMaximumUnicodeStringLength is not
- zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINTN.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrHexToUintnS (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT UINTN *Data
- )
-{
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. Neither String nor Data shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Data != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. The length of String shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((StrnLenS (String, RSIZE_MAX + 1) <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- if (CharToUpper (*String) == L'X') {
- if (*(String - 1) != L'0') {
- *Data = 0;
- return RETURN_SUCCESS;
- }
- //
- // Skip the 'X'
- //
- String++;
- }
-
- *Data = 0;
-
- while (InternalIsHexaDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according to the range
- // defined by UINTN, then MAX_UINTN is stored in *Data and
- // RETURN_UNSUPPORTED is returned.
- //
- if (*Data > ((MAX_UINTN - InternalHexCharToUintn (*String)) >> 4)) {
- *Data = MAX_UINTN;
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_UNSUPPORTED;
- }
-
- *Data = (*Data << 4) + InternalHexCharToUintn (*String);
- String++;
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type
- UINT64.
-
- This function outputs a value of type UINT64 by interpreting the contents of
- the Unicode string specified by String as a hexadecimal number. The format of
- the input Unicode string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
- If "x" appears in the input string, it must be prefixed with at least one 0.
- The function will ignore the pad space, which includes spaces or tab
- characters, before [zeros], [x] or [hexadecimal digit]. The running zero
- before [x] or [hexadecimal digit] will be ignored. Then, the decoding starts
- after [x] or the first valid hexadecimal digit. Then, the function stops at
- the first character that is a not a valid hexadecimal character or NULL,
- whichever one comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- If String has no valid hexadecimal digits in the above format, then 0 is
- stored at the location pointed to by Data.
- If the number represented by String exceeds the range defined by UINT64, then
- MAX_UINT64 is stored at the location pointed to by Data.
-
- If EndPointer is not NULL, a pointer to the character that stopped the scan
- is stored at the location pointed to by EndPointer. If String has no valid
- hexadecimal digits right after the optional pad spaces, the value of String
- is stored at the location pointed to by EndPointer.
-
- @param String Pointer to a Null-terminated Unicode string.
- @param EndPointer Pointer to character that stops scan.
- @param Data Pointer to the converted value.
-
- @retval RETURN_SUCCESS Value is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If PcdMaximumUnicodeStringLength is not
- zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINT64.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrHexToUint64S (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT UINT64 *Data
- )
-{
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. Neither String nor Data shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Data != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. The length of String shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((StrnLenS (String, RSIZE_MAX + 1) <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- if (CharToUpper (*String) == L'X') {
- if (*(String - 1) != L'0') {
- *Data = 0;
- return RETURN_SUCCESS;
- }
- //
- // Skip the 'X'
- //
- String++;
- }
-
- *Data = 0;
-
- while (InternalIsHexaDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according to the range
- // defined by UINT64, then MAX_UINT64 is stored in *Data and
- // RETURN_UNSUPPORTED is returned.
- //
- if (*Data > RShiftU64 (MAX_UINT64 - InternalHexCharToUintn (*String), 4)) {
- *Data = MAX_UINT64;
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_UNSUPPORTED;
- }
-
- *Data = LShiftU64 (*Data, 4) + InternalHexCharToUintn (*String);
- String++;
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) String;
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode string to IPv6 address and prefix length.
-
- This function outputs a value of type IPv6_ADDRESS and may output a value
- of type UINT8 by interpreting the contents of the Unicode string specified
- by String. The format of the input Unicode string String is as follows:
-
- X:X:X:X:X:X:X:X[/P]
-
- X contains one to four hexadecimal digit characters in the range [0-9], [a-f] and
- [A-F]. X is converted to a value of type UINT16, whose low byte is stored in low
- memory address and high byte is stored in high memory address. P contains decimal
- digit characters in the range [0-9]. The running zero in the beginning of P will
- be ignored. /P is optional.
-
- When /P is not in the String, the function stops at the first character that is
- not a valid hexadecimal digit character after eight X's are converted.
-
- When /P is in the String, the function stops at the first character that is not
- a valid decimal digit character after P is converted.
-
- "::" can be used to compress one or more groups of X when X contains only 0.
- The "::" can only appear once in the String.
-
- If String is NULL, then ASSERT().
-
- If Address is NULL, then ASSERT().
-
- If String is not aligned in a 16-bit boundary, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- If EndPointer is not NULL and Address is translated from String, a pointer
- to the character that stopped the scan is stored at the location pointed to
- by EndPointer.
-
- @param String Pointer to a Null-terminated Unicode string.
- @param EndPointer Pointer to character that stops scan.
- @param Address Pointer to the converted IPv6 address.
- @param PrefixLength Pointer to the converted IPv6 address prefix
- length. MAX_UINT8 is returned when /P is
- not in the String.
-
- @retval RETURN_SUCCESS Address is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If X contains more than four hexadecimal
- digit characters.
- If String contains "::" and number of X
- is not less than 8.
- If P starts with character that is not a
- valid decimal digit character.
- If the decimal number converted from P
- exceeds 128.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrToIpv6Address (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT IPv6_ADDRESS *Address,
- OUT UINT8 *PrefixLength OPTIONAL
- )
-{
- RETURN_STATUS Status;
- UINTN AddressIndex;
- UINTN Uintn;
- IPv6_ADDRESS LocalAddress;
- UINT8 LocalPrefixLength;
- CONST CHAR16 *Pointer;
- CHAR16 *End;
- UINTN CompressStart;
- BOOLEAN ExpectPrefix;
-
- LocalPrefixLength = MAX_UINT8;
- CompressStart = ARRAY_SIZE (Address->Addr);
- ExpectPrefix = FALSE;
-
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. None of String or Guid shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Address != NULL), RETURN_INVALID_PARAMETER);
-
- for (Pointer = String, AddressIndex = 0; AddressIndex < ARRAY_SIZE (Address->Addr) + 1;) {
- if (!InternalIsHexaDecimalDigitCharacter (*Pointer)) {
- if (*Pointer != L':') {
- //
- // ":" or "/" should be followed by digit characters.
- //
- return RETURN_UNSUPPORTED;
- }
-
- //
- // Meet second ":" after previous ":" or "/"
- // or meet first ":" in the beginning of String.
- //
- if (ExpectPrefix) {
- //
- // ":" shall not be after "/"
- //
- return RETURN_UNSUPPORTED;
- }
-
- if (CompressStart != ARRAY_SIZE (Address->Addr) || AddressIndex == ARRAY_SIZE (Address->Addr)) {
- //
- // "::" can only appear once.
- // "::" can only appear when address is not full length.
- //
- return RETURN_UNSUPPORTED;
- } else {
- //
- // Remember the start of zero compressing.
- //
- CompressStart = AddressIndex;
- Pointer++;
-
- if (CompressStart == 0) {
- if (*Pointer != L':') {
- //
- // Single ":" shall not be in the beginning of String.
- //
- return RETURN_UNSUPPORTED;
- }
- Pointer++;
- }
- }
- }
-
- if (!InternalIsHexaDecimalDigitCharacter (*Pointer)) {
- if (*Pointer == L'/') {
- //
- // Might be optional "/P" after "::".
- //
- if (CompressStart != AddressIndex) {
- return RETURN_UNSUPPORTED;
- }
- } else {
- break;
- }
- } else {
- if (!ExpectPrefix) {
- //
- // Get X.
- //
- Status = StrHexToUintnS (Pointer, &End, &Uintn);
- if (RETURN_ERROR (Status) || End - Pointer > 4) {
- //
- // Number of hexadecimal digit characters is no more than 4.
- //
- return RETURN_UNSUPPORTED;
- }
- Pointer = End;
- //
- // Uintn won't exceed MAX_UINT16 if number of hexadecimal digit characters is no more than 4.
- //
- ASSERT (AddressIndex + 1 < ARRAY_SIZE (Address->Addr));
- LocalAddress.Addr[AddressIndex] = (UINT8) ((UINT16) Uintn >> 8);
- LocalAddress.Addr[AddressIndex + 1] = (UINT8) Uintn;
- AddressIndex += 2;
- } else {
- //
- // Get P, then exit the loop.
- //
- Status = StrDecimalToUintnS (Pointer, &End, &Uintn);
- if (RETURN_ERROR (Status) || End == Pointer || Uintn > 128) {
- //
- // Prefix length should not exceed 128.
- //
- return RETURN_UNSUPPORTED;
- }
- LocalPrefixLength = (UINT8) Uintn;
- Pointer = End;
- break;
- }
- }
-
- //
- // Skip ':' or "/"
- //
- if (*Pointer == L'/') {
- ExpectPrefix = TRUE;
- } else if (*Pointer == L':') {
- if (AddressIndex == ARRAY_SIZE (Address->Addr)) {
- //
- // Meet additional ":" after all 8 16-bit address
- //
- break;
- }
- } else {
- //
- // Meet other character that is not "/" or ":" after all 8 16-bit address
- //
- break;
- }
- Pointer++;
- }
-
- if ((AddressIndex == ARRAY_SIZE (Address->Addr) && CompressStart != ARRAY_SIZE (Address->Addr)) ||
- (AddressIndex != ARRAY_SIZE (Address->Addr) && CompressStart == ARRAY_SIZE (Address->Addr))
- ) {
- //
- // Full length of address shall not have compressing zeros.
- // Non-full length of address shall have compressing zeros.
- //
- return RETURN_UNSUPPORTED;
- }
- CopyMem (&Address->Addr[0], &LocalAddress.Addr[0], CompressStart);
- ZeroMem (&Address->Addr[CompressStart], ARRAY_SIZE (Address->Addr) - AddressIndex);
- if (AddressIndex > CompressStart) {
- CopyMem (
- &Address->Addr[CompressStart + ARRAY_SIZE (Address->Addr) - AddressIndex],
- &LocalAddress.Addr[CompressStart],
- AddressIndex - CompressStart
- );
- }
-
- if (PrefixLength != NULL) {
- *PrefixLength = LocalPrefixLength;
- }
- if (EndPointer != NULL) {
- *EndPointer = (CHAR16 *) Pointer;
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode string to IPv4 address and prefix length.
-
- This function outputs a value of type IPv4_ADDRESS and may output a value
- of type UINT8 by interpreting the contents of the Unicode string specified
- by String. The format of the input Unicode string String is as follows:
-
- D.D.D.D[/P]
-
- D and P are decimal digit characters in the range [0-9]. The running zero in
- the beginning of D and P will be ignored. /P is optional.
-
- When /P is not in the String, the function stops at the first character that is
- not a valid decimal digit character after four D's are converted.
-
- When /P is in the String, the function stops at the first character that is not
- a valid decimal digit character after P is converted.
-
- If String is NULL, then ASSERT().
-
- If Address is NULL, then ASSERT().
-
- If String is not aligned in a 16-bit boundary, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- If EndPointer is not NULL and Address is translated from String, a pointer
- to the character that stopped the scan is stored at the location pointed to
- by EndPointer.
-
- @param String Pointer to a Null-terminated Unicode string.
- @param EndPointer Pointer to character that stops scan.
- @param Address Pointer to the converted IPv4 address.
- @param PrefixLength Pointer to the converted IPv4 address prefix
- length. MAX_UINT8 is returned when /P is
- not in the String.
-
- @retval RETURN_SUCCESS Address is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If String is not in the correct format.
- If any decimal number converted from D
- exceeds 255.
- If the decimal number converted from P
- exceeds 32.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrToIpv4Address (
- IN CONST CHAR16 *String,
- OUT CHAR16 **EndPointer, OPTIONAL
- OUT IPv4_ADDRESS *Address,
- OUT UINT8 *PrefixLength OPTIONAL
- )
-{
- RETURN_STATUS Status;
- UINTN AddressIndex;
- UINTN Uintn;
- IPv4_ADDRESS LocalAddress;
- UINT8 LocalPrefixLength;
- CHAR16 *Pointer;
-
- LocalPrefixLength = MAX_UINT8;
-
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. None of String or Guid shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Address != NULL), RETURN_INVALID_PARAMETER);
-
- for (Pointer = (CHAR16 *) String, AddressIndex = 0; AddressIndex < ARRAY_SIZE (Address->Addr) + 1;) {
- if (!InternalIsDecimalDigitCharacter (*Pointer)) {
- //
- // D or P contains invalid characters.
- //
- break;
- }
-
- //
- // Get D or P.
- //
- Status = StrDecimalToUintnS ((CONST CHAR16 *) Pointer, &Pointer, &Uintn);
- if (RETURN_ERROR (Status)) {
- return RETURN_UNSUPPORTED;
- }
- if (AddressIndex == ARRAY_SIZE (Address->Addr)) {
- //
- // It's P.
- //
- if (Uintn > 32) {
- return RETURN_UNSUPPORTED;
- }
- LocalPrefixLength = (UINT8) Uintn;
- } else {
- //
- // It's D.
- //
- if (Uintn > MAX_UINT8) {
- return RETURN_UNSUPPORTED;
- }
- LocalAddress.Addr[AddressIndex] = (UINT8) Uintn;
- AddressIndex++;
- }
-
- //
- // Check the '.' or '/', depending on the AddressIndex.
- //
- if (AddressIndex == ARRAY_SIZE (Address->Addr)) {
- if (*Pointer == L'/') {
- //
- // '/P' is in the String.
- // Skip "/" and get P in next loop.
- //
- Pointer++;
- } else {
- //
- // '/P' is not in the String.
- //
- break;
- }
- } else if (AddressIndex < ARRAY_SIZE (Address->Addr)) {
- if (*Pointer == L'.') {
- //
- // D should be followed by '.'
- //
- Pointer++;
- } else {
- return RETURN_UNSUPPORTED;
- }
- }
- }
-
- if (AddressIndex < ARRAY_SIZE (Address->Addr)) {
- return RETURN_UNSUPPORTED;
- }
-
- CopyMem (Address, &LocalAddress, sizeof (*Address));
- if (PrefixLength != NULL) {
- *PrefixLength = LocalPrefixLength;
- }
- if (EndPointer != NULL) {
- *EndPointer = Pointer;
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode GUID string to a value of type
- EFI_GUID.
-
- This function outputs a GUID value by interpreting the contents of
- the Unicode string specified by String. The format of the input
- Unicode string String consists of 36 characters, as follows:
-
- aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
-
- The pairs aa - pp are two characters in the range [0-9], [a-f] and
- [A-F], with each pair representing a single byte hexadecimal value.
-
- The mapping between String and the EFI_GUID structure is as follows:
- aa Data1[24:31]
- bb Data1[16:23]
- cc Data1[8:15]
- dd Data1[0:7]
- ee Data2[8:15]
- ff Data2[0:7]
- gg Data3[8:15]
- hh Data3[0:7]
- ii Data4[0:7]
- jj Data4[8:15]
- kk Data4[16:23]
- ll Data4[24:31]
- mm Data4[32:39]
- nn Data4[40:47]
- oo Data4[48:55]
- pp Data4[56:63]
-
- If String is NULL, then ASSERT().
- If Guid is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
- @param Guid Pointer to the converted GUID.
-
- @retval RETURN_SUCCESS Guid is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If String is not as the above format.
-
-**/
-RETURN_STATUS
-EFIAPI
-StrToGuid (
- IN CONST CHAR16 *String,
- OUT GUID *Guid
- )
-{
- RETURN_STATUS Status;
- GUID LocalGuid;
-
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. None of String or Guid shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Guid != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // Get aabbccdd in big-endian.
- //
- Status = StrHexToBytes (String, 2 * sizeof (LocalGuid.Data1), (UINT8 *) &LocalGuid.Data1, sizeof (LocalGuid.Data1));
- if (RETURN_ERROR (Status) || String[2 * sizeof (LocalGuid.Data1)] != L'-') {
- return RETURN_UNSUPPORTED;
- }
- //
- // Convert big-endian to little-endian.
- //
- LocalGuid.Data1 = SwapBytes32 (LocalGuid.Data1);
- String += 2 * sizeof (LocalGuid.Data1) + 1;
-
- //
- // Get eeff in big-endian.
- //
- Status = StrHexToBytes (String, 2 * sizeof (LocalGuid.Data2), (UINT8 *) &LocalGuid.Data2, sizeof (LocalGuid.Data2));
- if (RETURN_ERROR (Status) || String[2 * sizeof (LocalGuid.Data2)] != L'-') {
- return RETURN_UNSUPPORTED;
- }
- //
- // Convert big-endian to little-endian.
- //
- LocalGuid.Data2 = SwapBytes16 (LocalGuid.Data2);
- String += 2 * sizeof (LocalGuid.Data2) + 1;
-
- //
- // Get gghh in big-endian.
- //
- Status = StrHexToBytes (String, 2 * sizeof (LocalGuid.Data3), (UINT8 *) &LocalGuid.Data3, sizeof (LocalGuid.Data3));
- if (RETURN_ERROR (Status) || String[2 * sizeof (LocalGuid.Data3)] != L'-') {
- return RETURN_UNSUPPORTED;
- }
- //
- // Convert big-endian to little-endian.
- //
- LocalGuid.Data3 = SwapBytes16 (LocalGuid.Data3);
- String += 2 * sizeof (LocalGuid.Data3) + 1;
-
- //
- // Get iijj.
- //
- Status = StrHexToBytes (String, 2 * 2, &LocalGuid.Data4[0], 2);
- if (RETURN_ERROR (Status) || String[2 * 2] != L'-') {
- return RETURN_UNSUPPORTED;
- }
- String += 2 * 2 + 1;
-
- //
- // Get kkllmmnnoopp.
- //
- Status = StrHexToBytes (String, 2 * 6, &LocalGuid.Data4[2], 6);
- if (RETURN_ERROR (Status)) {
- return RETURN_UNSUPPORTED;
- }
-
- CopyGuid (Guid, &LocalGuid);
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a byte array.
-
- This function outputs a byte array by interpreting the contents of
- the Unicode string specified by String in hexadecimal format. The format of
- the input Unicode string String is:
-
- [XX]*
-
- X is a hexadecimal digit character in the range [0-9], [a-f] and [A-F].
- The function decodes every two hexadecimal digit characters as one byte. The
- decoding stops after Length of characters and outputs Buffer containing
- (Length / 2) bytes.
-
- If String is not aligned in a 16-bit boundary, then ASSERT().
-
- If String is NULL, then ASSERT().
-
- If Buffer is NULL, then ASSERT().
-
- If Length is not multiple of 2, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
-
- If MaxBufferSize is less than (Length / 2), then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
- @param Length The number of Unicode characters to decode.
- @param Buffer Pointer to the converted bytes array.
- @param MaxBufferSize The maximum size of Buffer.
-
- @retval RETURN_SUCCESS Buffer is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If Length is not multiple of 2.
- If PcdMaximumUnicodeStringLength is not zero,
- and Length is greater than
- PcdMaximumUnicodeStringLength.
- @retval RETURN_UNSUPPORTED If Length of characters from String contain
- a character that is not valid hexadecimal
- digit characters, or a Null-terminator.
- @retval RETURN_BUFFER_TOO_SMALL If MaxBufferSize is less than (Length / 2).
-**/
-RETURN_STATUS
-EFIAPI
-StrHexToBytes (
- IN CONST CHAR16 *String,
- IN UINTN Length,
- OUT UINT8 *Buffer,
- IN UINTN MaxBufferSize
- )
-{
- UINTN Index;
-
- ASSERT (((UINTN) String & BIT0) == 0);
-
- //
- // 1. None of String or Buffer shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Buffer != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. Length shall not be greater than RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. Length shall not be odd.
- //
- SAFE_STRING_CONSTRAINT_CHECK (((Length & BIT0) == 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. MaxBufferSize shall equal to or greater than Length / 2.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((MaxBufferSize >= Length / 2), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 5. String shall not contains invalid hexadecimal digits.
- //
- for (Index = 0; Index < Length; Index++) {
- if (!InternalIsHexaDecimalDigitCharacter (String[Index])) {
- break;
- }
- }
- if (Index != Length) {
- return RETURN_UNSUPPORTED;
- }
-
- //
- // Convert the hex string to bytes.
- //
- for(Index = 0; Index < Length; Index++) {
-
- //
- // For even characters, write the upper nibble for each buffer byte,
- // and for even characters, the lower nibble.
- //
- if ((Index & BIT0) == 0) {
- Buffer[Index / 2] = (UINT8) InternalHexCharToUintn (String[Index]) << 4;
- } else {
- Buffer[Index / 2] |= (UINT8) InternalHexCharToUintn (String[Index]);
- }
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Returns the length of a Null-terminated Ascii string.
-
- This function is similar as strlen_s defined in C11.
-
- @param String A pointer to a Null-terminated Ascii string.
- @param MaxSize The maximum number of Destination Ascii
- char, including terminating null char.
-
- @retval 0 If String is NULL.
- @retval MaxSize If there is no null character in the first MaxSize characters of String.
- @return The number of characters that percede the terminating null character.
-
-**/
-UINTN
-EFIAPI
-AsciiStrnLenS (
- IN CONST CHAR8 *String,
- IN UINTN MaxSize
- )
-{
- UINTN Length;
-
- //
- // If String is a null pointer or MaxSize is 0, then the AsciiStrnLenS function returns zero.
- //
- if ((String == NULL) || (MaxSize == 0)) {
- return 0;
- }
-
- //
- // Otherwise, the AsciiStrnLenS function returns the number of characters that precede the
- // terminating null character. If there is no null character in the first MaxSize characters of
- // String then AsciiStrnLenS returns MaxSize. At most the first MaxSize characters of String shall
- // be accessed by AsciiStrnLenS.
- //
- Length = 0;
- while (String[Length] != 0) {
- if (Length >= MaxSize - 1) {
- return MaxSize;
- }
- Length++;
- }
- return Length;
-}
-
-/**
- Returns the size of a Null-terminated Ascii string in bytes, including the
- Null terminator.
-
- This function returns the size of the Null-terminated Ascii string specified
- by String in bytes, including the Null terminator.
-
- @param String A pointer to a Null-terminated Ascii string.
- @param MaxSize The maximum number of Destination Ascii
- char, including the Null terminator.
-
- @retval 0 If String is NULL.
- @retval (sizeof (CHAR8) * (MaxSize + 1))
- If there is no Null terminator in the first MaxSize characters of
- String.
- @return The size of the Null-terminated Ascii string in bytes, including the
- Null terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiStrnSizeS (
- IN CONST CHAR8 *String,
- IN UINTN MaxSize
- )
-{
- //
- // If String is a null pointer, then the AsciiStrnSizeS function returns
- // zero.
- //
- if (String == NULL) {
- return 0;
- }
-
- //
- // Otherwise, the AsciiStrnSizeS function returns the size of the
- // Null-terminated Ascii string in bytes, including the Null terminator. If
- // there is no Null terminator in the first MaxSize characters of String,
- // then AsciiStrnSizeS returns (sizeof (CHAR8) * (MaxSize + 1)) to keep a
- // consistent map with the AsciiStrnLenS function.
- //
- return (AsciiStrnLenS (String, MaxSize) + 1) * sizeof (*String);
-}
-
-/**
- Copies the string pointed to by Source (including the terminating null char)
- to the array pointed to by Destination.
-
- This function is similar as strcpy_s defined in C11.
-
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Ascii string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Ascii string.
-
- @retval RETURN_SUCCESS String is copied.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrCpyS (
- OUT CHAR8 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR8 *Source
- )
-{
- UINTN SourceLen;
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. DestMax shall not be greater than ASCII_RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. DestMax shall be greater than AsciiStrnLenS(Source, DestMax).
- //
- SourceLen = AsciiStrnLenS (Source, DestMax);
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax > SourceLen), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 5. Copying shall not take place between objects that overlap.
- //
- SAFE_STRING_CONSTRAINT_CHECK (InternalSafeStringNoAsciiStrOverlap (Destination, DestMax, (CHAR8 *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- //
- // The AsciiStrCpyS function copies the string pointed to by Source (including the terminating
- // null character) into the array pointed to by Destination.
- //
- while (*Source != 0) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Copies not more than Length successive char from the string pointed to by
- Source to the array pointed to by Destination. If no null char is copied from
- Source, then Destination[Length] is always set to null.
-
- This function is similar as strncpy_s defined in C11.
-
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Ascii string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Ascii string.
- @param Length The maximum number of Ascii characters to copy.
-
- @retval RETURN_SUCCESS String is copied.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
- MIN(StrLen(Source), Length).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrnCpyS (
- OUT CHAR8 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- )
-{
- UINTN SourceLen;
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. Neither DestMax nor Length shall be greater than ASCII_RSIZE_MAX
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. If Length is not less than DestMax, then DestMax shall be greater than AsciiStrnLenS(Source, DestMax).
- //
- SourceLen = AsciiStrnLenS (Source, MIN (DestMax, Length));
- if (Length >= DestMax) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax > SourceLen), RETURN_BUFFER_TOO_SMALL);
- }
-
- //
- // 5. Copying shall not take place between objects that overlap.
- //
- if (SourceLen > Length) {
- SourceLen = Length;
- }
- SAFE_STRING_CONSTRAINT_CHECK (InternalSafeStringNoAsciiStrOverlap (Destination, DestMax, (CHAR8 *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- //
- // The AsciiStrnCpyS function copies not more than Length successive characters (characters that
- // follow a null character are not copied) from the array pointed to by Source to the array
- // pointed to by Destination. If no null character was copied from Source, then Destination[Length] is set to a null
- // character.
- //
- while ((SourceLen > 0) && (*Source != 0)) {
- *(Destination++) = *(Source++);
- SourceLen--;
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Appends a copy of the string pointed to by Source (including the terminating
- null char) to the end of the string pointed to by Destination.
-
- This function is similar as strcat_s defined in C11.
-
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Ascii string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Ascii string.
-
- @retval RETURN_SUCCESS String is appended.
- @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
- StrLen(Destination).
- @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
- greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrCatS (
- IN OUT CHAR8 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR8 *Source
- )
-{
- UINTN DestLen;
- UINTN CopyLen;
- UINTN SourceLen;
-
- //
- // Let CopyLen denote the value DestMax - AsciiStrnLenS(Destination, DestMax) upon entry to AsciiStrCatS.
- //
- DestLen = AsciiStrnLenS (Destination, DestMax);
- CopyLen = DestMax - DestLen;
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. DestMax shall not be greater than ASCII_RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. CopyLen shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((CopyLen != 0), RETURN_BAD_BUFFER_SIZE);
-
- //
- // 5. CopyLen shall be greater than AsciiStrnLenS(Source, CopyLen).
- //
- SourceLen = AsciiStrnLenS (Source, CopyLen);
- SAFE_STRING_CONSTRAINT_CHECK ((CopyLen > SourceLen), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 6. Copying shall not take place between objects that overlap.
- //
- SAFE_STRING_CONSTRAINT_CHECK (InternalSafeStringNoAsciiStrOverlap (Destination, DestMax, (CHAR8 *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- //
- // The AsciiStrCatS function appends a copy of the string pointed to by Source (including the
- // terminating null character) to the end of the string pointed to by Destination. The initial character
- // from Source overwrites the null character at the end of Destination.
- //
- Destination = Destination + DestLen;
- while (*Source != 0) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Appends not more than Length successive char from the string pointed to by
- Source to the end of the string pointed to by Destination. If no null char is
- copied from Source, then Destination[StrLen(Destination) + Length] is always
- set to null.
-
- This function is similar as strncat_s defined in C11.
-
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Destination A pointer to a Null-terminated Ascii string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
- @param Source A pointer to a Null-terminated Ascii string.
- @param Length The maximum number of Ascii characters to copy.
-
- @retval RETURN_SUCCESS String is appended.
- @retval RETURN_BAD_BUFFER_SIZE If DestMax is NOT greater than
- StrLen(Destination).
- @retval RETURN_BUFFER_TOO_SMALL If (DestMax - StrLen(Destination)) is NOT
- greater than MIN(StrLen(Source), Length).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrnCatS (
- IN OUT CHAR8 *Destination,
- IN UINTN DestMax,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- )
-{
- UINTN DestLen;
- UINTN CopyLen;
- UINTN SourceLen;
-
- //
- // Let CopyLen denote the value DestMax - AsciiStrnLenS(Destination, DestMax) upon entry to AsciiStrnCatS.
- //
- DestLen = AsciiStrnLenS (Destination, DestMax);
- CopyLen = DestMax - DestLen;
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. Neither DestMax nor Length shall be greater than ASCII_RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. CopyLen shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((CopyLen != 0), RETURN_BAD_BUFFER_SIZE);
-
- //
- // 5. If Length is not less than CopyLen, then CopyLen shall be greater than AsciiStrnLenS(Source, CopyLen).
- //
- SourceLen = AsciiStrnLenS (Source, MIN (CopyLen, Length));
- if (Length >= CopyLen) {
- SAFE_STRING_CONSTRAINT_CHECK ((CopyLen > SourceLen), RETURN_BUFFER_TOO_SMALL);
- }
-
- //
- // 6. Copying shall not take place between objects that overlap.
- //
- if (SourceLen > Length) {
- SourceLen = Length;
- }
- SAFE_STRING_CONSTRAINT_CHECK (InternalSafeStringNoAsciiStrOverlap (Destination, DestMax, (CHAR8 *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- //
- // The AsciiStrnCatS function appends not more than Length successive characters (characters
- // that follow a null character are not copied) from the array pointed to by Source to the end of
- // the string pointed to by Destination. The initial character from Source overwrites the null character at
- // the end of Destination. If no null character was copied from Source, then Destination[DestMax-CopyLen+Length] is set to
- // a null character.
- //
- Destination = Destination + DestLen;
- while ((SourceLen > 0) && (*Source != 0)) {
- *(Destination++) = *(Source++);
- SourceLen--;
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Ascii decimal string to a value of type UINTN.
-
- This function outputs a value of type UINTN by interpreting the contents of
- the Ascii string specified by String as a decimal number. The format of the
- input Ascii string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before
- [decimal digits]. The running zero in the beginning of [decimal digits] will
- be ignored. Then, the function stops at the first character that is a not a
- valid decimal character or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength Ascii characters, not including the
- Null-terminator, then ASSERT().
-
- If String has no valid decimal digits in the above format, then 0 is stored
- at the location pointed to by Data.
- If the number represented by String exceeds the range defined by UINTN, then
- MAX_UINTN is stored at the location pointed to by Data.
-
- If EndPointer is not NULL, a pointer to the character that stopped the scan
- is stored at the location pointed to by EndPointer. If String has no valid
- decimal digits right after the optional pad spaces, the value of String is
- stored at the location pointed to by EndPointer.
-
- @param String Pointer to a Null-terminated Ascii string.
- @param EndPointer Pointer to character that stops scan.
- @param Data Pointer to the converted value.
-
- @retval RETURN_SUCCESS Value is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than
- PcdMaximumAsciiStringLength Ascii
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINTN.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrDecimalToUintnS (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT UINTN *Data
- )
-{
- //
- // 1. Neither String nor Data shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Data != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. The length of String shall not be greater than ASCII_RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((AsciiStrnLenS (String, ASCII_RSIZE_MAX + 1) <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == ' ') || (*String == '\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == '0') {
- String++;
- }
-
- *Data = 0;
-
- while (InternalAsciiIsDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according to the range
- // defined by UINTN, then MAX_UINTN is stored in *Data and
- // RETURN_UNSUPPORTED is returned.
- //
- if (*Data > ((MAX_UINTN - (*String - '0')) / 10)) {
- *Data = MAX_UINTN;
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
- return RETURN_UNSUPPORTED;
- }
-
- *Data = *Data * 10 + (*String - '0');
- String++;
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Ascii decimal string to a value of type UINT64.
-
- This function outputs a value of type UINT64 by interpreting the contents of
- the Ascii string specified by String as a decimal number. The format of the
- input Ascii string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before
- [decimal digits]. The running zero in the beginning of [decimal digits] will
- be ignored. Then, the function stops at the first character that is a not a
- valid decimal character or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength Ascii characters, not including the
- Null-terminator, then ASSERT().
-
- If String has no valid decimal digits in the above format, then 0 is stored
- at the location pointed to by Data.
- If the number represented by String exceeds the range defined by UINT64, then
- MAX_UINT64 is stored at the location pointed to by Data.
-
- If EndPointer is not NULL, a pointer to the character that stopped the scan
- is stored at the location pointed to by EndPointer. If String has no valid
- decimal digits right after the optional pad spaces, the value of String is
- stored at the location pointed to by EndPointer.
-
- @param String Pointer to a Null-terminated Ascii string.
- @param EndPointer Pointer to character that stops scan.
- @param Data Pointer to the converted value.
-
- @retval RETURN_SUCCESS Value is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than
- PcdMaximumAsciiStringLength Ascii
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINT64.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrDecimalToUint64S (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT UINT64 *Data
- )
-{
- //
- // 1. Neither String nor Data shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Data != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. The length of String shall not be greater than ASCII_RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((AsciiStrnLenS (String, ASCII_RSIZE_MAX + 1) <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == ' ') || (*String == '\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == '0') {
- String++;
- }
-
- *Data = 0;
-
- while (InternalAsciiIsDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according to the range
- // defined by UINT64, then MAX_UINT64 is stored in *Data and
- // RETURN_UNSUPPORTED is returned.
- //
- if (*Data > DivU64x32 (MAX_UINT64 - (*String - '0'), 10)) {
- *Data = MAX_UINT64;
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
- return RETURN_UNSUPPORTED;
- }
-
- *Data = MultU64x32 (*Data, 10) + (*String - '0');
- String++;
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Ascii hexadecimal string to a value of type UINTN.
-
- This function outputs a value of type UINTN by interpreting the contents of
- the Ascii string specified by String as a hexadecimal number. The format of
- the input Ascii string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If
- "x" appears in the input string, it must be prefixed with at least one 0. The
- function will ignore the pad space, which includes spaces or tab characters,
- before [zeros], [x] or [hexadecimal digits]. The running zero before [x] or
- [hexadecimal digits] will be ignored. Then, the decoding starts after [x] or
- the first valid hexadecimal digit. Then, the function stops at the first
- character that is a not a valid hexadecimal character or Null-terminator,
- whichever on comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength Ascii characters, not including the
- Null-terminator, then ASSERT().
-
- If String has no valid hexadecimal digits in the above format, then 0 is
- stored at the location pointed to by Data.
- If the number represented by String exceeds the range defined by UINTN, then
- MAX_UINTN is stored at the location pointed to by Data.
-
- If EndPointer is not NULL, a pointer to the character that stopped the scan
- is stored at the location pointed to by EndPointer. If String has no valid
- hexadecimal digits right after the optional pad spaces, the value of String
- is stored at the location pointed to by EndPointer.
-
- @param String Pointer to a Null-terminated Ascii string.
- @param EndPointer Pointer to character that stops scan.
- @param Data Pointer to the converted value.
-
- @retval RETURN_SUCCESS Value is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than
- PcdMaximumAsciiStringLength Ascii
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINTN.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrHexToUintnS (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT UINTN *Data
- )
-{
- //
- // 1. Neither String nor Data shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Data != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. The length of String shall not be greater than ASCII_RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((AsciiStrnLenS (String, ASCII_RSIZE_MAX + 1) <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == ' ') || (*String == '\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == '0') {
- String++;
- }
-
- if (AsciiCharToUpper (*String) == 'X') {
- if (*(String - 1) != '0') {
- *Data = 0;
- return RETURN_SUCCESS;
- }
- //
- // Skip the 'X'
- //
- String++;
- }
-
- *Data = 0;
-
- while (InternalAsciiIsHexaDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according to the range
- // defined by UINTN, then MAX_UINTN is stored in *Data and
- // RETURN_UNSUPPORTED is returned.
- //
- if (*Data > ((MAX_UINTN - InternalAsciiHexCharToUintn (*String)) >> 4)) {
- *Data = MAX_UINTN;
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
- return RETURN_UNSUPPORTED;
- }
-
- *Data = (*Data << 4) + InternalAsciiHexCharToUintn (*String);
- String++;
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Ascii hexadecimal string to a value of type UINT64.
-
- This function outputs a value of type UINT64 by interpreting the contents of
- the Ascii string specified by String as a hexadecimal number. The format of
- the input Ascii string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If
- "x" appears in the input string, it must be prefixed with at least one 0. The
- function will ignore the pad space, which includes spaces or tab characters,
- before [zeros], [x] or [hexadecimal digits]. The running zero before [x] or
- [hexadecimal digits] will be ignored. Then, the decoding starts after [x] or
- the first valid hexadecimal digit. Then, the function stops at the first
- character that is a not a valid hexadecimal character or Null-terminator,
- whichever on comes first.
-
- If String is NULL, then ASSERT().
- If Data is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength Ascii characters, not including the
- Null-terminator, then ASSERT().
-
- If String has no valid hexadecimal digits in the above format, then 0 is
- stored at the location pointed to by Data.
- If the number represented by String exceeds the range defined by UINT64, then
- MAX_UINT64 is stored at the location pointed to by Data.
-
- If EndPointer is not NULL, a pointer to the character that stopped the scan
- is stored at the location pointed to by EndPointer. If String has no valid
- hexadecimal digits right after the optional pad spaces, the value of String
- is stored at the location pointed to by EndPointer.
-
- @param String Pointer to a Null-terminated Ascii string.
- @param EndPointer Pointer to character that stops scan.
- @param Data Pointer to the converted value.
-
- @retval RETURN_SUCCESS Value is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than
- PcdMaximumAsciiStringLength Ascii
- characters, not including the
- Null-terminator.
- @retval RETURN_UNSUPPORTED If the number represented by String exceeds
- the range defined by UINT64.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrHexToUint64S (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT UINT64 *Data
- )
-{
- //
- // 1. Neither String nor Data shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Data != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. The length of String shall not be greater than ASCII_RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((AsciiStrnLenS (String, ASCII_RSIZE_MAX + 1) <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == ' ') || (*String == '\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == '0') {
- String++;
- }
-
- if (AsciiCharToUpper (*String) == 'X') {
- if (*(String - 1) != '0') {
- *Data = 0;
- return RETURN_SUCCESS;
- }
- //
- // Skip the 'X'
- //
- String++;
- }
-
- *Data = 0;
-
- while (InternalAsciiIsHexaDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according to the range
- // defined by UINT64, then MAX_UINT64 is stored in *Data and
- // RETURN_UNSUPPORTED is returned.
- //
- if (*Data > RShiftU64 (MAX_UINT64 - InternalAsciiHexCharToUintn (*String), 4)) {
- *Data = MAX_UINT64;
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
- return RETURN_UNSUPPORTED;
- }
-
- *Data = LShiftU64 (*Data, 4) + InternalAsciiHexCharToUintn (*String);
- String++;
- }
-
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) String;
- }
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated Unicode string to a Null-terminated
- ASCII string.
-
- This function is similar to AsciiStrCpyS.
-
- This function converts the content of the Unicode string Source
- to the ASCII string Destination by copying the lower 8 bits of
- each Unicode character. The function terminates the ASCII string
- Destination by appending a Null-terminator character at the end.
-
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
-
- If any Unicode characters in Source contain non-zero value in
- the upper 8 bits, then ASSERT().
-
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Source The pointer to a Null-terminated Unicode string.
- @param Destination The pointer to a Null-terminated ASCII string.
- @param DestMax The maximum number of Destination Ascii
- char, including terminating null char.
-
- @retval RETURN_SUCCESS String is converted.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-
-**/
-RETURN_STATUS
-EFIAPI
-UnicodeStrToAsciiStrS (
- IN CONST CHAR16 *Source,
- OUT CHAR8 *Destination,
- IN UINTN DestMax
- )
-{
- UINTN SourceLen;
-
- ASSERT (((UINTN) Source & BIT0) == 0);
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. DestMax shall not be greater than ASCII_RSIZE_MAX or RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. DestMax shall be greater than StrnLenS (Source, DestMax).
- //
- SourceLen = StrnLenS (Source, DestMax);
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax > SourceLen), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 5. Copying shall not take place between objects that overlap.
- //
- SAFE_STRING_CONSTRAINT_CHECK (!InternalSafeStringIsOverlap (Destination, DestMax, (VOID *)Source, (SourceLen + 1) * sizeof(CHAR16)), RETURN_ACCESS_DENIED);
-
- //
- // convert string
- //
- while (*Source != '\0') {
- //
- // If any Unicode characters in Source contain
- // non-zero value in the upper 8 bits, then ASSERT().
- //
- ASSERT (*Source < 0x100);
- *(Destination++) = (CHAR8) *(Source++);
- }
- *Destination = '\0';
-
- return RETURN_SUCCESS;
-}
-
-/**
- Convert not more than Length successive characters from a Null-terminated
- Unicode string to a Null-terminated Ascii string. If no null char is copied
- from Source, then Destination[Length] is always set to null.
-
- This function converts not more than Length successive characters from the
- Unicode string Source to the Ascii string Destination by copying the lower 8
- bits of each Unicode character. The function terminates the Ascii string
- Destination by appending a Null-terminator character at the end.
-
- The caller is responsible to make sure Destination points to a buffer with
- size not smaller than ((MIN(StrLen(Source), Length) + 1) * sizeof (CHAR8))
- in bytes.
-
- If any Unicode characters in Source contain non-zero value in the upper 8
- bits, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then Destination and DestinationLength are
- unmodified.
-
- @param Source The pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to
- convert.
- @param Destination The pointer to a Null-terminated Ascii string.
- @param DestMax The maximum number of Destination Ascii char,
- including terminating null char.
- @param DestinationLength The number of Unicode characters converted.
-
- @retval RETURN_SUCCESS String is converted.
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If DestinationLength is NULL.
- If PcdMaximumAsciiStringLength is not zero,
- and Length or DestMax is greater than
- PcdMaximumAsciiStringLength.
- If PcdMaximumUnicodeStringLength is not
- zero, and Length or DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If DestMax is 0.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
- MIN(StrLen(Source), Length).
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-
-**/
-RETURN_STATUS
-EFIAPI
-UnicodeStrnToAsciiStrS (
- IN CONST CHAR16 *Source,
- IN UINTN Length,
- OUT CHAR8 *Destination,
- IN UINTN DestMax,
- OUT UINTN *DestinationLength
- )
-{
- UINTN SourceLen;
-
- ASSERT (((UINTN) Source & BIT0) == 0);
-
- //
- // 1. None of Destination, Source or DestinationLength shall be a null
- // pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((DestinationLength != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. Neither Length nor DestMax shall be greater than ASCII_RSIZE_MAX or
- // RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. If Length is not less than DestMax, then DestMax shall be greater than
- // StrnLenS(Source, DestMax).
- //
- SourceLen = StrnLenS (Source, DestMax);
- if (Length >= DestMax) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax > SourceLen), RETURN_BUFFER_TOO_SMALL);
- }
-
- //
- // 5. Copying shall not take place between objects that overlap.
- //
- if (SourceLen > Length) {
- SourceLen = Length;
- }
- SAFE_STRING_CONSTRAINT_CHECK (!InternalSafeStringIsOverlap (Destination, DestMax, (VOID *)Source, (SourceLen + 1) * sizeof(CHAR16)), RETURN_ACCESS_DENIED);
-
- *DestinationLength = 0;
-
- //
- // Convert string
- //
- while ((*Source != 0) && (SourceLen > 0)) {
- //
- // If any Unicode characters in Source contain non-zero value in the upper
- // 8 bits, then ASSERT().
- //
- ASSERT (*Source < 0x100);
- *(Destination++) = (CHAR8) *(Source++);
- SourceLen--;
- (*DestinationLength)++;
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Convert one Null-terminated ASCII string to a Null-terminated
- Unicode string.
-
- This function is similar to StrCpyS.
-
- This function converts the contents of the ASCII string Source to the Unicode
- string Destination. The function terminates the Unicode string Destination by
- appending a Null-terminator character at the end.
-
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
-
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then the Destination is unmodified.
-
- @param Source The pointer to a Null-terminated ASCII string.
- @param Destination The pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode
- char, including terminating null char.
-
- @retval RETURN_SUCCESS String is converted.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than StrLen(Source).
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If PcdMaximumUnicodeStringLength is not zero,
- and DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If PcdMaximumAsciiStringLength is not zero,
- and DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrToUnicodeStrS (
- IN CONST CHAR8 *Source,
- OUT CHAR16 *Destination,
- IN UINTN DestMax
- )
-{
- UINTN SourceLen;
-
- ASSERT (((UINTN) Destination & BIT0) == 0);
-
- //
- // 1. Neither Destination nor Source shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. DestMax shall not be greater than RSIZE_MAX or ASCII_RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. DestMax shall be greater than AsciiStrnLenS(Source, DestMax).
- //
- SourceLen = AsciiStrnLenS (Source, DestMax);
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax > SourceLen), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 5. Copying shall not take place between objects that overlap.
- //
- SAFE_STRING_CONSTRAINT_CHECK (!InternalSafeStringIsOverlap (Destination, DestMax * sizeof(CHAR16), (VOID *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- //
- // Convert string
- //
- while (*Source != '\0') {
- *(Destination++) = (CHAR16)(UINT8)*(Source++);
- }
- *Destination = '\0';
-
- return RETURN_SUCCESS;
-}
-
-/**
- Convert not more than Length successive characters from a Null-terminated
- Ascii string to a Null-terminated Unicode string. If no null char is copied
- from Source, then Destination[Length] is always set to null.
-
- This function converts not more than Length successive characters from the
- Ascii string Source to the Unicode string Destination. The function
- terminates the Unicode string Destination by appending a Null-terminator
- character at the end.
-
- The caller is responsible to make sure Destination points to a buffer with
- size not smaller than
- ((MIN(AsciiStrLen(Source), Length) + 1) * sizeof (CHAR8)) in bytes.
-
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
-
- If an error is returned, then Destination and DestinationLength are
- unmodified.
-
- @param Source The pointer to a Null-terminated Ascii string.
- @param Length The maximum number of Ascii characters to convert.
- @param Destination The pointer to a Null-terminated Unicode string.
- @param DestMax The maximum number of Destination Unicode char,
- including terminating null char.
- @param DestinationLength The number of Ascii characters converted.
-
- @retval RETURN_SUCCESS String is converted.
- @retval RETURN_INVALID_PARAMETER If Destination is NULL.
- If Source is NULL.
- If DestinationLength is NULL.
- If PcdMaximumUnicodeStringLength is not
- zero, and Length or DestMax is greater than
- PcdMaximumUnicodeStringLength.
- If PcdMaximumAsciiStringLength is not zero,
- and Length or DestMax is greater than
- PcdMaximumAsciiStringLength.
- If DestMax is 0.
- @retval RETURN_BUFFER_TOO_SMALL If DestMax is NOT greater than
- MIN(AsciiStrLen(Source), Length).
- @retval RETURN_ACCESS_DENIED If Source and Destination overlap.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrnToUnicodeStrS (
- IN CONST CHAR8 *Source,
- IN UINTN Length,
- OUT CHAR16 *Destination,
- IN UINTN DestMax,
- OUT UINTN *DestinationLength
- )
-{
- UINTN SourceLen;
-
- ASSERT (((UINTN) Destination & BIT0) == 0);
-
- //
- // 1. None of Destination, Source or DestinationLength shall be a null
- // pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((Destination != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Source != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((DestinationLength != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. Neither Length nor DestMax shall be greater than ASCII_RSIZE_MAX or
- // RSIZE_MAX.
- //
- if (RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. DestMax shall not equal zero.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax != 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. If Length is not less than DestMax, then DestMax shall be greater than
- // AsciiStrnLenS(Source, DestMax).
- //
- SourceLen = AsciiStrnLenS (Source, DestMax);
- if (Length >= DestMax) {
- SAFE_STRING_CONSTRAINT_CHECK ((DestMax > SourceLen), RETURN_BUFFER_TOO_SMALL);
- }
-
- //
- // 5. Copying shall not take place between objects that overlap.
- //
- if (SourceLen > Length) {
- SourceLen = Length;
- }
- SAFE_STRING_CONSTRAINT_CHECK (!InternalSafeStringIsOverlap (Destination, DestMax * sizeof(CHAR16), (VOID *)Source, SourceLen + 1), RETURN_ACCESS_DENIED);
-
- *DestinationLength = 0;
-
- //
- // Convert string
- //
- while ((*Source != 0) && (SourceLen > 0)) {
- *(Destination++) = (CHAR16)(UINT8)*(Source++);
- SourceLen--;
- (*DestinationLength)++;
- }
- *Destination = 0;
-
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated ASCII string to IPv6 address and prefix length.
-
- This function outputs a value of type IPv6_ADDRESS and may output a value
- of type UINT8 by interpreting the contents of the ASCII string specified
- by String. The format of the input ASCII string String is as follows:
-
- X:X:X:X:X:X:X:X[/P]
-
- X contains one to four hexadecimal digit characters in the range [0-9], [a-f] and
- [A-F]. X is converted to a value of type UINT16, whose low byte is stored in low
- memory address and high byte is stored in high memory address. P contains decimal
- digit characters in the range [0-9]. The running zero in the beginning of P will
- be ignored. /P is optional.
-
- When /P is not in the String, the function stops at the first character that is
- not a valid hexadecimal digit character after eight X's are converted.
-
- When /P is in the String, the function stops at the first character that is not
- a valid decimal digit character after P is converted.
-
- "::" can be used to compress one or more groups of X when X contains only 0.
- The "::" can only appear once in the String.
-
- If String is NULL, then ASSERT().
-
- If Address is NULL, then ASSERT().
-
- If EndPointer is not NULL and Address is translated from String, a pointer
- to the character that stopped the scan is stored at the location pointed to
- by EndPointer.
-
- @param String Pointer to a Null-terminated ASCII string.
- @param EndPointer Pointer to character that stops scan.
- @param Address Pointer to the converted IPv6 address.
- @param PrefixLength Pointer to the converted IPv6 address prefix
- length. MAX_UINT8 is returned when /P is
- not in the String.
-
- @retval RETURN_SUCCESS Address is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If X contains more than four hexadecimal
- digit characters.
- If String contains "::" and number of X
- is not less than 8.
- If P starts with character that is not a
- valid decimal digit character.
- If the decimal number converted from P
- exceeds 128.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrToIpv6Address (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT IPv6_ADDRESS *Address,
- OUT UINT8 *PrefixLength OPTIONAL
- )
-{
- RETURN_STATUS Status;
- UINTN AddressIndex;
- UINTN Uintn;
- IPv6_ADDRESS LocalAddress;
- UINT8 LocalPrefixLength;
- CONST CHAR8 *Pointer;
- CHAR8 *End;
- UINTN CompressStart;
- BOOLEAN ExpectPrefix;
-
- LocalPrefixLength = MAX_UINT8;
- CompressStart = ARRAY_SIZE (Address->Addr);
- ExpectPrefix = FALSE;
-
- //
- // None of String or Address shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Address != NULL), RETURN_INVALID_PARAMETER);
-
- for (Pointer = String, AddressIndex = 0; AddressIndex < ARRAY_SIZE (Address->Addr) + 1;) {
- if (!InternalAsciiIsHexaDecimalDigitCharacter (*Pointer)) {
- if (*Pointer != ':') {
- //
- // ":" or "/" should be followed by digit characters.
- //
- return RETURN_UNSUPPORTED;
- }
-
- //
- // Meet second ":" after previous ":" or "/"
- // or meet first ":" in the beginning of String.
- //
- if (ExpectPrefix) {
- //
- // ":" shall not be after "/"
- //
- return RETURN_UNSUPPORTED;
- }
-
- if (CompressStart != ARRAY_SIZE (Address->Addr) || AddressIndex == ARRAY_SIZE (Address->Addr)) {
- //
- // "::" can only appear once.
- // "::" can only appear when address is not full length.
- //
- return RETURN_UNSUPPORTED;
- } else {
- //
- // Remember the start of zero compressing.
- //
- CompressStart = AddressIndex;
- Pointer++;
-
- if (CompressStart == 0) {
- if (*Pointer != ':') {
- //
- // Single ":" shall not be in the beginning of String.
- //
- return RETURN_UNSUPPORTED;
- }
- Pointer++;
- }
- }
- }
-
- if (!InternalAsciiIsHexaDecimalDigitCharacter (*Pointer)) {
- if (*Pointer == '/') {
- //
- // Might be optional "/P" after "::".
- //
- if (CompressStart != AddressIndex) {
- return RETURN_UNSUPPORTED;
- }
- } else {
- break;
- }
- } else {
- if (!ExpectPrefix) {
- //
- // Get X.
- //
- Status = AsciiStrHexToUintnS (Pointer, &End, &Uintn);
- if (RETURN_ERROR (Status) || End - Pointer > 4) {
- //
- // Number of hexadecimal digit characters is no more than 4.
- //
- return RETURN_UNSUPPORTED;
- }
- Pointer = End;
- //
- // Uintn won't exceed MAX_UINT16 if number of hexadecimal digit characters is no more than 4.
- //
- ASSERT (AddressIndex + 1 < ARRAY_SIZE (Address->Addr));
- LocalAddress.Addr[AddressIndex] = (UINT8) ((UINT16) Uintn >> 8);
- LocalAddress.Addr[AddressIndex + 1] = (UINT8) Uintn;
- AddressIndex += 2;
- } else {
- //
- // Get P, then exit the loop.
- //
- Status = AsciiStrDecimalToUintnS (Pointer, &End, &Uintn);
- if (RETURN_ERROR (Status) || End == Pointer || Uintn > 128) {
- //
- // Prefix length should not exceed 128.
- //
- return RETURN_UNSUPPORTED;
- }
- LocalPrefixLength = (UINT8) Uintn;
- Pointer = End;
- break;
- }
- }
-
- //
- // Skip ':' or "/"
- //
- if (*Pointer == '/') {
- ExpectPrefix = TRUE;
- } else if (*Pointer == ':') {
- if (AddressIndex == ARRAY_SIZE (Address->Addr)) {
- //
- // Meet additional ":" after all 8 16-bit address
- //
- break;
- }
- } else {
- //
- // Meet other character that is not "/" or ":" after all 8 16-bit address
- //
- break;
- }
- Pointer++;
- }
-
- if ((AddressIndex == ARRAY_SIZE (Address->Addr) && CompressStart != ARRAY_SIZE (Address->Addr)) ||
- (AddressIndex != ARRAY_SIZE (Address->Addr) && CompressStart == ARRAY_SIZE (Address->Addr))
- ) {
- //
- // Full length of address shall not have compressing zeros.
- // Non-full length of address shall have compressing zeros.
- //
- return RETURN_UNSUPPORTED;
- }
- CopyMem (&Address->Addr[0], &LocalAddress.Addr[0], CompressStart);
- ZeroMem (&Address->Addr[CompressStart], ARRAY_SIZE (Address->Addr) - AddressIndex);
- if (AddressIndex > CompressStart) {
- CopyMem (
- &Address->Addr[CompressStart + ARRAY_SIZE (Address->Addr) - AddressIndex],
- &LocalAddress.Addr[CompressStart],
- AddressIndex - CompressStart
- );
-
- }
-
- if (PrefixLength != NULL) {
- *PrefixLength = LocalPrefixLength;
- }
- if (EndPointer != NULL) {
- *EndPointer = (CHAR8 *) Pointer;
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated ASCII string to IPv4 address and prefix length.
-
- This function outputs a value of type IPv4_ADDRESS and may output a value
- of type UINT8 by interpreting the contents of the ASCII string specified
- by String. The format of the input ASCII string String is as follows:
-
- D.D.D.D[/P]
-
- D and P are decimal digit characters in the range [0-9]. The running zero in
- the beginning of D and P will be ignored. /P is optional.
-
- When /P is not in the String, the function stops at the first character that is
- not a valid decimal digit character after four D's are converted.
-
- When /P is in the String, the function stops at the first character that is not
- a valid decimal digit character after P is converted.
-
- If String is NULL, then ASSERT().
-
- If Address is NULL, then ASSERT().
-
- If EndPointer is not NULL and Address is translated from String, a pointer
- to the character that stopped the scan is stored at the location pointed to
- by EndPointer.
-
- @param String Pointer to a Null-terminated ASCII string.
- @param EndPointer Pointer to character that stops scan.
- @param Address Pointer to the converted IPv4 address.
- @param PrefixLength Pointer to the converted IPv4 address prefix
- length. MAX_UINT8 is returned when /P is
- not in the String.
-
- @retval RETURN_SUCCESS Address is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If String is not in the correct format.
- If any decimal number converted from D
- exceeds 255.
- If the decimal number converted from P
- exceeds 32.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrToIpv4Address (
- IN CONST CHAR8 *String,
- OUT CHAR8 **EndPointer, OPTIONAL
- OUT IPv4_ADDRESS *Address,
- OUT UINT8 *PrefixLength OPTIONAL
- )
-{
- RETURN_STATUS Status;
- UINTN AddressIndex;
- UINTN Uintn;
- IPv4_ADDRESS LocalAddress;
- UINT8 LocalPrefixLength;
- CHAR8 *Pointer;
-
- LocalPrefixLength = MAX_UINT8;
-
- //
- // None of String or Address shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Address != NULL), RETURN_INVALID_PARAMETER);
-
- for (Pointer = (CHAR8 *) String, AddressIndex = 0; AddressIndex < ARRAY_SIZE (Address->Addr) + 1;) {
- if (!InternalAsciiIsDecimalDigitCharacter (*Pointer)) {
- //
- // D or P contains invalid characters.
- //
- break;
- }
-
- //
- // Get D or P.
- //
- Status = AsciiStrDecimalToUintnS ((CONST CHAR8 *) Pointer, &Pointer, &Uintn);
- if (RETURN_ERROR (Status)) {
- return RETURN_UNSUPPORTED;
- }
- if (AddressIndex == ARRAY_SIZE (Address->Addr)) {
- //
- // It's P.
- //
- if (Uintn > 32) {
- return RETURN_UNSUPPORTED;
- }
- LocalPrefixLength = (UINT8) Uintn;
- } else {
- //
- // It's D.
- //
- if (Uintn > MAX_UINT8) {
- return RETURN_UNSUPPORTED;
- }
- LocalAddress.Addr[AddressIndex] = (UINT8) Uintn;
- AddressIndex++;
- }
-
- //
- // Check the '.' or '/', depending on the AddressIndex.
- //
- if (AddressIndex == ARRAY_SIZE (Address->Addr)) {
- if (*Pointer == '/') {
- //
- // '/P' is in the String.
- // Skip "/" and get P in next loop.
- //
- Pointer++;
- } else {
- //
- // '/P' is not in the String.
- //
- break;
- }
- } else if (AddressIndex < ARRAY_SIZE (Address->Addr)) {
- if (*Pointer == '.') {
- //
- // D should be followed by '.'
- //
- Pointer++;
- } else {
- return RETURN_UNSUPPORTED;
- }
- }
- }
-
- if (AddressIndex < ARRAY_SIZE (Address->Addr)) {
- return RETURN_UNSUPPORTED;
- }
-
- CopyMem (Address, &LocalAddress, sizeof (*Address));
- if (PrefixLength != NULL) {
- *PrefixLength = LocalPrefixLength;
- }
- if (EndPointer != NULL) {
- *EndPointer = Pointer;
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated ASCII GUID string to a value of type
- EFI_GUID.
-
- This function outputs a GUID value by interpreting the contents of
- the ASCII string specified by String. The format of the input
- ASCII string String consists of 36 characters, as follows:
-
- aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
-
- The pairs aa - pp are two characters in the range [0-9], [a-f] and
- [A-F], with each pair representing a single byte hexadecimal value.
-
- The mapping between String and the EFI_GUID structure is as follows:
- aa Data1[24:31]
- bb Data1[16:23]
- cc Data1[8:15]
- dd Data1[0:7]
- ee Data2[8:15]
- ff Data2[0:7]
- gg Data3[8:15]
- hh Data3[0:7]
- ii Data4[0:7]
- jj Data4[8:15]
- kk Data4[16:23]
- ll Data4[24:31]
- mm Data4[32:39]
- nn Data4[40:47]
- oo Data4[48:55]
- pp Data4[56:63]
-
- If String is NULL, then ASSERT().
- If Guid is NULL, then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
- @param Guid Pointer to the converted GUID.
-
- @retval RETURN_SUCCESS Guid is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- @retval RETURN_UNSUPPORTED If String is not as the above format.
-
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrToGuid (
- IN CONST CHAR8 *String,
- OUT GUID *Guid
- )
-{
- RETURN_STATUS Status;
- GUID LocalGuid;
-
- //
- // None of String or Guid shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Guid != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // Get aabbccdd in big-endian.
- //
- Status = AsciiStrHexToBytes (String, 2 * sizeof (LocalGuid.Data1), (UINT8 *) &LocalGuid.Data1, sizeof (LocalGuid.Data1));
- if (RETURN_ERROR (Status) || String[2 * sizeof (LocalGuid.Data1)] != '-') {
- return RETURN_UNSUPPORTED;
- }
- //
- // Convert big-endian to little-endian.
- //
- LocalGuid.Data1 = SwapBytes32 (LocalGuid.Data1);
- String += 2 * sizeof (LocalGuid.Data1) + 1;
-
- //
- // Get eeff in big-endian.
- //
- Status = AsciiStrHexToBytes (String, 2 * sizeof (LocalGuid.Data2), (UINT8 *) &LocalGuid.Data2, sizeof (LocalGuid.Data2));
- if (RETURN_ERROR (Status) || String[2 * sizeof (LocalGuid.Data2)] != '-') {
- return RETURN_UNSUPPORTED;
- }
- //
- // Convert big-endian to little-endian.
- //
- LocalGuid.Data2 = SwapBytes16 (LocalGuid.Data2);
- String += 2 * sizeof (LocalGuid.Data2) + 1;
-
- //
- // Get gghh in big-endian.
- //
- Status = AsciiStrHexToBytes (String, 2 * sizeof (LocalGuid.Data3), (UINT8 *) &LocalGuid.Data3, sizeof (LocalGuid.Data3));
- if (RETURN_ERROR (Status) || String[2 * sizeof (LocalGuid.Data3)] != '-') {
- return RETURN_UNSUPPORTED;
- }
- //
- // Convert big-endian to little-endian.
- //
- LocalGuid.Data3 = SwapBytes16 (LocalGuid.Data3);
- String += 2 * sizeof (LocalGuid.Data3) + 1;
-
- //
- // Get iijj.
- //
- Status = AsciiStrHexToBytes (String, 2 * 2, &LocalGuid.Data4[0], 2);
- if (RETURN_ERROR (Status) || String[2 * 2] != '-') {
- return RETURN_UNSUPPORTED;
- }
- String += 2 * 2 + 1;
-
- //
- // Get kkllmmnnoopp.
- //
- Status = AsciiStrHexToBytes (String, 2 * 6, &LocalGuid.Data4[2], 6);
- if (RETURN_ERROR (Status)) {
- return RETURN_UNSUPPORTED;
- }
-
- CopyGuid (Guid, &LocalGuid);
- return RETURN_SUCCESS;
-}
-
-/**
- Convert a Null-terminated ASCII hexadecimal string to a byte array.
-
- This function outputs a byte array by interpreting the contents of
- the ASCII string specified by String in hexadecimal format. The format of
- the input ASCII string String is:
-
- [XX]*
-
- X is a hexadecimal digit character in the range [0-9], [a-f] and [A-F].
- The function decodes every two hexadecimal digit characters as one byte. The
- decoding stops after Length of characters and outputs Buffer containing
- (Length / 2) bytes.
-
- If String is NULL, then ASSERT().
-
- If Buffer is NULL, then ASSERT().
-
- If Length is not multiple of 2, then ASSERT().
-
- If PcdMaximumAsciiStringLength is not zero and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
-
- If MaxBufferSize is less than (Length / 2), then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
- @param Length The number of ASCII characters to decode.
- @param Buffer Pointer to the converted bytes array.
- @param MaxBufferSize The maximum size of Buffer.
-
- @retval RETURN_SUCCESS Buffer is translated from String.
- @retval RETURN_INVALID_PARAMETER If String is NULL.
- If Data is NULL.
- If Length is not multiple of 2.
- If PcdMaximumAsciiStringLength is not zero,
- and Length is greater than
- PcdMaximumAsciiStringLength.
- @retval RETURN_UNSUPPORTED If Length of characters from String contain
- a character that is not valid hexadecimal
- digit characters, or a Null-terminator.
- @retval RETURN_BUFFER_TOO_SMALL If MaxBufferSize is less than (Length / 2).
-**/
-RETURN_STATUS
-EFIAPI
-AsciiStrHexToBytes (
- IN CONST CHAR8 *String,
- IN UINTN Length,
- OUT UINT8 *Buffer,
- IN UINTN MaxBufferSize
- )
-{
- UINTN Index;
-
- //
- // 1. None of String or Buffer shall be a null pointer.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((String != NULL), RETURN_INVALID_PARAMETER);
- SAFE_STRING_CONSTRAINT_CHECK ((Buffer != NULL), RETURN_INVALID_PARAMETER);
-
- //
- // 2. Length shall not be greater than ASCII_RSIZE_MAX.
- //
- if (ASCII_RSIZE_MAX != 0) {
- SAFE_STRING_CONSTRAINT_CHECK ((Length <= ASCII_RSIZE_MAX), RETURN_INVALID_PARAMETER);
- }
-
- //
- // 3. Length shall not be odd.
- //
- SAFE_STRING_CONSTRAINT_CHECK (((Length & BIT0) == 0), RETURN_INVALID_PARAMETER);
-
- //
- // 4. MaxBufferSize shall equal to or greater than Length / 2.
- //
- SAFE_STRING_CONSTRAINT_CHECK ((MaxBufferSize >= Length / 2), RETURN_BUFFER_TOO_SMALL);
-
- //
- // 5. String shall not contains invalid hexadecimal digits.
- //
- for (Index = 0; Index < Length; Index++) {
- if (!InternalAsciiIsHexaDecimalDigitCharacter (String[Index])) {
- break;
- }
- }
- if (Index != Length) {
- return RETURN_UNSUPPORTED;
- }
-
- //
- // Convert the hex string to bytes.
- //
- for(Index = 0; Index < Length; Index++) {
-
- //
- // For even characters, write the upper nibble for each buffer byte,
- // and for even characters, the lower nibble.
- //
- if ((Index & BIT0) == 0) {
- Buffer[Index / 2] = (UINT8) InternalAsciiHexCharToUintn (String[Index]) << 4;
- } else {
- Buffer[Index / 2] |= (UINT8) InternalAsciiHexCharToUintn (String[Index]);
- }
- }
- return RETURN_SUCCESS;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SetJump.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SetJump.c
deleted file mode 100644
index 4e6e00c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SetJump.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
- Internal ASSERT () functions for SetJump.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Worker function that checks ASSERT condition for JumpBuffer
-
- Checks ASSERT condition for JumpBuffer.
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
-
-**/
-VOID
-EFIAPI
-InternalAssertJumpBuffer (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- )
-{
- ASSERT (JumpBuffer != NULL);
-
- ASSERT (((UINTN)JumpBuffer & (BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT - 1)) == 0);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/String.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/String.c
deleted file mode 100644
index a8ff885..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/String.c
+++ /dev/null
@@ -1,2143 +0,0 @@
-/** @file
- Unicode and ASCII string primitives.
-
- Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Copies one Null-terminated Unicode string to another Null-terminated Unicode
- string and returns the new Unicode string.
-
- This function copies the contents of the Unicode string Source to the Unicode
- string Destination, and returns Destination. If Source and Destination
- overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param Source A pointer to a Null-terminated Unicode string.
-
- @return Destination.
-
-**/
-CHAR16 *
-EFIAPI
-StrCpy (
- OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source
- )
-{
- CHAR16 *ReturnValue;
-
- //
- // Destination cannot be NULL
- //
- ASSERT (Destination != NULL);
- ASSERT (((UINTN) Destination & BIT0) == 0);
-
- //
- // Destination and source cannot overlap
- //
- ASSERT ((UINTN)(Destination - Source) > StrLen (Source));
- ASSERT ((UINTN)(Source - Destination) > StrLen (Source));
-
- ReturnValue = Destination;
- while (*Source != 0) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
- return ReturnValue;
-}
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Copies up to a specified length from one Null-terminated Unicode string to
- another Null-terminated Unicode string and returns the new Unicode string.
-
- This function copies the contents of the Unicode string Source to the Unicode
- string Destination, and returns Destination. At most, Length Unicode
- characters are copied from Source to Destination. If Length is 0, then
- Destination is returned unmodified. If Length is greater that the number of
- Unicode characters in Source, then Destination is padded with Null Unicode
- characters. If Source and Destination overlap, then the results are
- undefined.
-
- If Length > 0 and Destination is NULL, then ASSERT().
- If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param Source A pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to copy.
-
- @return Destination.
-
-**/
-CHAR16 *
-EFIAPI
-StrnCpy (
- OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- )
-{
- CHAR16 *ReturnValue;
-
- if (Length == 0) {
- return Destination;
- }
-
- //
- // Destination cannot be NULL if Length is not zero
- //
- ASSERT (Destination != NULL);
- ASSERT (((UINTN) Destination & BIT0) == 0);
-
- //
- // Destination and source cannot overlap
- //
- ASSERT ((UINTN)(Destination - Source) > StrLen (Source));
- ASSERT ((UINTN)(Source - Destination) >= Length);
-
- if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
- ASSERT (Length <= PcdGet32 (PcdMaximumUnicodeStringLength));
- }
-
- ReturnValue = Destination;
-
- while ((*Source != L'\0') && (Length > 0)) {
- *(Destination++) = *(Source++);
- Length--;
- }
-
- ZeroMem (Destination, Length * sizeof (*Destination));
- return ReturnValue;
-}
-#endif
-
-/**
- Returns the length of a Null-terminated Unicode string.
-
- This function returns the number of Unicode characters in the Null-terminated
- Unicode string specified by String.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
-
- @return The length of String.
-
-**/
-UINTN
-EFIAPI
-StrLen (
- IN CONST CHAR16 *String
- )
-{
- UINTN Length;
-
- ASSERT (String != NULL);
- ASSERT (((UINTN) String & BIT0) == 0);
-
- for (Length = 0; *String != L'\0'; String++, Length++) {
- //
- // If PcdMaximumUnicodeStringLength is not zero,
- // length should not more than PcdMaximumUnicodeStringLength
- //
- if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
- ASSERT (Length < PcdGet32 (PcdMaximumUnicodeStringLength));
- }
- }
- return Length;
-}
-
-/**
- Returns the size of a Null-terminated Unicode string in bytes, including the
- Null terminator.
-
- This function returns the size, in bytes, of the Null-terminated Unicode string
- specified by String.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
-
- @return The size of String.
-
-**/
-UINTN
-EFIAPI
-StrSize (
- IN CONST CHAR16 *String
- )
-{
- return (StrLen (String) + 1) * sizeof (*String);
-}
-
-/**
- Compares two Null-terminated Unicode strings, and returns the difference
- between the first mismatched Unicode characters.
-
- This function compares the Null-terminated Unicode string FirstString to the
- Null-terminated Unicode string SecondString. If FirstString is identical to
- SecondString, then 0 is returned. Otherwise, the value returned is the first
- mismatched Unicode character in SecondString subtracted from the first
- mismatched Unicode character in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If FirstString is not aligned on a 16-bit boundary, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If SecondString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more
- than PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more
- than PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- @param FirstString A pointer to a Null-terminated Unicode string.
- @param SecondString A pointer to a Null-terminated Unicode string.
-
- @retval 0 FirstString is identical to SecondString.
- @return others FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-StrCmp (
- IN CONST CHAR16 *FirstString,
- IN CONST CHAR16 *SecondString
- )
-{
- //
- // ASSERT both strings are less long than PcdMaximumUnicodeStringLength
- //
- ASSERT (StrSize (FirstString) != 0);
- ASSERT (StrSize (SecondString) != 0);
-
- while ((*FirstString != L'\0') && (*FirstString == *SecondString)) {
- FirstString++;
- SecondString++;
- }
- return *FirstString - *SecondString;
-}
-
-/**
- Compares up to a specified length the contents of two Null-terminated Unicode strings,
- and returns the difference between the first mismatched Unicode characters.
-
- This function compares the Null-terminated Unicode string FirstString to the
- Null-terminated Unicode string SecondString. At most, Length Unicode
- characters will be compared. If Length is 0, then 0 is returned. If
- FirstString is identical to SecondString, then 0 is returned. Otherwise, the
- value returned is the first mismatched Unicode character in SecondString
- subtracted from the first mismatched Unicode character in FirstString.
-
- If Length > 0 and FirstString is NULL, then ASSERT().
- If Length > 0 and FirstString is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and SecondString is NULL, then ASSERT().
- If Length > 0 and SecondString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
-
- @param FirstString A pointer to a Null-terminated Unicode string.
- @param SecondString A pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to compare.
-
- @retval 0 FirstString is identical to SecondString.
- @return others FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-StrnCmp (
- IN CONST CHAR16 *FirstString,
- IN CONST CHAR16 *SecondString,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return 0;
- }
-
- //
- // ASSERT both strings are less long than PcdMaximumUnicodeStringLength.
- // Length tests are performed inside StrLen().
- //
- ASSERT (StrSize (FirstString) != 0);
- ASSERT (StrSize (SecondString) != 0);
-
- if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
- ASSERT (Length <= PcdGet32 (PcdMaximumUnicodeStringLength));
- }
-
- while ((*FirstString != L'\0') &&
- (*SecondString != L'\0') &&
- (*FirstString == *SecondString) &&
- (Length > 1)) {
- FirstString++;
- SecondString++;
- Length--;
- }
-
- return *FirstString - *SecondString;
-}
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Concatenates one Null-terminated Unicode string to another Null-terminated
- Unicode string, and returns the concatenated Unicode string.
-
- This function concatenates two Null-terminated Unicode strings. The contents
- of Null-terminated Unicode string Source are concatenated to the end of
- Null-terminated Unicode string Destination. The Null-terminated concatenated
- Unicode String is returned. If Source and Destination overlap, then the
- results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
- than PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
- and Source results in a Unicode string with more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param Source A pointer to a Null-terminated Unicode string.
-
- @return Destination.
-
-**/
-CHAR16 *
-EFIAPI
-StrCat (
- IN OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source
- )
-{
- StrCpy (Destination + StrLen (Destination), Source);
-
- //
- // Size of the resulting string should never be zero.
- // PcdMaximumUnicodeStringLength is tested inside StrLen().
- //
- ASSERT (StrSize (Destination) != 0);
- return Destination;
-}
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Concatenates up to a specified length one Null-terminated Unicode to the end
- of another Null-terminated Unicode string, and returns the concatenated
- Unicode string.
-
- This function concatenates two Null-terminated Unicode strings. The contents
- of Null-terminated Unicode string Source are concatenated to the end of
- Null-terminated Unicode string Destination, and Destination is returned. At
- most, Length Unicode characters are concatenated from Source to the end of
- Destination, and Destination is always Null-terminated. If Length is 0, then
- Destination is returned unmodified. If Source and Destination overlap, then
- the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
- than PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
- and Source results in a Unicode string with more than PcdMaximumUnicodeStringLength
- Unicode characters, not including the Null-terminator, then ASSERT().
-
- @param Destination A pointer to a Null-terminated Unicode string.
- @param Source A pointer to a Null-terminated Unicode string.
- @param Length The maximum number of Unicode characters to concatenate from
- Source.
-
- @return Destination.
-
-**/
-CHAR16 *
-EFIAPI
-StrnCat (
- IN OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- )
-{
- UINTN DestinationLen;
-
- DestinationLen = StrLen (Destination);
- StrnCpy (Destination + DestinationLen, Source, Length);
- Destination[DestinationLen + Length] = L'\0';
-
- //
- // Size of the resulting string should never be zero.
- // PcdMaximumUnicodeStringLength is tested inside StrLen().
- //
- ASSERT (StrSize (Destination) != 0);
- return Destination;
-}
-#endif
-
-/**
- Returns the first occurrence of a Null-terminated Unicode sub-string
- in a Null-terminated Unicode string.
-
- This function scans the contents of the Null-terminated Unicode string
- specified by String and returns the first occurrence of SearchString.
- If SearchString is not found in String, then NULL is returned. If
- the length of SearchString is zero, then String is
- returned.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If SearchString is NULL, then ASSERT().
- If SearchString is not aligned on a 16-bit boundary, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and SearchString
- or String contains more than PcdMaximumUnicodeStringLength Unicode
- characters, not including the Null-terminator, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
- @param SearchString A pointer to a Null-terminated Unicode string to search for.
-
- @retval NULL If the SearchString does not appear in String.
- @return others If there is a match.
-
-**/
-CHAR16 *
-EFIAPI
-StrStr (
- IN CONST CHAR16 *String,
- IN CONST CHAR16 *SearchString
- )
-{
- CONST CHAR16 *FirstMatch;
- CONST CHAR16 *SearchStringTmp;
-
- //
- // ASSERT both strings are less long than PcdMaximumUnicodeStringLength.
- // Length tests are performed inside StrLen().
- //
- ASSERT (StrSize (String) != 0);
- ASSERT (StrSize (SearchString) != 0);
-
- if (*SearchString == L'\0') {
- return (CHAR16 *) String;
- }
-
- while (*String != L'\0') {
- SearchStringTmp = SearchString;
- FirstMatch = String;
-
- while ((*String == *SearchStringTmp)
- && (*String != L'\0')) {
- String++;
- SearchStringTmp++;
- }
-
- if (*SearchStringTmp == L'\0') {
- return (CHAR16 *) FirstMatch;
- }
-
- if (*String == L'\0') {
- return NULL;
- }
-
- String = FirstMatch + 1;
- }
-
- return NULL;
-}
-
-/**
- Check if a Unicode character is a decimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid decimal character is from
- L'0' to L'9'.
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a decmial character.
- @retval FALSE If the Char is not a decmial character.
-
-**/
-BOOLEAN
-EFIAPI
-InternalIsDecimalDigitCharacter (
- IN CHAR16 Char
- )
-{
- return (BOOLEAN) (Char >= L'0' && Char <= L'9');
-}
-
-/**
- Convert a Unicode character to upper case only if
- it maps to a valid small-case ASCII character.
-
- This internal function only deal with Unicode character
- which maps to a valid small-case ASCII character, i.e.
- L'a' to L'z'. For other Unicode character, the input character
- is returned directly.
-
- @param Char The character to convert.
-
- @retval LowerCharacter If the Char is with range L'a' to L'z'.
- @retval Unchanged Otherwise.
-
-**/
-CHAR16
-EFIAPI
-CharToUpper (
- IN CHAR16 Char
- )
-{
- if (Char >= L'a' && Char <= L'z') {
- return (CHAR16) (Char - (L'a' - L'A'));
- }
-
- return Char;
-}
-
-/**
- Convert a Unicode character to numerical value.
-
- This internal function only deal with Unicode character
- which maps to a valid hexadecimal ASII character, i.e.
- L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other
- Unicode character, the value returned does not make sense.
-
- @param Char The character to convert.
-
- @return The numerical value converted.
-
-**/
-UINTN
-EFIAPI
-InternalHexCharToUintn (
- IN CHAR16 Char
- )
-{
- if (InternalIsDecimalDigitCharacter (Char)) {
- return Char - L'0';
- }
-
- return (10 + CharToUpper (Char) - L'A');
-}
-
-/**
- Check if a Unicode character is a hexadecimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid hexadecimal character is
- L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
-
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a hexadecmial character.
- @retval FALSE If the Char is not a hexadecmial character.
-
-**/
-BOOLEAN
-EFIAPI
-InternalIsHexaDecimalDigitCharacter (
- IN CHAR16 Char
- )
-{
-
- return (BOOLEAN) (InternalIsDecimalDigitCharacter (Char) ||
- (Char >= L'A' && Char <= L'F') ||
- (Char >= L'a' && Char <= L'f'));
-}
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of
- type UINTN.
-
- This function returns a value of type UINTN by interpreting the contents
- of the Unicode string specified by String as a decimal number. The format
- of the input Unicode string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The
- function will ignore the pad space, which includes spaces or
- tab characters, before [decimal digits]. The running zero in the
- beginning of [decimal digits] will be ignored. Then, the function
- stops at the first character that is a not a valid decimal character
- or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits,
- then 0 is returned.
- If the number represented by String overflows according
- to the range defined by UINTN, then MAX_UINTN is returned.
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains
- more than PcdMaximumUnicodeStringLength Unicode characters, not including
- the Null-terminator, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
-
- @retval Value translated from String.
-
-**/
-UINTN
-EFIAPI
-StrDecimalToUintn (
- IN CONST CHAR16 *String
- )
-{
- UINTN Result;
-
- StrDecimalToUintnS (String, (CHAR16 **) NULL, &Result);
- return Result;
-}
-
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of
- type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the Unicode string specified by String as a decimal number. The format
- of the input Unicode string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The
- function will ignore the pad space, which includes spaces or
- tab characters, before [decimal digits]. The running zero in the
- beginning of [decimal digits] will be ignored. Then, the function
- stops at the first character that is a not a valid decimal character
- or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits,
- then 0 is returned.
- If the number represented by String overflows according
- to the range defined by UINT64, then MAX_UINT64 is returned.
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains
- more than PcdMaximumUnicodeStringLength Unicode characters, not including
- the Null-terminator, then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
-
- @retval Value translated from String.
-
-**/
-UINT64
-EFIAPI
-StrDecimalToUint64 (
- IN CONST CHAR16 *String
- )
-{
- UINT64 Result;
-
- StrDecimalToUint64S (String, (CHAR16 **) NULL, &Result);
- return Result;
-}
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
-
- This function returns a value of type UINTN by interpreting the contents
- of the Unicode string specified by String as a hexadecimal number.
- The format of the input Unicode string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
- If "x" appears in the input string, it must be prefixed with at least one 0.
- The function will ignore the pad space, which includes spaces or tab characters,
- before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or
- [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the
- first valid hexadecimal digit. Then, the function stops at the first character that is
- a not a valid hexadecimal character or NULL, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then zero is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
- then zero is returned.
- If the number represented by String overflows according to the range defined by
- UINTN, then MAX_UINTN is returned.
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
-
- @retval Value translated from String.
-
-**/
-UINTN
-EFIAPI
-StrHexToUintn (
- IN CONST CHAR16 *String
- )
-{
- UINTN Result;
-
- StrHexToUintnS (String, (CHAR16 **) NULL, &Result);
- return Result;
-}
-
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the Unicode string specified by String as a hexadecimal number.
- The format of the input Unicode string String is
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
- If "x" appears in the input string, it must be prefixed with at least one 0.
- The function will ignore the pad space, which includes spaces or tab characters,
- before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or
- [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the
- first valid hexadecimal digit. Then, the function stops at the first character that is
- a not a valid hexadecimal character or NULL, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then zero is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
- then zero is returned.
- If the number represented by String overflows according to the range defined by
- UINT64, then MAX_UINT64 is returned.
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
-
- @param String A pointer to a Null-terminated Unicode string.
-
- @retval Value translated from String.
-
-**/
-UINT64
-EFIAPI
-StrHexToUint64 (
- IN CONST CHAR16 *String
- )
-{
- UINT64 Result;
-
- StrHexToUint64S (String, (CHAR16 **) NULL, &Result);
- return Result;
-}
-
-/**
- Check if a ASCII character is a decimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid decimal character is from
- '0' to '9'.
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a decmial character.
- @retval FALSE If the Char is not a decmial character.
-
-**/
-BOOLEAN
-EFIAPI
-InternalAsciiIsDecimalDigitCharacter (
- IN CHAR8 Char
- )
-{
- return (BOOLEAN) (Char >= '0' && Char <= '9');
-}
-
-/**
- Check if a ASCII character is a hexadecimal character.
-
- This internal function checks if a ASCII character is a
- decimal character. The valid hexadecimal character is
- L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
-
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a hexadecmial character.
- @retval FALSE If the Char is not a hexadecmial character.
-
-**/
-BOOLEAN
-EFIAPI
-InternalAsciiIsHexaDecimalDigitCharacter (
- IN CHAR8 Char
- )
-{
-
- return (BOOLEAN) (InternalAsciiIsDecimalDigitCharacter (Char) ||
- (Char >= 'A' && Char <= 'F') ||
- (Char >= 'a' && Char <= 'f'));
-}
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Convert a Null-terminated Unicode string to a Null-terminated
- ASCII string and returns the ASCII string.
-
- This function converts the content of the Unicode string Source
- to the ASCII string Destination by copying the lower 8 bits of
- each Unicode character. It returns Destination.
-
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
-
- If any Unicode characters in Source contain non-zero value in
- the upper 8 bits, then ASSERT().
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and Source contains
- more than PcdMaximumUnicodeStringLength Unicode characters, not including
- the Null-terminator, then ASSERT().
-
- If PcdMaximumAsciiStringLength is not zero, and Source contains more
- than PcdMaximumAsciiStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
-
- @param Source A pointer to a Null-terminated Unicode string.
- @param Destination A pointer to a Null-terminated ASCII string.
-
- @return Destination.
-
-**/
-CHAR8 *
-EFIAPI
-UnicodeStrToAsciiStr (
- IN CONST CHAR16 *Source,
- OUT CHAR8 *Destination
- )
-{
- CHAR8 *ReturnValue;
-
- ASSERT (Destination != NULL);
-
- //
- // ASSERT if Source is long than PcdMaximumUnicodeStringLength.
- // Length tests are performed inside StrLen().
- //
- ASSERT (StrSize (Source) != 0);
-
- //
- // Source and Destination should not overlap
- //
- ASSERT ((UINTN) (Destination - (CHAR8 *) Source) >= StrSize (Source));
- ASSERT ((UINTN) ((CHAR8 *) Source - Destination) > StrLen (Source));
-
-
- ReturnValue = Destination;
- while (*Source != '\0') {
- //
- // If any Unicode characters in Source contain
- // non-zero value in the upper 8 bits, then ASSERT().
- //
- ASSERT (*Source < 0x100);
- *(Destination++) = (CHAR8) *(Source++);
- }
-
- *Destination = '\0';
-
- //
- // ASSERT Original Destination is less long than PcdMaximumAsciiStringLength.
- // Length tests are performed inside AsciiStrLen().
- //
- ASSERT (AsciiStrSize (ReturnValue) != 0);
-
- return ReturnValue;
-}
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Copies one Null-terminated ASCII string to another Null-terminated ASCII
- string and returns the new ASCII string.
-
- This function copies the contents of the ASCII string Source to the ASCII
- string Destination, and returns Destination. If Source and Destination
- overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param Destination A pointer to a Null-terminated ASCII string.
- @param Source A pointer to a Null-terminated ASCII string.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrCpy (
- OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source
- )
-{
- CHAR8 *ReturnValue;
-
- //
- // Destination cannot be NULL
- //
- ASSERT (Destination != NULL);
-
- //
- // Destination and source cannot overlap
- //
- ASSERT ((UINTN)(Destination - Source) > AsciiStrLen (Source));
- ASSERT ((UINTN)(Source - Destination) > AsciiStrLen (Source));
-
- ReturnValue = Destination;
- while (*Source != 0) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
- return ReturnValue;
-}
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Copies up to a specified length one Null-terminated ASCII string to another
- Null-terminated ASCII string and returns the new ASCII string.
-
- This function copies the contents of the ASCII string Source to the ASCII
- string Destination, and returns Destination. At most, Length ASCII characters
- are copied from Source to Destination. If Length is 0, then Destination is
- returned unmodified. If Length is greater that the number of ASCII characters
- in Source, then Destination is padded with Null ASCII characters. If Source
- and Destination overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param Destination A pointer to a Null-terminated ASCII string.
- @param Source A pointer to a Null-terminated ASCII string.
- @param Length The maximum number of ASCII characters to copy.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrnCpy (
- OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- )
-{
- CHAR8 *ReturnValue;
-
- if (Length == 0) {
- return Destination;
- }
-
- //
- // Destination cannot be NULL
- //
- ASSERT (Destination != NULL);
-
- //
- // Destination and source cannot overlap
- //
- ASSERT ((UINTN)(Destination - Source) > AsciiStrLen (Source));
- ASSERT ((UINTN)(Source - Destination) >= Length);
-
- if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
- ASSERT (Length <= PcdGet32 (PcdMaximumAsciiStringLength));
- }
-
- ReturnValue = Destination;
-
- while (*Source != 0 && Length > 0) {
- *(Destination++) = *(Source++);
- Length--;
- }
-
- ZeroMem (Destination, Length * sizeof (*Destination));
- return ReturnValue;
-}
-#endif
-
-/**
- Returns the length of a Null-terminated ASCII string.
-
- This function returns the number of ASCII characters in the Null-terminated
- ASCII string specified by String.
-
- If Length > 0 and Destination is NULL, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and String contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param String A pointer to a Null-terminated ASCII string.
-
- @return The length of String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrLen (
- IN CONST CHAR8 *String
- )
-{
- UINTN Length;
-
- ASSERT (String != NULL);
-
- for (Length = 0; *String != '\0'; String++, Length++) {
- //
- // If PcdMaximumUnicodeStringLength is not zero,
- // length should not more than PcdMaximumUnicodeStringLength
- //
- if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
- ASSERT (Length < PcdGet32 (PcdMaximumAsciiStringLength));
- }
- }
- return Length;
-}
-
-/**
- Returns the size of a Null-terminated ASCII string in bytes, including the
- Null terminator.
-
- This function returns the size, in bytes, of the Null-terminated ASCII string
- specified by String.
-
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and String contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param String A pointer to a Null-terminated ASCII string.
-
- @return The size of String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrSize (
- IN CONST CHAR8 *String
- )
-{
- return (AsciiStrLen (String) + 1) * sizeof (*String);
-}
-
-/**
- Compares two Null-terminated ASCII strings, and returns the difference
- between the first mismatched ASCII characters.
-
- This function compares the Null-terminated ASCII string FirstString to the
- Null-terminated ASCII string SecondString. If FirstString is identical to
- SecondString, then 0 is returned. Otherwise, the value returned is the first
- mismatched ASCII character in SecondString subtracted from the first
- mismatched ASCII character in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and SecondString contains more
- than PcdMaximumAsciiStringLength ASCII characters, not including the
- Null-terminator, then ASSERT().
-
- @param FirstString A pointer to a Null-terminated ASCII string.
- @param SecondString A pointer to a Null-terminated ASCII string.
-
- @retval ==0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-AsciiStrCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString
- )
-{
- //
- // ASSERT both strings are less long than PcdMaximumAsciiStringLength
- //
- ASSERT (AsciiStrSize (FirstString));
- ASSERT (AsciiStrSize (SecondString));
-
- while ((*FirstString != '\0') && (*FirstString == *SecondString)) {
- FirstString++;
- SecondString++;
- }
-
- return *FirstString - *SecondString;
-}
-
-/**
- Converts a lowercase Ascii character to upper one.
-
- If Chr is lowercase Ascii character, then converts it to upper one.
-
- If Value >= 0xA0, then ASSERT().
- If (Value & 0x0F) >= 0x0A, then ASSERT().
-
- @param Chr one Ascii character
-
- @return The uppercase value of Ascii character
-
-**/
-CHAR8
-EFIAPI
-AsciiCharToUpper (
- IN CHAR8 Chr
- )
-{
- return (UINT8) ((Chr >= 'a' && Chr <= 'z') ? Chr - ('a' - 'A') : Chr);
-}
-
-/**
- Convert a ASCII character to numerical value.
-
- This internal function only deal with Unicode character
- which maps to a valid hexadecimal ASII character, i.e.
- '0' to '9', 'a' to 'f' or 'A' to 'F'. For other
- ASCII character, the value returned does not make sense.
-
- @param Char The character to convert.
-
- @return The numerical value converted.
-
-**/
-UINTN
-EFIAPI
-InternalAsciiHexCharToUintn (
- IN CHAR8 Char
- )
-{
- if (InternalIsDecimalDigitCharacter (Char)) {
- return Char - '0';
- }
-
- return (10 + AsciiCharToUpper (Char) - 'A');
-}
-
-
-/**
- Performs a case insensitive comparison of two Null-terminated ASCII strings,
- and returns the difference between the first mismatched ASCII characters.
-
- This function performs a case insensitive comparison of the Null-terminated
- ASCII string FirstString to the Null-terminated ASCII string SecondString. If
- FirstString is identical to SecondString, then 0 is returned. Otherwise, the
- value returned is the first mismatched lower case ASCII character in
- SecondString subtracted from the first mismatched lower case ASCII character
- in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and SecondString contains more
- than PcdMaximumAsciiStringLength ASCII characters, not including the
- Null-terminator, then ASSERT().
-
- @param FirstString A pointer to a Null-terminated ASCII string.
- @param SecondString A pointer to a Null-terminated ASCII string.
-
- @retval ==0 FirstString is identical to SecondString using case insensitive
- comparisons.
- @retval !=0 FirstString is not identical to SecondString using case
- insensitive comparisons.
-
-**/
-INTN
-EFIAPI
-AsciiStriCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString
- )
-{
- CHAR8 UpperFirstString;
- CHAR8 UpperSecondString;
-
- //
- // ASSERT both strings are less long than PcdMaximumAsciiStringLength
- //
- ASSERT (AsciiStrSize (FirstString));
- ASSERT (AsciiStrSize (SecondString));
-
- UpperFirstString = AsciiCharToUpper (*FirstString);
- UpperSecondString = AsciiCharToUpper (*SecondString);
- while ((*FirstString != '\0') && (*SecondString != '\0') && (UpperFirstString == UpperSecondString)) {
- FirstString++;
- SecondString++;
- UpperFirstString = AsciiCharToUpper (*FirstString);
- UpperSecondString = AsciiCharToUpper (*SecondString);
- }
-
- return UpperFirstString - UpperSecondString;
-}
-
-/**
- Compares two Null-terminated ASCII strings with maximum lengths, and returns
- the difference between the first mismatched ASCII characters.
-
- This function compares the Null-terminated ASCII string FirstString to the
- Null-terminated ASCII string SecondString. At most, Length ASCII characters
- will be compared. If Length is 0, then 0 is returned. If FirstString is
- identical to SecondString, then 0 is returned. Otherwise, the value returned
- is the first mismatched ASCII character in SecondString subtracted from the
- first mismatched ASCII character in FirstString.
-
- If Length > 0 and FirstString is NULL, then ASSERT().
- If Length > 0 and SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and SecondString contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param FirstString A pointer to a Null-terminated ASCII string.
- @param SecondString A pointer to a Null-terminated ASCII string.
- @param Length The maximum number of ASCII characters for compare.
-
- @retval ==0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-AsciiStrnCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return 0;
- }
-
- //
- // ASSERT both strings are less long than PcdMaximumAsciiStringLength
- //
- ASSERT (AsciiStrSize (FirstString));
- ASSERT (AsciiStrSize (SecondString));
-
- if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
- ASSERT (Length <= PcdGet32 (PcdMaximumAsciiStringLength));
- }
-
- while ((*FirstString != '\0') &&
- (*SecondString != '\0') &&
- (*FirstString == *SecondString) &&
- (Length > 1)) {
- FirstString++;
- SecondString++;
- Length--;
- }
- return *FirstString - *SecondString;
-}
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Concatenates one Null-terminated ASCII string to another Null-terminated
- ASCII string, and returns the concatenated ASCII string.
-
- This function concatenates two Null-terminated ASCII strings. The contents of
- Null-terminated ASCII string Source are concatenated to the end of Null-
- terminated ASCII string Destination. The Null-terminated concatenated ASCII
- String is returned.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Destination contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and concatenating Destination and
- Source results in a ASCII string with more than PcdMaximumAsciiStringLength
- ASCII characters, then ASSERT().
-
- @param Destination A pointer to a Null-terminated ASCII string.
- @param Source A pointer to a Null-terminated ASCII string.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrCat (
- IN OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source
- )
-{
- AsciiStrCpy (Destination + AsciiStrLen (Destination), Source);
-
- //
- // Size of the resulting string should never be zero.
- // PcdMaximumUnicodeStringLength is tested inside StrLen().
- //
- ASSERT (AsciiStrSize (Destination) != 0);
- return Destination;
-}
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Concatenates up to a specified length one Null-terminated ASCII string to
- the end of another Null-terminated ASCII string, and returns the
- concatenated ASCII string.
-
- This function concatenates two Null-terminated ASCII strings. The contents
- of Null-terminated ASCII string Source are concatenated to the end of Null-
- terminated ASCII string Destination, and Destination is returned. At most,
- Length ASCII characters are concatenated from Source to the end of
- Destination, and Destination is always Null-terminated. If Length is 0, then
- Destination is returned unmodified. If Source and Destination overlap, then
- the results are undefined.
-
- If Length > 0 and Destination is NULL, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Destination contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and
- Source results in a ASCII string with more than PcdMaximumAsciiStringLength
- ASCII characters, not including the Null-terminator, then ASSERT().
-
- @param Destination A pointer to a Null-terminated ASCII string.
- @param Source A pointer to a Null-terminated ASCII string.
- @param Length The maximum number of ASCII characters to concatenate from
- Source.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrnCat (
- IN OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- )
-{
- UINTN DestinationLen;
-
- DestinationLen = AsciiStrLen (Destination);
- AsciiStrnCpy (Destination + DestinationLen, Source, Length);
- Destination[DestinationLen + Length] = '\0';
-
- //
- // Size of the resulting string should never be zero.
- // PcdMaximumUnicodeStringLength is tested inside StrLen().
- //
- ASSERT (AsciiStrSize (Destination) != 0);
- return Destination;
-}
-#endif
-
-/**
- Returns the first occurrence of a Null-terminated ASCII sub-string
- in a Null-terminated ASCII string.
-
- This function scans the contents of the ASCII string specified by String
- and returns the first occurrence of SearchString. If SearchString is not
- found in String, then NULL is returned. If the length of SearchString is zero,
- then String is returned.
-
- If String is NULL, then ASSERT().
- If SearchString is NULL, then ASSERT().
-
- If PcdMaximumAsciiStringLength is not zero, and SearchString or
- String contains more than PcdMaximumAsciiStringLength Unicode characters
- not including the Null-terminator, then ASSERT().
-
- @param String A pointer to a Null-terminated ASCII string.
- @param SearchString A pointer to a Null-terminated ASCII string to search for.
-
- @retval NULL If the SearchString does not appear in String.
- @retval others If there is a match return the first occurrence of SearchingString.
- If the length of SearchString is zero,return String.
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrStr (
- IN CONST CHAR8 *String,
- IN CONST CHAR8 *SearchString
- )
-{
- CONST CHAR8 *FirstMatch;
- CONST CHAR8 *SearchStringTmp;
-
- //
- // ASSERT both strings are less long than PcdMaximumAsciiStringLength
- //
- ASSERT (AsciiStrSize (String) != 0);
- ASSERT (AsciiStrSize (SearchString) != 0);
-
- if (*SearchString == '\0') {
- return (CHAR8 *) String;
- }
-
- while (*String != '\0') {
- SearchStringTmp = SearchString;
- FirstMatch = String;
-
- while ((*String == *SearchStringTmp)
- && (*String != '\0')) {
- String++;
- SearchStringTmp++;
- }
-
- if (*SearchStringTmp == '\0') {
- return (CHAR8 *) FirstMatch;
- }
-
- if (*String == '\0') {
- return NULL;
- }
-
- String = FirstMatch + 1;
- }
-
- return NULL;
-}
-
-/**
- Convert a Null-terminated ASCII decimal string to a value of type
- UINTN.
-
- This function returns a value of type UINTN by interpreting the contents
- of the ASCII string String as a decimal number. The format of the input
- ASCII string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before the digits.
- The running zero in the beginning of [decimal digits] will be ignored. Then, the
- function stops at the first character that is a not a valid decimal character or
- Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits, then 0 is returned.
- If the number represented by String overflows according to the range defined by
- UINTN, then MAX_UINTN is returned.
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String A pointer to a Null-terminated ASCII string.
-
- @retval Value translated from String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrDecimalToUintn (
- IN CONST CHAR8 *String
- )
-{
- UINTN Result;
-
- AsciiStrDecimalToUintnS (String, (CHAR8 **) NULL, &Result);
- return Result;
-}
-
-
-/**
- Convert a Null-terminated ASCII decimal string to a value of type
- UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the ASCII string String as a decimal number. The format of the input
- ASCII string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before the digits.
- The running zero in the beginning of [decimal digits] will be ignored. Then, the
- function stops at the first character that is a not a valid decimal character or
- Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits, then 0 is returned.
- If the number represented by String overflows according to the range defined by
- UINT64, then MAX_UINT64 is returned.
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String A pointer to a Null-terminated ASCII string.
-
- @retval Value translated from String.
-
-**/
-UINT64
-EFIAPI
-AsciiStrDecimalToUint64 (
- IN CONST CHAR8 *String
- )
-{
- UINT64 Result;
-
- AsciiStrDecimalToUint64S (String, (CHAR8 **) NULL, &Result);
- return Result;
-}
-
-/**
- Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
-
- This function returns a value of type UINTN by interpreting the contents of
- the ASCII string String as a hexadecimal number. The format of the input ASCII
- string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"
- appears in the input string, it must be prefixed with at least one 0. The function
- will ignore the pad space, which includes spaces or tab characters, before [zeros],
- [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits]
- will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal
- digit. Then, the function stops at the first character that is a not a valid
- hexadecimal character or Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
- 0 is returned.
-
- If the number represented by String overflows according to the range defined by UINTN,
- then MAX_UINTN is returned.
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
- the Null-terminator, then ASSERT().
-
- @param String A pointer to a Null-terminated ASCII string.
-
- @retval Value translated from String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrHexToUintn (
- IN CONST CHAR8 *String
- )
-{
- UINTN Result;
-
- AsciiStrHexToUintnS (String, (CHAR8 **) NULL, &Result);
- return Result;
-}
-
-
-/**
- Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents of
- the ASCII string String as a hexadecimal number. The format of the input ASCII
- string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"
- appears in the input string, it must be prefixed with at least one 0. The function
- will ignore the pad space, which includes spaces or tab characters, before [zeros],
- [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits]
- will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal
- digit. Then, the function stops at the first character that is a not a valid
- hexadecimal character or Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
- 0 is returned.
-
- If the number represented by String overflows according to the range defined by UINT64,
- then MAX_UINT64 is returned.
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
- the Null-terminator, then ASSERT().
-
- @param String A pointer to a Null-terminated ASCII string.
-
- @retval Value translated from String.
-
-**/
-UINT64
-EFIAPI
-AsciiStrHexToUint64 (
- IN CONST CHAR8 *String
- )
-{
- UINT64 Result;
-
- AsciiStrHexToUint64S (String, (CHAR8 **) NULL, &Result);
- return Result;
-}
-
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function is deprecated for security reason.
-
- Convert one Null-terminated ASCII string to a Null-terminated
- Unicode string and returns the Unicode string.
-
- This function converts the contents of the ASCII string Source to the Unicode
- string Destination, and returns Destination. The function terminates the
- Unicode string Destination by appending a Null-terminator character at the end.
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param Source A pointer to a Null-terminated ASCII string.
- @param Destination A pointer to a Null-terminated Unicode string.
-
- @return Destination.
-
-**/
-CHAR16 *
-EFIAPI
-AsciiStrToUnicodeStr (
- IN CONST CHAR8 *Source,
- OUT CHAR16 *Destination
- )
-{
- CHAR16 *ReturnValue;
-
- ASSERT (Destination != NULL);
-
- //
- // ASSERT Source is less long than PcdMaximumAsciiStringLength
- //
- ASSERT (AsciiStrSize (Source) != 0);
-
- //
- // Source and Destination should not overlap
- //
- ASSERT ((UINTN) ((CHAR8 *) Destination - Source) > AsciiStrLen (Source));
- ASSERT ((UINTN) (Source - (CHAR8 *) Destination) >= (AsciiStrSize (Source) * sizeof (CHAR16)));
-
-
- ReturnValue = Destination;
- while (*Source != '\0') {
- *(Destination++) = (CHAR16)(UINT8) *(Source++);
- }
- //
- // End the Destination with a NULL.
- //
- *Destination = '\0';
-
- //
- // ASSERT Original Destination is less long than PcdMaximumUnicodeStringLength
- //
- ASSERT (StrSize (ReturnValue) != 0);
-
- return ReturnValue;
-}
-
-#endif
-
-//
-// The basis for Base64 encoding is RFC 4686 https://tools.ietf.org/html/rfc4648
-//
-// RFC 4686 has a number of MAY and SHOULD cases. This implementation chooses
-// the more restrictive versions for security concerns (see RFC 4686 section 3.3).
-//
-// A invalid character, if encountered during the decode operation, causes the data
-// to be rejected. In addition, the '=' padding character is only allowed at the end
-// of the Base64 encoded string.
-//
-#define BAD_V 99
-
-STATIC CHAR8 EncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz"
- "0123456789+/";
-
-STATIC UINT8 DecodingTable[] = {
- //
- // Valid characters ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
- // Also, set '=' as a zero for decoding
- // 0 , 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // 0
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // 10
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, 62, BAD_V, BAD_V, BAD_V, 63, // 20
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, BAD_V, BAD_V, BAD_V, 0, BAD_V, BAD_V, // 30
- BAD_V, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // 40
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // 50
- BAD_V, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, // 60
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // 70
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // 80
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // 90
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // a0
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // b0
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // c0
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // d0
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, // d0
- BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V, BAD_V // f0
-};
-
-/**
- Convert binary data to a Base64 encoded ascii string based on RFC4648.
-
- Produce a Null-terminated Ascii string in the output buffer specified by Destination and DestinationSize.
- The Ascii string is produced by converting the data string specified by Source and SourceLength.
-
- @param Source Input UINT8 data
- @param SourceLength Number of UINT8 bytes of data
- @param Destination Pointer to output string buffer
- @param DestinationSize Size of ascii buffer. Set to 0 to get the size needed.
- Caller is responsible for passing in buffer of DestinationSize
-
- @retval RETURN_SUCCESS When ascii buffer is filled in.
- @retval RETURN_INVALID_PARAMETER If Source is NULL or DestinationSize is NULL.
- @retval RETURN_INVALID_PARAMETER If SourceLength or DestinationSize is bigger than (MAX_ADDRESS - (UINTN)Destination).
- @retval RETURN_BUFFER_TOO_SMALL If SourceLength is 0 and DestinationSize is <1.
- @retval RETURN_BUFFER_TOO_SMALL If Destination is NULL or DestinationSize is smaller than required buffersize.
-
-**/
-RETURN_STATUS
-EFIAPI
-Base64Encode (
- IN CONST UINT8 *Source,
- IN UINTN SourceLength,
- OUT CHAR8 *Destination OPTIONAL,
- IN OUT UINTN *DestinationSize
- )
-{
-
- UINTN RequiredSize;
- UINTN Left;
-
- //
- // Check pointers, and SourceLength is valid
- //
- if ((Source == NULL) || (DestinationSize == NULL)) {
- return RETURN_INVALID_PARAMETER;
- }
-
- //
- // Allow for RFC 4648 test vector 1
- //
- if (SourceLength == 0) {
- if (*DestinationSize < 1) {
- *DestinationSize = 1;
- return RETURN_BUFFER_TOO_SMALL;
- }
- *DestinationSize = 1;
- *Destination = '\0';
- return RETURN_SUCCESS;
- }
-
- //
- // Check if SourceLength or DestinationSize is valid
- //
- if ((SourceLength >= (MAX_ADDRESS - (UINTN)Source)) || (*DestinationSize >= (MAX_ADDRESS - (UINTN)Destination))){
- return RETURN_INVALID_PARAMETER;
- }
-
- //
- // 4 ascii per 3 bytes + NULL
- //
- RequiredSize = ((SourceLength + 2) / 3) * 4 + 1;
- if ((Destination == NULL) || *DestinationSize < RequiredSize) {
- *DestinationSize = RequiredSize;
- return RETURN_BUFFER_TOO_SMALL;
- }
-
- Left = SourceLength;
-
- //
- // Encode 24 bits (three bytes) into 4 ascii characters
- //
- while (Left >= 3) {
-
- *Destination++ = EncodingTable[( Source[0] & 0xfc) >> 2 ];
- *Destination++ = EncodingTable[((Source[0] & 0x03) << 4) + ((Source[1] & 0xf0) >> 4)];
- *Destination++ = EncodingTable[((Source[1] & 0x0f) << 2) + ((Source[2] & 0xc0) >> 6)];
- *Destination++ = EncodingTable[( Source[2] & 0x3f)];
- Left -= 3;
- Source += 3;
- }
-
- //
- // Handle the remainder, and add padding '=' characters as necessary.
- //
- switch (Left) {
- case 0:
-
- //
- // No bytes Left, done.
- //
- break;
- case 1:
-
- //
- // One more data byte, two pad characters
- //
- *Destination++ = EncodingTable[( Source[0] & 0xfc) >> 2];
- *Destination++ = EncodingTable[((Source[0] & 0x03) << 4)];
- *Destination++ = '=';
- *Destination++ = '=';
- break;
- case 2:
-
- //
- // Two more data bytes, and one pad character
- //
- *Destination++ = EncodingTable[( Source[0] & 0xfc) >> 2];
- *Destination++ = EncodingTable[((Source[0] & 0x03) << 4) + ((Source[1] & 0xf0) >> 4)];
- *Destination++ = EncodingTable[((Source[1] & 0x0f) << 2)];
- *Destination++ = '=';
- break;
- }
- //
- // Add terminating NULL
- //
- *Destination = '\0';
- return RETURN_SUCCESS;
-}
-
-/**
- Convert Base64 ascii string to binary data based on RFC4648.
-
- Produce Null-terminated binary data in the output buffer specified by Destination and DestinationSize.
- The binary data is produced by converting the Base64 ascii string specified by Source and SourceLength.
-
- @param Source Input ASCII characters
- @param SourceLength Number of ASCII characters
- @param Destination Pointer to output buffer
- @param DestinationSize Caller is responsible for passing in buffer of at least DestinationSize.
- Set 0 to get the size needed. Set to bytes stored on return.
-
- @retval RETURN_SUCCESS When binary buffer is filled in.
- @retval RETURN_INVALID_PARAMETER If Source is NULL or DestinationSize is NULL.
- @retval RETURN_INVALID_PARAMETER If SourceLength or DestinationSize is bigger than (MAX_ADDRESS -(UINTN)Destination ).
- @retval RETURN_INVALID_PARAMETER If there is any invalid character in input stream.
- @retval RETURN_BUFFER_TOO_SMALL If buffer length is smaller than required buffer size.
- **/
-RETURN_STATUS
-EFIAPI
-Base64Decode (
- IN CONST CHAR8 *Source,
- IN UINTN SourceLength,
- OUT UINT8 *Destination OPTIONAL,
- IN OUT UINTN *DestinationSize
- )
-{
-
- UINT32 Value;
- CHAR8 Chr;
- INTN BufferSize;
- UINTN SourceIndex;
- UINTN DestinationIndex;
- UINTN Index;
- UINTN ActualSourceLength;
-
- //
- // Check pointers are not NULL
- //
- if ((Source == NULL) || (DestinationSize == NULL)) {
- return RETURN_INVALID_PARAMETER;
- }
-
- //
- // Check if SourceLength or DestinationSize is valid
- //
- if ((SourceLength >= (MAX_ADDRESS - (UINTN)Source)) || (*DestinationSize >= (MAX_ADDRESS - (UINTN)Destination))){
- return RETURN_INVALID_PARAMETER;
- }
-
- ActualSourceLength = 0;
- BufferSize = 0;
-
- //
- // Determine the actual number of valid characters in the string.
- // All invalid characters except selected white space characters,
- // will cause the Base64 string to be rejected. White space to allow
- // properly formatted XML will be ignored.
- //
- // See section 3.3 of RFC 4648.
- //
- for (SourceIndex = 0; SourceIndex < SourceLength; SourceIndex++) {
-
- //
- // '=' is part of the quantum
- //
- if (Source[SourceIndex] == '=') {
- ActualSourceLength++;
- BufferSize--;
-
- //
- // Only two '=' characters can be valid.
- //
- if (BufferSize < -2) {
- return RETURN_INVALID_PARAMETER;
- }
- }
- else {
- Chr = Source[SourceIndex];
- if (BAD_V != DecodingTable[(UINT8) Chr]) {
-
- //
- // The '=' characters are only valid at the end, so any
- // valid character after an '=', will be flagged as an error.
- //
- if (BufferSize < 0) {
- return RETURN_INVALID_PARAMETER;
- }
- ActualSourceLength++;
- }
- else {
-
- //
- // The reset of the decoder will ignore all invalid characters allowed here.
- // Ignoring selected white space is useful. In this case, the decoder will
- // ignore ' ', '\t', '\n', and '\r'.
- //
- if ((Chr != ' ') &&(Chr != '\t') &&(Chr != '\n') &&(Chr != '\r')) {
- return RETURN_INVALID_PARAMETER;
- }
- }
- }
- }
-
- //
- // The Base64 character string must be a multiple of 4 character quantums.
- //
- if (ActualSourceLength % 4 != 0) {
- return RETURN_INVALID_PARAMETER;
- }
-
- BufferSize += ActualSourceLength / 4 * 3;
- if (BufferSize < 0) {
- return RETURN_INVALID_PARAMETER;
- }
-
- //
- // BufferSize is >= 0
- //
- if ((Destination == NULL) || (*DestinationSize < (UINTN) BufferSize)) {
- *DestinationSize = BufferSize;
- return RETURN_BUFFER_TOO_SMALL;
- }
-
- //
- // If no decodable characters, return a size of zero. RFC 4686 test vector 1.
- //
- if (ActualSourceLength == 0) {
- *DestinationSize = 0;
- return RETURN_SUCCESS;
- }
-
- //
- // Input data is verified to be a multiple of 4 valid charcters. Process four
- // characters at a time. Uncounted (ie. invalid) characters will be ignored.
- //
- for (SourceIndex = 0, DestinationIndex = 0; (SourceIndex < SourceLength) && (DestinationIndex < *DestinationSize); ) {
- Value = 0;
-
- //
- // Get 24 bits of data from 4 input characters, each character representing 6 bits
- //
- for (Index = 0; Index < 4; Index++) {
- do {
- Chr = DecodingTable[(UINT8) Source[SourceIndex++]];
- } while (Chr == BAD_V);
- Value <<= 6;
- Value |= (UINT32)Chr;
- }
-
- //
- // Store 3 bytes of binary data (24 bits)
- //
- *Destination++ = (UINT8) (Value >> 16);
- DestinationIndex++;
-
- //
- // Due to the '=' special cases for the two bytes at the end,
- // we have to check the length and not store the padding data
- //
- if (DestinationIndex++ < *DestinationSize) {
- *Destination++ = (UINT8) (Value >> 8);
- }
- if (DestinationIndex++ < *DestinationSize) {
- *Destination++ = (UINT8) Value;
- }
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Converts an 8-bit value to an 8-bit BCD value.
-
- Converts the 8-bit value specified by Value to BCD. The BCD value is
- returned.
-
- If Value >= 100, then ASSERT().
-
- @param Value The 8-bit value to convert to BCD. Range 0..99.
-
- @return The BCD value.
-
-**/
-UINT8
-EFIAPI
-DecimalToBcd8 (
- IN UINT8 Value
- )
-{
- ASSERT (Value < 100);
- return (UINT8) (((Value / 10) << 4) | (Value % 10));
-}
-
-/**
- Converts an 8-bit BCD value to an 8-bit value.
-
- Converts the 8-bit BCD value specified by Value to an 8-bit value. The 8-bit
- value is returned.
-
- If Value >= 0xA0, then ASSERT().
- If (Value & 0x0F) >= 0x0A, then ASSERT().
-
- @param Value The 8-bit BCD value to convert to an 8-bit value.
-
- @return The 8-bit value is returned.
-
-**/
-UINT8
-EFIAPI
-BcdToDecimal8 (
- IN UINT8 Value
- )
-{
- ASSERT (Value < 0xa0);
- ASSERT ((Value & 0xf) < 0xa);
- return (UINT8) ((Value >> 4) * 10 + (Value & 0xf));
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwapBytes16.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwapBytes16.c
deleted file mode 100644
index 39373bd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwapBytes16.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Switches the endianess of a 16-bit integer.
-
- This function swaps the bytes in a 16-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Value A 16-bit unsigned value.
-
- @return The byte swapped Value.
-
-**/
-UINT16
-EFIAPI
-SwapBytes16 (
- IN UINT16 Value
- )
-{
- return (UINT16) ((Value<< 8) | (Value>> 8));
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwapBytes32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwapBytes32.c
deleted file mode 100644
index a0aecf5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwapBytes32.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Switches the endianess of a 32-bit integer.
-
- This function swaps the bytes in a 32-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Value A 32-bit unsigned value.
-
- @return The byte swapped Value.
-
-**/
-UINT32
-EFIAPI
-SwapBytes32 (
- IN UINT32 Value
- )
-{
- UINT32 LowerBytes;
- UINT32 HigherBytes;
-
- LowerBytes = (UINT32) SwapBytes16 ((UINT16) Value);
- HigherBytes = (UINT32) SwapBytes16 ((UINT16) (Value >> 16));
-
- return (LowerBytes << 16 | HigherBytes);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwapBytes64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwapBytes64.c
deleted file mode 100644
index 946fc83..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwapBytes64.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- Math worker functions.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Switches the endianess of a 64-bit integer.
-
- This function swaps the bytes in a 64-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Value A 64-bit unsigned value.
-
- @return The byte swapped Value.
-
-**/
-UINT64
-EFIAPI
-SwapBytes64 (
- IN UINT64 Value
- )
-{
- return InternalMathSwapBytes64 (Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwitchStack.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwitchStack.c
deleted file mode 100644
index 656c673..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/SwitchStack.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
- Switch Stack functions.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the
- new stack specified by NewStack and passing in the parameters specified
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return. This function
- supports a variable number of arguments following the NewStack parameter.
- These additional arguments are ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param ... This variable argument list is ignored for IA32, x64, and EBC.
- For IPF, this variable argument list is expected to contain
- a single parameter of type VOID * that specifies the new backing
- store pointer.
-
-
-**/
-VOID
-EFIAPI
-SwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- ...
- )
-{
- VA_LIST Marker;
-
- ASSERT (EntryPoint != NULL);
- ASSERT (NewStack != NULL);
-
- //
- // New stack must be aligned with CPU_STACK_ALIGNMENT
- //
- ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
-
- VA_START (Marker, NewStack);
-
- InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker);
-
- VA_END (Marker);
-
- //
- // InternalSwitchStack () will never return
- //
- ASSERT (FALSE);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Unaligned.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Unaligned.c
deleted file mode 100644
index 04249c8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/Unaligned.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/** @file
- Unaligned access functions of BaseLib.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-/**
- Reads a 16-bit value from memory that may be unaligned.
-
- This function returns the 16-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer A pointer to a 16-bit value that may be unaligned.
-
- @return The 16-bit value read from Buffer.
-
-**/
-UINT16
-EFIAPI
-ReadUnaligned16 (
- IN CONST UINT16 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer;
-}
-
-/**
- Writes a 16-bit value to memory that may be unaligned.
-
- This function writes the 16-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer A pointer to a 16-bit value that may be unaligned.
- @param Value 16-bit value to write to Buffer.
-
- @return The 16-bit value to write to Buffer.
-
-**/
-UINT16
-EFIAPI
-WriteUnaligned16 (
- OUT UINT16 *Buffer,
- IN UINT16 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer = Value;
-}
-
-/**
- Reads a 24-bit value from memory that may be unaligned.
-
- This function returns the 24-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer A pointer to a 24-bit value that may be unaligned.
-
- @return The 24-bit value read from Buffer.
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned24 (
- IN CONST UINT32 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer & 0xffffff;
-}
-
-/**
- Writes a 24-bit value to memory that may be unaligned.
-
- This function writes the 24-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer A pointer to a 24-bit value that may be unaligned.
- @param Value 24-bit value to write to Buffer.
-
- @return The 24-bit value to write to Buffer.
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned24 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- *Buffer = BitFieldWrite32 (*Buffer, 0, 23, Value);
- return Value;
-}
-
-/**
- Reads a 32-bit value from memory that may be unaligned.
-
- This function returns the 32-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer A pointer to a 32-bit value that may be unaligned.
-
- @return The 32-bit value read from Buffer.
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned32 (
- IN CONST UINT32 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer;
-}
-
-/**
- Writes a 32-bit value to memory that may be unaligned.
-
- This function writes the 32-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer A pointer to a 32-bit value that may be unaligned.
- @param Value The 32-bit value to write to Buffer.
-
- @return The 32-bit value to write to Buffer.
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned32 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer = Value;
-}
-
-/**
- Reads a 64-bit value from memory that may be unaligned.
-
- This function returns the 64-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer A pointer to a 64-bit value that may be unaligned.
-
- @return The 64-bit value read from Buffer.
-
-**/
-UINT64
-EFIAPI
-ReadUnaligned64 (
- IN CONST UINT64 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer;
-}
-
-/**
- Writes a 64-bit value to memory that may be unaligned.
-
- This function writes the 64-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer A pointer to a 64-bit value that may be unaligned.
- @param Value The 64-bit value to write to Buffer.
-
- @return The 64-bit value to write to Buffer.
-
-**/
-UINT64
-EFIAPI
-WriteUnaligned64 (
- OUT UINT64 *Buffer,
- IN UINT64 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer = Value;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
deleted file mode 100644
index 2f08ca9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- CpuBreakpoint function.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-/**
- Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
-**/
-
-void __debugbreak (VOID);
-
-#pragma intrinsic(__debugbreak)
-
-/**
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-**/
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- )
-{
- __debugbreak ();
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuBreakpoint.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuBreakpoint.nasm
deleted file mode 100644
index d39f8fe..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuBreakpoint.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuBreakpoint.Asm
-;
-; Abstract:
-;
-; CpuBreakpoint function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuBreakpoint (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(CpuBreakpoint)
-ASM_PFX(CpuBreakpoint):
- int 3
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuId.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuId.S
deleted file mode 100644
index 19ae1c7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuId.S
+++ /dev/null
@@ -1,60 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuId.S
-#
-# Abstract:
-#
-# AsmCpuid function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmCpuid (
-# IN UINT32 RegisterInEax,
-# OUT UINT32 *RegisterOutEax OPTIONAL,
-# OUT UINT32 *RegisterOutEbx OPTIONAL,
-# OUT UINT32 *RegisterOutEcx OPTIONAL,
-# OUT UINT32 *RegisterOutEdx OPTIONAL
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmCpuid)
-ASM_PFX(AsmCpuid):
- push %rbx
- mov %ecx, %eax
- push %rax # save Index on stack
- push %rdx
- cpuid
- test %r9, %r9
- jz L1
- mov %ecx, (%r9)
-L1:
- pop %rcx
- jrcxz L2
- mov %eax, (%rcx)
-L2:
- mov %r8, %rcx
- jrcxz L3
- mov %ebx, (%rcx)
-L3:
- mov 0x38(%rsp), %rcx
- jrcxz L4
- mov %edx, (%rcx)
-L4:
- pop %rax # restore Index to rax as return value
- pop %rbx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuId.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuId.nasm
deleted file mode 100644
index 3f3060f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuId.nasm
+++ /dev/null
@@ -1,64 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuId.Asm
-;
-; Abstract:
-;
-; AsmCpuid function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmCpuid (
-; IN UINT32 RegisterInEax,
-; OUT UINT32 *RegisterOutEax OPTIONAL,
-; OUT UINT32 *RegisterOutEbx OPTIONAL,
-; OUT UINT32 *RegisterOutEcx OPTIONAL,
-; OUT UINT32 *RegisterOutEdx OPTIONAL
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmCpuid)
-ASM_PFX(AsmCpuid):
- push rbx
- mov eax, ecx
- push rax ; save Index on stack
- push rdx
- cpuid
- test r9, r9
- jz .0
- mov [r9], ecx
-.0:
- pop rcx
- jrcxz .1
- mov [rcx], eax
-.1:
- mov rcx, r8
- jrcxz .2
- mov [rcx], ebx
-.2:
- mov rcx, [rsp + 0x38]
- jrcxz .3
- mov [rcx], edx
-.3:
- pop rax ; restore Index to rax as return value
- pop rbx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuIdEx.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuIdEx.S
deleted file mode 100644
index c41456f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuIdEx.S
+++ /dev/null
@@ -1,62 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CpuIdEx.S
-#
-# Abstract:
-#
-# AsmCpuidEx function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# AsmCpuidEx (
-# IN UINT32 RegisterInEax,
-# IN UINT32 RegisterInEcx,
-# OUT UINT32 *RegisterOutEax OPTIONAL,
-# OUT UINT32 *RegisterOutEbx OPTIONAL,
-# OUT UINT32 *RegisterOutEcx OPTIONAL,
-# OUT UINT32 *RegisterOutEdx OPTIONAL
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmCpuidEx)
-ASM_PFX(AsmCpuidEx):
- push %rbx
- movl %ecx,%eax
- movl %edx,%ecx
- push %rax # save Index on stack
- cpuid
- mov 0x38(%rsp), %r10
- test %r10, %r10
- jz L1
- mov %ecx,(%r10)
-L1:
- mov %r8, %rcx
- jrcxz L2
- movl %eax,(%rcx)
-L2:
- mov %r9, %rcx
- jrcxz L3
- mov %ebx, (%rcx)
-L3:
- mov 0x40(%rsp), %rcx
- jrcxz L4
- mov %edx, (%rcx)
-L4:
- pop %rax # restore Index to rax as return value
- pop %rbx
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuIdEx.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuIdEx.nasm
deleted file mode 100644
index 624b8df..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuIdEx.nasm
+++ /dev/null
@@ -1,66 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuIdEx.Asm
-;
-; Abstract:
-;
-; AsmCpuidEx function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; AsmCpuidEx (
-; IN UINT32 RegisterInEax,
-; IN UINT32 RegisterInEcx,
-; OUT UINT32 *RegisterOutEax OPTIONAL,
-; OUT UINT32 *RegisterOutEbx OPTIONAL,
-; OUT UINT32 *RegisterOutEcx OPTIONAL,
-; OUT UINT32 *RegisterOutEdx OPTIONAL
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmCpuidEx)
-ASM_PFX(AsmCpuidEx):
- push rbx
- mov eax, ecx
- mov ecx, edx
- push rax ; save Index on stack
- cpuid
- mov r10, [rsp + 0x38]
- test r10, r10
- jz .0
- mov [r10], ecx
-.0:
- mov rcx, r8
- jrcxz .1
- mov [rcx], eax
-.1:
- mov rcx, r9
- jrcxz .2
- mov [rcx], ebx
-.2:
- mov rcx, [rsp + 0x40]
- jrcxz .3
- mov [rcx], edx
-.3:
- pop rax ; restore Index to rax as return value
- pop rbx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuPause.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuPause.nasm
deleted file mode 100644
index 83efe57..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/CpuPause.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CpuPause.Asm
-;
-; Abstract:
-;
-; CpuPause function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuPause (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(CpuPause)
-ASM_PFX(CpuPause):
- pause
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisableCache.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisableCache.S
deleted file mode 100644
index 45c1a22..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisableCache.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# DisableCache.S
-#
-# Abstract:
-#
-# Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a
-# WBINVD instruction.
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmDisableCache (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmDisableCache)
-ASM_PFX(AsmDisableCache):
- movq %cr0, %rax
- btsq $30, %rax
- btrq $29, %rax
- movq %rax, %cr0
- wbinvd
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisableCache.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisableCache.nasm
deleted file mode 100644
index 9f565b1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisableCache.nasm
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; DisableCache.Asm
-;
-; Abstract:
-;
-; Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a
-; WBINVD instruction.
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmDisableCache (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmDisableCache)
-ASM_PFX(AsmDisableCache):
- mov rax, cr0
- bts rax, 30
- btr rax, 29
- mov cr0, rax
- wbinvd
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisableInterrupts.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisableInterrupts.nasm
deleted file mode 100644
index eb11e14..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisableInterrupts.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; DisableInterrupts.Asm
-;
-; Abstract:
-;
-; DisableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; DisableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(DisableInterrupts)
-ASM_PFX(DisableInterrupts):
- cli
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisablePaging64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisablePaging64.S
deleted file mode 100644
index ecf580b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisablePaging64.S
+++ /dev/null
@@ -1,82 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# DisablePaging64.S
-#
-# Abstract:
-#
-# AsmDisablePaging64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86DisablePaging64 (
-# IN UINT16 Cs,
-# IN UINT32 EntryPoint,
-# IN UINT32 Context1, OPTIONAL
-# IN UINT32 Context2, OPTIONAL
-# IN UINT32 NewStack
-# );
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalX86DisablePaging64)
-ASM_PFX(InternalX86DisablePaging64):
- cli
- lea L1(%rip), %rsi # rsi <- The start address of transition code
- mov 0x28(%rsp), %edi # rdi <- New stack
- lea _mTransitionEnd(%rip), %rax # rax <- end of transition code
- sub %rsi, %rax # rax <- The size of transition piece code
- add $4, %rax # round rax up to the next 4 byte boundary
- and $0xfc, %al
- sub %rax, %rdi # rdi <- use stack to hold transition code
- mov %edi, %r10d # r10 <- The start address of transicition code below 4G
- push %rcx # save rcx to stack
- mov %rax, %rcx # rcx <- The size of transition piece code
- rep
- movsb # copy transition code to (new stack - 64byte) below 4G
- pop %rcx # restore rcx
-
- mov %r8d, %esi
- mov %r9d, %edi
- mov %r10d, %eax
- sub $4, %eax
- push %rcx # push Cs to stack
- push %r10 # push address of transition code on stack
- .byte 0x48, 0xcb # retq: Use far return to load CS register from stack
- # (Use raw byte code since some GNU assemblers generates incorrect code for "retq")
-L1:
- mov %eax,%esp # set up new stack
- mov %cr0,%rax
- btr $0x1f,%eax # clear CR0.PG
- mov %rax,%cr0 # disable paging
-
- mov %edx,%ebx # save EntryPoint to ebx, for rdmsr will overwrite edx
- mov $0xc0000080,%ecx
- rdmsr
- and $0xfe,%ah # clear LME
- wrmsr
- mov %cr4,%rax
- and $0xdf,%al # clear PAE
- mov %rax,%cr4
- push %rdi # push Context2
- push %rsi # push Context1
- callq *%rbx # transfer control to EntryPoint
- jmp . # no one should get here
-
-_mTransitionEnd :
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisablePaging64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisablePaging64.nasm
deleted file mode 100644
index 9410b35..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/DisablePaging64.nasm
+++ /dev/null
@@ -1,84 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; DisablePaging64.Asm
-;
-; Abstract:
-;
-; AsmDisablePaging64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86DisablePaging64 (
-; IN UINT16 Cs,
-; IN UINT32 EntryPoint,
-; IN UINT32 Context1, OPTIONAL
-; IN UINT32 Context2, OPTIONAL
-; IN UINT32 NewStack
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86DisablePaging64)
-ASM_PFX(InternalX86DisablePaging64):
- cli
- lea rsi, [.0] ; rsi <- The start address of transition code
- mov edi, [rsp + 0x28] ; rdi <- New stack
- lea rax, [mTransitionEnd] ; rax <- end of transition code
- sub rax, rsi ; rax <- The size of transition piece code
- add rax, 4 ; Round RAX up to the next 4 byte boundary
- and al, 0xfc
- sub rdi, rax ; rdi <- Use stack to hold transition code
- mov r10d, edi ; r10 <- The start address of transicition code below 4G
- push rcx ; save rcx to stack
- mov rcx, rax ; rcx <- The size of transition piece code
- rep movsb ; copy transition code to top of new stack which must be below 4GB
- pop rcx ; restore rcx
-
- mov esi, r8d
- mov edi, r9d
- mov eax, r10d ; eax <- start of the transition code on the stack
- sub eax, 4 ; eax <- One slot below transition code on the stack
- push rcx ; push Cs to stack
- push r10 ; push address of tansition code on stack
- DB 0x48 ; prefix to composite "retq" with next "retf"
- retf ; Use far return to load CS register from stack
-
-; Start of transition code
-.0:
- mov esp, eax ; set up new stack
- mov rax, cr0
- btr eax, 31 ; Clear CR0.PG
- mov cr0, rax ; disable paging and caches
-
- mov ebx, edx ; save EntryPoint to rbx, for rdmsr will overwrite rdx
- mov ecx, 0xc0000080
- rdmsr
- and ah, ~ 1 ; clear LME
- wrmsr
- mov rax, cr4
- and al, ~ (1 << 5) ; clear PAE
- mov cr4, rax
- push rdi ; push Context2
- push rsi ; push Context1
- call rbx ; transfer control to EntryPoint
- hlt ; no one should get here
-
-mTransitionEnd:
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableCache.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableCache.S
deleted file mode 100644
index 9af08df..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableCache.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# EnableCache.S
-#
-# Abstract:
-#
-# Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear
-# the NW bit of CR0 to 0
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmEnableCache (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(AsmEnableCache)
-ASM_PFX(AsmEnableCache):
- wbinvd
- movq %cr0, %rax
- btrq $30, %rax
- btrq $29, %rax
- movq %rax, %cr0
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableCache.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableCache.nasm
deleted file mode 100644
index 317ee8c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableCache.nasm
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; EnableCache.Asm
-;
-; Abstract:
-;
-; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear
-; the NW bit of CR0 to 0
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmEnableCache (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmEnableCache)
-ASM_PFX(AsmEnableCache):
- wbinvd
- mov rax, cr0
- btr rax, 29
- btr rax, 30
- mov cr0, rax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.S
deleted file mode 100644
index 0ffc6e9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# EnableDisableInterrupts.S
-#
-# Abstract:
-#
-# EnableDisableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# EnableDisableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(EnableDisableInterrupts)
-ASM_PFX(EnableDisableInterrupts):
- sti
- cli
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.nasm
deleted file mode 100644
index ad90580..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; EnableDisableInterrupts.Asm
-;
-; Abstract:
-;
-; EnableDisableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; EnableDisableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(EnableDisableInterrupts)
-ASM_PFX(EnableDisableInterrupts):
- sti
- cli
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableInterrupts.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableInterrupts.nasm
deleted file mode 100644
index 2b9f67c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/EnableInterrupts.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; EnableInterrupts.Asm
-;
-; Abstract:
-;
-; EnableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; EnableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(EnableInterrupts)
-ASM_PFX(EnableInterrupts):
- sti
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/FlushCacheLine.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/FlushCacheLine.nasm
deleted file mode 100644
index 6fff993..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/FlushCacheLine.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; FlushCacheLine.Asm
-;
-; Abstract:
-;
-; AsmFlushCacheLine function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; AsmFlushCacheLine (
-; IN VOID *LinearAddress
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmFlushCacheLine)
-ASM_PFX(AsmFlushCacheLine):
- clflush [rcx]
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/FxRestore.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/FxRestore.nasm
deleted file mode 100644
index 6b2db0e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/FxRestore.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; FxRestore.Asm
-;
-; Abstract:
-;
-; AsmFxRestore function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86FxRestore (
-; IN CONST IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86FxRestore)
-ASM_PFX(InternalX86FxRestore):
- fxrstor [rcx]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/FxSave.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/FxSave.nasm
deleted file mode 100644
index f729b3a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/FxSave.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; FxSave.Asm
-;
-; Abstract:
-;
-; AsmFxSave function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86FxSave (
-; OUT IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86FxSave)
-ASM_PFX(InternalX86FxSave):
- fxsave [rcx]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/GccInline.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/GccInline.c
deleted file mode 100644
index f8a9ff8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/GccInline.c
+++ /dev/null
@@ -1,1806 +0,0 @@
-/** @file
- GCC inline implementation of BaseLib processor specific functions.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-
-
-/**
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-**/
-VOID
-EFIAPI
-MemoryFence (
- VOID
- )
-{
- // This is a little bit of overkill and it is more about the compiler that it is
- // actually processor synchronization. This is like the _ReadWriteBarrier
- // Microsoft specific intrinsic
- __asm__ __volatile__ ("":::"memory");
-}
-
-
-/**
- Enables CPU interrupts.
-
- Enables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-EnableInterrupts (
- VOID
- )
-{
- __asm__ __volatile__ ("sti"::: "memory");
-}
-
-
-/**
- Disables CPU interrupts.
-
- Disables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-DisableInterrupts (
- VOID
- )
-{
- __asm__ __volatile__ ("cli"::: "memory");
-}
-
-
-
-
-/**
- Requests CPU to pause for a short period of time.
-
- Requests CPU to pause for a short period of time. Typically used in MP
- systems to prevent memory starvation while waiting for a spin lock.
-
-**/
-VOID
-EFIAPI
-CpuPause (
- VOID
- )
-{
- __asm__ __volatile__ ("pause");
-}
-
-
-/**
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-**/
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- )
-{
- __asm__ __volatile__ ("int $3");
-}
-
-
-
-/**
- Returns a 64-bit Machine Specific Register(MSR).
-
- Reads and returns the 64-bit MSR specified by Index. No parameter checking is
- performed on Index, and some Index values may cause CPU exceptions. The
- caller must either guarantee that Index is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and X64.
-
- @param Index The 32-bit MSR index to read.
-
- @return The value of the MSR identified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadMsr64 (
- IN UINT32 Index
- )
-{
- UINT32 LowData;
- UINT32 HighData;
-
- __asm__ __volatile__ (
- "rdmsr"
- : "=a" (LowData), // %0
- "=d" (HighData) // %1
- : "c" (Index) // %2
- );
-
- return (((UINT64)HighData) << 32) | LowData;
-}
-
-/**
- Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
- value.
-
- Writes the 64-bit value specified by Value to the MSR specified by Index. The
- 64-bit value written to the MSR is returned. No parameter checking is
- performed on Index or Value, and some of these may cause CPU exceptions. The
- caller must either guarantee that Index and Value are valid, or the caller
- must establish proper exception handlers. This function is only available on
- IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param Value The 64-bit value to write to the MSR.
-
- @return Value
-
-**/
-UINT64
-EFIAPI
-AsmWriteMsr64 (
- IN UINT32 Index,
- IN UINT64 Value
- )
-{
- UINT32 LowData;
- UINT32 HighData;
-
- LowData = (UINT32)(Value);
- HighData = (UINT32)(Value >> 32);
-
- __asm__ __volatile__ (
- "wrmsr"
- :
- : "c" (Index),
- "a" (LowData),
- "d" (HighData)
- );
-
- return Value;
-}
-
-
-
-/**
- Reads the current value of the EFLAGS register.
-
- Reads and returns the current value of the EFLAGS register. This function is
- only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a
- 64-bit value on X64.
-
- @return EFLAGS on IA-32 or RFLAGS on X64.
-
-**/
-UINTN
-EFIAPI
-AsmReadEflags (
- VOID
- )
-{
- UINTN Eflags;
-
- __asm__ __volatile__ (
- "pushfq \n\t"
- "pop %0 "
- : "=r" (Eflags) // %0
- );
-
- return Eflags;
-}
-
-
-
-/**
- Reads the current value of the Control Register 0 (CR0).
-
- Reads and returns the current value of CR0. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 0 (CR0).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr0 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%cr0,%0"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of the Control Register 2 (CR2).
-
- Reads and returns the current value of CR2. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 2 (CR2).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr2 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%cr2, %0"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-/**
- Reads the current value of the Control Register 3 (CR3).
-
- Reads and returns the current value of CR3. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 3 (CR3).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr3 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%cr3, %0"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of the Control Register 4 (CR4).
-
- Reads and returns the current value of CR4. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 4 (CR4).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr4 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%cr4, %0"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Writes a value to Control Register 0 (CR0).
-
- Writes and returns a new value to CR0. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr0 The value to write to CR0.
-
- @return The value written to CR0.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr0 (
- UINTN Cr0
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%cr0"
- :
- : "r" (Cr0)
- );
- return Cr0;
-}
-
-
-/**
- Writes a value to Control Register 2 (CR2).
-
- Writes and returns a new value to CR2. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr2 The value to write to CR2.
-
- @return The value written to CR2.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr2 (
- UINTN Cr2
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%cr2"
- :
- : "r" (Cr2)
- );
- return Cr2;
-}
-
-
-/**
- Writes a value to Control Register 3 (CR3).
-
- Writes and returns a new value to CR3. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr3 The value to write to CR3.
-
- @return The value written to CR3.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr3 (
- UINTN Cr3
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%cr3"
- :
- : "r" (Cr3)
- );
- return Cr3;
-}
-
-
-/**
- Writes a value to Control Register 4 (CR4).
-
- Writes and returns a new value to CR4. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr4 The value to write to CR4.
-
- @return The value written to CR4.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr4 (
- UINTN Cr4
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%cr4"
- :
- : "r" (Cr4)
- );
- return Cr4;
-}
-
-
-/**
- Reads the current value of Debug Register 0 (DR0).
-
- Reads and returns the current value of DR0. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 0 (DR0).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr0 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%dr0, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 1 (DR1).
-
- Reads and returns the current value of DR1. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 1 (DR1).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr1 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%dr1, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 2 (DR2).
-
- Reads and returns the current value of DR2. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 2 (DR2).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr2 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%dr2, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 3 (DR3).
-
- Reads and returns the current value of DR3. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 3 (DR3).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr3 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%dr3, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 4 (DR4).
-
- Reads and returns the current value of DR4. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 4 (DR4).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr4 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%dr4, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 5 (DR5).
-
- Reads and returns the current value of DR5. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 5 (DR5).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr5 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%dr5, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 6 (DR6).
-
- Reads and returns the current value of DR6. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 6 (DR6).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr6 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%dr6, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Debug Register 7 (DR7).
-
- Reads and returns the current value of DR7. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 7 (DR7).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr7 (
- VOID
- )
-{
- UINTN Data;
-
- __asm__ __volatile__ (
- "mov %%dr7, %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Writes a value to Debug Register 0 (DR0).
-
- Writes and returns a new value to DR0. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr0 The value to write to Dr0.
-
- @return The value written to Debug Register 0 (DR0).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr0 (
- UINTN Dr0
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%dr0"
- :
- : "r" (Dr0)
- );
- return Dr0;
-}
-
-
-/**
- Writes a value to Debug Register 1 (DR1).
-
- Writes and returns a new value to DR1. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr1 The value to write to Dr1.
-
- @return The value written to Debug Register 1 (DR1).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr1 (
- UINTN Dr1
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%dr1"
- :
- : "r" (Dr1)
- );
- return Dr1;
-}
-
-
-/**
- Writes a value to Debug Register 2 (DR2).
-
- Writes and returns a new value to DR2. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr2 The value to write to Dr2.
-
- @return The value written to Debug Register 2 (DR2).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr2 (
- UINTN Dr2
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%dr2"
- :
- : "r" (Dr2)
- );
- return Dr2;
-}
-
-
-/**
- Writes a value to Debug Register 3 (DR3).
-
- Writes and returns a new value to DR3. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr3 The value to write to Dr3.
-
- @return The value written to Debug Register 3 (DR3).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr3 (
- UINTN Dr3
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%dr3"
- :
- : "r" (Dr3)
- );
- return Dr3;
-}
-
-
-/**
- Writes a value to Debug Register 4 (DR4).
-
- Writes and returns a new value to DR4. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr4 The value to write to Dr4.
-
- @return The value written to Debug Register 4 (DR4).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr4 (
- UINTN Dr4
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%dr4"
- :
- : "r" (Dr4)
- );
- return Dr4;
-}
-
-
-/**
- Writes a value to Debug Register 5 (DR5).
-
- Writes and returns a new value to DR5. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr5 The value to write to Dr5.
-
- @return The value written to Debug Register 5 (DR5).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr5 (
- UINTN Dr5
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%dr5"
- :
- : "r" (Dr5)
- );
- return Dr5;
-}
-
-
-/**
- Writes a value to Debug Register 6 (DR6).
-
- Writes and returns a new value to DR6. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr6 The value to write to Dr6.
-
- @return The value written to Debug Register 6 (DR6).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr6 (
- UINTN Dr6
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%dr6"
- :
- : "r" (Dr6)
- );
- return Dr6;
-}
-
-
-/**
- Writes a value to Debug Register 7 (DR7).
-
- Writes and returns a new value to DR7. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr7 The value to write to Dr7.
-
- @return The value written to Debug Register 7 (DR7).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr7 (
- UINTN Dr7
- )
-{
- __asm__ __volatile__ (
- "mov %0, %%dr7"
- :
- : "r" (Dr7)
- );
- return Dr7;
-}
-
-
-/**
- Reads the current value of Code Segment Register (CS).
-
- Reads and returns the current value of CS. This function is only available on
- IA-32 and X64.
-
- @return The current value of CS.
-
-**/
-UINT16
-EFIAPI
-AsmReadCs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%cs, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Data Segment Register (DS).
-
- Reads and returns the current value of DS. This function is only available on
- IA-32 and X64.
-
- @return The current value of DS.
-
-**/
-UINT16
-EFIAPI
-AsmReadDs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%ds, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Extra Segment Register (ES).
-
- Reads and returns the current value of ES. This function is only available on
- IA-32 and X64.
-
- @return The current value of ES.
-
-**/
-UINT16
-EFIAPI
-AsmReadEs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%es, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of FS Data Segment Register (FS).
-
- Reads and returns the current value of FS. This function is only available on
- IA-32 and X64.
-
- @return The current value of FS.
-
-**/
-UINT16
-EFIAPI
-AsmReadFs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%fs, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of GS Data Segment Register (GS).
-
- Reads and returns the current value of GS. This function is only available on
- IA-32 and X64.
-
- @return The current value of GS.
-
-**/
-UINT16
-EFIAPI
-AsmReadGs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%gs, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Stack Segment Register (SS).
-
- Reads and returns the current value of SS. This function is only available on
- IA-32 and X64.
-
- @return The current value of SS.
-
-**/
-UINT16
-EFIAPI
-AsmReadSs (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "mov %%ds, %0"
- :"=a" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of Task Register (TR).
-
- Reads and returns the current value of TR. This function is only available on
- IA-32 and X64.
-
- @return The current value of TR.
-
-**/
-UINT16
-EFIAPI
-AsmReadTr (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "str %0"
- : "=r" (Data)
- );
-
- return Data;
-}
-
-
-/**
- Reads the current Global Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current GDTR descriptor and returns it in Gdtr. This
- function is only available on IA-32 and X64.
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86ReadGdtr (
- OUT IA32_DESCRIPTOR *Gdtr
- )
-{
- __asm__ __volatile__ (
- "sgdt %0"
- : "=m" (*Gdtr)
- );
-}
-
-
-/**
- Writes the current Global Descriptor Table Register (GDTR) descriptor.
-
- Writes and the current GDTR descriptor specified by Gdtr. This function is
- only available on IA-32 and X64.
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86WriteGdtr (
- IN CONST IA32_DESCRIPTOR *Gdtr
- )
-{
- __asm__ __volatile__ (
- "lgdt %0"
- :
- : "m" (*Gdtr)
- );
-
-}
-
-
-/**
- Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current IDTR descriptor and returns it in Idtr. This
- function is only available on IA-32 and X64.
-
- @param Idtr The pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86ReadIdtr (
- OUT IA32_DESCRIPTOR *Idtr
- )
-{
- __asm__ __volatile__ (
- "sidt %0"
- : "=m" (*Idtr)
- );
-}
-
-
-/**
- Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Writes the current IDTR descriptor and returns it in Idtr. This function is
- only available on IA-32 and X64.
-
- @param Idtr The pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86WriteIdtr (
- IN CONST IA32_DESCRIPTOR *Idtr
- )
-{
- __asm__ __volatile__ (
- "lidt %0"
- :
- : "m" (*Idtr)
- );
-}
-
-
-/**
- Reads the current Local Descriptor Table Register(LDTR) selector.
-
- Reads and returns the current 16-bit LDTR descriptor value. This function is
- only available on IA-32 and X64.
-
- @return The current selector of LDT.
-
-**/
-UINT16
-EFIAPI
-AsmReadLdtr (
- VOID
- )
-{
- UINT16 Data;
-
- __asm__ __volatile__ (
- "sldt %0"
- : "=g" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Writes the current Local Descriptor Table Register (GDTR) selector.
-
- Writes and the current LDTR descriptor specified by Ldtr. This function is
- only available on IA-32 and X64.
-
- @param Ldtr 16-bit LDTR selector value.
-
-**/
-VOID
-EFIAPI
-AsmWriteLdtr (
- IN UINT16 Ldtr
- )
-{
- __asm__ __volatile__ (
- "lldtw %0"
- :
- : "g" (Ldtr) // %0
- );
-}
-
-
-/**
- Save the current floating point/SSE/SSE2 context to a buffer.
-
- Saves the current floating point/SSE/SSE2 state to the buffer specified by
- Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
- available on IA-32 and X64.
-
- @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-InternalX86FxSave (
- OUT IA32_FX_BUFFER *Buffer
- )
-{
- __asm__ __volatile__ (
- "fxsave %0"
- :
- : "m" (*Buffer) // %0
- );
-}
-
-
-/**
- Restores the current floating point/SSE/SSE2 context from a buffer.
-
- Restores the current floating point/SSE/SSE2 state from the buffer specified
- by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
- only available on IA-32 and X64.
-
- @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-InternalX86FxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- )
-{
- __asm__ __volatile__ (
- "fxrstor %0"
- :
- : "m" (*Buffer) // %0
- );
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #0 (MM0).
-
- Reads and returns the current value of MM0. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM0.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm0 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "movd %%mm0, %0 \n\t"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #1 (MM1).
-
- Reads and returns the current value of MM1. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM1.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm1 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "movd %%mm1, %0 \n\t"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #2 (MM2).
-
- Reads and returns the current value of MM2. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM2.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm2 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "movd %%mm2, %0 \n\t"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #3 (MM3).
-
- Reads and returns the current value of MM3. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM3.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm3 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "movd %%mm3, %0 \n\t"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #4 (MM4).
-
- Reads and returns the current value of MM4. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM4.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm4 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "movd %%mm4, %0 \n\t"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #5 (MM5).
-
- Reads and returns the current value of MM5. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM5.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm5 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "movd %%mm5, %0 \n\t"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #6 (MM6).
-
- Reads and returns the current value of MM6. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM6.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm6 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "movd %%mm6, %0 \n\t"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Reads the current value of 64-bit MMX Register #7 (MM7).
-
- Reads and returns the current value of MM7. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM7.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm7 (
- VOID
- )
-{
- UINT64 Data;
-
- __asm__ __volatile__ (
- "movd %%mm7, %0 \n\t"
- : "=r" (Data) // %0
- );
-
- return Data;
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #0 (MM0).
-
- Writes the current value of MM0. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM0.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm0 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movd %0, %%mm0" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #1 (MM1).
-
- Writes the current value of MM1. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM1.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm1 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movd %0, %%mm1" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #2 (MM2).
-
- Writes the current value of MM2. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM2.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm2 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movd %0, %%mm2" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #3 (MM3).
-
- Writes the current value of MM3. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM3.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm3 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movd %0, %%mm3" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #4 (MM4).
-
- Writes the current value of MM4. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM4.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm4 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movd %0, %%mm4" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #5 (MM5).
-
- Writes the current value of MM5. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM5.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm5 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movd %0, %%mm5" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #6 (MM6).
-
- Writes the current value of MM6. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM6.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm6 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movd %0, %%mm6" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Writes the current value of 64-bit MMX Register #7 (MM7).
-
- Writes the current value of MM7. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM7.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm7 (
- IN UINT64 Value
- )
-{
- __asm__ __volatile__ (
- "movd %0, %%mm7" // %0
- :
- : "m" (Value)
- );
-}
-
-
-/**
- Reads the current value of Time Stamp Counter (TSC).
-
- Reads and returns the current value of TSC. This function is only available
- on IA-32 and X64.
-
- @return The current value of TSC
-
-**/
-UINT64
-EFIAPI
-AsmReadTsc (
- VOID
- )
-{
- UINT32 LowData;
- UINT32 HiData;
-
- __asm__ __volatile__ (
- "rdtsc"
- : "=a" (LowData),
- "=d" (HiData)
- );
-
- return (((UINT64)HiData) << 32) | LowData;
-}
-
-
-/**
- Reads the current value of a Performance Counter (PMC).
-
- Reads and returns the current value of performance counter specified by
- Index. This function is only available on IA-32 and X64.
-
- @param Index The 32-bit Performance Counter index to read.
-
- @return The value of the PMC specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmc (
- IN UINT32 Index
- )
-{
- UINT32 LowData;
- UINT32 HiData;
-
- __asm__ __volatile__ (
- "rdpmc"
- : "=a" (LowData),
- "=d" (HiData)
- : "c" (Index)
- );
-
- return (((UINT64)HiData) << 32) | LowData;
-}
-
-
-/**
- Sets up a monitor buffer that is used by AsmMwait().
-
- Executes a MONITOR instruction with the register state specified by Eax, Ecx
- and Edx. Returns Eax. This function is only available on IA-32 and X64.
-
- @param Eax The value to load into EAX or RAX before executing the MONITOR
- instruction.
- @param Ecx The value to load into ECX or RCX before executing the MONITOR
- instruction.
- @param Edx The value to load into EDX or RDX before executing the MONITOR
- instruction.
-
- @return Eax
-
-**/
-UINTN
-EFIAPI
-AsmMonitor (
- IN UINTN Eax,
- IN UINTN Ecx,
- IN UINTN Edx
- )
-{
- __asm__ __volatile__ (
- "monitor"
- :
- : "a" (Eax),
- "c" (Ecx),
- "d" (Edx)
- );
-
- return Eax;
-}
-
-
-/**
- Executes an MWAIT instruction.
-
- Executes an MWAIT instruction with the register state specified by Eax and
- Ecx. Returns Eax. This function is only available on IA-32 and X64.
-
- @param Eax The value to load into EAX or RAX before executing the MONITOR
- instruction.
- @param Ecx The value to load into ECX or RCX before executing the MONITOR
- instruction.
-
- @return Eax
-
-**/
-UINTN
-EFIAPI
-AsmMwait (
- IN UINTN Eax,
- IN UINTN Ecx
- )
-{
- __asm__ __volatile__ (
- "mwait"
- :
- : "a" (Eax),
- "c" (Ecx)
- );
-
- return Eax;
-}
-
-
-/**
- Executes a WBINVD instruction.
-
- Executes a WBINVD instruction. This function is only available on IA-32 and
- X64.
-
-**/
-VOID
-EFIAPI
-AsmWbinvd (
- VOID
- )
-{
- __asm__ __volatile__ ("wbinvd":::"memory");
-}
-
-
-/**
- Executes a INVD instruction.
-
- Executes a INVD instruction. This function is only available on IA-32 and
- X64.
-
-**/
-VOID
-EFIAPI
-AsmInvd (
- VOID
- )
-{
- __asm__ __volatile__ ("invd":::"memory");
-
-}
-
-
-/**
- Flushes a cache line from all the instruction and data caches within the
- coherency domain of the CPU.
-
- Flushed the cache line specified by LinearAddress, and returns LinearAddress.
- This function is only available on IA-32 and X64.
-
- @param LinearAddress The address of the cache line to flush. If the CPU is
- in a physical addressing mode, then LinearAddress is a
- physical address. If the CPU is in a virtual
- addressing mode, then LinearAddress is a virtual
- address.
-
- @return LinearAddress
-**/
-VOID *
-EFIAPI
-AsmFlushCacheLine (
- IN VOID *LinearAddress
- )
-{
- __asm__ __volatile__ (
- "clflush (%0)"
- :
- : "r" (LinearAddress)
- : "memory"
- );
-
- return LinearAddress;
-}
-
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Invd.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Invd.nasm
deleted file mode 100644
index 8fcd187..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Invd.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Invd.Asm
-;
-; Abstract:
-;
-; AsmInvd function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmInvd (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmInvd)
-ASM_PFX(AsmInvd):
- invd
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Lfence.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Lfence.nasm
deleted file mode 100644
index 814d025..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Lfence.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2018, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Lfence.nasm
-;
-; Abstract:
-;
-; Performs a serializing operation on all load-from-memory instructions that
-; were issued prior to the call of this function.
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmLfence (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmLfence)
-ASM_PFX(AsmLfence):
- lfence
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/LongJump.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/LongJump.S
deleted file mode 100644
index 885fdd9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/LongJump.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# LongJump.S
-#
-# Abstract:
-#
-# Implementation of _LongJump() on x64.
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalLongJump (
-# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalLongJump)
-ASM_PFX(InternalLongJump):
- mov (%rcx), %rbx
- mov 0x8(%rcx), %rsp
- mov 0x10(%rcx), %rbp
- mov 0x18(%rcx), %rdi
- mov 0x20(%rcx), %rsi
- mov 0x28(%rcx), %r12
- mov 0x30(%rcx), %r13
- mov 0x38(%rcx), %r14
- mov 0x40(%rcx), %r15
- # load non-volatile fp registers
- ldmxcsr 0x50(%rcx)
- movdqu 0x58(%rcx), %xmm6
- movdqu 0x68(%rcx), %xmm7
- movdqu 0x78(%rcx), %xmm8
- movdqu 0x88(%rcx), %xmm9
- movdqu 0x98(%rcx), %xmm10
- movdqu 0xA8(%rcx), %xmm11
- movdqu 0xB8(%rcx), %xmm12
- movdqu 0xC8(%rcx), %xmm13
- movdqu 0xD8(%rcx), %xmm14
- movdqu 0xE8(%rcx), %xmm15
- mov %rdx, %rax # set return value
- jmp *0x48(%rcx)
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/LongJump.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/LongJump.nasm
deleted file mode 100644
index f328222..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/LongJump.nasm
+++ /dev/null
@@ -1,83 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; LongJump.Asm
-;
-; Abstract:
-;
-; Implementation of _LongJump() on x64.
-;
-;------------------------------------------------------------------------------
-
-%include "Nasm.inc"
-
- DEFAULT REL
- SECTION .text
-
-extern ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalLongJump (
-; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalLongJump)
-ASM_PFX(InternalLongJump):
-
- mov eax, [ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))]
- test eax, eax
- jz CetDone
- mov rax, cr4
- bt eax, 23 ; check if CET is enabled
- jnc CetDone
-
- push rdx ; save rdx
-
- mov rdx, [rcx + 0xF8] ; rdx = target SSP
- READSSP_RAX
- sub rdx, rax ; rdx = delta
- mov rax, rdx ; rax = delta
-
- shr rax, 3 ; rax = delta/sizeof(UINT64)
- INCSSP_RAX
-
- pop rdx ; restore rdx
-CetDone:
-
- mov rbx, [rcx]
- mov rsp, [rcx + 8]
- mov rbp, [rcx + 0x10]
- mov rdi, [rcx + 0x18]
- mov rsi, [rcx + 0x20]
- mov r12, [rcx + 0x28]
- mov r13, [rcx + 0x30]
- mov r14, [rcx + 0x38]
- mov r15, [rcx + 0x40]
- ; load non-volatile fp registers
- ldmxcsr [rcx + 0x50]
- movdqu xmm6, [rcx + 0x58]
- movdqu xmm7, [rcx + 0x68]
- movdqu xmm8, [rcx + 0x78]
- movdqu xmm9, [rcx + 0x88]
- movdqu xmm10, [rcx + 0x98]
- movdqu xmm11, [rcx + 0xA8]
- movdqu xmm12, [rcx + 0xB8]
- movdqu xmm13, [rcx + 0xC8]
- movdqu xmm14, [rcx + 0xD8]
- movdqu xmm15, [rcx + 0xE8]
- mov rax, rdx ; set return value
- jmp qword [rcx + 0x48]
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Monitor.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Monitor.nasm
deleted file mode 100644
index 980678a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Monitor.nasm
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Monitor.Asm
-;
-; Abstract:
-;
-; AsmMonitor function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmMonitor (
-; IN UINTN Eax,
-; IN UINTN Ecx,
-; IN UINTN Edx
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmMonitor)
-ASM_PFX(AsmMonitor):
- mov eax, ecx
- mov ecx, edx
- mov edx, r8d
- DB 0xf, 1, 0xc8 ; monitor
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Mwait.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Mwait.nasm
deleted file mode 100644
index 912d7a2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Mwait.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Mwait.Asm
-;
-; Abstract:
-;
-; AsmMwait function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmMwait (
-; IN UINTN Eax,
-; IN UINTN Ecx
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmMwait)
-ASM_PFX(AsmMwait):
- mov eax, ecx
- mov ecx, edx
- DB 0xf, 1, 0xc9 ; mwait
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Non-existing.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Non-existing.c
deleted file mode 100644
index 76503e3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Non-existing.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/** @file
- Non-existing BaseLib functions on x64
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-#include
-
-/**
- Enables the 32-bit paging mode on the CPU.
-
- Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode. This function is
- only available on IA-32. After the 32-bit paging mode is enabled, control is
- transferred to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit protected mode with flat descriptors. This
- means all descriptors must have a base of 0 and a limit of 4GB.
- 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
- descriptors.
- 4) CR3 must point to valid page tables that will be used once the transition
- is complete, and those page tables must guarantee that the pages for this
- function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is enabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is enabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is enabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-InternalX86EnablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- //
- // This function cannot work on x64 platform
- //
- ASSERT (FALSE);
-}
-
-/**
- Disables the 32-bit paging mode on the CPU.
-
- Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 32-paged protected
- mode. This function is only available on IA-32. After the 32-bit paging mode
- is disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be NULL. The function EntryPoint must never return.
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit paged mode.
- 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
- 4) CR3 must point to valid page tables that guarantee that the pages for
- this function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is disabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is disabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is
- disabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-InternalX86DisablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- //
- // This function cannot work on x64 platform
- //
- ASSERT (FALSE);
-}
-
-
-/**
- Enables the 64-bit paging mode on the CPU.
-
- Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode with flat
- descriptors. This function is only available on IA-32. After the 64-bit
- paging mode is enabled, control is transferred to the function specified by
- EntryPoint using the new stack specified by NewStack and passing in the
- parameters specified by Context1 and Context2. Context1 and Context2 are
- optional and may be 0. The function EntryPoint must never return.
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for long mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is enabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is enabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is enabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-InternalX86EnablePaging64 (
- IN UINT16 Cs,
- IN UINT64 EntryPoint,
- IN UINT64 Context1, OPTIONAL
- IN UINT64 Context2, OPTIONAL
- IN UINT64 NewStack
- )
-{
- //
- // This function cannot work on x64 platform.
- //
- ASSERT (FALSE);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/RdRand.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/RdRand.S
deleted file mode 100644
index 0556979..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/RdRand.S
+++ /dev/null
@@ -1,72 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# RdRand.S
-#
-# Abstract:
-#
-# Generates random number through CPU RdRand instruction under 64-bit platform.
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// Generates a 16 bit random number through RDRAND instruction.
-// Return TRUE if Rand generated successfully, or FALSE if not.
-//
-// BOOLEAN EFIAPI InternalX86RdRand16 (UINT16 *Rand);
-//------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86RdRand16)
-ASM_PFX(InternalX86RdRand16):
- .byte 0x0f, 0xc7, 0xf0 // rdrand r16: "0f c7 /6 ModRM:r/m(w)"
- jc rn16_ok // jmp if CF=1
- xor %rax, %rax // reg=0 if CF=0
- ret // return with failure status
-rn16_ok:
- mov %ax, (%rcx)
- mov $0x1, %rax
- ret
-
-//------------------------------------------------------------------------------
-// Generates a 32 bit random number through RDRAND instruction.
-// Return TRUE if Rand generated successfully, or FALSE if not.
-//
-// BOOLEAN EFIAPI InternalX86RdRand32 (UINT32 *Rand);
-//------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86RdRand32)
-ASM_PFX(InternalX86RdRand32):
- .byte 0x0f, 0xc7, 0xf0 // rdrand r32: "0f c7 /6 ModRM:r/m(w)"
- jc rn32_ok // jmp if CF=1
- xor %rax, %rax // reg=0 if CF=0
- ret // return with failure status
-rn32_ok:
- mov %eax, (%rcx)
- mov $0x1, %rax
- ret
-
-//------------------------------------------------------------------------------
-// Generates a 64 bit random number through RDRAND instruction.
-// Return TRUE if Rand generated successfully, or FALSE if not.
-//
-// BOOLEAN EFIAPI InternalX86RdRand64 (UINT64 *Rand);
-//------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalX86RdRand64)
-ASM_PFX(InternalX86RdRand64):
- .byte 0x48, 0x0f, 0xc7, 0xf0 // rdrand r64: "REX.W + 0f c7 /6 ModRM:r/m(w)"
- jc rn64_ok // jmp if CF=1
- xor %rax, %rax // reg=0 if CF=0
- ret // return with failure status
-rn64_ok:
- mov %rax, (%rcx)
- mov $0x1, %rax
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/RdRand.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/RdRand.nasm
deleted file mode 100644
index e1a21eb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/RdRand.nasm
+++ /dev/null
@@ -1,83 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; RdRand.nasm
-;
-; Abstract:
-;
-; Generates random number through CPU RdRand instruction under 64-bit platform.
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; Generates a 16 bit random number through RDRAND instruction.
-; Return TRUE if Rand generated successfully, or FALSE if not.
-;
-; BOOLEAN EFIAPI InternalX86RdRand16 (UINT16 *Rand);
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86RdRand16)
-ASM_PFX(InternalX86RdRand16):
- ; rdrand ax ; generate a 16 bit RN into eax,
- ; CF=1 if RN generated ok, otherwise CF=0
- db 0xf, 0xc7, 0xf0 ; rdrand r16: "0f c7 /6 ModRM:r/m(w)"
- jc rn16_ok ; jmp if CF=1
- xor rax, rax ; reg=0 if CF=0
- ret ; return with failure status
-rn16_ok:
- mov [rcx], ax
- mov rax, 1
- ret
-
-;------------------------------------------------------------------------------
-; Generates a 32 bit random number through RDRAND instruction.
-; Return TRUE if Rand generated successfully, or FALSE if not.
-;
-; BOOLEAN EFIAPI InternalX86RdRand32 (UINT32 *Rand);
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86RdRand32)
-ASM_PFX(InternalX86RdRand32):
- ; rdrand eax ; generate a 32 bit RN into eax,
- ; CF=1 if RN generated ok, otherwise CF=0
- db 0xf, 0xc7, 0xf0 ; rdrand r32: "0f c7 /6 ModRM:r/m(w)"
- jc rn32_ok ; jmp if CF=1
- xor rax, rax ; reg=0 if CF=0
- ret ; return with failure status
-rn32_ok:
- mov [rcx], eax
- mov rax, 1
- ret
-
-;------------------------------------------------------------------------------
-; Generates a 64 bit random number through one RDRAND instruction.
-; Return TRUE if Rand generated successfully, or FALSE if not.
-;
-; BOOLEAN EFIAPI InternalX86RdRand64 (UINT64 *Random);
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86RdRand64)
-ASM_PFX(InternalX86RdRand64):
- ; rdrand rax ; generate a 64 bit RN into rax,
- ; CF=1 if RN generated ok, otherwise CF=0
- db 0x48, 0xf, 0xc7, 0xf0 ; rdrand r64: "REX.W + 0f c7 /6 ModRM:r/m(w)"
- jc rn64_ok ; jmp if CF=1
- xor rax, rax ; reg=0 if CF=0
- ret ; return with failure status
-rn64_ok:
- mov [rcx], rax
- mov rax, 1
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr0.nasm
deleted file mode 100644
index 0c6e2f9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr0.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadCr0.Asm
-;
-; Abstract:
-;
-; AsmReadCr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadCr0)
-ASM_PFX(AsmReadCr0):
- mov rax, cr0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr2.nasm
deleted file mode 100644
index 45055ec..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr2.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadCr2.Asm
-;
-; Abstract:
-;
-; AsmReadCr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadCr2)
-ASM_PFX(AsmReadCr2):
- mov rax, cr2
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr3.nasm
deleted file mode 100644
index 3a3a935..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr3.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadCr3.Asm
-;
-; Abstract:
-;
-; AsmReadCr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadCr3)
-ASM_PFX(AsmReadCr3):
- mov rax, cr3
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr4.nasm
deleted file mode 100644
index 68b6028..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCr4.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadCr4.Asm
-;
-; Abstract:
-;
-; AsmReadCr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadCr4)
-ASM_PFX(AsmReadCr4):
- mov rax, cr4
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCs.nasm
deleted file mode 100644
index e5d09cb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadCs.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadCs.Asm
-;
-; Abstract:
-;
-; AsmReadCs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadCs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadCs)
-ASM_PFX(AsmReadCs):
- mov eax, cs
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr0.nasm
deleted file mode 100644
index bf5955a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr0.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr0.Asm
-;
-; Abstract:
-;
-; AsmReadDr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr0)
-ASM_PFX(AsmReadDr0):
- mov rax, dr0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr1.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr1.nasm
deleted file mode 100644
index a797490..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr1.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr1.Asm
-;
-; Abstract:
-;
-; AsmReadDr1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr1 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr1)
-ASM_PFX(AsmReadDr1):
- mov rax, dr1
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr2.nasm
deleted file mode 100644
index 2ef64f4..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr2.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr2.Asm
-;
-; Abstract:
-;
-; AsmReadDr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr2)
-ASM_PFX(AsmReadDr2):
- mov rax, dr2
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr3.nasm
deleted file mode 100644
index 1222185..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr3.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr3.Asm
-;
-; Abstract:
-;
-; AsmReadDr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr3)
-ASM_PFX(AsmReadDr3):
- mov rax, dr3
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr4.nasm
deleted file mode 100644
index c8d1581..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr4.nasm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr4.Asm
-;
-; Abstract:
-;
-; AsmReadDr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr4)
-ASM_PFX(AsmReadDr4):
- ;
- ; There's no obvious reason to access this register, since it's aliased to
- ; DR7 when DE=0 or an exception generated when DE=1
- ;
- DB 0xf, 0x21, 0xe0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr5.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr5.nasm
deleted file mode 100644
index 771e71c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr5.nasm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr5.Asm
-;
-; Abstract:
-;
-; AsmReadDr5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr5 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr5)
-ASM_PFX(AsmReadDr5):
- ;
- ; There's no obvious reason to access this register, since it's aliased to
- ; DR7 when DE=0 or an exception generated when DE=1
- ;
- DB 0xf, 0x21, 0xe8
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr6.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr6.nasm
deleted file mode 100644
index a75656d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr6.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr6.Asm
-;
-; Abstract:
-;
-; AsmReadDr6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr6 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr6)
-ASM_PFX(AsmReadDr6):
- mov rax, dr6
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr7.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr7.nasm
deleted file mode 100644
index 65d8f76..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDr7.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDr7.Asm
-;
-; Abstract:
-;
-; AsmReadDr7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr7 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDr7)
-ASM_PFX(AsmReadDr7):
- mov rax, dr7
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDs.nasm
deleted file mode 100644
index 6eba940..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadDs.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadDs.Asm
-;
-; Abstract:
-;
-; AsmReadDs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadDs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadDs)
-ASM_PFX(AsmReadDs):
- mov eax, ds
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadEflags.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadEflags.nasm
deleted file mode 100644
index 98d4b49..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadEflags.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadEflags.Asm
-;
-; Abstract:
-;
-; AsmReadEflags function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadEflags (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadEflags)
-ASM_PFX(AsmReadEflags):
- pushfq
- pop rax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadEs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadEs.nasm
deleted file mode 100644
index ea016d8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadEs.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadEs.Asm
-;
-; Abstract:
-;
-; AsmReadEs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadEs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadEs)
-ASM_PFX(AsmReadEs):
- mov eax, es
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadFs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadFs.nasm
deleted file mode 100644
index 123790e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadFs.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadFs.Asm
-;
-; Abstract:
-;
-; AsmReadFs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadFs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadFs)
-ASM_PFX(AsmReadFs):
- mov eax, fs
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadGdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadGdtr.nasm
deleted file mode 100644
index 0f51605..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadGdtr.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadGdtr.Asm
-;
-; Abstract:
-;
-; AsmReadGdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86ReadGdtr (
-; OUT IA32_DESCRIPTOR *Gdtr
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86ReadGdtr)
-ASM_PFX(InternalX86ReadGdtr):
- sgdt [rcx]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadGs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadGs.nasm
deleted file mode 100644
index 8786454..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadGs.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadGs.Asm
-;
-; Abstract:
-;
-; AsmReadGs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadGs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadGs)
-ASM_PFX(AsmReadGs):
- mov eax, gs
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadIdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadIdtr.nasm
deleted file mode 100644
index cfc32c7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadIdtr.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadIdtr.Asm
-;
-; Abstract:
-;
-; AsmReadIdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86ReadIdtr (
-; OUT IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86ReadIdtr)
-ASM_PFX(InternalX86ReadIdtr):
- sidt [rcx]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadLdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadLdtr.nasm
deleted file mode 100644
index 9fbf5ac..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadLdtr.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadLdtr.Asm
-;
-; Abstract:
-;
-; AsmReadLdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadLdtr (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadLdtr)
-ASM_PFX(AsmReadLdtr):
- sldt eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm0.nasm
deleted file mode 100644
index a69149b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm0.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm0.Asm
-;
-; Abstract:
-;
-; AsmReadMm0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm0)
-ASM_PFX(AsmReadMm0):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x7e, 0xc0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm1.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm1.nasm
deleted file mode 100644
index 917494c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm1.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm1.Asm
-;
-; Abstract:
-;
-; AsmReadMm1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm1 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm1)
-ASM_PFX(AsmReadMm1):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x7e, 0xc8
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm2.nasm
deleted file mode 100644
index d31c34a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm2.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm2.Asm
-;
-; Abstract:
-;
-; AsmReadMm2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm2)
-ASM_PFX(AsmReadMm2):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x7e, 0xd0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm3.nasm
deleted file mode 100644
index 9cabaa2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm3.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm3.Asm
-;
-; Abstract:
-;
-; AsmReadMm3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm3)
-ASM_PFX(AsmReadMm3):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x7e, 0xd8
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm4.nasm
deleted file mode 100644
index 7eae1fd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm4.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm4.Asm
-;
-; Abstract:
-;
-; AsmReadMm4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm4)
-ASM_PFX(AsmReadMm4):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x7e, 0xe0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm5.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm5.nasm
deleted file mode 100644
index 4784d6a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm5.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm5.Asm
-;
-; Abstract:
-;
-; AsmReadMm5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm5 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm5)
-ASM_PFX(AsmReadMm5):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x7e, 0xe8
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm6.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm6.nasm
deleted file mode 100644
index 58f8b98..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm6.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm6.Asm
-;
-; Abstract:
-;
-; AsmReadMm6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm6 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm6)
-ASM_PFX(AsmReadMm6):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x7e, 0xf0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm7.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm7.nasm
deleted file mode 100644
index 46e4807..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMm7.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMm7.Asm
-;
-; Abstract:
-;
-; AsmReadMm7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm7 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMm7)
-ASM_PFX(AsmReadMm7):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x7e, 0xf8
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMsr64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMsr64.c
deleted file mode 100644
index 06a9dbc..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMsr64.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- CpuBreakpoint function.
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
-**/
-
-unsigned __int64 __readmsr (int register);
-
-#pragma intrinsic(__readmsr)
-
-/**
- Read data to MSR.
-
- @param Index Register index of MSR.
-
- @return Value read from MSR.
-
-**/
-UINT64
-EFIAPI
-AsmReadMsr64 (
- IN UINT32 Index
- )
-{
- return __readmsr (Index);
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMsr64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMsr64.nasm
deleted file mode 100644
index 650be2c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadMsr64.nasm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadMsr64.Asm
-;
-; Abstract:
-;
-; AsmReadMsr64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMsr64 (
-; IN UINT32 Index
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadMsr64)
-ASM_PFX(AsmReadMsr64):
- rdmsr ; edx & eax are zero extended
- shl rdx, 0x20
- or rax, rdx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadPmc.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadPmc.nasm
deleted file mode 100644
index 507e9b6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadPmc.nasm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadPmc.Asm
-;
-; Abstract:
-;
-; AsmReadPmc function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadPmc (
-; IN UINT32 PmcIndex
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadPmc)
-ASM_PFX(AsmReadPmc):
- rdpmc
- shl rdx, 0x20
- or rax, rdx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadSs.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadSs.nasm
deleted file mode 100644
index be764ba..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadSs.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadSs.Asm
-;
-; Abstract:
-;
-; AsmReadSs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadSs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadSs)
-ASM_PFX(AsmReadSs):
- mov eax, ss
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadTr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadTr.nasm
deleted file mode 100644
index df2f7d7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadTr.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadTr.Asm
-;
-; Abstract:
-;
-; AsmReadTr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadTr (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadTr)
-ASM_PFX(AsmReadTr):
- str eax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadTsc.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadTsc.nasm
deleted file mode 100644
index 61fa2f0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/ReadTsc.nasm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ReadTsc.Asm
-;
-; Abstract:
-;
-; AsmReadTsc function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadTsc (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmReadTsc)
-ASM_PFX(AsmReadTsc):
- rdtsc
- shl rdx, 0x20
- or rax, rdx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SetJump.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SetJump.S
deleted file mode 100644
index ef6beee..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SetJump.S
+++ /dev/null
@@ -1,53 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetJump.S
-#
-# Abstract:
-#
-# Implementation of SetJump() on x86_64
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(SetJump)
-ASM_PFX(SetJump):
- push %rcx
- add $0xffffffffffffffe0,%rsp
- call ASM_PFX(InternalAssertJumpBuffer)
- add $0x20,%rsp
- pop %rcx
- pop %rdx
- mov %rbx,(%rcx)
- mov %rsp,0x8(%rcx)
- mov %rbp,0x10(%rcx)
- mov %rdi,0x18(%rcx)
- mov %rsi,0x20(%rcx)
- mov %r12,0x28(%rcx)
- mov %r13,0x30(%rcx)
- mov %r14,0x38(%rcx)
- mov %r15,0x40(%rcx)
- mov %rdx,0x48(%rcx)
- # save non-volatile fp registers
- stmxcsr 0x50(%rcx)
- movdqu %xmm6, 0x58(%rcx)
- movdqu %xmm7, 0x68(%rcx)
- movdqu %xmm8, 0x78(%rcx)
- movdqu %xmm9, 0x88(%rcx)
- movdqu %xmm10, 0x98(%rcx)
- movdqu %xmm11, 0xA8(%rcx)
- movdqu %xmm12, 0xB8(%rcx)
- movdqu %xmm13, 0xC8(%rcx)
- movdqu %xmm14, 0xD8(%rcx)
- movdqu %xmm15, 0xE8(%rcx)
- xor %rax,%rax
- jmpq *%rdx
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SetJump.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SetJump.nasm
deleted file mode 100644
index 42ad913..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SetJump.nasm
+++ /dev/null
@@ -1,87 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetJump.Asm
-;
-; Abstract:
-;
-; Implementation of SetJump() on x64.
-;
-;------------------------------------------------------------------------------
-
-%include "Nasm.inc"
-
- DEFAULT REL
- SECTION .text
-
-extern ASM_PFX(InternalAssertJumpBuffer)
-extern ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; SetJump (
-; OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(SetJump)
-ASM_PFX(SetJump):
- push rcx
- add rsp, -0x20
- call ASM_PFX(InternalAssertJumpBuffer)
- add rsp, 0x20
- pop rcx
- pop rdx
-
- xor rax, rax
- mov [rcx + 0xF8], rax ; save 0 to SSP
-
- mov eax, [ASM_PFX(PcdGet32 (PcdControlFlowEnforcementPropertyMask))]
- test eax, eax
- jz CetDone
- mov rax, cr4
- bt eax, 23 ; check if CET is enabled
- jnc CetDone
-
- mov rax, 1
- INCSSP_RAX ; to read original SSP
- READSSP_RAX
- mov [rcx + 0xF8], rax ; save SSP
-
-CetDone:
-
- mov [rcx], rbx
- mov [rcx + 8], rsp
- mov [rcx + 0x10], rbp
- mov [rcx + 0x18], rdi
- mov [rcx + 0x20], rsi
- mov [rcx + 0x28], r12
- mov [rcx + 0x30], r13
- mov [rcx + 0x38], r14
- mov [rcx + 0x40], r15
- mov [rcx + 0x48], rdx
- ; save non-volatile fp registers
- stmxcsr [rcx + 0x50]
- movdqu [rcx + 0x58], xmm6
- movdqu [rcx + 0x68], xmm7
- movdqu [rcx + 0x78], xmm8
- movdqu [rcx + 0x88], xmm9
- movdqu [rcx + 0x98], xmm10
- movdqu [rcx + 0xA8], xmm11
- movdqu [rcx + 0xB8], xmm12
- movdqu [rcx + 0xC8], xmm13
- movdqu [rcx + 0xD8], xmm14
- movdqu [rcx + 0xE8], xmm15
- xor rax, rax
- jmp rdx
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SwitchStack.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SwitchStack.S
deleted file mode 100644
index 40a2ae9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SwitchStack.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SwitchStack.S
-#
-# Abstract:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# Routine Description:
-#
-# Routine for switching stacks with 2 parameters
-#
-# Arguments:
-#
-# (rcx) EntryPoint - Entry point with new stack.
-# (rdx) Context1 - Parameter1 for entry point.
-# (r8) Context2 - Parameter2 for entry point.
-# (r9) NewStack - The pointer to new stack.
-#
-# Returns:
-#
-# None
-#
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalSwitchStack)
-ASM_PFX(InternalSwitchStack):
- pushq %rbp
- movq %rsp, %rbp
-
- mov %rcx, %rax // Shift registers for new call
- mov %rdx, %rcx
- mov %r8, %rdx
- #
- # Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,
- # in case the callee wishes to spill them.
- #
- lea -0x20(%r9), %rsp
- pushq $0 // stop gdb stack unwind
- jmp *%rax // call EntryPoint ()
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SwitchStack.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SwitchStack.nasm
deleted file mode 100644
index 652baf6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/SwitchStack.nasm
+++ /dev/null
@@ -1,51 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SwitchStack.Asm
-;
-; Abstract:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; Routine Description:
-;
-; Routine for switching stacks with 2 parameters
-;
-; Arguments:
-;
-; (rcx) EntryPoint - Entry point with new stack.
-; (rdx) Context1 - Parameter1 for entry point.
-; (r8) Context2 - Parameter2 for entry point.
-; (r9) NewStack - The pointer to new stack.
-;
-; Returns:
-;
-; None
-;
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalSwitchStack)
-ASM_PFX(InternalSwitchStack):
- mov rax, rcx
- mov rcx, rdx
- mov rdx, r8
- ;
- ; Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack,
- ; in case the callee wishes to spill them.
- ;
- lea rsp, [r9 - 0x20]
- call rax
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Thunk16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Thunk16.S
deleted file mode 100644
index c382906..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Thunk16.S
+++ /dev/null
@@ -1,334 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# Thunk16.S
-#
-# Abstract:
-#
-# Real mode thunk
-#
-#------------------------------------------------------------------------------
-
-#include
-
-ASM_GLOBAL ASM_PFX(m16Start)
-ASM_GLOBAL ASM_PFX(m16Size)
-ASM_GLOBAL ASM_PFX(mThunk16Attr)
-ASM_GLOBAL ASM_PFX(m16Gdt)
-ASM_GLOBAL ASM_PFX(m16GdtrBase)
-ASM_GLOBAL ASM_PFX(mTransition)
-ASM_GLOBAL ASM_PFX(InternalAsmThunk16)
-
-# define the structure of IA32_REGS
-.set _EDI, 0 #size 4
-.set _ESI, 4 #size 4
-.set _EBP, 8 #size 4
-.set _ESP, 12 #size 4
-.set _EBX, 16 #size 4
-.set _EDX, 20 #size 4
-.set _ECX, 24 #size 4
-.set _EAX, 28 #size 4
-.set _DS, 32 #size 2
-.set _ES, 34 #size 2
-.set _FS, 36 #size 2
-.set _GS, 38 #size 2
-.set _EFLAGS, 40 #size 8
-.set _EIP, 48 #size 4
-.set _CS, 52 #size 2
-.set _SS, 54 #size 2
-.set IA32_REGS_SIZE, 56
-
- .data
-
-.set Lm16Size, ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start)
-ASM_PFX(m16Size): .word Lm16Size
-.set LmThunk16Attr, L_ThunkAttr - ASM_PFX(m16Start)
-ASM_PFX(mThunk16Attr): .word LmThunk16Attr
-.set Lm16Gdt, ASM_PFX(NullSeg) - ASM_PFX(m16Start)
-ASM_PFX(m16Gdt): .word Lm16Gdt
-.set Lm16GdtrBase, _16GdtrBase - ASM_PFX(m16Start)
-ASM_PFX(m16GdtrBase): .word Lm16GdtrBase
-.set LmTransition, _EntryPoint - ASM_PFX(m16Start)
-ASM_PFX(mTransition): .word LmTransition
-
- .text
-
-ASM_PFX(m16Start):
-
-SavedGdt: .space 10
-
-#------------------------------------------------------------------------------
-# _BackFromUserCode() takes control in real mode after 'retf' has been executed
-# by user code. It will be shadowed to somewhere in memory below 1MB.
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(BackFromUserCode)
-ASM_PFX(BackFromUserCode):
- #
- # The order of saved registers on the stack matches the order they appears
- # in IA32_REGS structure. This facilitates wrapper function to extract them
- # into that structure.
- #
- # Some instructions for manipulation of segment registers have to be written
- # in opcode since 64-bit MASM prevents accesses to those registers.
- #
- .byte 0x16 # push ss
- .byte 0xe # push cs
- .byte 0x66
- call L_Base # push eip
-L_Base:
- .byte 0x66
- pushq $0 # reserved high order 32 bits of EFlags
- .byte 0x66, 0x9c # pushfd actually
- cli # disable interrupts
- push %gs
- push %fs
- .byte 6 # push es
- .byte 0x1e # push ds
- .byte 0x66,0x60 # pushad
- .byte 0x66,0xba # mov edx, imm32
-L_ThunkAttr: .space 4
- testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15, %dl
- jz L_1
- movl $0x15cd2401,%eax # mov ax, 2401h & int 15h
- cli # disable interrupts
- jnc L_2
-L_1:
- testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl
- jz L_2
- inb $0x92,%al
- orb $2,%al
- outb %al, $0x92 # deactivate A20M#
-L_2:
- xorw %ax, %ax # xor eax, eax
- movl %ss, %eax # mov ax, ss
- lea IA32_REGS_SIZE(%esp), %bp
- #
- # rsi in the following 2 instructions is indeed bp in 16-bit code
- #
- movw %bp, (_ESP - IA32_REGS_SIZE)(%rsi)
- .byte 0x66
- movl (_EIP - IA32_REGS_SIZE)(%rsi), %ebx
- shlw $4,%ax # shl eax, 4
- addw %ax,%bp # add ebp, eax
- movw %cs,%ax
- shlw $4,%ax
- lea (L_64BitCode - L_Base)(%ebx, %eax), %ax
- .byte 0x66,0x2e,0x89,0x87 # mov cs:[bx + (L_64Eip - L_Base)], eax
- .word L_64Eip - L_Base
- .byte 0x66,0xb8 # mov eax, imm32
-L_SavedCr4: .space 4
- movq %rax, %cr4
- #
- # rdi in the instruction below is indeed bx in 16-bit code
- #
- .byte 0x66,0x2e # 2eh is "cs:" segment override
- lgdt (SavedGdt - L_Base)(%rdi)
- .byte 0x66
- movl $0xc0000080,%ecx
- rdmsr
- orb $1,%ah
- wrmsr
- .byte 0x66,0xb8 # mov eax, imm32
-L_SavedCr0: .space 4
- movq %rax, %cr0
- .byte 0x66,0xea # jmp far cs:L_64Bit
-L_64Eip: .space 4
-L_SavedCs: .space 2
-L_64BitCode:
- .byte 0x90
- .byte 0x48,0xbc # mov rsp, imm64
-L_SavedSp: .space 8 # restore stack
- nop
- ret
-
-_EntryPoint: .long ASM_PFX(ToUserCode) - ASM_PFX(m16Start)
- .word CODE16
-_16Gdtr: .word GDT_SIZE - 1
-_16GdtrBase: .quad 0
-_16Idtr: .word 0x3ff
- .long 0
-
-#------------------------------------------------------------------------------
-# _ToUserCode() takes control in real mode before passing control to user code.
-# It will be shadowed to somewhere in memory below 1MB.
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(ToUserCode)
-ASM_PFX(ToUserCode):
- movl %edx,%ss # set new segment selectors
- movl %edx,%ds
- movl %edx,%es
- movl %edx,%fs
- movl %edx,%gs
- .byte 0x66
- movl $0xc0000080,%ecx
- movq %rax, %cr0
- rdmsr
- andb $0xfe, %ah # $0b11111110
- wrmsr
- movq %rbp, %cr4
- movl %esi,%ss # set up 16-bit stack segment
- movw %bx,%sp # set up 16-bit stack pointer
- .byte 0x66 # make the following call 32-bit
- call L_Base1 # push eip
-L_Base1:
- popw %bp # ebp <- address of L_Base1
- pushq (IA32_REGS_SIZE + 2)(%esp)
- lea 0x0c(%rsi), %eax
- pushq %rax
- lret # execution begins at next instruction
-L_RealMode:
- .byte 0x66,0x2e # CS and operand size override
- lidt (_16Idtr - L_Base1)(%rsi)
- .byte 0x66,0x61 # popad
- .byte 0x1f # pop ds
- .byte 0x7 # pop es
- .byte 0x0f, 0xa1 # pop fs
- .byte 0x0f, 0xa9 # pop gs
- .byte 0x66, 0x9d # popfd
- leaw 4(%esp),%sp # skip high order 32 bits of EFlags
- .byte 0x66 # make the following retf 32-bit
- lret # transfer control to user code
-
-.set CODE16, ASM_PFX(_16Code) - .
-.set DATA16, ASM_PFX(_16Data) - .
-.set DATA32, ASM_PFX(_32Data) - .
-
-ASM_PFX(NullSeg): .quad 0
-ASM_PFX(_16Code):
- .word -1
- .word 0
- .byte 0
- .byte 0x9b
- .byte 0x8f # 16-bit segment, 4GB limit
- .byte 0
-ASM_PFX(_16Data):
- .word -1
- .word 0
- .byte 0
- .byte 0x93
- .byte 0x8f # 16-bit segment, 4GB limit
- .byte 0
-ASM_PFX(_32Data):
- .word -1
- .word 0
- .byte 0
- .byte 0x93
- .byte 0xcf # 16-bit segment, 4GB limit
- .byte 0
-
-.set GDT_SIZE, . - ASM_PFX(NullSeg)
-
-#------------------------------------------------------------------------------
-# IA32_REGISTER_SET *
-# EFIAPI
-# InternalAsmThunk16 (
-# IN IA32_REGISTER_SET *RegisterSet,
-# IN OUT VOID *Transition
-# );
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalAsmThunk16)
-ASM_PFX(InternalAsmThunk16):
- pushq %rbp
- pushq %rbx
- pushq %rsi
- pushq %rdi
-
- movl %ds, %ebx
- pushq %rbx # Save ds segment register on the stack
- movl %es, %ebx
- pushq %rbx # Save es segment register on the stack
- movl %ss, %ebx
- pushq %rbx # Save ss segment register on the stack
-
- .byte 0x0f, 0xa0 #push fs
- .byte 0x0f, 0xa8 #push gs
- movq %rcx, %rsi
- movzwl _SS(%rsi), %r8d
- movl _ESP(%rsi), %edi
- lea -(IA32_REGS_SIZE + 4)(%edi), %rdi
- imul $16, %r8d, %eax
- movl %edi,%ebx # ebx <- stack for 16-bit code
- pushq $(IA32_REGS_SIZE / 4)
- addl %eax,%edi # edi <- linear address of 16-bit stack
- popq %rcx
- rep
- movsl # copy RegSet
- lea (L_SavedCr4 - ASM_PFX(m16Start))(%rdx), %ecx
- movl %edx,%eax # eax <- transition code address
- andl $0xf,%edx
- shll $12,%eax # segment address in high order 16 bits
- .set LBackFromUserCodeDelta, ASM_PFX(BackFromUserCode) - ASM_PFX(m16Start)
- lea (LBackFromUserCodeDelta)(%rdx), %ax
- stosl # [edi] <- return address of user code
- sgdt 0x60(%rsp) # save GDT stack in argument space
- movzwq 0x60(%rsp), %r10 # r10 <- GDT limit
- lea ((ASM_PFX(InternalAsmThunk16) - L_SavedCr4) + 0xf)(%rcx), %r11
- andq $0xfffffffffffffff0, %r11 # r11 <- 16-byte aligned shadowed GDT table in real mode buffer
-
- movw %r10w, (SavedGdt - L_SavedCr4)(%rcx) # save the limit of shadowed GDT table
- movq %r11, (SavedGdt - L_SavedCr4 + 0x2)(%rcx) # save the base address of shadowed GDT table
-
- movq 0x62(%rsp) ,%rsi # rsi <- the original GDT base address
- xchg %r10, %rcx # save rcx to r10 and initialize rcx to be the limit of GDT table
- incq %rcx # rcx <- the size of memory to copy
- xchg %r11, %rdi # save rdi to r11 and initialize rdi to the base address of shadowed GDT table
- rep
- movsb # perform memory copy to shadow GDT table
- movq %r10, %rcx # restore the orignal rcx before memory copy
- movq %r11, %rdi # restore the original rdi before memory copy
-
- sidt 0x50(%rsp)
- movq %cr0, %rax
- .set LSavedCrDelta, L_SavedCr0 - L_SavedCr4
- movl %eax, (LSavedCrDelta)(%rcx)
- andl $0x7ffffffe,%eax # clear PE, PG bits
- movq %cr4, %rbp
- movl %ebp, (%rcx) # save CR4 in SavedCr4
- andl $0xffffffcf,%ebp # clear PAE, PSE bits
- movl %r8d, %esi # esi <- 16-bit stack segment
- .byte 0x6a, DATA32
- popq %rdx
- lgdt (_16Gdtr - L_SavedCr4)(%rcx)
- movl %edx,%ss
- pushfq
- lea -8(%rdx), %edx
- lea L_RetFromRealMode(%rip), %r8
- pushq %r8
- movl %cs, %r8d
- movw %r8w, (L_SavedCs - L_SavedCr4)(%rcx)
- movq %rsp, (L_SavedSp - L_SavedCr4)(%rcx)
- .byte 0xff, 0x69 # jmp (_EntryPoint - L_SavedCr4)(%rcx)
- .set Ltemp1, _EntryPoint - L_SavedCr4
- .byte Ltemp1
-L_RetFromRealMode:
- popfq
- lgdt 0x60(%rsp) # restore protected mode GDTR
- lidt 0x50(%rsp) # restore protected mode IDTR
- lea -IA32_REGS_SIZE(%rbp), %eax
- .byte 0x0f, 0xa9 # pop gs
- .byte 0x0f, 0xa1 # pop fs
-
- popq %rbx
- movl %ebx, %ss
- popq %rbx
- movl %ebx, %es
- popq %rbx
- movl %ebx, %ds
-
- popq %rdi
- popq %rsi
- popq %rbx
- popq %rbp
-
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Thunk16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Thunk16.nasm
deleted file mode 100644
index 955e716..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Thunk16.nasm
+++ /dev/null
@@ -1,325 +0,0 @@
-
-#include "BaseLibInternals.h"
-
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Thunk.asm
-;
-; Abstract:
-;
-; Real mode thunk
-;
-;------------------------------------------------------------------------------
-
-global ASM_PFX(m16Size)
-global ASM_PFX(mThunk16Attr)
-global ASM_PFX(m16Gdt)
-global ASM_PFX(m16GdtrBase)
-global ASM_PFX(mTransition)
-global ASM_PFX(m16Start)
-
-struc IA32_REGS
-
- ._EDI: resd 1
- ._ESI: resd 1
- ._EBP: resd 1
- ._ESP: resd 1
- ._EBX: resd 1
- ._EDX: resd 1
- ._ECX: resd 1
- ._EAX: resd 1
- ._DS: resw 1
- ._ES: resw 1
- ._FS: resw 1
- ._GS: resw 1
- ._EFLAGS: resq 1
- ._EIP: resd 1
- ._CS: resw 1
- ._SS: resw 1
- .size:
-
-endstruc
-
-SECTION .data
-
-;
-; These are global constant to convey information to C code.
-;
-ASM_PFX(m16Size) DW ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start)
-ASM_PFX(mThunk16Attr) DW _BackFromUserCode.ThunkAttrEnd - 4 - ASM_PFX(m16Start)
-ASM_PFX(m16Gdt) DW _NullSeg - ASM_PFX(m16Start)
-ASM_PFX(m16GdtrBase) DW _16GdtrBase - ASM_PFX(m16Start)
-ASM_PFX(mTransition) DW _EntryPoint - ASM_PFX(m16Start)
-
-SECTION .text
-
-ASM_PFX(m16Start):
-
-SavedGdt:
- dw 0
- dq 0
-
-;------------------------------------------------------------------------------
-; _BackFromUserCode() takes control in real mode after 'retf' has been executed
-; by user code. It will be shadowed to somewhere in memory below 1MB.
-;------------------------------------------------------------------------------
-_BackFromUserCode:
- ;
- ; The order of saved registers on the stack matches the order they appears
- ; in IA32_REGS structure. This facilitates wrapper function to extract them
- ; into that structure.
- ;
-BITS 16
- push ss
- push cs
- ;
- ; Note: We can't use o32 on the next instruction because of a bug
- ; in NASM 2.09.04 through 2.10rc1.
- ;
- call dword .Base ; push eip
-.Base:
- push dword 0 ; reserved high order 32 bits of EFlags
- pushfd
- cli ; disable interrupts
- push gs
- push fs
- push es
- push ds
- pushad
- mov edx, strict dword 0
-.ThunkAttrEnd:
- test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15
- jz .1
- mov ax, 2401h
- int 15h
- cli ; disable interrupts
- jnc .2
-.1:
- test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL
- jz .2
- in al, 92h
- or al, 2
- out 92h, al ; deactivate A20M#
-.2:
- xor eax, eax
- mov ax, ss
- lea ebp, [esp + IA32_REGS.size]
- mov [bp - IA32_REGS.size + IA32_REGS._ESP], ebp
- mov ebx, [bp - IA32_REGS.size + IA32_REGS._EIP]
- shl eax, 4 ; shl eax, 4
- add ebp, eax ; add ebp, eax
- mov eax, cs
- shl eax, 4
- lea eax, [eax + ebx + (.X64JmpEnd - .Base)]
- mov [cs:bx + (.X64JmpEnd - 6 - .Base)], eax
- mov eax, strict dword 0
-.SavedCr4End:
- mov cr4, eax
-o32 lgdt [cs:bx + (SavedGdt - .Base)]
- mov ecx, 0c0000080h
- rdmsr
- or ah, 1
- wrmsr
- mov eax, strict dword 0
-.SavedCr0End:
- mov cr0, eax
- jmp 0:strict dword 0
-.X64JmpEnd:
-BITS 64
- nop
- mov rsp, strict qword 0
-.SavedSpEnd:
- nop
- ret
-
-_EntryPoint:
- DD _ToUserCode - ASM_PFX(m16Start)
- DW CODE16
-_16Gdtr:
- DW GDT_SIZE - 1
-_16GdtrBase:
- DQ 0
-_16Idtr:
- DW (1 << 10) - 1
- DD 0
-
-;------------------------------------------------------------------------------
-; _ToUserCode() takes control in real mode before passing control to user code.
-; It will be shadowed to somewhere in memory below 1MB.
-;------------------------------------------------------------------------------
-_ToUserCode:
-BITS 16
- mov ss, dx ; set new segment selectors
- mov ds, dx
- mov es, dx
- mov fs, dx
- mov gs, dx
- mov ecx, 0c0000080h
- mov cr0, eax ; real mode starts at next instruction
- rdmsr
- and ah, ~1
- wrmsr
- mov cr4, ebp
- mov ss, si ; set up 16-bit stack segment
- mov esp, ebx ; set up 16-bit stack pointer
- call dword .Base ; push eip
-.Base:
- pop ebp ; ebp <- address of .Base
- push word [dword esp + IA32_REGS.size + 2]
- lea ax, [bp + (.RealMode - .Base)]
- push ax
- retf ; execution begins at next instruction
-.RealMode:
-
-o32 lidt [cs:bp + (_16Idtr - .Base)]
-
- popad
- pop ds
- pop es
- pop fs
- pop gs
- popfd
- lea esp, [esp + 4] ; skip high order 32 bits of EFlags
-
-o32 retf ; transfer control to user code
-
-ALIGN 8
-
-CODE16 equ _16Code - $
-DATA16 equ _16Data - $
-DATA32 equ _32Data - $
-
-_NullSeg DQ 0
-_16Code:
- DW -1
- DW 0
- DB 0
- DB 9bh
- DB 8fh ; 16-bit segment, 4GB limit
- DB 0
-_16Data:
- DW -1
- DW 0
- DB 0
- DB 93h
- DB 8fh ; 16-bit segment, 4GB limit
- DB 0
-_32Data:
- DW -1
- DW 0
- DB 0
- DB 93h
- DB 0cfh ; 16-bit segment, 4GB limit
- DB 0
-
-GDT_SIZE equ $ - _NullSeg
-
-;------------------------------------------------------------------------------
-; IA32_REGISTER_SET *
-; EFIAPI
-; InternalAsmThunk16 (
-; IN IA32_REGISTER_SET *RegisterSet,
-; IN OUT VOID *Transition
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalAsmThunk16)
-ASM_PFX(InternalAsmThunk16):
-BITS 64
- push rbp
- push rbx
- push rsi
- push rdi
-
- mov ebx, ds
- push rbx ; Save ds segment register on the stack
- mov ebx, es
- push rbx ; Save es segment register on the stack
- mov ebx, ss
- push rbx ; Save ss segment register on the stack
-
- push fs
- push gs
- mov rsi, rcx
- movzx r8d, word [rsi + IA32_REGS._SS]
- mov edi, [rsi + IA32_REGS._ESP]
- lea rdi, [edi - (IA32_REGS.size + 4)]
- imul eax, r8d, 16 ; eax <- r8d(stack segment) * 16
- mov ebx, edi ; ebx <- stack for 16-bit code
- push IA32_REGS.size / 4
- add edi, eax ; edi <- linear address of 16-bit stack
- pop rcx
- rep movsd ; copy RegSet
- lea ecx, [rdx + (_BackFromUserCode.SavedCr4End - ASM_PFX(m16Start))]
- mov eax, edx ; eax <- transition code address
- and edx, 0fh
- shl eax, 12 ; segment address in high order 16 bits
- lea ax, [rdx + (_BackFromUserCode - ASM_PFX(m16Start))] ; offset address
- stosd ; [edi] <- return address of user code
-
- sgdt [rsp + 60h] ; save GDT stack in argument space
- movzx r10, word [rsp + 60h] ; r10 <- GDT limit
- lea r11, [rcx + (ASM_PFX(InternalAsmThunk16) - _BackFromUserCode.SavedCr4End) + 0xf]
- and r11, ~0xf ; r11 <- 16-byte aligned shadowed GDT table in real mode buffer
-
- mov [rcx + (SavedGdt - _BackFromUserCode.SavedCr4End)], r10w ; save the limit of shadowed GDT table
- mov [rcx + (SavedGdt - _BackFromUserCode.SavedCr4End) + 2], r11 ; save the base address of shadowed GDT table
-
- mov rsi, [rsp + 62h] ; rsi <- the original GDT base address
- xchg rcx, r10 ; save rcx to r10 and initialize rcx to be the limit of GDT table
- inc rcx ; rcx <- the size of memory to copy
- xchg rdi, r11 ; save rdi to r11 and initialize rdi to the base address of shadowed GDT table
- rep movsb ; perform memory copy to shadow GDT table
- mov rcx, r10 ; restore the orignal rcx before memory copy
- mov rdi, r11 ; restore the original rdi before memory copy
-
- sidt [rsp + 50h] ; save IDT stack in argument space
- mov rax, cr0
- mov [rcx + (_BackFromUserCode.SavedCr0End - 4 - _BackFromUserCode.SavedCr4End)], eax
- and eax, 7ffffffeh ; clear PE, PG bits
- mov rbp, cr4
- mov [rcx - 4], ebp ; save CR4 in _BackFromUserCode.SavedCr4End - 4
- and ebp, ~30h ; clear PAE, PSE bits
- mov esi, r8d ; esi <- 16-bit stack segment
- push DATA32
- pop rdx ; rdx <- 32-bit data segment selector
- lgdt [rcx + (_16Gdtr - _BackFromUserCode.SavedCr4End)]
- mov ss, edx
- pushfq
- lea edx, [rdx + DATA16 - DATA32]
- lea r8, [REL .RetFromRealMode]
- push r8
- mov r8d, cs
- mov [rcx + (_BackFromUserCode.X64JmpEnd - 2 - _BackFromUserCode.SavedCr4End)], r8w
- mov [rcx + (_BackFromUserCode.SavedSpEnd - 8 - _BackFromUserCode.SavedCr4End)], rsp
- jmp dword far [rcx + (_EntryPoint - _BackFromUserCode.SavedCr4End)]
-.RetFromRealMode:
- popfq
- lgdt [rsp + 60h] ; restore protected mode GDTR
- lidt [rsp + 50h] ; restore protected mode IDTR
- lea eax, [rbp - IA32_REGS.size]
- pop gs
- pop fs
- pop rbx
- mov ss, ebx
- pop rbx
- mov es, ebx
- pop rbx
- mov ds, ebx
-
- pop rdi
- pop rsi
- pop rbx
- pop rbp
-
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Wbinvd.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Wbinvd.nasm
deleted file mode 100644
index 6f7e03e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/Wbinvd.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; Wbinvd.Asm
-;
-; Abstract:
-;
-; AsmWbinvd function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWbinvd (
-; VOID
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWbinvd)
-ASM_PFX(AsmWbinvd):
- wbinvd
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr0.nasm
deleted file mode 100644
index 245d64e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr0.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteCr0.Asm
-;
-; Abstract:
-;
-; AsmWriteCr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr0 (
-; UINTN Cr0
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteCr0)
-ASM_PFX(AsmWriteCr0):
- mov cr0, rcx
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr2.nasm
deleted file mode 100644
index b85864e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr2.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteCr2.Asm
-;
-; Abstract:
-;
-; AsmWriteCr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr2 (
-; UINTN Cr2
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteCr2)
-ASM_PFX(AsmWriteCr2):
- mov cr2, rcx
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr3.nasm
deleted file mode 100644
index 3297fd9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr3.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteCr3.Asm
-;
-; Abstract:
-;
-; AsmWriteCr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr3 (
-; UINTN Cr3
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteCr3)
-ASM_PFX(AsmWriteCr3):
- mov cr3, rcx
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr4.nasm
deleted file mode 100644
index 426e27e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteCr4.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteCr4.Asm
-;
-; Abstract:
-;
-; AsmWriteCr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr4 (
-; UINTN Cr4
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteCr4)
-ASM_PFX(AsmWriteCr4):
- mov cr4, rcx
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr0.nasm
deleted file mode 100644
index e6ffa16..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr0.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr0.Asm
-;
-; Abstract:
-;
-; AsmWriteDr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr0 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr0)
-ASM_PFX(AsmWriteDr0):
- mov dr0, rcx
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr1.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr1.nasm
deleted file mode 100644
index 59db62d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr1.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr1.Asm
-;
-; Abstract:
-;
-; AsmWriteDr1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr1 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr1)
-ASM_PFX(AsmWriteDr1):
- mov dr1, rcx
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr2.nasm
deleted file mode 100644
index c7562d8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr2.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr2.Asm
-;
-; Abstract:
-;
-; AsmWriteDr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr2 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr2)
-ASM_PFX(AsmWriteDr2):
- mov dr2, rcx
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr3.nasm
deleted file mode 100644
index 3b36fb6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr3.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr3.Asm
-;
-; Abstract:
-;
-; AsmWriteDr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr3 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr3)
-ASM_PFX(AsmWriteDr3):
- mov dr3, rcx
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr4.nasm
deleted file mode 100644
index 09277a4..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr4.nasm
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr4.Asm
-;
-; Abstract:
-;
-; AsmWriteDr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr4 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr4)
-ASM_PFX(AsmWriteDr4):
- ;
- ; There's no obvious reason to access this register, since it's aliased to
- ; DR6 when DE=0 or an exception generated when DE=1
- ;
- DB 0xf, 0x23, 0xe1
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr5.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr5.nasm
deleted file mode 100644
index 9461613..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr5.nasm
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr5.Asm
-;
-; Abstract:
-;
-; AsmWriteDr5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr5 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr5)
-ASM_PFX(AsmWriteDr5):
- ;
- ; There's no obvious reason to access this register, since it's aliased to
- ; DR7 when DE=0 or an exception generated when DE=1
- ;
- DB 0xf, 0x23, 0xe9
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr6.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr6.nasm
deleted file mode 100644
index 315bf9f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr6.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr6.Asm
-;
-; Abstract:
-;
-; AsmWriteDr6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr6 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr6)
-ASM_PFX(AsmWriteDr6):
- mov dr6, rcx
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr7.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr7.nasm
deleted file mode 100644
index 5dc7613..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteDr7.nasm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteDr7.Asm
-;
-; Abstract:
-;
-; AsmWriteDr7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr7 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteDr7)
-ASM_PFX(AsmWriteDr7):
- mov dr7, rcx
- mov rax, rcx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteGdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteGdtr.nasm
deleted file mode 100644
index b2671a3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteGdtr.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteGdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteGdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86WriteGdtr (
-; IN CONST IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86WriteGdtr)
-ASM_PFX(InternalX86WriteGdtr):
- lgdt [rcx]
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteIdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteIdtr.nasm
deleted file mode 100644
index 12d2e2d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteIdtr.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteIdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteIdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86WriteIdtr (
-; IN CONST IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalX86WriteIdtr)
-ASM_PFX(InternalX86WriteIdtr):
- pushfq
- cli
- lidt [rcx]
- popfq
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteLdtr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteLdtr.nasm
deleted file mode 100644
index f29e0a1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteLdtr.nasm
+++ /dev/null
@@ -1,38 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteLdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteLdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteLdtr (
-; IN UINT16 Ldtr
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteLdtr)
-ASM_PFX(AsmWriteLdtr):
- lldt cx
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm0.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm0.nasm
deleted file mode 100644
index 0fcd95d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm0.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm0.Asm
-;
-; Abstract:
-;
-; AsmWriteMm0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm0 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm0)
-ASM_PFX(AsmWriteMm0):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x6e, 0xc1
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm1.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm1.nasm
deleted file mode 100644
index ed76786..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm1.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm1.Asm
-;
-; Abstract:
-;
-; AsmWriteMm1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm1 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm1)
-ASM_PFX(AsmWriteMm1):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x6e, 0xc9
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm2.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm2.nasm
deleted file mode 100644
index ccdcbbc..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm2.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm2.Asm
-;
-; Abstract:
-;
-; AsmWriteMm2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm2 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm2)
-ASM_PFX(AsmWriteMm2):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x6e, 0xd1
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm3.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm3.nasm
deleted file mode 100644
index 7f6a6d3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm3.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm3.Asm
-;
-; Abstract:
-;
-; AsmWriteMm3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm3 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm3)
-ASM_PFX(AsmWriteMm3):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x6e, 0xd9
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm4.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm4.nasm
deleted file mode 100644
index 3ea63e7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm4.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm4.Asm
-;
-; Abstract:
-;
-; AsmWriteMm4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm4 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm4)
-ASM_PFX(AsmWriteMm4):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x6e, 0xe1
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm5.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm5.nasm
deleted file mode 100644
index 4b99ed4..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm5.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm5.Asm
-;
-; Abstract:
-;
-; AsmWriteMm5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm5 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm5)
-ASM_PFX(AsmWriteMm5):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x6e, 0xe9
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm6.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm6.nasm
deleted file mode 100644
index 24a715b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm6.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm6.Asm
-;
-; Abstract:
-;
-; AsmWriteMm6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm6 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm6)
-ASM_PFX(AsmWriteMm6):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x6e, 0xf1
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm7.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm7.nasm
deleted file mode 100644
index 0696c6d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMm7.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMm7.Asm
-;
-; Abstract:
-;
-; AsmWriteMm7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm7 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMm7)
-ASM_PFX(AsmWriteMm7):
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 0x48, 0xf, 0x6e, 0xf9
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMsr64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMsr64.c
deleted file mode 100644
index 7099e2a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMsr64.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
- CpuBreakpoint function.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-/**
- Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
-**/
-
-void __writemsr (unsigned long Register, unsigned __int64 Value);
-
-#pragma intrinsic(__writemsr)
-
-/**
- Write data to MSR.
-
- @param Index The register index of MSR.
- @param Value Data wants to be written.
-
- @return Value written to MSR.
-
-**/
-UINT64
-EFIAPI
-AsmWriteMsr64 (
- IN UINT32 Index,
- IN UINT64 Value
- )
-{
- __writemsr (Index, Value);
- return Value;
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMsr64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMsr64.nasm
deleted file mode 100644
index feec7e8..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteMsr64.nasm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteMsr64.Asm
-;
-; Abstract:
-;
-; AsmWriteMsr64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmWriteMsr64 (
-; IN UINT32 Index,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteMsr64)
-ASM_PFX(AsmWriteMsr64):
- mov rax, rdx ; meanwhile, rax <- return value
- shr rdx, 0x20 ; edx:eax contains the value to write
- wrmsr
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteTr.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteTr.nasm
deleted file mode 100644
index cfd552f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X64/WriteTr.nasm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; Copyright (c) 2017, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; WriteTr.nasm
-;
-; Abstract:
-;
-; Write TR register
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID
-; AsmWriteTr (
-; UINT16 Selector
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(AsmWriteTr)
-ASM_PFX(AsmWriteTr):
- mov eax, ecx
- ltr ax
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86DisablePaging32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86DisablePaging32.c
deleted file mode 100644
index 77466b3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86DisablePaging32.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file
- IA-32/x64 AsmDisablePaging32()
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Disables the 32-bit paging mode on the CPU.
-
- Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 32-paged protected
- mode. This function is only available on IA-32. After the 32-bit paging mode
- is disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be NULL. The function EntryPoint must never return.
-
- If the current execution mode is not 32-bit paged mode, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit paged mode.
- 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
- 4) CR3 must point to valid page tables that guarantee that the pages for
- this function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is disabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is disabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is
- disabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-AsmDisablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- ASSERT (EntryPoint != NULL);
- ASSERT (NewStack != NULL);
- InternalX86DisablePaging32 (EntryPoint, Context1, Context2, NewStack);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86DisablePaging64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86DisablePaging64.c
deleted file mode 100644
index 4f248ce..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86DisablePaging64.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file
- IA-32/x64 AsmDisablePaging64()
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Disables the 64-bit paging mode on the CPU.
-
- Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 64-paging mode.
- This function is only available on x64. After the 64-bit paging mode is
- disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be 0. The function EntryPoint must never return.
-
- If the current execution mode is not 64-bit paged mode, then ASSERT().
- If EntryPoint is 0, then ASSERT().
- If NewStack is 0, then ASSERT().
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for 32-bit protected mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is disabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is disabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is disabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-AsmDisablePaging64 (
- IN UINT16 Cs,
- IN UINT32 EntryPoint,
- IN UINT32 Context1, OPTIONAL
- IN UINT32 Context2, OPTIONAL
- IN UINT32 NewStack
- )
-{
- ASSERT (EntryPoint != 0);
- ASSERT (NewStack != 0);
- InternalX86DisablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86EnablePaging32.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86EnablePaging32.c
deleted file mode 100644
index a596662..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86EnablePaging32.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/** @file
- IA-32/x64 AsmEnablePaging32()
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Enables the 32-bit paging mode on the CPU.
-
- Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode. This function is
- only available on IA-32. After the 32-bit paging mode is enabled, control is
- transferred to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- If the current execution mode is not 32-bit protected mode, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit protected mode with flat descriptors. This
- means all descriptors must have a base of 0 and a limit of 4GB.
- 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
- descriptors.
- 4) CR3 must point to valid page tables that will be used once the transition
- is complete, and those page tables must guarantee that the pages for this
- function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is enabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is enabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is enabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-AsmEnablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- ASSERT (EntryPoint != NULL);
- ASSERT (NewStack != NULL);
- InternalX86EnablePaging32 (EntryPoint, Context1, Context2, NewStack);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86EnablePaging64.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86EnablePaging64.c
deleted file mode 100644
index 4a96a84..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86EnablePaging64.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/** @file
- IA-32/x64 AsmEnablePaging64()
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Enables the 64-bit paging mode on the CPU.
-
- Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode with flat
- descriptors. This function is only available on IA-32. After the 64-bit
- paging mode is enabled, control is transferred to the function specified by
- EntryPoint using the new stack specified by NewStack and passing in the
- parameters specified by Context1 and Context2. Context1 and Context2 are
- optional and may be 0. The function EntryPoint must never return.
-
- If the current execution mode is not 32-bit protected mode with flat
- descriptors, then ASSERT().
- If EntryPoint is 0, then ASSERT().
- If NewStack is 0, then ASSERT().
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for long mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is enabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is enabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is enabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-AsmEnablePaging64 (
- IN UINT16 Cs,
- IN UINT64 EntryPoint,
- IN UINT64 Context1, OPTIONAL
- IN UINT64 Context2, OPTIONAL
- IN UINT64 NewStack
- )
-{
- ASSERT (EntryPoint != 0);
- ASSERT (NewStack != 0);
- InternalX86EnablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86FxRestore.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86FxRestore.c
deleted file mode 100644
index 39ba95c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86FxRestore.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/** @file
- IA-32/x64 AsmFxRestore()
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Restores the current floating point/SSE/SSE2 context from a buffer.
-
- Restores the current floating point/SSE/SSE2 state from the buffer specified
- by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
- only available on IA-32 and x64.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-byte boundary, then ASSERT().
- If Buffer was not saved with AsmFxSave(), then ASSERT().
-
- @param Buffer A pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-AsmFxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- )
-{
- ASSERT (Buffer != NULL);
- ASSERT (0 == ((UINTN)Buffer & 0xf));
-
- //
- // Check the flag recorded by AsmFxSave()
- //
- ASSERT (0xAA5555AA == *(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]));
-
- InternalX86FxRestore (Buffer);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86FxSave.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86FxSave.c
deleted file mode 100644
index 270b1fd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86FxSave.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file
- IA-32/x64 AsmFxSave()
-
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Save the current floating point/SSE/SSE2 context to a buffer.
-
- Saves the current floating point/SSE/SSE2 state to the buffer specified by
- Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
- available on IA-32 and x64.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param Buffer A pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-AsmFxSave (
- OUT IA32_FX_BUFFER *Buffer
- )
-{
- ASSERT (Buffer != NULL);
- ASSERT (0 == ((UINTN)Buffer & 0xf));
-
- InternalX86FxSave (Buffer);
-
- //
- // Mark one flag at end of Buffer, it will be check by AsmFxRestor()
- //
- *(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]) = 0xAA5555AA;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86GetInterruptState.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86GetInterruptState.c
deleted file mode 100644
index 51166e5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86GetInterruptState.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/** @file
- IA-32/x64 GetInterruptState()
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-/**
- Retrieves the current CPU interrupt state.
-
- Returns TRUE is interrupts are currently enabled. Otherwise
- returns FALSE.
-
- @retval TRUE CPU interrupts are enabled.
- @retval FALSE CPU interrupts are disabled.
-
-**/
-BOOLEAN
-EFIAPI
-GetInterruptState (
- VOID
- )
-{
- IA32_EFLAGS32 EFlags;
-
- EFlags.UintN = AsmReadEflags ();
- return (BOOLEAN)(1 == EFlags.Bits.IF);
-}
-
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86MemoryFence.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86MemoryFence.c
deleted file mode 100644
index 8c3d094..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86MemoryFence.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
- IA-32/x64 MemoryFence().
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-/**
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-**/
-VOID
-EFIAPI
-MemoryFence (
- VOID
- )
-{
- return;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86Msr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86Msr.c
deleted file mode 100644
index 6e888a1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86Msr.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/** @file
- IA-32/x64 MSR functions.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-
-/**
- Returns the lower 32-bits of a Machine Specific Register(MSR).
-
- Reads and returns the lower 32-bits of the MSR specified by Index.
- No parameter checking is performed on Index, and some Index values may cause
- CPU exceptions. The caller must either guarantee that Index is valid, or the
- caller must set up exception handlers to catch the exceptions. This function
- is only available on IA-32 and x64.
-
- @param Index The 32-bit MSR index to read.
-
- @return The lower 32 bits of the MSR identified by Index.
-
-**/
-UINT32
-EFIAPI
-AsmReadMsr32 (
- IN UINT32 Index
- )
-{
- return (UINT32)AsmReadMsr64 (Index);
-}
-
-/**
- Writes a 32-bit value to a Machine Specific Register(MSR), and returns the value.
- The upper 32-bits of the MSR are set to zero.
-
- Writes the 32-bit value specified by Value to the MSR specified by Index. The
- upper 32-bits of the MSR write are set to zero. The 32-bit value written to
- the MSR is returned. No parameter checking is performed on Index or Value,
- and some of these may cause CPU exceptions. The caller must either guarantee
- that Index and Value are valid, or the caller must establish proper exception
- handlers. This function is only available on IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param Value The 32-bit value to write to the MSR.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-AsmWriteMsr32 (
- IN UINT32 Index,
- IN UINT32 Value
- )
-{
- return (UINT32)AsmWriteMsr64 (Index, Value);
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise OR on the lower 32-bits, and
- writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise OR
- between the lower 32-bits of the read result and the value specified by
- OrData, and writes the result to the 64-bit MSR specified by Index. The lower
- 32-bits of the value written to the MSR is returned. No parameter checking is
- performed on Index or OrData, and some of these may cause CPU exceptions. The
- caller must either guarantee that Index and OrData are valid, or the caller
- must establish proper exception handlers. This function is only available on
- IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrOr32 (
- IN UINT32 Index,
- IN UINT32 OrData
- )
-{
- return (UINT32)AsmMsrOr64 (Index, OrData);
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes
- the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- lower 32-bits of the read result and the value specified by AndData, and
- writes the result to the 64-bit MSR specified by Index. The lower 32-bits of
- the value written to the MSR is returned. No parameter checking is performed
- on Index or AndData, and some of these may cause CPU exceptions. The caller
- must either guarantee that Index and AndData are valid, or the caller must
- establish proper exception handlers. This function is only available on IA-32
- and x64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrAnd32 (
- IN UINT32 Index,
- IN UINT32 AndData
- )
-{
- return (UINT32)AsmMsrAnd64 (Index, AndData);
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise OR
- on the lower 32-bits, and writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- lower 32-bits of the read result and the value specified by AndData
- preserving the upper 32-bits, performs a bitwise OR between the
- result of the AND operation and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Address. The lower 32-bits of the value
- written to the MSR is returned. No parameter checking is performed on Index,
- AndData, or OrData, and some of these may cause CPU exceptions. The caller
- must either guarantee that Index, AndData, and OrData are valid, or the
- caller must establish proper exception handlers. This function is only
- available on IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrAndThenOr32 (
- IN UINT32 Index,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return (UINT32)AsmMsrAndThenOr64 (Index, AndData, OrData);
-}
-
-/**
- Reads a bit field of an MSR.
-
- Reads the bit field in the lower 32-bits of a 64-bit MSR. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned. The caller must either guarantee that Index is valid, or the caller
- must set up exception handlers to catch the exceptions. This function is only
- available on IA-32 and x64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The bit field read from the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldRead32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead32 (AsmReadMsr32 (Index), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an MSR.
-
- Writes Value to a bit field in the lower 32-bits of a 64-bit MSR. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination MSR are preserved. The lower 32-bits of the MSR written is
- returned. The caller must either guarantee that Index and the data written
- is valid, or the caller must set up exception handlers to catch the exceptions.
- This function is only available on IA-32 and x64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value The new value of the bit field.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldWrite32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- ASSERT (EndBit < sizeof (Value) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)AsmMsrBitFieldWrite64 (Index, StartBit, EndBit, Value);
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The lower 32-bits of the value
- written to the MSR are returned. Extra left bits in OrData are stripped. The
- caller must either guarantee that Index and the data written is valid, or
- the caller must set up exception handlers to catch the exceptions. This
- function is only available on IA-32 and x64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldOr32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- ASSERT (EndBit < sizeof (OrData) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)AsmMsrBitFieldOr64 (Index, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by AndData, and writes the result to the
- 64-bit MSR specified by Index. The lower 32-bits of the value written to the
- MSR are returned. Extra left bits in AndData are stripped. The caller must
- either guarantee that Index and the data written is valid, or the caller must
- set up exception handlers to catch the exceptions. This function is only
- available on IA-32 and x64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldAnd32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- ASSERT (EndBit < sizeof (AndData) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)AsmMsrBitFieldAnd64 (Index, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by a
- bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit MSR specified by Index. The
- lower 32-bits of the value written to the MSR are returned. Extra left bits
- in both AndData and OrData are stripped. The caller must either guarantee
- that Index and the data written is valid, or the caller must set up exception
- handlers to catch the exceptions. This function is only available on IA-32
- and x64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldAndThenOr32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- ASSERT (EndBit < sizeof (AndData) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)AsmMsrBitFieldAndThenOr64 (
- Index,
- StartBit,
- EndBit,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise OR, and writes the result
- back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The value written to the MSR is
- returned. No parameter checking is performed on Index or OrData, and some of
- these may cause CPU exceptions. The caller must either guarantee that Index
- and OrData are valid, or the caller must establish proper exception handlers.
- This function is only available on IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrOr64 (
- IN UINT32 Index,
- IN UINT64 OrData
- )
-{
- return AsmWriteMsr64 (Index, AsmReadMsr64 (Index) | OrData);
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by OrData, and writes the result to the
- 64-bit MSR specified by Index. The value written to the MSR is returned. No
- parameter checking is performed on Index or OrData, and some of these may
- cause CPU exceptions. The caller must either guarantee that Index and OrData
- are valid, or the caller must establish proper exception handlers. This
- function is only available on IA-32 and x64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrAnd64 (
- IN UINT32 Index,
- IN UINT64 AndData
- )
-{
- return AsmWriteMsr64 (Index, AsmReadMsr64 (Index) & AndData);
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise
- OR, and writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between read
- result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 64-bit MSR specified by Index. The value written
- to the MSR is returned. No parameter checking is performed on Index, AndData,
- or OrData, and some of these may cause CPU exceptions. The caller must either
- guarantee that Index, AndData, and OrData are valid, or the caller must
- establish proper exception handlers. This function is only available on IA-32
- and x64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrAndThenOr64 (
- IN UINT32 Index,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return AsmWriteMsr64 (Index, (AsmReadMsr64 (Index) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of an MSR.
-
- Reads the bit field in the 64-bit MSR. The bit field is specified by the
- StartBit and the EndBit. The value of the bit field is returned. The caller
- must either guarantee that Index is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and x64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read from the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldRead64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead64 (AsmReadMsr64 (Index), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an MSR.
-
- Writes Value to a bit field in a 64-bit MSR. The bit field is specified by
- the StartBit and the EndBit. All other bits in the destination MSR are
- preserved. The MSR written is returned. The caller must either guarantee
- that Index and the data written is valid, or the caller must set up exception
- handlers to catch the exceptions. This function is only available on IA-32 and x64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value The new value of the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldWrite64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- )
-{
- return AsmWriteMsr64 (
- Index,
- BitFieldWrite64 (AsmReadMsr64 (Index), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise OR, and
- writes the result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The value written to the MSR is
- returned. Extra left bits in OrData are stripped. The caller must either
- guarantee that Index and the data written is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and x64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldOr64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- )
-{
- return AsmWriteMsr64 (
- Index,
- BitFieldOr64 (AsmReadMsr64 (Index), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by AndData, and writes the result to the
- 64-bit MSR specified by Index. The value written to the MSR is returned.
- Extra left bits in AndData are stripped. The caller must either guarantee
- that Index and the data written is valid, or the caller must set up exception
- handlers to catch the exceptions. This function is only available on IA-32
- and x64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldAnd64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- )
-{
- return AsmWriteMsr64 (
- Index,
- BitFieldAnd64 (AsmReadMsr64 (Index), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
- bitwise OR, and writes the result back to the bit field in the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by
- a bitwise OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit MSR specified by Index. The
- value written to the MSR is returned. Extra left bits in both AndData and
- OrData are stripped. The caller must either guarantee that Index and the data
- written is valid, or the caller must set up exception handlers to catch the
- exceptions. This function is only available on IA-32 and x64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
- If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
- If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the bit field.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldAndThenOr64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return AsmWriteMsr64 (
- Index,
- BitFieldAndThenOr64 (
- AsmReadMsr64 (Index),
- StartBit,
- EndBit,
- AndData,
- OrData
- )
- );
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86PatchInstruction.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86PatchInstruction.c
deleted file mode 100644
index 18abe98..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86PatchInstruction.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
- IA-32/x64 PatchInstructionX86()
-
- Copyright (C) 2018, Intel Corporation. All rights reserved.
- Copyright (C) 2018, Red Hat, Inc.
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
- WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Patch the immediate operand of an IA32 or X64 instruction such that the byte,
- word, dword or qword operand is encoded at the end of the instruction's
- binary representation.
-
- This function should be used to update object code that was compiled with
- NASM from assembly source code. Example:
-
- NASM source code:
-
- mov eax, strict dword 0 ; the imm32 zero operand will be patched
- ASM_PFX(gPatchCr3):
- mov cr3, eax
-
- C source code:
-
- X86_ASSEMBLY_PATCH_LABEL gPatchCr3;
- PatchInstructionX86 (gPatchCr3, AsmReadCr3 (), 4);
-
- @param[out] InstructionEnd Pointer right past the instruction to patch. The
- immediate operand to patch is expected to
- comprise the trailing bytes of the instruction.
- If InstructionEnd is closer to address 0 than
- ValueSize permits, then ASSERT().
-
- @param[in] PatchValue The constant to write to the immediate operand.
- The caller is responsible for ensuring that
- PatchValue can be represented in the byte, word,
- dword or qword operand (as indicated through
- ValueSize); otherwise ASSERT().
-
- @param[in] ValueSize The size of the operand in bytes; must be 1, 2,
- 4, or 8. ASSERT() otherwise.
-**/
-VOID
-EFIAPI
-PatchInstructionX86 (
- OUT X86_ASSEMBLY_PATCH_LABEL *InstructionEnd,
- IN UINT64 PatchValue,
- IN UINTN ValueSize
- )
-{
- //
- // The equality ((UINTN)InstructionEnd == ValueSize) would assume a zero-size
- // instruction at address 0; forbid it.
- //
- ASSERT ((UINTN)InstructionEnd > ValueSize);
-
- switch (ValueSize) {
- case 1:
- ASSERT (PatchValue <= MAX_UINT8);
- *((UINT8 *)(UINTN)InstructionEnd - 1) = (UINT8)PatchValue;
- break;
-
- case 2:
- ASSERT (PatchValue <= MAX_UINT16);
- WriteUnaligned16 ((UINT16 *)(UINTN)InstructionEnd - 1, (UINT16)PatchValue);
- break;
-
- case 4:
- ASSERT (PatchValue <= MAX_UINT32);
- WriteUnaligned32 ((UINT32 *)(UINTN)InstructionEnd - 1, (UINT32)PatchValue);
- break;
-
- case 8:
- WriteUnaligned64 ((UINT64 *)(UINTN)InstructionEnd - 1, PatchValue);
- break;
-
- default:
- ASSERT (FALSE);
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86RdRand.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86RdRand.c
deleted file mode 100644
index 5aaab4e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86RdRand.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/** @file
- IA-32/x64 AsmRdRandxx()
- Generates random number through CPU RdRand instruction.
-
- Copyright (c) 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Generates a 16-bit random number through RDRAND instruction.
-
- if Rand is NULL, then ASSERT().
-
- @param[out] Rand Buffer pointer to store the random result.
-
- @retval TRUE RDRAND call was successful.
- @retval FALSE Failed attempts to call RDRAND.
-
- **/
-BOOLEAN
-EFIAPI
-AsmRdRand16 (
- OUT UINT16 *Rand
- )
-{
- ASSERT (Rand != NULL);
- return InternalX86RdRand16 (Rand);
-}
-
-/**
- Generates a 32-bit random number through RDRAND instruction.
-
- if Rand is NULL, then ASSERT().
-
- @param[out] Rand Buffer pointer to store the random result.
-
- @retval TRUE RDRAND call was successful.
- @retval FALSE Failed attempts to call RDRAND.
-
-**/
-BOOLEAN
-EFIAPI
-AsmRdRand32 (
- OUT UINT32 *Rand
- )
-{
- ASSERT (Rand != NULL);
- return InternalX86RdRand32 (Rand);
-}
-
-/**
- Generates a 64-bit random number through RDRAND instruction.
-
- if Rand is NULL, then ASSERT().
-
- @param[out] Rand Buffer pointer to store the random result.
-
- @retval TRUE RDRAND call was successful.
- @retval FALSE Failed attempts to call RDRAND.
-
-**/
-BOOLEAN
-EFIAPI
-AsmRdRand64 (
- OUT UINT64 *Rand
- )
-{
- ASSERT (Rand != NULL);
- return InternalX86RdRand64 (Rand);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86ReadGdtr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86ReadGdtr.c
deleted file mode 100644
index d0a5919..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86ReadGdtr.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- IA-32/x64 AsmReadGdtr()
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Reads the current Global Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current GDTR descriptor and returns it in Gdtr. This
- function is only available on IA-32 and x64.
-
- If Gdtr is NULL, then ASSERT().
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmReadGdtr (
- OUT IA32_DESCRIPTOR *Gdtr
- )
-{
- ASSERT (Gdtr != NULL);
- InternalX86ReadGdtr (Gdtr);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86ReadIdtr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86ReadIdtr.c
deleted file mode 100644
index 8a55011..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86ReadIdtr.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- IA-32/x64 AsmReadIdtr()
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Reads the current Interrupt Descriptor Table Register(IDTR) descriptor.
-
- Reads and returns the current IDTR descriptor and returns it in Idtr. This
- function is only available on IA-32 and x64.
-
- If Idtr is NULL, then ASSERT().
-
- @param Idtr The pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmReadIdtr (
- OUT IA32_DESCRIPTOR *Idtr
- )
-{
- ASSERT (Idtr != NULL);
- InternalX86ReadIdtr (Idtr);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86SpeculationBarrier.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86SpeculationBarrier.c
deleted file mode 100644
index eb763cd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86SpeculationBarrier.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
- SpeculationBarrier() function for IA32 and x64.
-
- Copyright (C) 2018, Intel Corporation. All rights reserved.
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
- WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include
-
-/**
- Uses as a barrier to stop speculative execution.
-
- Ensures that no later instruction will execute speculatively, until all prior
- instructions have completed.
-
-**/
-VOID
-EFIAPI
-SpeculationBarrier (
- VOID
- )
-{
- AsmLfence ();
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86Thunk.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86Thunk.c
deleted file mode 100644
index 93e74cd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86Thunk.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/** @file
- Real Mode Thunk Functions for IA32 and x64.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-extern CONST UINT8 m16Start;
-extern CONST UINT16 m16Size;
-extern CONST UINT16 mThunk16Attr;
-extern CONST UINT16 m16Gdt;
-extern CONST UINT16 m16GdtrBase;
-extern CONST UINT16 mTransition;
-
-/**
- Invokes 16-bit code in big real mode and returns the updated register set.
-
- This function transfers control to the 16-bit code specified by CS:EIP using
- the stack specified by SS:ESP in RegisterSet. The updated registers are saved
- on the real mode stack and the starting address of the save area is returned.
-
- @param RegisterSet Values of registers before invocation of 16-bit code.
- @param Transition The pointer to the transition code under 1MB.
-
- @return The pointer to a IA32_REGISTER_SET structure containing the updated
- register values.
-
-**/
-IA32_REGISTER_SET *
-EFIAPI
-InternalAsmThunk16 (
- IN IA32_REGISTER_SET *RegisterSet,
- IN OUT VOID *Transition
- );
-
-/**
- Retrieves the properties for 16-bit thunk functions.
-
- Computes the size of the buffer and stack below 1MB required to use the
- AsmPrepareThunk16(), AsmThunk16() and AsmPrepareAndThunk16() functions. This
- buffer size is returned in RealModeBufferSize, and the stack size is returned
- in ExtraStackSize. If parameters are passed to the 16-bit real mode code,
- then the actual minimum stack size is ExtraStackSize plus the maximum number
- of bytes that need to be passed to the 16-bit real mode code.
-
- If RealModeBufferSize is NULL, then ASSERT().
- If ExtraStackSize is NULL, then ASSERT().
-
- @param RealModeBufferSize A pointer to the size of the buffer below 1MB
- required to use the 16-bit thunk functions.
- @param ExtraStackSize A pointer to the extra size of stack below 1MB
- that the 16-bit thunk functions require for
- temporary storage in the transition to and from
- 16-bit real mode.
-
-**/
-VOID
-EFIAPI
-AsmGetThunk16Properties (
- OUT UINT32 *RealModeBufferSize,
- OUT UINT32 *ExtraStackSize
- )
-{
- ASSERT (RealModeBufferSize != NULL);
- ASSERT (ExtraStackSize != NULL);
-
- *RealModeBufferSize = m16Size;
-
- //
- // Extra 4 bytes for return address, and another 4 bytes for mode transition
- //
- *ExtraStackSize = sizeof (IA32_DWORD_REGS) + 8;
-}
-
-/**
- Prepares all structures a code required to use AsmThunk16().
-
- Prepares all structures and code required to use AsmThunk16().
-
- This interface is limited to be used in either physical mode or virtual modes with paging enabled where the
- virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1.
-
- If ThunkContext is NULL, then ASSERT().
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmPrepareThunk16 (
- IN OUT THUNK_CONTEXT *ThunkContext
- )
-{
- IA32_SEGMENT_DESCRIPTOR *RealModeGdt;
-
- ASSERT (ThunkContext != NULL);
- ASSERT ((UINTN)ThunkContext->RealModeBuffer < 0x100000);
- ASSERT (ThunkContext->RealModeBufferSize >= m16Size);
- ASSERT ((UINTN)ThunkContext->RealModeBuffer + m16Size <= 0x100000);
-
- CopyMem (ThunkContext->RealModeBuffer, &m16Start, m16Size);
-
- //
- // Point RealModeGdt to the GDT to be used in transition
- //
- // RealModeGdt[0]: Reserved as NULL descriptor
- // RealModeGdt[1]: Code Segment
- // RealModeGdt[2]: Data Segment
- // RealModeGdt[3]: Call Gate
- //
- RealModeGdt = (IA32_SEGMENT_DESCRIPTOR*)(
- (UINTN)ThunkContext->RealModeBuffer + m16Gdt);
-
- //
- // Update Code & Data Segment Descriptor
- //
- RealModeGdt[1].Bits.BaseLow =
- (UINT32)(UINTN)ThunkContext->RealModeBuffer & ~0xf;
- RealModeGdt[1].Bits.BaseMid =
- (UINT32)(UINTN)ThunkContext->RealModeBuffer >> 16;
-
- //
- // Update transition code entry point offset
- //
- *(UINT32*)((UINTN)ThunkContext->RealModeBuffer + mTransition) +=
- (UINT32)(UINTN)ThunkContext->RealModeBuffer & 0xf;
-
- //
- // Update Segment Limits for both Code and Data Segment Descriptors
- //
- if ((ThunkContext->ThunkAttributes & THUNK_ATTRIBUTE_BIG_REAL_MODE) == 0) {
- //
- // Set segment limits to 64KB
- //
- RealModeGdt[1].Bits.LimitHigh = 0;
- RealModeGdt[1].Bits.G = 0;
- RealModeGdt[2].Bits.LimitHigh = 0;
- RealModeGdt[2].Bits.G = 0;
- }
-
- //
- // Update GDTBASE for this thunk context
- //
- *(VOID**)((UINTN)ThunkContext->RealModeBuffer + m16GdtrBase) = RealModeGdt;
-
- //
- // Update Thunk Attributes
- //
- *(UINT32*)((UINTN)ThunkContext->RealModeBuffer + mThunk16Attr) =
- ThunkContext->ThunkAttributes;
-}
-
-/**
- Transfers control to a 16-bit real mode entry point and returns the results.
-
- Transfers control to a 16-bit real mode entry point and returns the results.
- AsmPrepareThunk16() must be called with ThunkContext before this function is used.
- This function must be called with interrupts disabled.
-
- The register state from the RealModeState field of ThunkContext is restored just prior
- to calling the 16-bit real mode entry point. This includes the EFLAGS field of RealModeState,
- which is used to set the interrupt state when a 16-bit real mode entry point is called.
- Control is transferred to the 16-bit real mode entry point specified by the CS and Eip fields of RealModeState.
- The stack is initialized to the SS and ESP fields of RealModeState. Any parameters passed to
- the 16-bit real mode code must be populated by the caller at SS:ESP prior to calling this function.
- The 16-bit real mode entry point is invoked with a 16-bit CALL FAR instruction,
- so when accessing stack contents, the 16-bit real mode code must account for the 16-bit segment
- and 16-bit offset of the return address that were pushed onto the stack. The 16-bit real mode entry
- point must exit with a RETF instruction. The register state is captured into RealModeState immediately
- after the RETF instruction is executed.
-
- If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts,
- or any of the 16-bit real mode code makes a SW interrupt, then the caller is responsible for making sure
- the IDT at address 0 is initialized to handle any HW or SW interrupts that may occur while in 16-bit real mode.
-
- If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts,
- then the caller is responsible for making sure the 8259 PIC is in a state compatible with 16-bit real mode.
- This includes the base vectors, the interrupt masks, and the edge/level trigger mode.
-
- If THUNK_ATTRIBUTE_BIG_REAL_MODE is set in the ThunkAttributes field of ThunkContext, then the user code
- is invoked in big real mode. Otherwise, the user code is invoked in 16-bit real mode with 64KB segment limits.
-
- If neither THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 nor THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in
- ThunkAttributes, then it is assumed that the user code did not enable the A20 mask, and no attempt is made to
- disable the A20 mask.
-
- If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is set and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is clear in
- ThunkAttributes, then attempt to use the INT 15 service to disable the A20 mask. If this INT 15 call fails,
- then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports.
-
- If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is clear and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is set in
- ThunkAttributes, then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports.
-
- If ThunkContext is NULL, then ASSERT().
- If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT().
- If both THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in
- ThunkAttributes, then ASSERT().
-
- This interface is limited to be used in either physical mode or virtual modes with paging enabled where the
- virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1.
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmThunk16 (
- IN OUT THUNK_CONTEXT *ThunkContext
- )
-{
- IA32_REGISTER_SET *UpdatedRegs;
-
- ASSERT (ThunkContext != NULL);
- ASSERT ((UINTN)ThunkContext->RealModeBuffer < 0x100000);
- ASSERT (ThunkContext->RealModeBufferSize >= m16Size);
- ASSERT ((UINTN)ThunkContext->RealModeBuffer + m16Size <= 0x100000);
- ASSERT (((ThunkContext->ThunkAttributes & (THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 | THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL)) != \
- (THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 | THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL)));
-
- UpdatedRegs = InternalAsmThunk16 (
- ThunkContext->RealModeState,
- ThunkContext->RealModeBuffer
- );
-
- CopyMem (ThunkContext->RealModeState, UpdatedRegs, sizeof (*UpdatedRegs));
-}
-
-/**
- Prepares all structures and code for a 16-bit real mode thunk, transfers
- control to a 16-bit real mode entry point, and returns the results.
-
- Prepares all structures and code for a 16-bit real mode thunk, transfers
- control to a 16-bit real mode entry point, and returns the results. If the
- caller only need to perform a single 16-bit real mode thunk, then this
- service should be used. If the caller intends to make more than one 16-bit
- real mode thunk, then it is more efficient if AsmPrepareThunk16() is called
- once and AsmThunk16() can be called for each 16-bit real mode thunk.
-
- This interface is limited to be used in either physical mode or virtual modes with paging enabled where the
- virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1.
-
- See AsmPrepareThunk16() and AsmThunk16() for the detailed description and ASSERT() conditions.
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmPrepareAndThunk16 (
- IN OUT THUNK_CONTEXT *ThunkContext
- )
-{
- AsmPrepareThunk16 (ThunkContext);
- AsmThunk16 (ThunkContext);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86WriteGdtr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86WriteGdtr.c
deleted file mode 100644
index 7544e8a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86WriteGdtr.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- IA-32/x64 AsmWriteGdtr()
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Writes the current Global Descriptor Table Register (GDTR) descriptor.
-
- Writes and the current GDTR descriptor specified by Gdtr. This function is
- only available on IA-32 and x64.
-
- If Gdtr is NULL, then ASSERT().
-
- @param Gdtr The pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmWriteGdtr (
- IN CONST IA32_DESCRIPTOR *Gdtr
- )
-{
- ASSERT (Gdtr != NULL);
- InternalX86WriteGdtr (Gdtr);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86WriteIdtr.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86WriteIdtr.c
deleted file mode 100644
index 9060a92..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseLib/X86WriteIdtr.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/** @file
- IA-32/x64 AsmWriteIdtr()
-
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "BaseLibInternals.h"
-
-/**
- Writes the current Interrupt Descriptor Table Register(IDTR) descriptor.
-
- Writes the current IDTR descriptor and returns it in Idtr. This function is
- only available on IA-32 and x64.
-
- If Idtr is NULL, then ASSERT().
-
- @param Idtr The pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmWriteIdtr (
- IN CONST IA32_DESCRIPTOR *Idtr
- )
-{
- ASSERT (Idtr != NULL);
- InternalX86WriteIdtr (Idtr);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
deleted file mode 100644
index e172080..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
+++ /dev/null
@@ -1,57 +0,0 @@
-## @file
-# Instance of Base Memory Library without assembly.
-#
-# Base Memory Library implementation - no ASM.
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseMemoryLib
- MODULE_UNI_FILE = BaseMemoryLib.uni
- FILE_GUID = fd44e603-002a-4b29-9f5f-529e815b6165
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = BaseMemoryLib
-
-
-#
-# VALID_ARCHITECTURES = IA32 X64 EBC ARM AARCH64
-#
-
-[Sources]
- SetMem.c
- ScanMem64Wrapper.c
- ScanMem32Wrapper.c
- ScanMem16Wrapper.c
- ScanMem8Wrapper.c
- ZeroMemWrapper.c
- CompareMemWrapper.c
- SetMem64Wrapper.c
- SetMem32Wrapper.c
- SetMem16Wrapper.c
- SetMemWrapper.c
- CopyMemWrapper.c
- IsZeroBufferWrapper.c
- MemLibGeneric.c
- MemLibGuid.c
- CopyMem.c
- MemLibInternals.h
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- DebugLib
- BaseLib
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.uni
deleted file mode 100644
index 458e262..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.uni
+++ /dev/null
@@ -1,21 +0,0 @@
-// /** @file
-// Instance of Base Memory Library without assembly.
-//
-// Base Memory Library implementation - no ASM.
-//
-// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Instance of Base Memory Library without assembly"
-
-#string STR_MODULE_DESCRIPTION #language en-US "Base Memory Library implementation - no ASM."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/CompareMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/CompareMemWrapper.c
deleted file mode 100644
index c181c3d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/CompareMemWrapper.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file
- CompareMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Compares the contents of two buffers.
-
- This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer.
- If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the
- value returned is the first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
- If Length > 0 and DestinationBuffer is NULL, then ASSERT().
- If Length > 0 and SourceBuffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer A pointer to the destination buffer to compare.
- @param SourceBuffer A pointer to the source buffer to compare.
- @param Length The number of bytes to compare.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- if (Length == 0 || DestinationBuffer == SourceBuffer) {
- return 0;
- }
- ASSERT (DestinationBuffer != NULL);
- ASSERT (SourceBuffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
-
- return InternalMemCompareMem (DestinationBuffer, SourceBuffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/CopyMem.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/CopyMem.c
deleted file mode 100644
index 0bd481d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/CopyMem.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/** @file
- Implementation of the InternalMemCopyMem routine. This function is broken
- out into its own source file so that it can be excluded from a build for a
- particular platform easily if an optimized version is desired.
-
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
- Copyright (c) 2012 - 2013, ARM Ltd. All rights reserved.
- Copyright (c) 2016, Linaro Ltd. All rights reserved.
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "MemLibInternals.h"
-
-/**
- Copy Length bytes from Source to Destination.
-
- @param DestinationBuffer The target of the copy request.
- @param SourceBuffer The place to copy from.
- @param Length The number of bytes to copy.
-
- @return Destination
-
-**/
-VOID *
-EFIAPI
-InternalMemCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- //
- // Declare the local variables that actually move the data elements as
- // volatile to prevent the optimizer from replacing this function with
- // the intrinsic memcpy()
- //
- volatile UINT8 *Destination8;
- CONST UINT8 *Source8;
- volatile UINT32 *Destination32;
- CONST UINT32 *Source32;
- volatile UINT64 *Destination64;
- CONST UINT64 *Source64;
- UINTN Alignment;
-
- if ((((UINTN)DestinationBuffer & 0x7) == 0) && (((UINTN)SourceBuffer & 0x7) == 0) && (Length >= 8)) {
- if (SourceBuffer > DestinationBuffer) {
- Destination64 = (UINT64*)DestinationBuffer;
- Source64 = (CONST UINT64*)SourceBuffer;
- while (Length >= 8) {
- *(Destination64++) = *(Source64++);
- Length -= 8;
- }
-
- // Finish if there are still some bytes to copy
- Destination8 = (UINT8*)Destination64;
- Source8 = (CONST UINT8*)Source64;
- while (Length-- != 0) {
- *(Destination8++) = *(Source8++);
- }
- } else if (SourceBuffer < DestinationBuffer) {
- Destination64 = (UINT64*)((UINTN)DestinationBuffer + Length);
- Source64 = (CONST UINT64*)((UINTN)SourceBuffer + Length);
-
- // Destination64 and Source64 were aligned on a 64-bit boundary
- // but if length is not a multiple of 8 bytes then they won't be
- // anymore.
-
- Alignment = Length & 0x7;
- if (Alignment != 0) {
- Destination8 = (UINT8*)Destination64;
- Source8 = (CONST UINT8*)Source64;
-
- while (Alignment-- != 0) {
- *(--Destination8) = *(--Source8);
- --Length;
- }
- Destination64 = (UINT64*)Destination8;
- Source64 = (CONST UINT64*)Source8;
- }
-
- while (Length > 0) {
- *(--Destination64) = *(--Source64);
- Length -= 8;
- }
- }
- } else if ((((UINTN)DestinationBuffer & 0x3) == 0) && (((UINTN)SourceBuffer & 0x3) == 0) && (Length >= 4)) {
- if (SourceBuffer > DestinationBuffer) {
- Destination32 = (UINT32*)DestinationBuffer;
- Source32 = (CONST UINT32*)SourceBuffer;
- while (Length >= 4) {
- *(Destination32++) = *(Source32++);
- Length -= 4;
- }
-
- // Finish if there are still some bytes to copy
- Destination8 = (UINT8*)Destination32;
- Source8 = (CONST UINT8*)Source32;
- while (Length-- != 0) {
- *(Destination8++) = *(Source8++);
- }
- } else if (SourceBuffer < DestinationBuffer) {
- Destination32 = (UINT32*)((UINTN)DestinationBuffer + Length);
- Source32 = (CONST UINT32*)((UINTN)SourceBuffer + Length);
-
- // Destination32 and Source32 were aligned on a 32-bit boundary
- // but if length is not a multiple of 4 bytes then they won't be
- // anymore.
-
- Alignment = Length & 0x3;
- if (Alignment != 0) {
- Destination8 = (UINT8*)Destination32;
- Source8 = (CONST UINT8*)Source32;
-
- while (Alignment-- != 0) {
- *(--Destination8) = *(--Source8);
- --Length;
- }
- Destination32 = (UINT32*)Destination8;
- Source32 = (CONST UINT32*)Source8;
- }
-
- while (Length > 0) {
- *(--Destination32) = *(--Source32);
- Length -= 4;
- }
- }
- } else {
- if (SourceBuffer > DestinationBuffer) {
- Destination8 = (UINT8*)DestinationBuffer;
- Source8 = (CONST UINT8*)SourceBuffer;
- while (Length-- != 0) {
- *(Destination8++) = *(Source8++);
- }
- } else if (SourceBuffer < DestinationBuffer) {
- Destination8 = (UINT8*)DestinationBuffer + (Length - 1);
- Source8 = (CONST UINT8*)SourceBuffer + (Length - 1);
- while (Length-- != 0) {
- *(Destination8--) = *(Source8--);
- }
- }
- }
- return DestinationBuffer;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c
deleted file mode 100644
index f27de29..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file
- CopyMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Copies a source buffer to a destination buffer, and returns the destination buffer.
-
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
- DestinationBuffer. The implementation must be reentrant, and it must handle the case
- where SourceBuffer overlaps DestinationBuffer.
-
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer A pointer to the destination buffer of the memory copy.
- @param SourceBuffer A pointer to the source buffer of the memory copy.
- @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.
-
- @return DestinationBuffer.
-
-**/
-VOID *
-EFIAPI
-CopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return DestinationBuffer;
- }
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
-
- if (DestinationBuffer == SourceBuffer) {
- return DestinationBuffer;
- }
- return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/IsZeroBufferWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/IsZeroBufferWrapper.c
deleted file mode 100644
index 078c924..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/IsZeroBufferWrapper.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
- Implementation of IsZeroBuffer function.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Checks if the contents of a buffer are all zeros.
-
- This function checks whether the contents of a buffer are all zeros. If the
- contents are all zeros, return TRUE. Otherwise, return FALSE.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- )
-{
- ASSERT (!(Buffer == NULL && Length > 0));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return InternalMemIsZeroBuffer (Buffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c
deleted file mode 100644
index f16755b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/** @file
- Architecture Independent Base Memory Library Implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 16-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- for (; Length != 0; Length--) {
- ((UINT16*)Buffer)[Length - 1] = Value;
- }
- return Buffer;
-}
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 32-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- for (; Length != 0; Length--) {
- ((UINT32*)Buffer)[Length - 1] = Value;
- }
- return Buffer;
-}
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 64-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- for (; Length != 0; Length--) {
- ((UINT64*)Buffer)[Length - 1] = Value;
- }
- return Buffer;
-}
-
-/**
- Set Buffer to 0 for Size bytes.
-
- @param Buffer Memory to set.
- @param Length The number of bytes to set.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- return InternalMemSetMem (Buffer, Length, 0);
-}
-
-/**
- Compares two memory buffers of a given length.
-
- @param DestinationBuffer The first memory buffer.
- @param SourceBuffer The second memory buffer.
- @param Length Length of DestinationBuffer and SourceBuffer memory
- regions to compare. Must be non-zero.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-InternalMemCompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- while ((--Length != 0) &&
- (*(INT8*)DestinationBuffer == *(INT8*)SourceBuffer)) {
- DestinationBuffer = (INT8*)DestinationBuffer + 1;
- SourceBuffer = (INT8*)SourceBuffer + 1;
- }
- return (INTN)*(UINT8*)DestinationBuffer - (INTN)*(UINT8*)SourceBuffer;
-}
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the
- matching 8-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 8-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- CONST UINT8 *Pointer;
-
- Pointer = (CONST UINT8*)Buffer;
- do {
- if (*Pointer == Value) {
- return Pointer;
- }
- ++Pointer;
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the
- matching 16-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 16-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- CONST UINT16 *Pointer;
-
- Pointer = (CONST UINT16*)Buffer;
- do {
- if (*Pointer == Value) {
- return Pointer;
- }
- ++Pointer;
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the
- matching 32-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 32-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- CONST UINT32 *Pointer;
-
- Pointer = (CONST UINT32*)Buffer;
- do {
- if (*Pointer == Value) {
- return Pointer;
- }
- ++Pointer;
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the
- matching 64-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 64-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- CONST UINT64 *Pointer;
-
- Pointer = (CONST UINT64*)Buffer;
- do {
- if (*Pointer == Value) {
- return Pointer;
- }
- ++Pointer;
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Checks whether the contents of a buffer are all zeros.
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-InternalMemIsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- )
-{
- CONST UINT8 *BufferData;
- UINTN Index;
-
- BufferData = Buffer;
- for (Index = 0; Index < Length; Index++) {
- if (BufferData[Index] != 0) {
- return FALSE;
- }
- }
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/MemLibGuid.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
deleted file mode 100644
index 9eb2832..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/MemLibGuid.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/** @file
- Implementation of GUID functions.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid to
- DestinationGuid, and returns DestinationGuid.
-
- If DestinationGuid is NULL, then ASSERT().
- If SourceGuid is NULL, then ASSERT().
-
- @param DestinationGuid A pointer to the destination GUID.
- @param SourceGuid A pointer to the source GUID.
-
- @return DestinationGuid.
-
-**/
-GUID *
-EFIAPI
-CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
- )
-{
- WriteUnaligned64 (
- (UINT64*)DestinationGuid,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid)
- );
- WriteUnaligned64 (
- (UINT64*)DestinationGuid + 1,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid + 1)
- );
- return DestinationGuid;
-}
-
-/**
- Compares two GUIDs.
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
- If there are any bit differences in the two GUIDs, then FALSE is returned.
-
- If Guid1 is NULL, then ASSERT().
- If Guid2 is NULL, then ASSERT().
-
- @param Guid1 A pointer to a 128 bit GUID.
- @param Guid2 A pointer to a 128 bit GUID.
-
- @retval TRUE Guid1 and Guid2 are identical.
- @retval FALSE Guid1 and Guid2 are not identical.
-
-**/
-BOOLEAN
-EFIAPI
-CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
- )
-{
- UINT64 LowPartOfGuid1;
- UINT64 LowPartOfGuid2;
- UINT64 HighPartOfGuid1;
- UINT64 HighPartOfGuid2;
-
- LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
- LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
- HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
- HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);
-
- return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);
-}
-
-/**
- Scans a target buffer for a GUID, and returns a pointer to the matching GUID
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the 128-bit
- GUID value that matches Guid. If a match is found, then a pointer to the matching
- GUID in the target buffer is returned. If no match is found, then NULL is returned.
- If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 128-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Guid The value to search for in the target buffer.
-
- @return A pointer to the matching Guid in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
- )
-{
- CONST GUID *GuidPtr;
-
- ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
- ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
- ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
-
- GuidPtr = (GUID*)Buffer;
- Buffer = GuidPtr + Length / sizeof (*GuidPtr);
- while (GuidPtr < (CONST GUID*)Buffer) {
- if (CompareGuid (GuidPtr, Guid)) {
- return (VOID*)GuidPtr;
- }
- GuidPtr++;
- }
- return NULL;
-}
-
-/**
- Checks if the given GUID is a zero GUID.
-
- This function checks whether the given GUID is a zero GUID. If the GUID is
- identical to a zero GUID then TRUE is returned. Otherwise, FALSE is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid The pointer to a 128 bit GUID.
-
- @retval TRUE Guid is a zero GUID.
- @retval FALSE Guid is not a zero GUID.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroGuid (
- IN CONST GUID *Guid
- )
-{
- UINT64 LowPartOfGuid;
- UINT64 HighPartOfGuid;
-
- LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
- HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
-
- return (BOOLEAN) (LowPartOfGuid == 0 && HighPartOfGuid == 0);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/MemLibInternals.h b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/MemLibInternals.h
deleted file mode 100644
index 87b4b64..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/MemLibInternals.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/** @file
- Declaration of internal functions for Base Memory Library.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
-
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __MEM_LIB_INTERNALS__
-#define __MEM_LIB_INTERNALS__
-
-#include
-#include
-#include
-#include
-
-/**
- Copy Length bytes from Source to Destination.
-
- @param DestinationBuffer Target of copy
- @param SourceBuffer Place to copy from
- @param Length The number of bytes to copy
-
- @return Destination
-
-**/
-VOID *
-EFIAPI
-InternalMemCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Set Buffer to Value for Size bytes.
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set
- @param Value The value of the set operation.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 16-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 32-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 64-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Set Buffer to 0 for Size bytes.
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- );
-
-/**
- Compares two memory buffers of a given length.
-
- @param DestinationBuffer The first memory buffer.
- @param SourceBuffer The second memory buffer.
- @param Length The length of DestinationBuffer and SourceBuffer memory
- regions to compare. Must be non-zero.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-InternalMemCompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the
- matching 8-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 8-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the
- matching 16-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 16-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the
- matching 32-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 32-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the
- matching 64-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 64-bit value to scan. Must be non-zero.
- @param Value The calue to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Checks whether the contents of a buffer are all zeros.
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-InternalMemIsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- );
-
-#endif
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c
deleted file mode 100644
index 7b37607..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/** @file
- ScanMem16() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a 16-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c
deleted file mode 100644
index 654306a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file
- ScanMem32() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a 32-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c
deleted file mode 100644
index 9606caa..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/** @file
- ScanMem64() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a 64-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c
deleted file mode 100644
index 8e90816..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/** @file
- ScanMem8() and ScanMemN() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for an 8-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer, or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
-
- return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
-}
-
-/**
- Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
- UINTN sized value in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a UINTN sized value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a UINTN boundary, then ASSERT().
- If Length is not aligned on a UINTN boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer, or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMemN (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINTN Value
- )
-{
- if (sizeof (UINTN) == sizeof (UINT64)) {
- return ScanMem64 (Buffer, Length, (UINT64)Value);
- } else {
- return ScanMem32 (Buffer, Length, (UINT32)Value);
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem.c
deleted file mode 100644
index 49a5fde..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/** @file
- Implementation of the EfiSetMem routine. This function is broken
- out into its own source file so that it can be excluded from a
- build for a particular platform easily if an optimized version
- is desired.
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- Copyright (c) 2012 - 2013, ARM Ltd. All rights reserved.
- Copyright (c) 2016, Linaro Ltd. All rights reserved.
-
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-
-
-
-#include "MemLibInternals.h"
-
-/**
- Set Buffer to Value for Size bytes.
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set.
- @param Value The value of the set operation.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- //
- // Declare the local variables that actually move the data elements as
- // volatile to prevent the optimizer from replacing this function with
- // the intrinsic memset()
- //
- volatile UINT8 *Pointer8;
- volatile UINT32 *Pointer32;
- volatile UINT64 *Pointer64;
- UINT32 Value32;
- UINT64 Value64;
-
- if ((((UINTN)Buffer & 0x7) == 0) && (Length >= 8)) {
- // Generate the 64bit value
- Value32 = (Value << 24) | (Value << 16) | (Value << 8) | Value;
- Value64 = LShiftU64 (Value32, 32) | Value32;
-
- Pointer64 = (UINT64*)Buffer;
- while (Length >= 8) {
- *(Pointer64++) = Value64;
- Length -= 8;
- }
-
- // Finish with bytes if needed
- Pointer8 = (UINT8*)Pointer64;
- } else if ((((UINTN)Buffer & 0x3) == 0) && (Length >= 4)) {
- // Generate the 32bit value
- Value32 = (Value << 24) | (Value << 16) | (Value << 8) | Value;
-
- Pointer32 = (UINT32*)Buffer;
- while (Length >= 4) {
- *(Pointer32++) = Value32;
- Length -= 4;
- }
-
- // Finish with bytes if needed
- Pointer8 = (UINT8*)Pointer32;
- } else {
- Pointer8 = (UINT8*)Buffer;
- }
- while (Length-- > 0) {
- *(Pointer8++) = Value;
- }
- return Buffer;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem16Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem16Wrapper.c
deleted file mode 100644
index 8e6daa3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem16Wrapper.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
- SetMem16() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 16-bit value specified by
- Value, and returns Buffer. Value is repeated every 16-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem16 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem32Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem32Wrapper.c
deleted file mode 100644
index 7758e1f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem32Wrapper.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
- SetMem32() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 32-bit value specified by
- Value, and returns Buffer. Value is repeated every 32-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem32 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem64Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem64Wrapper.c
deleted file mode 100644
index 5273a86..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMem64Wrapper.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
- SetMem64() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 64-bit value specified by
- Value, and returns Buffer. Value is repeated every 64-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem64 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c
deleted file mode 100644
index f9ed175..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/** @file
- SetMem() and SetMemN() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a byte value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with Value, and returns Buffer.
-
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
-
- return InternalMemSetMem (Buffer, Length, Value);
-}
-
-/**
- Fills a target buffer with a value that is size UINTN, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the UINTN sized value specified by
- Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a UINTN boundary, then ASSERT().
- If Length is not aligned on a UINTN boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMemN (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINTN Value
- )
-{
- if (sizeof (UINTN) == sizeof (UINT64)) {
- return SetMem64 (Buffer, Length, (UINT64)Value);
- } else {
- return SetMem32 (Buffer, Length, (UINT32)Value);
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c
deleted file mode 100644
index d768dd1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/** @file
- ZeroMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with zeros, and returns the target buffer.
-
- This function fills Length bytes of Buffer with zeros, and returns Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill with zeros.
- @param Length The number of bytes in Buffer to fill with zeros.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-ZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
- return InternalMemZeroMem (Buffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf
deleted file mode 100644
index e0af1d3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf
+++ /dev/null
@@ -1,129 +0,0 @@
-## @file
-# Instance of Base Memory Library using MMX registers.
-#
-# Base Memory Library that uses MMX registers for high performance.
-# Optimized for use in DXE.
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseMemoryLibMmx
- MODULE_UNI_FILE = BaseMemoryLibMmx.uni
- FILE_GUID = d458a654-f64c-49db-b8d1-3821306bf1f6
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = BaseMemoryLib
-
-
-#
-# VALID_ARCHITECTURES = IA32 X64
-#
-
-[Packages]
- MdePkg/MdePkg.dec
-
-
-[Sources]
- ScanMem64Wrapper.c
- ScanMem32Wrapper.c
- ScanMem16Wrapper.c
- ScanMem8Wrapper.c
- ZeroMemWrapper.c
- CompareMemWrapper.c
- SetMem64Wrapper.c
- SetMem32Wrapper.c
- SetMem16Wrapper.c
- SetMemWrapper.c
- CopyMemWrapper.c
- IsZeroBufferWrapper.c
- MemLibGuid.c
- MemLibInternals.h
-
-[Sources.Ia32]
- Ia32/ScanMem64.nasm
- Ia32/ScanMem64.S
- Ia32/ScanMem32.nasm
- Ia32/ScanMem32.S
- Ia32/ScanMem16.nasm
- Ia32/ScanMem16.S
- Ia32/ScanMem8.nasm
- Ia32/ScanMem8.S
- Ia32/CompareMem.nasm
- Ia32/CompareMem.S
- Ia32/SetMem64.nasm
- Ia32/SetMem64.S
- Ia32/SetMem32.nasm
- Ia32/SetMem32.S
- Ia32/SetMem16.nasm
- Ia32/SetMem16.S
- Ia32/ZeroMem.nasm
- Ia32/ZeroMem.S
- Ia32/SetMem.nasm
- Ia32/SetMem.S
- Ia32/CopyMem.nasm
- Ia32/CopyMem.S
- Ia32/ScanMem64.nasm
- Ia32/ScanMem32.nasm
- Ia32/ScanMem16.nasm
- Ia32/ScanMem8.nasm
- Ia32/CompareMem.nasm
- Ia32/SetMem64.nasm
- Ia32/SetMem32.nasm
- Ia32/SetMem16.nasm
- Ia32/ZeroMem.nasm
- Ia32/SetMem.nasm
- Ia32/CopyMem.nasm
- Ia32/IsZeroBuffer.nasm
-
-[Sources.X64]
- X64/ZeroMem.nasm
- X64/ScanMem64.nasm
- X64/ScanMem32.nasm
- X64/ScanMem16.nasm
- X64/ScanMem8.nasm
- X64/CompareMem.nasm
- X64/SetMem64.nasm
- X64/SetMem32.nasm
- X64/SetMem16.nasm
- X64/SetMem.nasm
- X64/CopyMem.nasm
- X64/ScanMem64.nasm
- X64/ScanMem64.S
- X64/ScanMem32.nasm
- X64/ScanMem32.S
- X64/ScanMem16.nasm
- X64/ScanMem16.S
- X64/ScanMem8.nasm
- X64/ScanMem8.S
- X64/CompareMem.nasm
- X64/CompareMem.S
- X64/SetMem64.nasm
- X64/SetMem64.S
- X64/SetMem32.nasm
- X64/SetMem32.S
- X64/SetMem16.nasm
- X64/SetMem16.S
- X64/ZeroMem.nasm
- X64/ZeroMem.S
- X64/SetMem.nasm
- X64/SetMem.S
- X64/CopyMem.nasm
- X64/CopyMem.S
- X64/IsZeroBuffer.nasm
-
-
-[LibraryClasses]
- DebugLib
- BaseLib
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.uni
deleted file mode 100644
index 6bc43ba..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.uni
+++ /dev/null
@@ -1,22 +0,0 @@
-// /** @file
-// Instance of Base Memory Library using MMX registers.
-//
-// Base Memory Library that uses MMX registers for high performance.
-// Optimized for use in DXE.
-//
-// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Instance of Base Memory Library using MMX registers"
-
-#string STR_MODULE_DESCRIPTION #language en-US "Base Memory Library that uses MMX registers for high performance. Optimized for use in DXE."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c
deleted file mode 100644
index 161171b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file
- CompareMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Compares the contents of two buffers.
-
- This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer.
- If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the
- value returned is the first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
- If Length > 0 and DestinationBuffer is NULL, then ASSERT().
- If Length > 0 and SourceBuffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer The pointer to the destination buffer to compare.
- @param SourceBuffer The pointer to the source buffer to compare.
- @param Length The number of bytes to compare.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- if (Length == 0 || DestinationBuffer == SourceBuffer) {
- return 0;
- }
- ASSERT (DestinationBuffer != NULL);
- ASSERT (SourceBuffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
-
- return InternalMemCompareMem (DestinationBuffer, SourceBuffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c
deleted file mode 100644
index 1a01fbe..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file
- CopyMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Copies a source buffer to a destination buffer, and returns the destination buffer.
-
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
- DestinationBuffer. The implementation must be reentrant, and it must handle the case
- where SourceBuffer overlaps DestinationBuffer.
-
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer The pointer to the destination buffer of the memory copy.
- @param SourceBuffer The pointer to the source buffer of the memory copy.
- @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.
-
- @return DestinationBuffer.
-
-**/
-VOID *
-EFIAPI
-CopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return DestinationBuffer;
- }
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
-
- if (DestinationBuffer == SourceBuffer) {
- return DestinationBuffer;
- }
- return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.S
deleted file mode 100644
index 1c9239e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.S
+++ /dev/null
@@ -1,55 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CompareMem.Asm
-#
-# Abstract:
-#
-# CompareMem function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)
-
-#------------------------------------------------------------------------------
-# INTN
-# EFIAPI
-# InternalMemCompareMem (
-# IN CONST VOID *DestinationBuffer,
-# IN CONST VOID *SourceBuffer,
-# IN UINTN Length
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemCompareMem):
- push %esi
- push %edi
- movl 12(%esp), %esi
- movl 16(%esp), %edi
- movl 20(%esp), %ecx
- repe cmpsb
- movzbl -1(%esi), %eax
- movzbl -1(%edi), %edx
- subl %edx, %eax
- pop %edi
- pop %esi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.nasm
deleted file mode 100644
index e8d1abd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CompareMem.nasm
+++ /dev/null
@@ -1,57 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CompareMem.Asm
-;
-; Abstract:
-;
-; CompareMem function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; INTN
-; EFIAPI
-; InternalMemCompareMem (
-; IN CONST VOID *DestinationBuffer,
-; IN CONST VOID *SourceBuffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- push esi
- push edi
- mov esi, [esp + 12]
- mov edi, [esp + 16]
- mov ecx, [esp + 20]
- repe cmpsb
- movzx eax, byte [esi - 1]
- movzx edx, byte [edi - 1]
- sub eax, edx
- pop edi
- pop esi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.S
deleted file mode 100644
index 0c204a3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.S
+++ /dev/null
@@ -1,86 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CopyMem.asm
-#
-# Abstract:
-#
-# CopyMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemCopyMem (
-# IN VOID *Destination,
-# IN VOID *Source,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemCopyMem):
- push %esi
- push %edi
- movl 16(%esp), %esi # esi <- Source
- movl 12(%esp), %edi # edi <- Destination
- movl 20(%esp), %edx # edx <- Count
- leal -1(%esi,%edx,), %eax # eax <- End of Source
- cmpl %edi, %esi
- jae L0
- cmpl %edi, %eax # Overlapped?
- jae L_CopyBackward # Copy backward if overlapped
-L0:
- xorl %ecx, %ecx
- subl %esi, %ecx
- andl $7, %ecx # ecx + esi aligns on 8-byte boundary
- jz L1
- cmpl %edx, %ecx
- cmova %edx, %ecx
- subl %ecx, %edx # edx <- remaining bytes to copy
- rep
- movsb
-L1:
- movl %edx, %ecx
- andl $7, %edx
- shrl $3, %ecx # ecx <- # of Qwords to copy
- jz L_CopyBytes
- pushl %eax
- pushl %eax
- movq %mm0, (%esp) # save mm0
-L2:
- movq (%esi), %mm0
- movq %mm0, (%edi)
- addl $8, %esi
- addl $8, %edi
- loop L2
- movq (%esp), %mm0 # restore mm0
- popl %ecx # stack cleanup
- popl %ecx # stack cleanup
- jmp L_CopyBytes
-L_CopyBackward:
- movl %eax, %esi # esi <- Last byte in Source
- leal -1(%edi,%edx,), %edi # edi <- Last byte in Destination
- std
-L_CopyBytes:
- movl %edx, %ecx
- rep
- movsb
- cld
- movl 12(%esp), %eax
- pop %edi
- pop %esi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.nasm
deleted file mode 100644
index 21e4427..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/CopyMem.nasm
+++ /dev/null
@@ -1,77 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CopyMem.nasm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemCopyMem (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- push esi
- push edi
- mov esi, [esp + 16] ; esi <- Source
- mov edi, [esp + 12] ; edi <- Destination
- mov edx, [esp + 20] ; edx <- Count
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- jae .0
- cmp eax, edi ; Overlapped?
- jae @CopyBackward ; Copy backward if overlapped
-.0:
- mov ecx, edx
- and edx, 7
- shr ecx, 3 ; ecx <- # of Qwords to copy
- jz @CopyBytes
- push eax
- push eax
- movq [esp], mm0 ; save mm0
-.1:
- movq mm0, [esi]
- movq [edi], mm0
- add esi, 8
- add edi, 8
- loop .1
- movq mm0, [esp] ; restore mm0
- pop ecx ; stack cleanup
- pop ecx ; stack cleanup
- jmp @CopyBytes
-@CopyBackward:
- mov esi, eax ; esi <- Last byte in Source
- lea edi, [edi + edx - 1] ; edi <- Last byte in Destination
- std
-@CopyBytes:
- mov ecx, edx
- rep movsb
- cld
- mov eax, [esp + 12]
- pop edi
- pop esi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/IsZeroBuffer.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/IsZeroBuffer.nasm
deleted file mode 100644
index cfd41a6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/IsZeroBuffer.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; IsZeroBuffer.nasm
-;
-; Abstract:
-;
-; IsZeroBuffer function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; BOOLEAN
-; EFIAPI
-; InternalMemIsZeroBuffer (
-; IN CONST VOID *Buffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemIsZeroBuffer)
-ASM_PFX(InternalMemIsZeroBuffer):
- push edi
- mov edi, [esp + 8] ; edi <- Buffer
- mov ecx, [esp + 12] ; ecx <- Length
- mov edx, ecx ; edx <- ecx
- shr ecx, 2 ; ecx <- number of dwords
- and edx, 3 ; edx <- number of trailing bytes
- xor eax, eax ; eax <- 0, also set ZF
- repe scasd
- jnz @ReturnFalse ; ZF=0 means non-zero element found
- mov ecx, edx
- repe scasb
- jnz @ReturnFalse
- pop edi
- mov eax, 1 ; return TRUE
- ret
-@ReturnFalse:
- pop edi
- xor eax, eax
- ret ; return FALSE
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.S
deleted file mode 100644
index c485543..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem16.Asm
-#
-# Abstract:
-#
-# ScanMem16 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem16)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem16 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT16 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem16):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movl 16(%esp), %eax
- repne scasw
- leal -2(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.nasm
deleted file mode 100644
index 78d9f30..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem16.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem16.Asm
-;
-; Abstract:
-;
-; ScanMem16 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem16 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT16 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem16)
-ASM_PFX(InternalMemScanMem16):
- push edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov eax, [esp + 16]
- repne scasw
- lea eax, [edi - 2]
- cmovnz eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.S
deleted file mode 100644
index a9b4975..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem32.Asm
-#
-# Abstract:
-#
-# ScanMem32 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem32)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem32 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT32 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem32):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movl 16(%esp), %eax
- repne scasl
- leal -4(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.nasm
deleted file mode 100644
index bbacf38..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem32.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem32.Asm
-;
-; Abstract:
-;
-; ScanMem32 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem32 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT32 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem32)
-ASM_PFX(InternalMemScanMem32):
- push edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov eax, [esp + 16]
- repne scasd
- lea eax, [edi - 4]
- cmovnz eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.S
deleted file mode 100644
index e23cf5f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.S
+++ /dev/null
@@ -1,61 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem64.Asm
-#
-# Abstract:
-#
-# ScanMem64 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem64)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem64 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem64):
- push %edi
- movl 12(%esp), %ecx
- movl 16(%esp), %eax
- movl 20(%esp), %edx
- movl 8(%esp), %edi
-L0:
- cmpl (%edi), %eax
- leal 8(%edi), %edi
- loopne L0
- jne L1
- cmpl -4(%edi), %edx
- jecxz L1
- jne L0
-L1:
- leal -8(%edi), %eax
- cmovne %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.nasm
deleted file mode 100644
index e994d4a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem64.nasm
+++ /dev/null
@@ -1,63 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem64.Asm
-;
-; Abstract:
-;
-; ScanMem64 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem64 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem64)
-ASM_PFX(InternalMemScanMem64):
- push edi
- mov ecx, [esp + 12]
- mov eax, [esp + 16]
- mov edx, [esp + 20]
- mov edi, [esp + 8]
-.0:
- cmp eax, [edi]
- lea edi, [edi + 8]
- loopne .0
- jne .1
- cmp edx, [edi - 4]
- jecxz .1
- jne .0
-.1:
- lea eax, [edi - 8]
- cmovne eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.S
deleted file mode 100644
index afefaab..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem8.Asm
-#
-# Abstract:
-#
-# ScanMem8 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem8 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT8 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem8):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movb 16(%esp), %al
- repne scasb
- leal -1(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.nasm
deleted file mode 100644
index d13c9c7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ScanMem8.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem8.Asm
-;
-; Abstract:
-;
-; ScanMem8 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem8 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- push edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov al, [esp + 16]
- repne scasb
- lea eax, [edi - 1]
- cmovnz eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.S
deleted file mode 100644
index 52b5da6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.S
+++ /dev/null
@@ -1,66 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem.asm
-#
-# Abstract:
-#
-# SetMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT8 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem):
- push %edi
- movb 16(%esp), %al
- movb %al, %ah
- shrdl $16, %eax, %edx
- shldl $16, %edx, %eax
- movl 12(%esp), %ecx # ecx <- Count
- movl 8(%esp), %edi # edi <- Buffer
- movl %ecx, %edx
- andl $7, %edx
- shrl $3, %ecx # # of Qwords to set
- jz L1
- addl $-16, %esp
- movq %mm0, (%esp) # save mm0
- movq %mm1, 8(%esp) # save mm1
- movd %eax, %mm0
- movd %eax, %mm1
- psllq $32, %mm0
- por %mm1, %mm0 # fill mm0 with 8 Value's
-L0:
- movq %mm0, (%edi)
- addl $8, %edi
- loop L0
- movq (%esp), %mm0 # restore mm0
- movq 8(%esp), %mm1 # restore mm1
- addl $0x10, %esp # stack cleanup
-L1:
- movl %edx, %ecx
- rep
- stosb
- movl 8(%esp), %eax # eax <- Buffer as return value
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.nasm
deleted file mode 100644
index ab71586..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem.nasm
+++ /dev/null
@@ -1,68 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem.nasm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT8 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- push edi
- mov al, [esp + 16]
- mov ah, al
- shrd edx, eax, 16
- shld eax, edx, 16
- mov ecx, [esp + 12] ; ecx <- Count
- mov edi, [esp + 8] ; edi <- Buffer
- mov edx, ecx
- and edx, 7
- shr ecx, 3 ; # of Qwords to set
- jz @SetBytes
- add esp, -0x10
- movq [esp], mm0 ; save mm0
- movq [esp + 8], mm1 ; save mm1
- movd mm0, eax
- movd mm1, eax
- psllq mm0, 32
- por mm0, mm1 ; fill mm0 with 8 Value's
-.0:
- movq [edi], mm0
- add edi, 8
- loop .0
- movq mm0, [esp] ; restore mm0
- movq mm1, [esp + 8] ; restore mm1
- add esp, 0x10 ; stack cleanup
-@SetBytes:
- mov ecx, edx
- rep stosb
- mov eax, [esp + 8] ; eax <- Buffer as return value
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.S
deleted file mode 100644
index af10605..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.S
+++ /dev/null
@@ -1,59 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem16.asm
-#
-# Abstract:
-#
-# SetMem16 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem16 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT16 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem16):
- push %edi
- movl 16(%esp), %eax
- shrdl $16, %eax, %edx
- shldl $16, %edx, %eax
- movl 12(%esp), %edx
- movl 8(%esp), %edi
- movl %edx, %ecx
- andl $3, %edx
- shrl $2, %ecx
- jz L1
- movd %eax, %mm0
- movd %eax, %mm1
- psllq $32, %mm0
- por %mm1, %mm0
-L0:
- movq %mm0, (%edi)
- addl $8, %edi
- loop L0
-L1:
- movl %edx, %ecx
- rep
- stosw
- movl 8(%esp), %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.nasm
deleted file mode 100644
index 61d1ef0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.nasm
+++ /dev/null
@@ -1,61 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem16.nasm
-;
-; Abstract:
-;
-; SetMem16 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem16 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT16 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- push edi
- mov eax, [esp + 16]
- shrd edx, eax, 16
- shld eax, edx, 16
- mov edx, [esp + 12]
- mov edi, [esp + 8]
- mov ecx, edx
- and edx, 3
- shr ecx, 2
- jz @SetWords
- movd mm0, eax
- movd mm1, eax
- psllq mm0, 32
- por mm0, mm1
-.0:
- movq [edi], mm0
- add edi, 8
- loop .0
-@SetWords:
- mov ecx, edx
- rep stosw
- mov eax, [esp + 8]
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S
deleted file mode 100644
index acf273d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem32.asm
-#
-# Abstract:
-#
-# SetMem32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem32 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT32 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem32):
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- movd 12(%esp), %mm0
- shrl %ecx
- movl %eax, %edx
- jz L1
- movq %mm0, %mm1
- psllq $32, %mm1
- por %mm1, %mm0
-L0:
- movq %mm0, (%edx)
- lea 8(%edx), %edx
- loop L0
-L1:
- jnc L2
- movd %mm0, (%edx)
-L2:
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.nasm
deleted file mode 100644
index 9289f33..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem32.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem32.nasm
-;
-; Abstract:
-;
-; SetMem32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem32 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT32 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- mov eax, [esp + 4] ; eax <- Buffer as return value
- mov ecx, [esp + 8] ; ecx <- Count
- movd mm0, dword [esp + 12] ; mm0 <- Value
- shr ecx, 1 ; ecx <- number of qwords to set
- mov edx, eax ; edx <- Buffer
- jz @SetDwords
- movq mm1, mm0
- psllq mm1, 32
- por mm0, mm1
-.0:
- movq qword [edx], mm0
- lea edx, [edx + 8] ; use "lea" to avoid change in flags
- loop .0
-@SetDwords:
- jnc .1
- movd dword [edx], mm0
-.1:
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.S
deleted file mode 100644
index be4b42b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem64.asm
-#
-# Abstract:
-#
-# SetMem64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem64 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT64 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem64):
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- movq 12(%esp), %mm0
- movl %eax, %edx
-L0:
- movq %mm0, (%edx)
- lea 8(%edx), %edx
- loop L0
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.nasm
deleted file mode 100644
index 13fa52f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem64.nasm
+++ /dev/null
@@ -1,46 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem64.nasm
-;
-; Abstract:
-;
-; SetMem64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem64 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT64 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- mov eax, [esp + 4]
- mov ecx, [esp + 8]
- movq mm0, [esp + 12]
- mov edx, eax
-.0:
- movq [edx], mm0
- add edx, 8
- loop .0
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.S
deleted file mode 100644
index ac92ec2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ZeroMem.asm
-#
-# Abstract:
-#
-# ZeroMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemZeroMem (
-# IN VOID *Buffer,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemZeroMem):
- push %edi
- movl 8(%esp), %edi
- movl 12(%esp), %ecx
- movl %ecx, %edx
- shrl $3, %ecx
- jz L_ZeroBytes
- pxor %mm0, %mm0
-L0:
- movq %mm0, (%edi)
- addl $8, %edi
- loop L0
-L_ZeroBytes:
- andl $7, %edx
- xorl %eax, %eax
- movl %edx, %ecx
- rep
- stosb
- movl 8(%esp), %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.nasm
deleted file mode 100644
index bcf7cf6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ZeroMem.nasm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- push edi
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- mov edx, ecx
- shr ecx, 3
- jz @ZeroBytes
- pxor mm0, mm0
-.0:
- movq [edi], mm0
- add edi, 8
- loop .0
-@ZeroBytes:
- and edx, 7
- xor eax, eax
- mov ecx, edx
- rep stosb
- mov eax, [esp + 8]
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/IsZeroBufferWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/IsZeroBufferWrapper.c
deleted file mode 100644
index 078c924..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/IsZeroBufferWrapper.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
- Implementation of IsZeroBuffer function.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Checks if the contents of a buffer are all zeros.
-
- This function checks whether the contents of a buffer are all zeros. If the
- contents are all zeros, return TRUE. Otherwise, return FALSE.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- )
-{
- ASSERT (!(Buffer == NULL && Length > 0));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return InternalMemIsZeroBuffer (Buffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
deleted file mode 100644
index 28b08c9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/** @file
- Implementation of GUID functions.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid to
- DestinationGuid, and returns DestinationGuid.
-
- If DestinationGuid is NULL, then ASSERT().
- If SourceGuid is NULL, then ASSERT().
-
- @param DestinationGuid The pointer to the destination GUID.
- @param SourceGuid The pointer to the source GUID.
-
- @return DestinationGuid.
-
-**/
-GUID *
-EFIAPI
-CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
- )
-{
- WriteUnaligned64 (
- (UINT64*)DestinationGuid,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid)
- );
- WriteUnaligned64 (
- (UINT64*)DestinationGuid + 1,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid + 1)
- );
- return DestinationGuid;
-}
-
-/**
- Compares two GUIDs.
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
- If there are any bit differences in the two GUIDs, then FALSE is returned.
-
- If Guid1 is NULL, then ASSERT().
- If Guid2 is NULL, then ASSERT().
-
- @param Guid1 A pointer to a 128 bit GUID.
- @param Guid2 A pointer to a 128 bit GUID.
-
- @retval TRUE Guid1 and Guid2 are identical.
- @retval FALSE Guid1 and Guid2 are not identical.
-
-**/
-BOOLEAN
-EFIAPI
-CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
- )
-{
- UINT64 LowPartOfGuid1;
- UINT64 LowPartOfGuid2;
- UINT64 HighPartOfGuid1;
- UINT64 HighPartOfGuid2;
-
- LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
- LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
- HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
- HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);
-
- return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);
-}
-
-/**
- Scans a target buffer for a GUID, and returns a pointer to the matching GUID
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the 128-bit
- GUID value that matches Guid. If a match is found, then a pointer to the matching
- GUID in the target buffer is returned. If no match is found, then NULL is returned.
- If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 128-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Guid The value to search for in the target buffer.
-
- @return A pointer to the matching Guid in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
- )
-{
- CONST GUID *GuidPtr;
-
- ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
- ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
- ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
-
- GuidPtr = (GUID*)Buffer;
- Buffer = GuidPtr + Length / sizeof (*GuidPtr);
- while (GuidPtr < (CONST GUID*)Buffer) {
- if (CompareGuid (GuidPtr, Guid)) {
- return (VOID*)GuidPtr;
- }
- GuidPtr++;
- }
- return NULL;
-}
-
-/**
- Checks if the given GUID is a zero GUID.
-
- This function checks whether the given GUID is a zero GUID. If the GUID is
- identical to a zero GUID then TRUE is returned. Otherwise, FALSE is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid The pointer to a 128 bit GUID.
-
- @retval TRUE Guid is a zero GUID.
- @retval FALSE Guid is not a zero GUID.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroGuid (
- IN CONST GUID *Guid
- )
-{
- UINT64 LowPartOfGuid;
- UINT64 HighPartOfGuid;
-
- LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
- HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
-
- return (BOOLEAN) (LowPartOfGuid == 0 && HighPartOfGuid == 0);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h
deleted file mode 100644
index ce1c17f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/** @file
- Declaration of internal functions for Base Memory Library.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
-
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __MEM_LIB_INTERNALS__
-#define __MEM_LIB_INTERNALS__
-
-#include
-#include
-#include
-#include
-
-/**
- Copy Length bytes from Source to Destination.
-
- @param DestinationBuffer The target of the copy request.
- @param SourceBuffer The place to copy from.
- @param Length The number of bytes to copy
-
- @return Destination
-
-**/
-VOID *
-EFIAPI
-InternalMemCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Set Buffer to Value for Size bytes.
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set
- @param Value The value of the set operation.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 16-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 32-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 64-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Set Buffer to 0 for Size bytes.
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- );
-
-/**
- Compares two memory buffers of a given length.
-
- @param DestinationBuffer The first memory buffer.
- @param SourceBuffer The second memory buffer.
- @param Length The length of DestinationBuffer and SourceBuffer memory
- regions to compare. Must be non-zero.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-InternalMemCompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the
- matching 8-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 8-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the
- matching 16-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 16-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the
- matching 32-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 32-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the
- matching 64-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 64-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Checks whether the contents of a buffer are all zeros.
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-InternalMemIsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- );
-
-#endif
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c
deleted file mode 100644
index 7b37607..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/** @file
- ScanMem16() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a 16-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c
deleted file mode 100644
index ff19a9c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file
- ScanMem32() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a 32-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value Thevalue to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c
deleted file mode 100644
index 9606caa..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/** @file
- ScanMem64() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a 64-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c
deleted file mode 100644
index 6d974d2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/** @file
- ScanMem8() and ScanMemN() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for an 8-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
-
- return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
-}
-
-/**
- Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
- UINTN sized value in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a UINTN sized value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a UINTN boundary, then ASSERT().
- If Length is not aligned on a UINTN boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMemN (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINTN Value
- )
-{
- if (sizeof (UINTN) == sizeof (UINT64)) {
- return ScanMem64 (Buffer, Length, (UINT64)Value);
- } else {
- return ScanMem32 (Buffer, Length, (UINT32)Value);
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c
deleted file mode 100644
index 8e6daa3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
- SetMem16() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 16-bit value specified by
- Value, and returns Buffer. Value is repeated every 16-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem16 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c
deleted file mode 100644
index 7758e1f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
- SetMem32() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 32-bit value specified by
- Value, and returns Buffer. Value is repeated every 32-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem32 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c
deleted file mode 100644
index 5273a86..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
- SetMem64() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 64-bit value specified by
- Value, and returns Buffer. Value is repeated every 64-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem64 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c
deleted file mode 100644
index f9ed175..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/** @file
- SetMem() and SetMemN() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a byte value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with Value, and returns Buffer.
-
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
-
- return InternalMemSetMem (Buffer, Length, Value);
-}
-
-/**
- Fills a target buffer with a value that is size UINTN, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the UINTN sized value specified by
- Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a UINTN boundary, then ASSERT().
- If Length is not aligned on a UINTN boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMemN (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINTN Value
- )
-{
- if (sizeof (UINTN) == sizeof (UINT64)) {
- return SetMem64 (Buffer, Length, (UINT64)Value);
- } else {
- return SetMem32 (Buffer, Length, (UINT32)Value);
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.S
deleted file mode 100644
index 12fde1c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.S
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from CompareMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CompareMem.S
-#
-# Abstract:
-#
-# CompareMem function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# INTN
-# EFIAPI
-# InternalMemCompareMem (
-# IN CONST VOID *DestinationBuffer,
-# IN CONST VOID *SourceBuffer,
-# IN UINTN Length
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- pushq %rsi
- pushq %rdi
- movq %rcx, %rsi
- movq %rdx, %rdi
- movq %r8, %rcx
- repe cmpsb
- movzbq -1(%rsi), %rax
- movzbq -1(%rdi), %rdx
- subq %rdx, %rax
- popq %rdi
- popq %rsi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.nasm
deleted file mode 100644
index cb0d886..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CompareMem.nasm
+++ /dev/null
@@ -1,58 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CompareMem.Asm
-;
-; Abstract:
-;
-; CompareMem function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; INTN
-; EFIAPI
-; InternalMemCompareMem (
-; IN CONST VOID *DestinationBuffer,
-; IN CONST VOID *SourceBuffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- push rsi
- push rdi
- mov rsi, rcx
- mov rdi, rdx
- mov rcx, r8
- repe cmpsb
- movzx rax, byte [rsi - 1]
- movzx rdx, byte [rdi - 1]
- sub rax, rdx
- pop rdi
- pop rsi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.S
deleted file mode 100644
index aec628e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.S
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from CopyMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CopyMem.S
-#
-# Abstract:
-#
-# CopyMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemCopyMem (
-# IN VOID *Destination,
-# IN VOID *Source,
-# IN UINTN Count
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- pushq %rsi
- pushq %rdi
- movq %rdx, %rsi # rsi <- Source
- movq %rcx, %rdi # rdi <- Destination
- leaq -1(%rsi, %r8,), %r9 # r9 <- End of Source
- cmpq %rdi, %rsi
- movq %rdi, %rax # rax <- Destination as return value
- jae L0
- cmpq %rdi, %r9
- jae L_CopyBackward # Copy backward if overlapped
-L0:
- movq %r8, %rcx
- andq $7, %r8
- shrq $3, %rcx # rcx <- # of Qwords to copy
- jz L_CopyBytes
- movd %mm0, %r10 # (Save mm0 in r10)
-L1:
- movq (%rsi), %mm0
- movntq %mm0, (%rdi)
- addq $8, %rsi
- addq $8, %rdi
- loop L1
- mfence
- movd %r10, %mm0 # (Restore mm0)
- jmp L_CopyBytes
-L_CopyBackward:
- movq %r9, %rsi # rsi <- End of Source
- leaq -1(%rdi, %r8,), %rdi # rdi <- End of Destination
- std # set direction flag
-L_CopyBytes:
- movq %r8, %rcx
- rep movsb # Copy bytes backward
- cld
- popq %rdi
- popq %rsi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.nasm
deleted file mode 100644
index b3b9634..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.nasm
+++ /dev/null
@@ -1,74 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CopyMem.nasm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemCopyMem (
-; OUT VOID *DestinationBuffer,
-; IN CONST VOID *SourceBuffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- push rsi
- push rdi
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- mov rax, rdi ; rax <- Destination as return value
- jae .0
- cmp r9, rdi
- jae @CopyBackward ; Copy backward if overlapped
-.0:
- mov rcx, r8
- and r8, 7
- shr rcx, 3 ; rcx <- # of Qwords to copy
- jz @CopyBytes
- DB 0x49, 0xf, 0x7e, 0xc2 ; movd r10, mm0 (Save mm0 in r10)
-.1:
- DB 0xf, 0x6f, 0x6 ; movd mm0, [rsi]
- DB 0xf, 0xe7, 0x7 ; movntq [rdi], mm0
- add rsi, 8
- add rdi, 8
- loop .1
- mfence
- DB 0x49, 0xf, 0x6e, 0xc2 ; movd mm0, r10 (Restore mm0)
- jmp @CopyBytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- End of Source
- lea rdi, [rdi + r8 - 1] ; rdi <- End of Destination
- std ; set direction flag
-@CopyBytes:
- mov rcx, r8
- rep movsb ; Copy bytes backward
- cld
- pop rdi
- pop rsi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/IsZeroBuffer.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/IsZeroBuffer.nasm
deleted file mode 100644
index 3b855a7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/IsZeroBuffer.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; IsZeroBuffer.nasm
-;
-; Abstract:
-;
-; IsZeroBuffer function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; BOOLEAN
-; EFIAPI
-; InternalMemIsZeroBuffer (
-; IN CONST VOID *Buffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemIsZeroBuffer)
-ASM_PFX(InternalMemIsZeroBuffer):
- push rdi
- mov rdi, rcx ; rdi <- Buffer
- mov rcx, rdx ; rcx <- Length
- shr rcx, 3 ; rcx <- number of qwords
- and rdx, 7 ; rdx <- number of trailing bytes
- xor rax, rax ; rax <- 0, also set ZF
- repe scasq
- jnz @ReturnFalse ; ZF=0 means non-zero element found
- mov rcx, rdx
- repe scasb
- jnz @ReturnFalse
- pop rdi
- mov rax, 1 ; return TRUE
- ret
-@ReturnFalse:
- pop rdi
- xor rax, rax
- ret ; return FALSE
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.S
deleted file mode 100644
index 718dd80..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.S
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem16.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem16.S
-#
-# Abstract:
-#
-# ScanMem16 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem16 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT16 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemScanMem16)
-ASM_PFX(InternalMemScanMem16):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- movq %rdx, %rcx
- repne scasw
- leaq -2(%rdi), %rax
- cmovnz %rcx, %rax
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.nasm
deleted file mode 100644
index 9f0de63..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem16.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem16.Asm
-;
-; Abstract:
-;
-; ScanMem16 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem16 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT16 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem16)
-ASM_PFX(InternalMemScanMem16):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasw
- lea rax, [rdi - 2]
- cmovnz rax, rcx
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.S
deleted file mode 100644
index b34d916..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.S
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem32.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem32.S
-#
-# Abstract:
-#
-# ScanMem32 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem32 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT32 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemScanMem32)
-ASM_PFX(InternalMemScanMem32):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- movq %rdx, %rcx
- repne scasl
- leaq -4(%rdi), %rax
- cmovnz %rcx, %rax
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.nasm
deleted file mode 100644
index 5c9ae5d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem32.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem32.Asm
-;
-; Abstract:
-;
-; ScanMem32 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem32 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT32 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem32)
-ASM_PFX(InternalMemScanMem32):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasd
- lea rax, [rdi - 4]
- cmovnz rax, rcx
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.S
deleted file mode 100644
index 7d5f902..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.S
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem64.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem64.S
-#
-# Abstract:
-#
-# ScanMem64 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem64 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemScanMem64)
-ASM_PFX(InternalMemScanMem64):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- movq %rdx, %rcx
- repne scasq
- leaq -8(%rdi), %rax
- cmovnz %rcx, %rax
- popq %rdi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.nasm
deleted file mode 100644
index b98c6de..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem64.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem64.Asm
-;
-; Abstract:
-;
-; ScanMem64 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem64 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem64)
-ASM_PFX(InternalMemScanMem64):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasq
- lea rax, [rdi - 8]
- cmovnz rax, rcx
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.S
deleted file mode 100644
index efd877b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.S
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem8.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem8.S
-#
-# Abstract:
-#
-# ScanMem8 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem8 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT8 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- pushq %rdi
- movq %rcx, %rdi
- movq %rdx, %rcx
- movq %r8, %rax
- repne scasb
- leaq -1(%rdi), %rax
- cmovnz %rcx, %rax # set rax to 0 if not found
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.nasm
deleted file mode 100644
index 8499795..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem8.Asm
-;
-; Abstract:
-;
-; ScanMem8 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem8 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- push rdi
- mov rdi, rcx
- mov rcx, rdx
- mov rax, r8
- repne scasb
- lea rax, [rdi - 1]
- cmovnz rax, rcx ; set rax to 0 if not found
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.S
deleted file mode 100644
index ba16ab2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.S
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem.S
-#
-# Abstract:
-#
-# SetMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemSetMem (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT8 Value
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- push %rdi
- movq %r8, %rax
- movb %al, %ah
- movd %rax, %mm0
- movq %rcx, %r8
- movq %r8, %rdi # rdi <- Buffer
- movq %rdx, %rcx
- andq $7, %rdx
- shrq $3, %rcx
- jz L_SetBytes
- .byte 0x0f, 0x70, 0x0C0, 0x00
-L0:
- movntq %mm0, (%rdi)
- addq $8, %rdi
- loop L0
- mfence
-L_SetBytes:
- movl %edx, %ecx
- rep stosb
- movq %r8, %rax
- pop %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.nasm
deleted file mode 100644
index 1b50e5e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.nasm
+++ /dev/null
@@ -1,60 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem.nasm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem (
-; OUT VOID *Buffer,
-; IN UINTN Length,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- push rdi
- mov rax, r8
- mov ah, al
- DB 0x48, 0xf, 0x6e, 0xc0 ; movd mm0, rax
- mov r8, rcx
- mov rdi, r8 ; rdi <- Buffer
- mov rcx, rdx
- and edx, 7
- shr rcx, 3
- jz @SetBytes
- DB 0xf, 0x70, 0xC0, 0x0 ; pshufw mm0, mm0, 0h
-.0:
- DB 0xf, 0xe7, 0x7 ; movntq [rdi], mm0
- add rdi, 8
- loop .0
- mfence
-@SetBytes:
- mov ecx, edx
- rep stosb
- mov rax, r8
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.S
deleted file mode 100644
index 7d28278..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.S
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem16.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem16.S
-#
-# Abstract:
-#
-# SetMem16 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemSetMem16 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT16 Value
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- pushq %rdi
- movq %r8, %rax
- movd %rax, %mm0
- movq %rcx, %r8
- movq %r8, %rdi
- movq %rdx, %rcx
- andl $3, %edx
- shrq $2, %rcx
- jz L_SetWords
- .byte 0x0f, 0x70, 0x0C0, 0x00
-L0:
- movntq %mm0, (%rdi)
- addq $8, %rdi
- loop L0
- mfence
-L_SetWords:
- movl %edx, %ecx
- rep stosw
- movq %r8, %rax
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.nasm
deleted file mode 100644
index 4343550..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.nasm
+++ /dev/null
@@ -1,59 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem16.nasm
-;
-; Abstract:
-;
-; SetMem16 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem16 (
-; OUT VOID *Buffer,
-; IN UINTN Length,
-; IN UINT16 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- push rdi
- mov rax, r8
- DB 0x48, 0xf, 0x6e, 0xc0 ; movd mm0, rax
- mov r8, rcx
- mov rdi, r8
- mov rcx, rdx
- and edx, 3
- shr rcx, 2
- jz @SetWords
- DB 0xf, 0x70, 0xC0, 0x0 ; pshufw mm0, mm0, 0h
-.0:
- DB 0xf, 0xe7, 0x7 ; movntq [rdi], mm0
- add rdi, 8
- loop .0
- mfence
-@SetWords:
- mov ecx, edx
- rep stosw
- mov rax, r8
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.S
deleted file mode 100644
index b60e06a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.S
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem32.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem32.S
-#
-# Abstract:
-#
-# SetMem32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemSetMem32 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT32 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- movd %r8, %mm0 # mm0 <- Value
- movq %rcx, %rax # rax <- Buffer
- xchgq %rdx, %rcx # rcx <- Count rdx <- Buffer
- shrq $1, % rcx # rcx <- # of qwords to set
- jz L_SetDwords
- .byte 0x0f, 0x70, 0x0C0, 0x44
-L0:
- movntq %mm0, (%rdx)
- leaq 8(%rdx), %rdx # use "lea" to avoid flag changes
- loop L0
- mfence
-L_SetDwords:
- jnc L1
- movd %mm0, (%rdx)
-L1:
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.nasm
deleted file mode 100644
index cf659b0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.nasm
+++ /dev/null
@@ -1,53 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem32.nasm
-;
-; Abstract:
-;
-; SetMem32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem32 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT32 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- DB 0x49, 0xf, 0x6e, 0xc0 ; movd mm0, r8 (Value)
- mov rax, rcx ; rax <- Buffer
- xchg rcx, rdx ; rcx <- Count rdx <- Buffer
- shr rcx, 1 ; rcx <- # of qwords to set
- jz @SetDwords
- DB 0xf, 0x70, 0xC0, 0x44 ; pshufw mm0, mm0, 44h
-.0:
- DB 0xf, 0xe7, 0x2 ; movntq [rdx], mm0
- lea rdx, [rdx + 8] ; use "lea" to avoid flag changes
- loop .0
- mfence
-@SetDwords:
- jnc .1
- DB 0xf, 0x7e, 0x2 ; movd [rdx], mm0
-.1:
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.S
deleted file mode 100644
index c8cbb9a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.S
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem64.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem64.S
-#
-# Abstract:
-#
-# SetMem64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem64 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT64 Value
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- movd %r8, %mm0 #Value
- movq %rcx, %rax #rax <- Buffer
- xchg %rdx, %rcx #rcx <- Count
-L0:
- movntq %mm0, (%rdx)
- addq $8, %rdx
- loop L0
- mfence
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.nasm
deleted file mode 100644
index f4aa51c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.nasm
+++ /dev/null
@@ -1,46 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem64.nasm
-;
-; Abstract:
-;
-; SetMem64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem64 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT64 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- DB 0x49, 0xf, 0x6e, 0xc0 ; movd mm0, r8 (Value)
- mov rax, rcx ; rax <- Buffer
- xchg rcx, rdx ; rcx <- Count
-.0:
- DB 0xf, 0xe7, 0x2 ; movntq [rdx], mm0
- add rdx, 8
- loop .0
- mfence
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.S
deleted file mode 100644
index 1994f9c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.S
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ZeroMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ZeroMem.S
-#
-# Abstract:
-#
-# ZeroMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemZeroMem (
-# IN VOID *Buffer,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- pushq %rdi
- movq %rcx, %rdi
- movq %rdx, %rcx
- movq %rdi, %r8
- andq $7, %rdx
- shrq $3, %rcx
- jz L_ZeroBytes
- pxor %mm0, %mm0
-L0:
- movntq %mm0, (%rdi)
- addq $8, %rdi
- loop L0
- mfence
-L_ZeroBytes:
- xorl %eax, %eax
- movl %edx, %ecx
- rep stosb
- movq %r8, %rax
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.nasm
deleted file mode 100644
index 9eb4d26..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/X64/ZeroMem.nasm
+++ /dev/null
@@ -1,56 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ZeroMem.nasm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- push rdi
- mov rdi, rcx
- mov rcx, rdx
- mov r8, rdi
- and edx, 7
- shr rcx, 3
- jz @ZeroBytes
- DB 0xf, 0xef, 0xc0 ; pxor mm0, mm0
-.0:
- DB 0xf, 0xe7, 7 ; movntq [rdi], mm0
- add rdi, 8
- loop .0
- DB 0xf, 0xae, 0xf0 ; mfence
-@ZeroBytes:
- xor eax, eax
- mov ecx, edx
- rep stosb
- mov rax, r8
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c
deleted file mode 100644
index d768dd1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/** @file
- ZeroMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with zeros, and returns the target buffer.
-
- This function fills Length bytes of Buffer with zeros, and returns Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill with zeros.
- @param Length The number of bytes in Buffer to fill with zeros.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-ZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
- return InternalMemZeroMem (Buffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S
deleted file mode 100644
index 8544c01..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// Copyright (c) 2016, Linaro Limited
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
- .text
- .align 5
-ASM_GLOBAL ASM_PFX(InternalMemCompareGuid)
-ASM_PFX(InternalMemCompareGuid):
- mov x2, xzr
- ldp x3, x4, [x0]
- cbz x1, 0f
- ldp x1, x2, [x1]
-0: cmp x1, x3
- ccmp x2, x4, #0, eq
- cset w0, eq
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareMem.S
deleted file mode 100644
index 7e5bf8a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareMem.S
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-// Copyright (c) 2013, Linaro Limited
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-// Assumptions:
-//
-// ARMv8-a, AArch64
-//
-
-
-// Parameters and result.
-#define src1 x0
-#define src2 x1
-#define limit x2
-#define result x0
-
-// Internal variables.
-#define data1 x3
-#define data1w w3
-#define data2 x4
-#define data2w w4
-#define diff x6
-#define endloop x7
-#define tmp1 x8
-#define tmp2 x9
-#define pos x11
-#define limit_wd x12
-#define mask x13
-
- .p2align 6
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- eor tmp1, src1, src2
- tst tmp1, #7
- b.ne .Lmisaligned8
- ands tmp1, src1, #7
- b.ne .Lmutual_align
- add limit_wd, limit, #7
- lsr limit_wd, limit_wd, #3
-
- // Start of performance-critical section -- one 64B cache line.
-.Lloop_aligned:
- ldr data1, [src1], #8
- ldr data2, [src2], #8
-.Lstart_realigned:
- subs limit_wd, limit_wd, #1
- eor diff, data1, data2 // Non-zero if differences found.
- csinv endloop, diff, xzr, ne // Last Dword or differences.
- cbz endloop, .Lloop_aligned
- // End of performance-critical section -- one 64B cache line.
-
- // Not reached the limit, must have found a diff.
- cbnz limit_wd, .Lnot_limit
-
- // Limit % 8 == 0 => all bytes significant.
- ands limit, limit, #7
- b.eq .Lnot_limit
-
- lsl limit, limit, #3 // Bits -> bytes.
- mov mask, #~0
- lsl mask, mask, limit
- bic data1, data1, mask
- bic data2, data2, mask
-
- orr diff, diff, mask
-
-.Lnot_limit:
- rev diff, diff
- rev data1, data1
- rev data2, data2
-
- // The MS-non-zero bit of DIFF marks either the first bit
- // that is different, or the end of the significant data.
- // Shifting left now will bring the critical information into the
- // top bits.
- clz pos, diff
- lsl data1, data1, pos
- lsl data2, data2, pos
-
- // But we need to zero-extend (char is unsigned) the value and then
- // perform a signed 32-bit subtraction.
- lsr data1, data1, #56
- sub result, data1, data2, lsr #56
- ret
-
-.Lmutual_align:
- // Sources are mutually aligned, but are not currently at an
- // alignment boundary. Round down the addresses and then mask off
- // the bytes that precede the start point.
- bic src1, src1, #7
- bic src2, src2, #7
- add limit, limit, tmp1 // Adjust the limit for the extra.
- lsl tmp1, tmp1, #3 // Bytes beyond alignment -> bits.
- ldr data1, [src1], #8
- neg tmp1, tmp1 // Bits to alignment -64.
- ldr data2, [src2], #8
- mov tmp2, #~0
-
- // Little-endian. Early bytes are at LSB.
- lsr tmp2, tmp2, tmp1 // Shift (tmp1 & 63).
- add limit_wd, limit, #7
- orr data1, data1, tmp2
- orr data2, data2, tmp2
- lsr limit_wd, limit_wd, #3
- b .Lstart_realigned
-
- .p2align 6
-.Lmisaligned8:
- sub limit, limit, #1
-1:
- // Perhaps we can do better than this.
- ldrb data1w, [src1], #1
- ldrb data2w, [src2], #1
- subs limit, limit, #1
- ccmp data1w, data2w, #0, cs // NZCV = 0b0000.
- b.eq 1b
- sub result, data1, data2
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CopyMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CopyMem.S
deleted file mode 100644
index ec5f696..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CopyMem.S
+++ /dev/null
@@ -1,284 +0,0 @@
-//
-// Copyright (c) 2012 - 2016, Linaro Limited
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
-// Copyright (c) 2015 ARM Ltd
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 3. The name of the company may not be used to endorse or promote
-// products derived from this software without specific prior written
-// permission.
-//
-// THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-// IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-// Assumptions:
-//
-// ARMv8-a, AArch64, unaligned accesses.
-//
-//
-
-#define dstin x0
-#define src x1
-#define count x2
-#define dst x3
-#define srcend x4
-#define dstend x5
-#define A_l x6
-#define A_lw w6
-#define A_h x7
-#define A_hw w7
-#define B_l x8
-#define B_lw w8
-#define B_h x9
-#define C_l x10
-#define C_h x11
-#define D_l x12
-#define D_h x13
-#define E_l x14
-#define E_h x15
-#define F_l srcend
-#define F_h dst
-#define tmp1 x9
-#define tmp2 x3
-
-#define L(l) .L ## l
-
-// Copies are split into 3 main cases: small copies of up to 16 bytes,
-// medium copies of 17..96 bytes which are fully unrolled. Large copies
-// of more than 96 bytes align the destination and use an unrolled loop
-// processing 64 bytes per iteration.
-// Small and medium copies read all data before writing, allowing any
-// kind of overlap, and memmove tailcalls memcpy for these cases as
-// well as non-overlapping copies.
-
-__memcpy:
- prfm PLDL1KEEP, [src]
- add srcend, src, count
- add dstend, dstin, count
- cmp count, 16
- b.ls L(copy16)
- cmp count, 96
- b.hi L(copy_long)
-
- // Medium copies: 17..96 bytes.
- sub tmp1, count, 1
- ldp A_l, A_h, [src]
- tbnz tmp1, 6, L(copy96)
- ldp D_l, D_h, [srcend, -16]
- tbz tmp1, 5, 1f
- ldp B_l, B_h, [src, 16]
- ldp C_l, C_h, [srcend, -32]
- stp B_l, B_h, [dstin, 16]
- stp C_l, C_h, [dstend, -32]
-1:
- stp A_l, A_h, [dstin]
- stp D_l, D_h, [dstend, -16]
- ret
-
- .p2align 4
- // Small copies: 0..16 bytes.
-L(copy16):
- cmp count, 8
- b.lo 1f
- ldr A_l, [src]
- ldr A_h, [srcend, -8]
- str A_l, [dstin]
- str A_h, [dstend, -8]
- ret
- .p2align 4
-1:
- tbz count, 2, 1f
- ldr A_lw, [src]
- ldr A_hw, [srcend, -4]
- str A_lw, [dstin]
- str A_hw, [dstend, -4]
- ret
-
- // Copy 0..3 bytes. Use a branchless sequence that copies the same
- // byte 3 times if count==1, or the 2nd byte twice if count==2.
-1:
- cbz count, 2f
- lsr tmp1, count, 1
- ldrb A_lw, [src]
- ldrb A_hw, [srcend, -1]
- ldrb B_lw, [src, tmp1]
- strb A_lw, [dstin]
- strb B_lw, [dstin, tmp1]
- strb A_hw, [dstend, -1]
-2: ret
-
- .p2align 4
- // Copy 64..96 bytes. Copy 64 bytes from the start and
- // 32 bytes from the end.
-L(copy96):
- ldp B_l, B_h, [src, 16]
- ldp C_l, C_h, [src, 32]
- ldp D_l, D_h, [src, 48]
- ldp E_l, E_h, [srcend, -32]
- ldp F_l, F_h, [srcend, -16]
- stp A_l, A_h, [dstin]
- stp B_l, B_h, [dstin, 16]
- stp C_l, C_h, [dstin, 32]
- stp D_l, D_h, [dstin, 48]
- stp E_l, E_h, [dstend, -32]
- stp F_l, F_h, [dstend, -16]
- ret
-
- // Align DST to 16 byte alignment so that we don't cross cache line
- // boundaries on both loads and stores. There are at least 96 bytes
- // to copy, so copy 16 bytes unaligned and then align. The loop
- // copies 64 bytes per iteration and prefetches one iteration ahead.
-
- .p2align 4
-L(copy_long):
- and tmp1, dstin, 15
- bic dst, dstin, 15
- ldp D_l, D_h, [src]
- sub src, src, tmp1
- add count, count, tmp1 // Count is now 16 too large.
- ldp A_l, A_h, [src, 16]
- stp D_l, D_h, [dstin]
- ldp B_l, B_h, [src, 32]
- ldp C_l, C_h, [src, 48]
- ldp D_l, D_h, [src, 64]!
- subs count, count, 128 + 16 // Test and readjust count.
- b.ls 2f
-1:
- stp A_l, A_h, [dst, 16]
- ldp A_l, A_h, [src, 16]
- stp B_l, B_h, [dst, 32]
- ldp B_l, B_h, [src, 32]
- stp C_l, C_h, [dst, 48]
- ldp C_l, C_h, [src, 48]
- stp D_l, D_h, [dst, 64]!
- ldp D_l, D_h, [src, 64]!
- subs count, count, 64
- b.hi 1b
-
- // Write the last full set of 64 bytes. The remainder is at most 64
- // bytes, so it is safe to always copy 64 bytes from the end even if
- // there is just 1 byte left.
-2:
- ldp E_l, E_h, [srcend, -64]
- stp A_l, A_h, [dst, 16]
- ldp A_l, A_h, [srcend, -48]
- stp B_l, B_h, [dst, 32]
- ldp B_l, B_h, [srcend, -32]
- stp C_l, C_h, [dst, 48]
- ldp C_l, C_h, [srcend, -16]
- stp D_l, D_h, [dst, 64]
- stp E_l, E_h, [dstend, -64]
- stp A_l, A_h, [dstend, -48]
- stp B_l, B_h, [dstend, -32]
- stp C_l, C_h, [dstend, -16]
- ret
-
-
-//
-// All memmoves up to 96 bytes are done by memcpy as it supports overlaps.
-// Larger backwards copies are also handled by memcpy. The only remaining
-// case is forward large copies. The destination is aligned, and an
-// unrolled loop processes 64 bytes per iteration.
-//
-
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- sub tmp2, dstin, src
- cmp count, 96
- ccmp tmp2, count, 2, hi
- b.hs __memcpy
-
- cbz tmp2, 3f
- add dstend, dstin, count
- add srcend, src, count
-
- // Align dstend to 16 byte alignment so that we don't cross cache line
- // boundaries on both loads and stores. There are at least 96 bytes
- // to copy, so copy 16 bytes unaligned and then align. The loop
- // copies 64 bytes per iteration and prefetches one iteration ahead.
-
- and tmp2, dstend, 15
- ldp D_l, D_h, [srcend, -16]
- sub srcend, srcend, tmp2
- sub count, count, tmp2
- ldp A_l, A_h, [srcend, -16]
- stp D_l, D_h, [dstend, -16]
- ldp B_l, B_h, [srcend, -32]
- ldp C_l, C_h, [srcend, -48]
- ldp D_l, D_h, [srcend, -64]!
- sub dstend, dstend, tmp2
- subs count, count, 128
- b.ls 2f
- nop
-1:
- stp A_l, A_h, [dstend, -16]
- ldp A_l, A_h, [srcend, -16]
- stp B_l, B_h, [dstend, -32]
- ldp B_l, B_h, [srcend, -32]
- stp C_l, C_h, [dstend, -48]
- ldp C_l, C_h, [srcend, -48]
- stp D_l, D_h, [dstend, -64]!
- ldp D_l, D_h, [srcend, -64]!
- subs count, count, 64
- b.hi 1b
-
- // Write the last full set of 64 bytes. The remainder is at most 64
- // bytes, so it is safe to always copy 64 bytes from the start even if
- // there is just 1 byte left.
-2:
- ldp E_l, E_h, [src, 48]
- stp A_l, A_h, [dstend, -16]
- ldp A_l, A_h, [src, 32]
- stp B_l, B_h, [dstend, -32]
- ldp B_l, B_h, [src, 16]
- stp C_l, C_h, [dstend, -48]
- ldp C_l, C_h, [src]
- stp D_l, D_h, [dstend, -64]
- stp E_l, E_h, [dstin, 48]
- stp A_l, A_h, [dstin, 32]
- stp B_l, B_h, [dstin, 16]
- stp C_l, C_h, [dstin]
-3: ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/ScanMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/ScanMem.S
deleted file mode 100644
index 3fe772f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/ScanMem.S
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// Copyright (c) 2014, ARM Limited
-// All rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the company nor the names of its contributors
-// may be used to endorse or promote products derived from this
-// software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-// Assumptions:
-//
-// ARMv8-a, AArch64
-// Neon Available.
-//
-
-// Arguments and results.
-#define srcin x0
-#define cntin x1
-#define chrin w2
-
-#define result x0
-
-#define src x3
-#define tmp x4
-#define wtmp2 w5
-#define synd x6
-#define soff x9
-#define cntrem x10
-
-#define vrepchr v0
-#define vdata1 v1
-#define vdata2 v2
-#define vhas_chr1 v3
-#define vhas_chr2 v4
-#define vrepmask v5
-#define vend v6
-
-//
-// Core algorithm:
-//
-// For each 32-byte chunk we calculate a 64-bit syndrome value, with two bits
-// per byte. For each tuple, bit 0 is set if the relevant byte matched the
-// requested character and bit 1 is not used (faster than using a 32bit
-// syndrome). Since the bits in the syndrome reflect exactly the order in which
-// things occur in the original string, counting trailing zeros allows to
-// identify exactly which byte has matched.
-//
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- // Do not dereference srcin if no bytes to compare.
- cbz cntin, .Lzero_length
- //
- // Magic constant 0x40100401 allows us to identify which lane matches
- // the requested byte.
- //
- mov wtmp2, #0x0401
- movk wtmp2, #0x4010, lsl #16
- dup vrepchr.16b, chrin
- // Work with aligned 32-byte chunks
- bic src, srcin, #31
- dup vrepmask.4s, wtmp2
- ands soff, srcin, #31
- and cntrem, cntin, #31
- b.eq .Lloop
-
- //
- // Input string is not 32-byte aligned. We calculate the syndrome
- // value for the aligned 32 bytes block containing the first bytes
- // and mask the irrelevant part.
- //
-
- ld1 {vdata1.16b, vdata2.16b}, [src], #32
- sub tmp, soff, #32
- adds cntin, cntin, tmp
- cmeq vhas_chr1.16b, vdata1.16b, vrepchr.16b
- cmeq vhas_chr2.16b, vdata2.16b, vrepchr.16b
- and vhas_chr1.16b, vhas_chr1.16b, vrepmask.16b
- and vhas_chr2.16b, vhas_chr2.16b, vrepmask.16b
- addp vend.16b, vhas_chr1.16b, vhas_chr2.16b // 256->128
- addp vend.16b, vend.16b, vend.16b // 128->64
- mov synd, vend.d[0]
- // Clear the soff*2 lower bits
- lsl tmp, soff, #1
- lsr synd, synd, tmp
- lsl synd, synd, tmp
- // The first block can also be the last
- b.ls .Lmasklast
- // Have we found something already?
- cbnz synd, .Ltail
-
-.Lloop:
- ld1 {vdata1.16b, vdata2.16b}, [src], #32
- subs cntin, cntin, #32
- cmeq vhas_chr1.16b, vdata1.16b, vrepchr.16b
- cmeq vhas_chr2.16b, vdata2.16b, vrepchr.16b
- // If we're out of data we finish regardless of the result
- b.ls .Lend
- // Use a fast check for the termination condition
- orr vend.16b, vhas_chr1.16b, vhas_chr2.16b
- addp vend.2d, vend.2d, vend.2d
- mov synd, vend.d[0]
- // We're not out of data, loop if we haven't found the character
- cbz synd, .Lloop
-
-.Lend:
- // Termination condition found, let's calculate the syndrome value
- and vhas_chr1.16b, vhas_chr1.16b, vrepmask.16b
- and vhas_chr2.16b, vhas_chr2.16b, vrepmask.16b
- addp vend.16b, vhas_chr1.16b, vhas_chr2.16b // 256->128
- addp vend.16b, vend.16b, vend.16b // 128->64
- mov synd, vend.d[0]
- // Only do the clear for the last possible block
- b.hi .Ltail
-
-.Lmasklast:
- // Clear the (32 - ((cntrem + soff) % 32)) * 2 upper bits
- add tmp, cntrem, soff
- and tmp, tmp, #31
- sub tmp, tmp, #32
- neg tmp, tmp, lsl #1
- lsl synd, synd, tmp
- lsr synd, synd, tmp
-
-.Ltail:
- // Count the trailing zeros using bit reversing
- rbit synd, synd
- // Compensate the last post-increment
- sub src, src, #32
- // Check that we have found a character
- cmp synd, #0
- // And count the leading zeros
- clz synd, synd
- // Compute the potential result
- add result, src, synd, lsr #1
- // Select result or NULL
- csel result, xzr, result, eq
- ret
-
-.Lzero_length:
- mov result, #0
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/SetMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/SetMem.S
deleted file mode 100644
index 384fbdc..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/SetMem.S
+++ /dev/null
@@ -1,247 +0,0 @@
-//
-// Copyright (c) 2012 - 2016, Linaro Limited
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
-// Copyright (c) 2015 ARM Ltd
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 3. The name of the company may not be used to endorse or promote
-// products derived from this software without specific prior written
-// permission.
-//
-// THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-// IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-// Assumptions:
-//
-// ARMv8-a, AArch64, unaligned accesses
-//
-//
-
-#define dstin x0
-#define count x1
-#define val x2
-#define valw w2
-#define dst x3
-#define dstend x4
-#define tmp1 x5
-#define tmp1w w5
-#define tmp2 x6
-#define tmp2w w6
-#define zva_len x7
-#define zva_lenw w7
-
-#define L(l) .L ## l
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- dup v0.8H, valw
- lsl count, count, #1
- b 0f
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- dup v0.4S, valw
- lsl count, count, #2
- b 0f
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- dup v0.2D, val
- lsl count, count, #3
- b 0f
-
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- movi v0.16B, #0
- b 0f
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- dup v0.16B, valw
-0: add dstend, dstin, count
- mov val, v0.D[0]
-
- cmp count, 96
- b.hi L(set_long)
- cmp count, 16
- b.hs L(set_medium)
-
- // Set 0..15 bytes.
- tbz count, 3, 1f
- str val, [dstin]
- str val, [dstend, -8]
- ret
- nop
-1: tbz count, 2, 2f
- str valw, [dstin]
- str valw, [dstend, -4]
- ret
-2: cbz count, 3f
- strb valw, [dstin]
- tbz count, 1, 3f
- strh valw, [dstend, -2]
-3: ret
-
- // Set 17..96 bytes.
-L(set_medium):
- str q0, [dstin]
- tbnz count, 6, L(set96)
- str q0, [dstend, -16]
- tbz count, 5, 1f
- str q0, [dstin, 16]
- str q0, [dstend, -32]
-1: ret
-
- .p2align 4
- // Set 64..96 bytes. Write 64 bytes from the start and
- // 32 bytes from the end.
-L(set96):
- str q0, [dstin, 16]
- stp q0, q0, [dstin, 32]
- stp q0, q0, [dstend, -32]
- ret
-
- .p2align 3
- nop
-L(set_long):
- bic dst, dstin, 15
- str q0, [dstin]
- cmp count, 256
- ccmp val, 0, 0, cs
- b.eq L(try_zva)
-L(no_zva):
- sub count, dstend, dst // Count is 16 too large.
- add dst, dst, 16
- sub count, count, 64 + 16 // Adjust count and bias for loop.
-1: stp q0, q0, [dst], 64
- stp q0, q0, [dst, -32]
-L(tail64):
- subs count, count, 64
- b.hi 1b
-2: stp q0, q0, [dstend, -64]
- stp q0, q0, [dstend, -32]
- ret
-
- .p2align 3
-L(try_zva):
- mrs tmp1, dczid_el0
- tbnz tmp1w, 4, L(no_zva)
- and tmp1w, tmp1w, 15
- cmp tmp1w, 4 // ZVA size is 64 bytes.
- b.ne L(zva_128)
-
- // Write the first and last 64 byte aligned block using stp rather
- // than using DC ZVA. This is faster on some cores.
-L(zva_64):
- str q0, [dst, 16]
- stp q0, q0, [dst, 32]
- bic dst, dst, 63
- stp q0, q0, [dst, 64]
- stp q0, q0, [dst, 96]
- sub count, dstend, dst // Count is now 128 too large.
- sub count, count, 128+64+64 // Adjust count and bias for loop.
- add dst, dst, 128
- nop
-1: dc zva, dst
- add dst, dst, 64
- subs count, count, 64
- b.hi 1b
- stp q0, q0, [dst, 0]
- stp q0, q0, [dst, 32]
- stp q0, q0, [dstend, -64]
- stp q0, q0, [dstend, -32]
- ret
-
- .p2align 3
-L(zva_128):
- cmp tmp1w, 5 // ZVA size is 128 bytes.
- b.ne L(zva_other)
-
- str q0, [dst, 16]
- stp q0, q0, [dst, 32]
- stp q0, q0, [dst, 64]
- stp q0, q0, [dst, 96]
- bic dst, dst, 127
- sub count, dstend, dst // Count is now 128 too large.
- sub count, count, 128+128 // Adjust count and bias for loop.
- add dst, dst, 128
-1: dc zva, dst
- add dst, dst, 128
- subs count, count, 128
- b.hi 1b
- stp q0, q0, [dstend, -128]
- stp q0, q0, [dstend, -96]
- stp q0, q0, [dstend, -64]
- stp q0, q0, [dstend, -32]
- ret
-
-L(zva_other):
- mov tmp2w, 4
- lsl zva_lenw, tmp2w, tmp1w
- add tmp1, zva_len, 64 // Max alignment bytes written.
- cmp count, tmp1
- blo L(no_zva)
-
- sub tmp2, zva_len, 1
- add tmp1, dst, zva_len
- add dst, dst, 16
- subs count, tmp1, dst // Actual alignment bytes to write.
- bic tmp1, tmp1, tmp2 // Aligned dc zva start address.
- beq 2f
-1: stp q0, q0, [dst], 64
- stp q0, q0, [dst, -32]
- subs count, count, 64
- b.hi 1b
-2: mov dst, tmp1
- sub count, dstend, tmp1 // Remaining bytes to write.
- subs count, count, zva_len
- b.lo 4f
-3: dc zva, dst
- add dst, dst, zva_len
- subs count, count, zva_len
- b.hs 3b
-4: add count, count, zva_len
- b L(tail64)
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S
deleted file mode 100644
index 78a4525..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// Copyright (c) 2016, Linaro Limited
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
- .text
- .thumb
- .syntax unified
- .align 5
- .type ASM_PFX(InternalMemCompareGuid), %function
-ASM_GLOBAL ASM_PFX(InternalMemCompareGuid)
-ASM_PFX(InternalMemCompareGuid):
- push {r4, lr}
- ldr r2, [r0]
- ldr r3, [r0, #4]
- ldr r4, [r0, #8]
- ldr r0, [r0, #12]
- cbz r1, 1f
- ldr ip, [r1]
- ldr lr, [r1, #4]
- cmp r2, ip
- it eq
- cmpeq.n r3, lr
- beq 0f
- movs r0, #0
- pop {r4, pc}
-
-0: ldr r2, [r1, #8]
- ldr r3, [r1, #12]
- cmp r4, r2
- it eq
- cmpeq.n r0, r3
- bne 2f
- movs r0, #1
- pop {r4, pc}
-
-1: orrs r2, r2, r3
- orrs r4, r4, r0
- movs r0, #1
- orrs r2, r2, r4
-2: it ne
- movne.n r0, #0
- pop {r4, pc}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm
deleted file mode 100644
index 0373404..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm
+++ /dev/null
@@ -1,70 +0,0 @@
-;
-; Copyright (c) 2016, Linaro Limited
-; All rights reserved.
-;
-; Redistribution and use in source and binary forms, with or without
-; modification, are permitted provided that the following conditions are met:
-; * Redistributions of source code must retain the above copyright
-; notice, this list of conditions and the following disclaimer.
-; * Redistributions in binary form must reproduce the above copyright
-; notice, this list of conditions and the following disclaimer in the
-; documentation and/or other materials provided with the distribution.
-; * Neither the name of the Linaro nor the
-; names of its contributors may be used to endorse or promote products
-; derived from this software without specific prior written permission.
-;
-; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-; HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-;
-
- EXPORT InternalMemCompareGuid
- THUMB
- AREA CompareGuid, CODE, READONLY, CODEALIGN, ALIGN=5
-
-InternalMemCompareGuid
- push {r4, lr}
- ldr r2, [r0]
- ldr r3, [r0, #4]
- ldr r4, [r0, #8]
- ldr r0, [r0, #12]
- cbz r1, L1
- ldr ip, [r1]
- ldr lr, [r1, #4]
- cmp r2, ip
- it eq
- cmpeq r3, lr
- beq L0
- movs r0, #0
- pop {r4, pc}
-
-L0
- ldr r2, [r1, #8]
- ldr r3, [r1, #12]
- cmp r4, r2
- it eq
- cmpeq r0, r3
- bne L2
- movs r0, #1
- pop {r4, pc}
-
-L1
- orrs r2, r2, r3
- orrs r4, r4, r0
- movs r0, #1
- orrs r2, r2, r4
-
-L2
- it ne
- movne r0, #0
- pop {r4, pc}
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S
deleted file mode 100644
index 8e17760..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// Copyright (c) 2013 - 2016, Linaro Limited
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-// Parameters and result.
-#define src1 r0
-#define src2 r1
-#define limit r2
-#define result r0
-
-// Internal variables.
-#define data1 r3
-#define data2 r4
-#define limit_wd r5
-#define diff r6
-#define tmp1 r7
-#define tmp2 r12
-#define pos r8
-#define mask r14
-
- .text
- .thumb
- .syntax unified
- .align 5
- .type ASM_PFX(InternalMemCompareMem), %function
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- push {r4-r8, lr}
- eor tmp1, src1, src2
- tst tmp1, #3
- bne .Lmisaligned4
- ands tmp1, src1, #3
- bne .Lmutual_align
- add limit_wd, limit, #3
- nop.w
- lsr limit_wd, limit_wd, #2
-
- // Start of performance-critical section -- one 32B cache line.
-.Lloop_aligned:
- ldr data1, [src1], #4
- ldr data2, [src2], #4
-.Lstart_realigned:
- subs limit_wd, limit_wd, #1
- eor diff, data1, data2 // Non-zero if differences found.
- cbnz diff, 0f
- bne .Lloop_aligned
- // End of performance-critical section -- one 32B cache line.
-
- // Not reached the limit, must have found a diff.
-0: cbnz limit_wd, .Lnot_limit
-
- // Limit % 4 == 0 => all bytes significant.
- ands limit, limit, #3
- beq .Lnot_limit
-
- lsl limit, limit, #3 // Bits -> bytes.
- mov mask, #~0
- lsl mask, mask, limit
- bic data1, data1, mask
- bic data2, data2, mask
-
- orr diff, diff, mask
-
-.Lnot_limit:
- rev diff, diff
- rev data1, data1
- rev data2, data2
-
- // The MS-non-zero bit of DIFF marks either the first bit
- // that is different, or the end of the significant data.
- // Shifting left now will bring the critical information into the
- // top bits.
- clz pos, diff
- lsl data1, data1, pos
- lsl data2, data2, pos
-
- // But we need to zero-extend (char is unsigned) the value and then
- // perform a signed 32-bit subtraction.
- lsr data1, data1, #28
- sub result, data1, data2, lsr #28
- pop {r4-r8, pc}
-
-.Lmutual_align:
- // Sources are mutually aligned, but are not currently at an
- // alignment boundary. Round down the addresses and then mask off
- // the bytes that precede the start point.
- bic src1, src1, #3
- bic src2, src2, #3
- add limit, limit, tmp1 // Adjust the limit for the extra.
- lsl tmp1, tmp1, #3 // Bytes beyond alignment -> bits.
- ldr data1, [src1], #4
- rsb tmp1, tmp1, #32 // Bits to alignment -32.
- ldr data2, [src2], #4
- mov tmp2, #~0
-
- // Little-endian. Early bytes are at LSB.
- lsr tmp2, tmp2, tmp1 // Shift (tmp1 & 31).
- add limit_wd, limit, #3
- orr data1, data1, tmp2
- orr data2, data2, tmp2
- lsr limit_wd, limit_wd, #2
- b .Lstart_realigned
-
-.Lmisaligned4:
- sub limit, limit, #1
-1:
- // Perhaps we can do better than this.
- ldrb data1, [src1], #1
- ldrb data2, [src2], #1
- subs limit, limit, #1
- it cs
- cmpcs.n data1, data2
- beq 1b
- sub result, data1, data2
- pop {r4-r8, pc}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.asm
deleted file mode 100644
index 4c72dcf..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.asm
+++ /dev/null
@@ -1,140 +0,0 @@
-;
-; Copyright (c) 2013 - 2016, Linaro Limited
-; All rights reserved.
-;
-; Redistribution and use in source and binary forms, with or without
-; modification, are permitted provided that the following conditions are met:
-; * Redistributions of source code must retain the above copyright
-; notice, this list of conditions and the following disclaimer.
-; * Redistributions in binary form must reproduce the above copyright
-; notice, this list of conditions and the following disclaimer in the
-; documentation and/or other materials provided with the distribution.
-; * Neither the name of the Linaro nor the
-; names of its contributors may be used to endorse or promote products
-; derived from this software without specific prior written permission.
-;
-; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-; HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-;
-
-; Parameters and result.
-#define src1 r0
-#define src2 r1
-#define limit r2
-#define result r0
-
-; Internal variables.
-#define data1 r3
-#define data2 r4
-#define limit_wd r5
-#define diff r6
-#define tmp1 r7
-#define tmp2 r12
-#define pos r8
-#define mask r14
-
- EXPORT InternalMemCompareMem
- THUMB
- AREA CompareMem, CODE, READONLY
-
-InternalMemCompareMem
- push {r4-r8, lr}
- eor tmp1, src1, src2
- tst tmp1, #3
- bne Lmisaligned4
- ands tmp1, src1, #3
- bne Lmutual_align
- add limit_wd, limit, #3
- nop.w
- lsr limit_wd, limit_wd, #2
-
- ; Start of performance-critical section -- one 32B cache line.
-Lloop_aligned
- ldr data1, [src1], #4
- ldr data2, [src2], #4
-Lstart_realigned
- subs limit_wd, limit_wd, #1
- eor diff, data1, data2 ; Non-zero if differences found.
- cbnz diff, L0
- bne Lloop_aligned
- ; End of performance-critical section -- one 32B cache line.
-
- ; Not reached the limit, must have found a diff.
-L0
- cbnz limit_wd, Lnot_limit
-
- // Limit % 4 == 0 => all bytes significant.
- ands limit, limit, #3
- beq Lnot_limit
-
- lsl limit, limit, #3 // Bits -> bytes.
- mov mask, #~0
- lsl mask, mask, limit
- bic data1, data1, mask
- bic data2, data2, mask
-
- orr diff, diff, mask
-
-Lnot_limit
- rev diff, diff
- rev data1, data1
- rev data2, data2
-
- ; The MS-non-zero bit of DIFF marks either the first bit
- ; that is different, or the end of the significant data.
- ; Shifting left now will bring the critical information into the
- ; top bits.
- clz pos, diff
- lsl data1, data1, pos
- lsl data2, data2, pos
-
- ; But we need to zero-extend (char is unsigned) the value and then
- ; perform a signed 32-bit subtraction.
- lsr data1, data1, #28
- sub result, data1, data2, lsr #28
- pop {r4-r8, pc}
-
-Lmutual_align
- ; Sources are mutually aligned, but are not currently at an
- ; alignment boundary. Round down the addresses and then mask off
- ; the bytes that precede the start point.
- bic src1, src1, #3
- bic src2, src2, #3
- add limit, limit, tmp1 ; Adjust the limit for the extra.
- lsl tmp1, tmp1, #2 ; Bytes beyond alignment -> bits.
- ldr data1, [src1], #4
- neg tmp1, tmp1 ; Bits to alignment -32.
- ldr data2, [src2], #4
- mov tmp2, #~0
-
- ; Little-endian. Early bytes are at LSB.
- lsr tmp2, tmp2, tmp1 ; Shift (tmp1 & 31).
- add limit_wd, limit, #3
- orr data1, data1, tmp2
- orr data2, data2, tmp2
- lsr limit_wd, limit_wd, #2
- b Lstart_realigned
-
-Lmisaligned4
- sub limit, limit, #1
-L1
- // Perhaps we can do better than this.
- ldrb data1, [src1], #1
- ldrb data2, [src2], #1
- subs limit, limit, #1
- it cs
- cmpcs data1, data2
- beq L1
- sub result, data1, data2
- pop {r4-r8, pc}
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.S
deleted file mode 100644
index 85d6811..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.S
+++ /dev/null
@@ -1,176 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# CopyMem() worker for ARM
-#
-# This file started out as C code that did 64 bit moves if the buffer was
-# 32-bit aligned, else it does a byte copy. It also does a byte copy for
-# any trailing bytes. It was updated to do 32-byte copies using stm/ldm.
-#
-# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-# Copyright (c) 2016, Linaro Ltd. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
- .text
- .thumb
- .syntax unified
-
-/**
- Copy Length bytes from Source to Destination. Overlap is OK.
-
- This implementation
-
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
-
-
-VOID *
-EFIAPI
-InternalMemCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-**/
- .type ASM_PFX(InternalMemCopyMem), %function
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- push {r4-r11, lr}
- // Save the input parameters in extra registers (r11 = destination, r14 = source, r12 = length)
- mov r11, r0
- mov r10, r0
- mov r12, r2
- mov r14, r1
-
- cmp r11, r1
- // If (dest < source)
- bcc memcopy_check_optim_default
-
- // If (source + length < dest)
- rsb r3, r1, r11
- cmp r12, r3
- bcc memcopy_check_optim_default
- b memcopy_check_optim_overlap
-
-memcopy_check_optim_default:
- // Check if we can use an optimized path ((length >= 32) && destination word-aligned && source word-aligned) for the memcopy (optimized path if r0 == 1)
- tst r0, #0xF
- it ne
- movne.n r0, #0
- bne memcopy_default
- tst r1, #0xF
- it ne
- movne.n r3, #0
- it eq
- moveq.n r3, #1
- cmp r2, #31
- it ls
- movls.n r0, #0
- bls memcopy_default
- and r0, r3, #1
- b memcopy_default
-
-memcopy_check_optim_overlap:
- // r10 = dest_end, r14 = source_end
- add r10, r11, r12
- add r14, r12, r1
-
- // Are we in the optimized case ((length >= 32) && dest_end word-aligned && source_end word-aligned)
- cmp r2, #31
- it ls
- movls.n r0, #0
- it hi
- movhi.n r0, #1
- tst r10, #0xF
- it ne
- movne.n r0, #0
- tst r14, #0xF
- it ne
- movne.n r0, #0
- b memcopy_overlapped
-
-memcopy_overlapped_non_optim:
- // We read 1 byte from the end of the source buffer
- sub r3, r14, #1
- sub r12, r12, #1
- ldrb r3, [r3, #0]
- sub r2, r10, #1
- cmp r12, #0
- // We write 1 byte at the end of the dest buffer
- sub r10, r10, #1
- sub r14, r14, #1
- strb r3, [r2, #0]
- bne memcopy_overlapped_non_optim
- b memcopy_end
-
-// r10 = dest_end, r14 = source_end
-memcopy_overlapped:
- // Are we in the optimized case ?
- cmp r0, #0
- beq memcopy_overlapped_non_optim
-
- // Optimized Overlapped - Read 32 bytes
- sub r14, r14, #32
- sub r12, r12, #32
- cmp r12, #31
- ldmia r14, {r2-r9}
-
- // If length is less than 32 then disable optim
- it ls
- movls.n r0, #0
-
- cmp r12, #0
-
- // Optimized Overlapped - Write 32 bytes
- sub r10, r10, #32
- stmia r10, {r2-r9}
-
- // while (length != 0)
- bne memcopy_overlapped
- b memcopy_end
-
-memcopy_default_non_optim:
- // Byte copy
- ldrb r3, [r14], #1
- sub r12, r12, #1
- strb r3, [r10], #1
-
-memcopy_default:
- cmp r12, #0
- beq memcopy_end
-
-// r10 = dest, r14 = source
-memcopy_default_loop:
- cmp r0, #0
- beq memcopy_default_non_optim
-
- // Optimized memcopy - Read 32 Bytes
- sub r12, r12, #32
- cmp r12, #31
- ldmia r14!, {r2-r9}
-
- // If length is less than 32 then disable optim
- it ls
- movls.n r0, #0
-
- cmp r12, #0
-
- // Optimized memcopy - Write 32 Bytes
- stmia r10!, {r2-r9}
-
- // while (length != 0)
- bne memcopy_default_loop
-
-memcopy_end:
- mov r0, r11
- pop {r4-r11, pc}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.asm
deleted file mode 100644
index f544740..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CopyMem.asm
+++ /dev/null
@@ -1,147 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; CopyMem() worker for ARM
-;
-; This file started out as C code that did 64 bit moves if the buffer was
-; 32-bit aligned, else it does a byte copy. It also does a byte copy for
-; any trailing bytes. It was updated to do 32-byte copies using stm/ldm.
-;
-; Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-; Copyright (c) 2016, Linaro Ltd. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT InternalMemCopyMem
- AREA SetMem, CODE, READONLY
- THUMB
-
-InternalMemCopyMem
- stmfd sp!, {r4-r11, lr}
- // Save the input parameters in extra registers (r11 = destination, r14 = source, r12 = length)
- mov r11, r0
- mov r10, r0
- mov r12, r2
- mov r14, r1
-
-memcopy_check_overlapped
- cmp r11, r1
- // If (dest < source)
- bcc memcopy_check_optim_default
-
- // If (source + length < dest)
- rsb r3, r1, r11
- cmp r12, r3
- bcc memcopy_check_optim_default
- b memcopy_check_optim_overlap
-
-memcopy_check_optim_default
- // Check if we can use an optimized path ((length >= 32) && destination word-aligned && source word-aligned) for the memcopy (optimized path if r0 == 1)
- tst r0, #0xF
- movne r0, #0
- bne memcopy_default
- tst r1, #0xF
- movne r3, #0
- moveq r3, #1
- cmp r2, #31
- movls r0, #0
- andhi r0, r3, #1
- b memcopy_default
-
-memcopy_check_optim_overlap
- // r10 = dest_end, r14 = source_end
- add r10, r11, r12
- add r14, r12, r1
-
- // Are we in the optimized case ((length >= 32) && dest_end word-aligned && source_end word-aligned)
- cmp r2, #31
- movls r0, #0
- movhi r0, #1
- tst r10, #0xF
- movne r0, #0
- tst r14, #0xF
- movne r0, #0
- b memcopy_overlapped
-
-memcopy_overlapped_non_optim
- // We read 1 byte from the end of the source buffer
- sub r3, r14, #1
- sub r12, r12, #1
- ldrb r3, [r3, #0]
- sub r2, r10, #1
- cmp r12, #0
- // We write 1 byte at the end of the dest buffer
- sub r10, r10, #1
- sub r14, r14, #1
- strb r3, [r2, #0]
- bne memcopy_overlapped_non_optim
- b memcopy_end
-
-// r10 = dest_end, r14 = source_end
-memcopy_overlapped
- // Are we in the optimized case ?
- cmp r0, #0
- beq memcopy_overlapped_non_optim
-
- // Optimized Overlapped - Read 32 bytes
- sub r14, r14, #32
- sub r12, r12, #32
- cmp r12, #31
- ldmia r14, {r2-r9}
-
- // If length is less than 32 then disable optim
- movls r0, #0
-
- cmp r12, #0
-
- // Optimized Overlapped - Write 32 bytes
- sub r10, r10, #32
- stmia r10, {r2-r9}
-
- // while (length != 0)
- bne memcopy_overlapped
- b memcopy_end
-
-memcopy_default_non_optim
- // Byte copy
- ldrb r3, [r14], #1
- sub r12, r12, #1
- strb r3, [r10], #1
-
-memcopy_default
- cmp r12, #0
- beq memcopy_end
-
-// r10 = dest, r14 = source
-memcopy_default_loop
- cmp r0, #0
- beq memcopy_default_non_optim
-
- // Optimized memcopy - Read 32 Bytes
- sub r12, r12, #32
- cmp r12, #31
- ldmia r14!, {r2-r9}
-
- // If length is less than 32 then disable optim
- movls r0, #0
-
- cmp r12, #0
-
- // Optimized memcopy - Write 32 Bytes
- stmia r10!, {r2-r9}
-
- // while (length != 0)
- bne memcopy_default_loop
-
-memcopy_end
- mov r0, r11
- ldmfd sp!, {r4-r11, pc}
-
- END
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/MemLibGuid.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/MemLibGuid.c
deleted file mode 100644
index b2942f3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/MemLibGuid.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/** @file
- Implementation of GUID functions for ARM and AARCH64
-
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
- Copyright (c) 2016, Linaro Ltd. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Internal function to compare two GUIDs.
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
- If there are any bit differences in the two GUIDs, then FALSE is returned.
-
- @param Guid1 A pointer to a 128 bit GUID.
- @param Guid2 A pointer to a 128 bit GUID.
-
- @retval TRUE Guid1 and Guid2 are identical.
- @retval FALSE Guid1 and Guid2 are not identical.
-
-**/
-BOOLEAN
-EFIAPI
-InternalMemCompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
- );
-
-/**
- Copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid to
- DestinationGuid, and returns DestinationGuid.
-
- If DestinationGuid is NULL, then ASSERT().
- If SourceGuid is NULL, then ASSERT().
-
- @param DestinationGuid The pointer to the destination GUID.
- @param SourceGuid The pointer to the source GUID.
-
- @return DestinationGuid.
-
-**/
-GUID *
-EFIAPI
-CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
- )
-{
- ASSERT (DestinationGuid != NULL);
- ASSERT (SourceGuid != NULL);
-
- return InternalMemCopyMem (DestinationGuid, SourceGuid, sizeof (GUID));
-}
-
-/**
- Compares two GUIDs.
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
- If there are any bit differences in the two GUIDs, then FALSE is returned.
-
- If Guid1 is NULL, then ASSERT().
- If Guid2 is NULL, then ASSERT().
-
- @param Guid1 A pointer to a 128 bit GUID.
- @param Guid2 A pointer to a 128 bit GUID.
-
- @retval TRUE Guid1 and Guid2 are identical.
- @retval FALSE Guid1 and Guid2 are not identical.
-
-**/
-BOOLEAN
-EFIAPI
-CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
- )
-{
- ASSERT (Guid1 != NULL);
- ASSERT (Guid2 != NULL);
-
- return InternalMemCompareGuid (Guid1, Guid2);
-}
-
-/**
- Scans a target buffer for a GUID, and returns a pointer to the matching GUID
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the 128-bit
- GUID value that matches Guid. If a match is found, then a pointer to the matching
- GUID in the target buffer is returned. If no match is found, then NULL is returned.
- If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 128-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Guid The value to search for in the target buffer.
-
- @return A pointer to the matching Guid in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
- )
-{
- CONST GUID *GuidPtr;
-
- ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
- ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
- ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
-
- GuidPtr = (GUID*)Buffer;
- Buffer = GuidPtr + Length / sizeof (*GuidPtr);
- while (GuidPtr < (CONST GUID*)Buffer) {
- if (InternalMemCompareGuid (GuidPtr, Guid)) {
- return (VOID*)GuidPtr;
- }
- GuidPtr++;
- }
- return NULL;
-}
-
-/**
- Checks if the given GUID is a zero GUID.
-
- This function checks whether the given GUID is a zero GUID. If the GUID is
- identical to a zero GUID then TRUE is returned. Otherwise, FALSE is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid The pointer to a 128 bit GUID.
-
- @retval TRUE Guid is a zero GUID.
- @retval FALSE Guid is not a zero GUID.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroGuid (
- IN CONST GUID *Guid
- )
-{
- ASSERT (Guid != NULL);
-
- return InternalMemCompareGuid (Guid, NULL);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S
deleted file mode 100644
index 5502f28..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright (c) 2010-2011, Linaro Limited
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// * Neither the name of Linaro Limited nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
-// Written by Dave Gilbert
-//
-// This memchr routine is optimised on a Cortex-A9 and should work on
-// all ARMv7 processors. It has a fast past for short sizes, and has
-// an optimised path for large data sets; the worst case is finding the
-// match early in a large data set.
-//
-
-
-// 2011-02-07 david.gilbert@linaro.org
-// Extracted from local git a5b438d861
-// 2011-07-14 david.gilbert@linaro.org
-// Import endianness fix from local git ea786f1b
-// 2011-12-07 david.gilbert@linaro.org
-// Removed unneeded cbz from align loop
-
-// this lets us check a flag in a 00/ff byte easily in either endianness
-#define CHARTSTMASK(c) 1<<(c*8)
-
- .text
- .thumb
- .syntax unified
-
- .type ASM_PFX(InternalMemScanMem8), %function
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- // r0 = start of memory to scan
- // r1 = length
- // r2 = character to look for
- // returns r0 = pointer to character or NULL if not found
- uxtb r2, r2 // Don't think we can trust the caller to actually pass a char
-
- cmp r1, #16 // If it's short don't bother with anything clever
- blt 20f
-
- tst r0, #7 // If it's already aligned skip the next bit
- beq 10f
-
- // Work up to an aligned point
-5:
- ldrb r3, [r0],#1
- subs r1, r1, #1
- cmp r3, r2
- beq 50f // If it matches exit found
- tst r0, #7
- bne 5b // If not aligned yet then do next byte
-
-10:
- // At this point, we are aligned, we know we have at least 8 bytes to work with
- push {r4-r7}
- orr r2, r2, r2, lsl #8 // expand the match word across to all bytes
- orr r2, r2, r2, lsl #16
- bic r4, r1, #7 // Number of double words to work with
- mvns r7, #0 // all F's
- movs r3, #0
-
-15:
- ldmia r0!, {r5,r6}
- subs r4, r4, #8
- eor r5, r5, r2 // Get it so that r5,r6 have 00's where the bytes match the target
- eor r6, r6, r2
- uadd8 r5, r5, r7 // Parallel add 0xff - sets the GE bits for anything that wasn't 0
- sel r5, r3, r7 // bytes are 00 for none-00 bytes, or ff for 00 bytes - NOTE INVERSION
- uadd8 r6, r6, r7 // Parallel add 0xff - sets the GE bits for anything that wasn't 0
- sel r6, r5, r7 // chained....bytes are 00 for none-00 bytes, or ff for 00 bytes - NOTE INVERSION
- cbnz r6, 60f
- bne 15b // (Flags from the subs above) If not run out of bytes then go around again
-
- pop {r4-r7}
- and r2, r2, #0xff // Get r2 back to a single character from the expansion above
- and r1, r1, #7 // Leave the count remaining as the number after the double words have been done
-
-20:
- cbz r1, 40f // 0 length or hit the end already then not found
-
-21: // Post aligned section, or just a short call
- ldrb r3, [r0], #1
- subs r1, r1, #1
- eor r3, r3, r2 // r3 = 0 if match - doesn't break flags from sub
- cbz r3, 50f
- bne 21b // on r1 flags
-
-40:
- movs r0, #0 // not found
- bx lr
-
-50:
- subs r0, r0, #1 // found
- bx lr
-
-60: // We're here because the fast path found a hit - now we have to track down exactly which word it was
- // r0 points to the start of the double word after the one that was tested
- // r5 has the 00/ff pattern for the first word, r6 has the chained value
- subs r0, r0, #3
- cmp r5, #0
- it eq
- moveq.n r5, r6 // the end is in the 2nd word
- it ne
- subne.n r0, r0, #4 // or 2nd byte of 1st word
-
- // r0 currently points to the 3rd byte of the word containing the hit
- tst r5, #CHARTSTMASK(0) // 1st character
- bne 61f
- adds r0, r0, #1
- tst r5, #CHARTSTMASK(1) // 2nd character
- bne 61f
- adds r0, r0 ,#1
- tst r5, #(3 << 15) // 2nd & 3rd character
- // If not the 3rd must be the last one
- it eq
- addeq.n r0, r0, #1
-
-61:
- pop {r4-r7}
- subs r0, r0, #1
- bx lr
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.asm
deleted file mode 100644
index bb489f1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.asm
+++ /dev/null
@@ -1,147 +0,0 @@
-; Copyright (c) 2010-2011, Linaro Limited
-; All rights reserved.
-;
-; Redistribution and use in source and binary forms, with or without
-; modification, are permitted provided that the following conditions
-; are met:
-;
-; * Redistributions of source code must retain the above copyright
-; notice, this list of conditions and the following disclaimer.
-;
-; * Redistributions in binary form must reproduce the above copyright
-; notice, this list of conditions and the following disclaimer in the
-; documentation and/or other materials provided with the distribution.
-;
-; * Neither the name of Linaro Limited nor the names of its
-; contributors may be used to endorse or promote products derived
-; from this software without specific prior written permission.
-;
-; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-; HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-;
-
-;
-; Written by Dave Gilbert
-;
-; This memchr routine is optimised on a Cortex-A9 and should work on
-; all ARMv7 processors. It has a fast past for short sizes, and has
-; an optimised path for large data sets; the worst case is finding the
-; match early in a large data set.
-;
-
-
-; 2011-02-07 david.gilbert@linaro.org
-; Extracted from local git a5b438d861
-; 2011-07-14 david.gilbert@linaro.org
-; Import endianness fix from local git ea786f1b
-; 2011-12-07 david.gilbert@linaro.org
-; Removed unneeded cbz from align loop
-
-; this lets us check a flag in a 00/ff byte easily in either endianness
-#define CHARTSTMASK(c) 1<<(c*8)
-
- EXPORT InternalMemScanMem8
- AREA ScanMem, CODE, READONLY
- THUMB
-
-InternalMemScanMem8
- ; r0 = start of memory to scan
- ; r1 = length
- ; r2 = character to look for
- ; returns r0 = pointer to character or NULL if not found
- uxtb r2, r2 ; Don't think we can trust the caller to actually pass a char
-
- cmp r1, #16 ; If it's short don't bother with anything clever
- blt L20
-
- tst r0, #7 ; If it's already aligned skip the next bit
- beq L10
-
- ; Work up to an aligned point
-L5
- ldrb r3, [r0],#1
- subs r1, r1, #1
- cmp r3, r2
- beq L50 ; If it matches exit found
- tst r0, #7
- bne L5 ; If not aligned yet then do next byte
-
-L10
- ; At this point, we are aligned, we know we have at least 8 bytes to work with
- push {r4-r7}
- orr r2, r2, r2, lsl #8 ; expand the match word across to all bytes
- orr r2, r2, r2, lsl #16
- bic r4, r1, #7 ; Number of double words to work with
- mvns r7, #0 ; all F's
- movs r3, #0
-
-L15
- ldmia r0!, {r5,r6}
- subs r4, r4, #8
- eor r5, r5, r2 ; Get it so that r5,r6 have 00's where the bytes match the target
- eor r6, r6, r2
- uadd8 r5, r5, r7 ; Parallel add 0xff - sets the GE bits for anything that wasn't 0
- sel r5, r3, r7 ; bytes are 00 for none-00 bytes, or ff for 00 bytes - NOTE INVERSION
- uadd8 r6, r6, r7 ; Parallel add 0xff - sets the GE bits for anything that wasn't 0
- sel r6, r5, r7 ; chained....bytes are 00 for none-00 bytes, or ff for 00 bytes - NOTE INVERSION
- cbnz r6, L60
- bne L15 ; (Flags from the subs above) If not run out of bytes then go around again
-
- pop {r4-r7}
- and r2, r2, #0xff ; Get r2 back to a single character from the expansion above
- and r1, r1, #7 ; Leave the count remaining as the number after the double words have been done
-
-L20
- cbz r1, L40 ; 0 length or hit the end already then not found
-
-L21 ; Post aligned section, or just a short call
- ldrb r3, [r0], #1
- subs r1, r1, #1
- eor r3, r3, r2 ; r3 = 0 if match - doesn't break flags from sub
- cbz r3, L50
- bne L21 ; on r1 flags
-
-L40
- movs r0, #0 ; not found
- bx lr
-
-L50
- subs r0, r0, #1 ; found
- bx lr
-
-L60 ; We're here because the fast path found a hit - now we have to track down exactly which word it was
- ; r0 points to the start of the double word after the one that was tested
- ; r5 has the 00/ff pattern for the first word, r6 has the chained value
- cmp r5, #0
- itte eq
- moveq r5, r6 ; the end is in the 2nd word
- subeq r0, r0, #3 ; Points to 2nd byte of 2nd word
- subne r0, r0, #7 ; or 2nd byte of 1st word
-
- ; r0 currently points to the 3rd byte of the word containing the hit
- tst r5, #CHARTSTMASK(0) ; 1st character
- bne L61
- adds r0, r0, #1
- tst r5, #CHARTSTMASK(1) ; 2nd character
- ittt eq
- addeq r0, r0 ,#1
- tsteq r5, #(3 << 15) ; 2nd & 3rd character
- ; If not the 3rd must be the last one
- addeq r0, r0, #1
-
-L61
- pop {r4-r7}
- subs r0, r0, #1
- bx lr
-
- END
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMemGeneric.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMemGeneric.c
deleted file mode 100644
index e48db72..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMemGeneric.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/** @file
- Architecture Independent Base Memory Library Implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "../MemLibInternals.h"
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the
- matching 16-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 16-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- CONST UINT16 *Pointer;
-
- Pointer = (CONST UINT16*)Buffer;
- do {
- if (*Pointer == Value) {
- return Pointer;
- }
- ++Pointer;
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the
- matching 32-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 32-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- CONST UINT32 *Pointer;
-
- Pointer = (CONST UINT32*)Buffer;
- do {
- if (*Pointer == Value) {
- return Pointer;
- }
- ++Pointer;
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the
- matching 64-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 64-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence, or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- CONST UINT64 *Pointer;
-
- Pointer = (CONST UINT64*)Buffer;
- do {
- if (*Pointer == Value) {
- return Pointer;
- }
- ++Pointer;
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Checks whether the contents of a buffer are all zeros.
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-InternalMemIsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- )
-{
- CONST UINT8 *BufferData;
- UINTN Index;
-
- BufferData = Buffer;
- for (Index = 0; Index < Length; Index++) {
- if (BufferData[Index] != 0) {
- return FALSE;
- }
- }
- return TRUE;
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.S
deleted file mode 100644
index 35481b5..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.S
+++ /dev/null
@@ -1,94 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2016, Linaro Ltd. All rights reserved.
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#------------------------------------------------------------------------------
-
- .text
- .thumb
- .syntax unified
- .align 5
- .type ASM_PFX(InternalMemSetMem16), %function
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- uxth r2, r2
- lsl r1, r1, #1
- orr r2, r2, r2, lsl #16
- b 0f
-
- .type ASM_PFX(InternalMemSetMem32), %function
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- lsl r1, r1, #2
- b 0f
-
- .type ASM_PFX(InternalMemSetMem64), %function
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- lsl r1, r1, #3
- b 1f
-
- .align 5
- .type ASM_PFX(InternalMemSetMem), %function
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- uxtb r2, r2
- orr r2, r2, r2, lsl #8
- orr r2, r2, r2, lsl #16
- b 0f
-
- .type ASM_PFX(InternalMemZeroMem), %function
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- movs r2, #0
-0: mov r3, r2
-
-1: push {r4, lr}
- cmp r1, #16 // fewer than 16 bytes of input?
- add r1, r1, r0 // r1 := dst + length
- add lr, r0, #16
- blt 2f
- bic lr, lr, #15 // align output pointer
-
- str r2, [r0] // potentially unaligned store of 4 bytes
- str r3, [r0, #4] // potentially unaligned store of 4 bytes
- str r2, [r0, #8] // potentially unaligned store of 4 bytes
- str r3, [r0, #12] // potentially unaligned store of 4 bytes
- beq 1f
-
-0: add lr, lr, #16 // advance the output pointer by 16 bytes
- subs r4, r1, lr // past the output?
- blt 3f // break out of the loop
- strd r2, r3, [lr, #-16] // aligned store of 16 bytes
- strd r2, r3, [lr, #-8]
- bne 0b // goto beginning of loop
-1: pop {r4, pc}
-
-2: subs r4, r1, lr
-3: adds r4, r4, #16
- subs r1, r1, #8
- cmp r4, #4 // between 4 and 15 bytes?
- blt 4f
- cmp r4, #8 // between 8 and 15 bytes?
- sub r4, lr, #16
- str r2, [r4] // overlapping store of 4 + (4 + 4) + 4 bytes
- it gt
- strgt.n r3, [r4, #4]
- it gt
- strgt.n r2, [r1]
- str r3, [r1, #4]
- pop {r4, pc}
-
-4: cmp r4, #2 // 2 or 3 bytes?
- strb r2, [lr, #-16] // store 1 byte
- it ge
- strhge.n r2, [r1, #6] // store 2 bytes
- pop {r4, pc}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.asm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.asm
deleted file mode 100644
index 000c2a2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Arm/SetMem.asm
+++ /dev/null
@@ -1,96 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2016, Linaro Ltd. All rights reserved.
-;
-; This program and the accompanying materials are licensed and made available
-; under the terms and conditions of the BSD License which accompanies this
-; distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;------------------------------------------------------------------------------
-
- EXPORT InternalMemZeroMem
- EXPORT InternalMemSetMem
- EXPORT InternalMemSetMem16
- EXPORT InternalMemSetMem32
- EXPORT InternalMemSetMem64
-
- AREA SetMem, CODE, READONLY, CODEALIGN, ALIGN=5
- THUMB
-
-InternalMemSetMem16
- uxth r2, r2
- lsl r1, r1, #1
- orr r2, r2, r2, lsl #16
- b B0
-
-InternalMemSetMem32
- lsl r1, r1, #2
- b B0
-
-InternalMemSetMem64
- lsl r1, r1, #3
- b B1
-
- ALIGN 32
-InternalMemSetMem
- uxtb r2, r2
- orr r2, r2, r2, lsl #8
- orr r2, r2, r2, lsl #16
- b B0
-
-InternalMemZeroMem
- movs r2, #0
-B0
- mov r3, r2
-
-B1
- push {r4, lr}
- cmp r1, #16 ; fewer than 16 bytes of input?
- add r1, r1, r0 ; r1 := dst + length
- add lr, r0, #16
- blt L2
- bic lr, lr, #15 ; align output pointer
-
- str r2, [r0] ; potentially unaligned store of 4 bytes
- str r3, [r0, #4] ; potentially unaligned store of 4 bytes
- str r2, [r0, #8] ; potentially unaligned store of 4 bytes
- str r3, [r0, #12] ; potentially unaligned store of 4 bytes
- beq L1
-
-L0
- add lr, lr, #16 ; advance the output pointer by 16 bytes
- subs r4, r1, lr ; past the output?
- blt L3 ; break out of the loop
- strd r2, r3, [lr, #-16] ; aligned store of 16 bytes
- strd r2, r3, [lr, #-8]
- bne L0 ; goto beginning of loop
-L1
- pop {r4, pc}
-
-L2
- subs r4, r1, lr
-L3
- adds r4, r4, #16
- subs r1, r1, #8
- cmp r4, #4 ; between 4 and 15 bytes?
- blt L4
- cmp r4, #8 ; between 8 and 15 bytes?
- str r2, [lr, #-16] ; overlapping store of 4 + (4 + 4) + 4 bytes
- itt gt
- strgt r3, [lr, #-12]
- strgt r2, [r1]
- str r3, [r1, #4]
- pop {r4, pc}
-
-L4
- cmp r4, #2 ; 2 or 3 bytes?
- strb r2, [lr, #-16] ; store 1 byte
- it ge
- strhge r2, [r1, #6] ; store 2 bytes
- pop {r4, pc}
-
- END
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
deleted file mode 100644
index baf313a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
+++ /dev/null
@@ -1,152 +0,0 @@
-## @file
-# Instance of Base Memory Library optimized for use in DXE phase.
-#
-# Base Memory Library that is optimized for use in DXE phase.
-# Uses REP, MMX, XMM registers as required for best performance.
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseMemoryLibOptDxe
- MODULE_UNI_FILE = BaseMemoryLibOptDxe.uni
- FILE_GUID = 02BD55C2-AB1D-4b75-B0FD-9A63AE09B31D
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = BaseMemoryLib
-
-
-#
-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
-#
-
-[Sources]
- MemLibInternals.h
-
-[Sources.Ia32]
- Ia32/ScanMem64.nasm
- Ia32/ScanMem64.S
- Ia32/ScanMem32.nasm
- Ia32/ScanMem32.S
- Ia32/ScanMem16.nasm
- Ia32/ScanMem16.S
- Ia32/ScanMem8.nasm
- Ia32/ScanMem8.S
- Ia32/CompareMem.nasm
- Ia32/CompareMem.S
- Ia32/ZeroMem.nasm
- Ia32/ZeroMem.S
- Ia32/SetMem64.nasm
- Ia32/SetMem64.S
- Ia32/SetMem32.nasm
- Ia32/SetMem32.S
- Ia32/SetMem16.nasm
- Ia32/SetMem16.S
- Ia32/SetMem.nasm
- Ia32/SetMem.S
- Ia32/CopyMem.nasm
- Ia32/CopyMem.S
- Ia32/ScanMem64.nasm
- Ia32/ScanMem32.nasm
- Ia32/ScanMem16.nasm
- Ia32/ScanMem8.nasm
- Ia32/CompareMem.nasm
- Ia32/ZeroMem.nasm
- Ia32/SetMem64.nasm
- Ia32/SetMem32.nasm
- Ia32/SetMem16.nasm
- Ia32/SetMem.nasm
- Ia32/CopyMem.nasm
- Ia32/IsZeroBuffer.nasm
- MemLibGuid.c
-
-[Sources.X64]
- X64/ScanMem64.nasm
- X64/ScanMem64.S
- X64/ScanMem32.nasm
- X64/ScanMem32.S
- X64/ScanMem16.nasm
- X64/ScanMem16.S
- X64/ScanMem8.nasm
- X64/ScanMem8.S
- X64/CompareMem.nasm
- X64/CompareMem.S
- X64/ZeroMem.nasm
- X64/ZeroMem.S
- X64/SetMem64.nasm
- X64/SetMem64.S
- X64/SetMem32.nasm
- X64/SetMem32.S
- X64/SetMem16.nasm
- X64/SetMem16.S
- X64/SetMem.nasm
- X64/SetMem.S
- X64/CopyMem.nasm
- X64/CopyMem.S
- X64/IsZeroBuffer.nasm
- MemLibGuid.c
-
-[Defines.ARM, Defines.AARCH64]
- #
- # The ARM implementations of this library may perform unaligned accesses, and
- # may use DC ZVA instructions that are only allowed when the MMU and D-cache
- # are on. Since SEC, PEI_CORE and PEIM modules may execute with the MMU off,
- # omit them from the supported module types list for this library.
- #
- LIBRARY_CLASS = BaseMemoryLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_DRIVER UEFI_APPLICATION
-
-[Sources.ARM]
- Arm/ScanMem.S |GCC
- Arm/SetMem.S |GCC
- Arm/CopyMem.S |GCC
- Arm/CompareMem.S |GCC
- Arm/CompareGuid.S |GCC
-
- Arm/ScanMem.asm |RVCT
- Arm/SetMem.asm |RVCT
- Arm/CopyMem.asm |RVCT
- Arm/CompareMem.asm |RVCT
- Arm/CompareGuid.asm |RVCT
-
-[Sources.AARCH64]
- AArch64/ScanMem.S
- AArch64/SetMem.S
- AArch64/CopyMem.S
- AArch64/CompareMem.S
- AArch64/CompareGuid.S
-
-[Sources.ARM, Sources.AARCH64]
- Arm/ScanMemGeneric.c
- Arm/MemLibGuid.c
-
-[Sources]
- ScanMem64Wrapper.c
- ScanMem32Wrapper.c
- ScanMem16Wrapper.c
- ScanMem8Wrapper.c
- ZeroMemWrapper.c
- CompareMemWrapper.c
- SetMem64Wrapper.c
- SetMem32Wrapper.c
- SetMem16Wrapper.c
- SetMemWrapper.c
- CopyMemWrapper.c
- IsZeroBufferWrapper.c
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- DebugLib
- BaseLib
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.uni
deleted file mode 100644
index bb0cd56..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.uni
+++ /dev/null
@@ -1,22 +0,0 @@
-// /** @file
-// Instance of Base Memory Library optimized for use in DXE phase.
-//
-// Base Memory Library that is optimized for use in DXE phase.
-// Uses REP, MMX, XMM registers as required for best performance.
-//
-// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Base Memory Library for DXE"
-
-#string STR_MODULE_DESCRIPTION #language en-US "Base Memory Library that is optimized for use in DXE phase. Uses REP, MMX, XMM registers as required for best performance."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/CompareMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/CompareMemWrapper.c
deleted file mode 100644
index 161171b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/CompareMemWrapper.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file
- CompareMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Compares the contents of two buffers.
-
- This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer.
- If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the
- value returned is the first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
- If Length > 0 and DestinationBuffer is NULL, then ASSERT().
- If Length > 0 and SourceBuffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer The pointer to the destination buffer to compare.
- @param SourceBuffer The pointer to the source buffer to compare.
- @param Length The number of bytes to compare.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- if (Length == 0 || DestinationBuffer == SourceBuffer) {
- return 0;
- }
- ASSERT (DestinationBuffer != NULL);
- ASSERT (SourceBuffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
-
- return InternalMemCompareMem (DestinationBuffer, SourceBuffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/CopyMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/CopyMemWrapper.c
deleted file mode 100644
index 1a01fbe..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/CopyMemWrapper.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file
- CopyMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Copies a source buffer to a destination buffer, and returns the destination buffer.
-
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
- DestinationBuffer. The implementation must be reentrant, and it must handle the case
- where SourceBuffer overlaps DestinationBuffer.
-
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer The pointer to the destination buffer of the memory copy.
- @param SourceBuffer The pointer to the source buffer of the memory copy.
- @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.
-
- @return DestinationBuffer.
-
-**/
-VOID *
-EFIAPI
-CopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return DestinationBuffer;
- }
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
-
- if (DestinationBuffer == SourceBuffer) {
- return DestinationBuffer;
- }
- return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.S
deleted file mode 100644
index a430453..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.S
+++ /dev/null
@@ -1,55 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CompareMem.S
-#
-# Abstract:
-#
-# CompareMem function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)
-
-#------------------------------------------------------------------------------
-# INTN
-# EFIAPI
-# InternalMemCompareMem (
-# IN CONST VOID *DestinationBuffer,
-# IN CONST VOID *SourceBuffer,
-# IN UINTN Length
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemCompareMem):
- push %esi
- push %edi
- movl 12(%esp), %esi
- movl 16(%esp), %edi
- movl 20(%esp), %ecx
- repe cmpsb
- movzbl -1(%esi), %eax
- movzbl -1(%edi), %edx
- subl %edx, %eax
- pop %edi
- pop %esi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.nasm
deleted file mode 100644
index e8d1abd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.nasm
+++ /dev/null
@@ -1,57 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CompareMem.Asm
-;
-; Abstract:
-;
-; CompareMem function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; INTN
-; EFIAPI
-; InternalMemCompareMem (
-; IN CONST VOID *DestinationBuffer,
-; IN CONST VOID *SourceBuffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- push esi
- push edi
- mov esi, [esp + 12]
- mov edi, [esp + 16]
- mov ecx, [esp + 20]
- repe cmpsb
- movzx eax, byte [esi - 1]
- movzx edx, byte [edi - 1]
- sub eax, edx
- pop edi
- pop esi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CopyMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CopyMem.S
deleted file mode 100644
index dbd052b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CopyMem.S
+++ /dev/null
@@ -1,85 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CopyMem.S
-#
-# Abstract:
-#
-# CopyMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemCopyMem (
-# IN VOID *Destination,
-# IN VOID *Source,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemCopyMem):
- push %esi
- push %edi
- movl 16(%esp), %esi # esi <- Source
- movl 12(%esp), %edi # edi <- Destination
- movl 20(%esp), %edx # edx <- Count
- leal -1(%esi,%edx,), %eax # eax <- End of Source
- cmpl %edi, %esi
- jae L0
- cmpl %edi, %eax # Overlapped?
- jae L_CopyBackward # Copy backward if overlapped
-L0:
- xorl %ecx, %ecx
- subl %edi, %ecx
- andl $15, %ecx # ecx + edi aligns on 16-byte boundary
- jz L1
- cmpl %edx, %ecx
- cmova %edx, %ecx
- subl %ecx, %edx # edx <- remaining bytes to copy
- rep
- movsb
-L1:
- movl %edx, %ecx
- andl $15, %edx
- shrl $4, %ecx # ecx <- # of DQwords to copy
- jz L_CopyBytes
- addl $-16, %esp
- movdqu %xmm0, (%esp)
-L2:
- movdqu (%esi), %xmm0
- movntdq %xmm0, (%edi)
- addl $16, %esi
- addl $16, %edi
- loop L2
- mfence
- movdqu (%esp),%xmm0
- addl $16, %esp # stack cleanup
- jmp L_CopyBytes
-L_CopyBackward:
- movl %eax, %esi # esi <- Last byte in Source
- leal -1(%edi,%edx,), %edi # edi <- Last byte in Destination
- std
-L_CopyBytes:
- movl %edx, %ecx
- rep
- movsb
- cld
- movl 12(%esp), %eax # eax <- Destination as return value
- pop %edi
- pop %esi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CopyMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CopyMem.nasm
deleted file mode 100644
index 6913874..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CopyMem.nasm
+++ /dev/null
@@ -1,84 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CopyMem.nasm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemCopyMem (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- push esi
- push edi
- mov esi, [esp + 16] ; esi <- Source
- mov edi, [esp + 12] ; edi <- Destination
- mov edx, [esp + 20] ; edx <- Count
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- jae .0
- cmp eax, edi ; Overlapped?
- jae @CopyBackward ; Copy backward if overlapped
-.0:
- xor ecx, ecx
- sub ecx, edi
- and ecx, 15 ; ecx + edi aligns on 16-byte boundary
- jz .1
- cmp ecx, edx
- cmova ecx, edx
- sub edx, ecx ; edx <- remaining bytes to copy
- rep movsb
-.1:
- mov ecx, edx
- and edx, 15
- shr ecx, 4 ; ecx <- # of DQwords to copy
- jz @CopyBytes
- add esp, -16
- movdqu [esp], xmm0 ; save xmm0
-.2:
- movdqu xmm0, [esi] ; esi may not be 16-bytes aligned
- movntdq [edi], xmm0 ; edi should be 16-bytes aligned
- add esi, 16
- add edi, 16
- loop .2
- mfence
- movdqu xmm0, [esp] ; restore xmm0
- add esp, 16 ; stack cleanup
- jmp @CopyBytes
-@CopyBackward:
- mov esi, eax ; esi <- Last byte in Source
- lea edi, [edi + edx - 1] ; edi <- Last byte in Destination
- std
-@CopyBytes:
- mov ecx, edx
- rep movsb
- cld
- mov eax, [esp + 12] ; eax <- Destination as return value
- pop edi
- pop esi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/IsZeroBuffer.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/IsZeroBuffer.nasm
deleted file mode 100644
index cfd41a6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/IsZeroBuffer.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; IsZeroBuffer.nasm
-;
-; Abstract:
-;
-; IsZeroBuffer function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; BOOLEAN
-; EFIAPI
-; InternalMemIsZeroBuffer (
-; IN CONST VOID *Buffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemIsZeroBuffer)
-ASM_PFX(InternalMemIsZeroBuffer):
- push edi
- mov edi, [esp + 8] ; edi <- Buffer
- mov ecx, [esp + 12] ; ecx <- Length
- mov edx, ecx ; edx <- ecx
- shr ecx, 2 ; ecx <- number of dwords
- and edx, 3 ; edx <- number of trailing bytes
- xor eax, eax ; eax <- 0, also set ZF
- repe scasd
- jnz @ReturnFalse ; ZF=0 means non-zero element found
- mov ecx, edx
- repe scasb
- jnz @ReturnFalse
- pop edi
- mov eax, 1 ; return TRUE
- ret
-@ReturnFalse:
- pop edi
- xor eax, eax
- ret ; return FALSE
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.S
deleted file mode 100644
index c485543..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem16.Asm
-#
-# Abstract:
-#
-# ScanMem16 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem16)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem16 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT16 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem16):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movl 16(%esp), %eax
- repne scasw
- leal -2(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.nasm
deleted file mode 100644
index 78d9f30..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem16.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem16.Asm
-;
-; Abstract:
-;
-; ScanMem16 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem16 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT16 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem16)
-ASM_PFX(InternalMemScanMem16):
- push edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov eax, [esp + 16]
- repne scasw
- lea eax, [edi - 2]
- cmovnz eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.S
deleted file mode 100644
index 016ebd2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem32.S
-#
-# Abstract:
-#
-# ScanMem32 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem32)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem32 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT32 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem32):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movl 16(%esp), %eax
- repne scasl
- leal -4(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.nasm
deleted file mode 100644
index bbacf38..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem32.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem32.Asm
-;
-; Abstract:
-;
-; ScanMem32 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem32 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT32 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem32)
-ASM_PFX(InternalMemScanMem32):
- push edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov eax, [esp + 16]
- repne scasd
- lea eax, [edi - 4]
- cmovnz eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.S
deleted file mode 100644
index 6e42856..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.S
+++ /dev/null
@@ -1,61 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem64.S
-#
-# Abstract:
-#
-# ScanMem64 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem64)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem64 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem64):
- push %edi
- movl 12(%esp), %ecx
- movl 16(%esp), %eax
- movl 20(%esp), %edx
- movl 8(%esp), %edi
-L0:
- cmpl (%edi), %eax
- leal 8(%edi), %edi
- loopne L0
- jne L1
- cmpl -4(%edi), %edx
- jecxz L1
- jne L0
-L1:
- leal -8(%edi), %eax
- cmovne %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.nasm
deleted file mode 100644
index e994d4a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem64.nasm
+++ /dev/null
@@ -1,63 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem64.Asm
-;
-; Abstract:
-;
-; ScanMem64 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem64 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem64)
-ASM_PFX(InternalMemScanMem64):
- push edi
- mov ecx, [esp + 12]
- mov eax, [esp + 16]
- mov edx, [esp + 20]
- mov edi, [esp + 8]
-.0:
- cmp eax, [edi]
- lea edi, [edi + 8]
- loopne .0
- jne .1
- cmp edx, [edi - 4]
- jecxz .1
- jne .0
-.1:
- lea eax, [edi - 8]
- cmovne eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.S
deleted file mode 100644
index 02bb27f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem8.S
-#
-# Abstract:
-#
-# ScanMem8 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem8 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT8 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem8):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movb 16(%esp), %al
- repne scasb
- leal -1(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.nasm
deleted file mode 100644
index d13c9c7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ScanMem8.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem8.Asm
-;
-; Abstract:
-;
-; ScanMem8 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem8 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- push edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov al, [esp + 16]
- repne scasb
- lea eax, [edi - 1]
- cmovnz eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.S
deleted file mode 100644
index ee0b659..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.S
+++ /dev/null
@@ -1,50 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem.S
-#
-# Abstract:
-#
-# SetMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT8 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem):
- push %edi
- movl 12(%esp),%ecx
- movb 16(%esp),%al
- movb %al, %ah
- shrd $16, %eax, %edx
- shld $16, %edx, %eax
- movl %ecx, %edx
- movl 8(%esp),%edi
- shr $2, %ecx
- rep stosl
- movl %edx, %ecx
- andl $3, %ecx
- rep stosb
- movl 8(%esp),%eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.nasm
deleted file mode 100644
index 3a75363..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem.nasm
+++ /dev/null
@@ -1,52 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem.Asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT8 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- push edi
- mov ecx, [esp + 12]
- mov al, [esp + 16]
- mov ah, al
- shrd edx, eax, 16
- shld eax, edx, 16
- mov edx, ecx
- mov edi, [esp + 8]
- shr ecx, 2
- rep stosd
- mov ecx, edx
- and ecx, 3
- rep stosb
- mov eax, [esp + 8]
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem16.S
deleted file mode 100644
index 8989bdd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem16.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem16.S
-#
-# Abstract:
-#
-# SetMem16 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem16 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT16 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem16):
- push %edi
- movl 16(%esp), %eax
- movl 8(%esp), %edi
- movl 12(%esp), %ecx
- rep
- stosw
- movl 8(%esp), %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem16.nasm
deleted file mode 100644
index cfa4906..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem16.nasm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem16.Asm
-;
-; Abstract:
-;
-; SetMem16 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem16 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT16 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- push edi
- mov eax, [esp + 16]
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- rep stosw
- mov eax, [esp + 8]
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem32.S
deleted file mode 100644
index b2c9a85..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem32.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem32.S
-#
-# Abstract:
-#
-# SetMem32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem32 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT32 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem32):
- push %edi
- movl 16(%esp),%eax
- movl 8(%esp),%edi
- movl 12(%esp),%ecx
- rep
- stosl
- movl 8(%esp),%eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem32.nasm
deleted file mode 100644
index 78e09b3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem32.nasm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem32.Asm
-;
-; Abstract:
-;
-; SetMem32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem32 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT32 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- push edi
- mov eax, [esp + 16]
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- rep stosd
- mov eax, [esp + 8]
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem64.S
deleted file mode 100644
index f25dfe1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem64.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem64.S
-#
-# Abstract:
-#
-# SetMem64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem64 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT64 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem64):
- push %edi
- movl 12(%esp), %ecx
- movl 16(%esp), %eax
- movl 20(%esp), %edx
- movl 8(%esp), %edi
-L0:
- mov %eax, -8(%edi, %ecx, 8)
- mov %edx, -4(%edi, %ecx, 8)
- loop L0
- movl %edi, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem64.nasm
deleted file mode 100644
index d0afacb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/SetMem64.nasm
+++ /dev/null
@@ -1,48 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem64.Asm
-;
-; Abstract:
-;
-; SetMem64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem64 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT64 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- push edi
- mov ecx, [esp + 12]
- mov eax, [esp + 16]
- mov edx, [esp + 20]
- mov edi, [esp + 8]
-.0:
- mov [edi + ecx*8 - 8], eax
- mov [edi + ecx*8 - 4], edx
- loop .0
- mov eax, edi
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ZeroMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ZeroMem.S
deleted file mode 100644
index 70cede6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ZeroMem.S
+++ /dev/null
@@ -1,49 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ZeroMem.S
-#
-# Abstract:
-#
-# ZeroMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemZeroMem (
-# IN VOID *Buffer,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemZeroMem):
- push %edi
- xorl %eax,%eax
- movl 8(%esp),%edi
- movl 12(%esp),%ecx
- movl %ecx,%edx
- shrl $2,%ecx
- andl $3,%edx
- pushl %edi
- rep
- stosl
- movl %edx,%ecx
- rep
- stosb
- popl %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ZeroMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ZeroMem.nasm
deleted file mode 100644
index 31efb6a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/Ia32/ZeroMem.nasm
+++ /dev/null
@@ -1,49 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ZeroMem.Asm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- push edi
- xor eax, eax
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- mov edx, ecx
- shr ecx, 2
- and edx, 3
- push edi
- rep stosd
- mov ecx, edx
- rep stosb
- pop eax
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/IsZeroBufferWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/IsZeroBufferWrapper.c
deleted file mode 100644
index 078c924..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/IsZeroBufferWrapper.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
- Implementation of IsZeroBuffer function.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Checks if the contents of a buffer are all zeros.
-
- This function checks whether the contents of a buffer are all zeros. If the
- contents are all zeros, return TRUE. Otherwise, return FALSE.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- )
-{
- ASSERT (!(Buffer == NULL && Length > 0));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return InternalMemIsZeroBuffer (Buffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
deleted file mode 100644
index 28b08c9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/MemLibGuid.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/** @file
- Implementation of GUID functions.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid to
- DestinationGuid, and returns DestinationGuid.
-
- If DestinationGuid is NULL, then ASSERT().
- If SourceGuid is NULL, then ASSERT().
-
- @param DestinationGuid The pointer to the destination GUID.
- @param SourceGuid The pointer to the source GUID.
-
- @return DestinationGuid.
-
-**/
-GUID *
-EFIAPI
-CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
- )
-{
- WriteUnaligned64 (
- (UINT64*)DestinationGuid,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid)
- );
- WriteUnaligned64 (
- (UINT64*)DestinationGuid + 1,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid + 1)
- );
- return DestinationGuid;
-}
-
-/**
- Compares two GUIDs.
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
- If there are any bit differences in the two GUIDs, then FALSE is returned.
-
- If Guid1 is NULL, then ASSERT().
- If Guid2 is NULL, then ASSERT().
-
- @param Guid1 A pointer to a 128 bit GUID.
- @param Guid2 A pointer to a 128 bit GUID.
-
- @retval TRUE Guid1 and Guid2 are identical.
- @retval FALSE Guid1 and Guid2 are not identical.
-
-**/
-BOOLEAN
-EFIAPI
-CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
- )
-{
- UINT64 LowPartOfGuid1;
- UINT64 LowPartOfGuid2;
- UINT64 HighPartOfGuid1;
- UINT64 HighPartOfGuid2;
-
- LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
- LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
- HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
- HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);
-
- return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);
-}
-
-/**
- Scans a target buffer for a GUID, and returns a pointer to the matching GUID
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the 128-bit
- GUID value that matches Guid. If a match is found, then a pointer to the matching
- GUID in the target buffer is returned. If no match is found, then NULL is returned.
- If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 128-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Guid The value to search for in the target buffer.
-
- @return A pointer to the matching Guid in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
- )
-{
- CONST GUID *GuidPtr;
-
- ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
- ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
- ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
-
- GuidPtr = (GUID*)Buffer;
- Buffer = GuidPtr + Length / sizeof (*GuidPtr);
- while (GuidPtr < (CONST GUID*)Buffer) {
- if (CompareGuid (GuidPtr, Guid)) {
- return (VOID*)GuidPtr;
- }
- GuidPtr++;
- }
- return NULL;
-}
-
-/**
- Checks if the given GUID is a zero GUID.
-
- This function checks whether the given GUID is a zero GUID. If the GUID is
- identical to a zero GUID then TRUE is returned. Otherwise, FALSE is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid The pointer to a 128 bit GUID.
-
- @retval TRUE Guid is a zero GUID.
- @retval FALSE Guid is not a zero GUID.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroGuid (
- IN CONST GUID *Guid
- )
-{
- UINT64 LowPartOfGuid;
- UINT64 HighPartOfGuid;
-
- LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
- HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
-
- return (BOOLEAN) (LowPartOfGuid == 0 && HighPartOfGuid == 0);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/MemLibInternals.h b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/MemLibInternals.h
deleted file mode 100644
index be7952e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/MemLibInternals.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/** @file
- Declaration of internal functions for Base Memory Library.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
-
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __MEM_LIB_INTERNALS__
-#define __MEM_LIB_INTERNALS__
-
-#include
-#include
-#include
-#include
-
-/**
- Copy Length bytes from Source to Destination.
-
- @param DestinationBuffer The target of the copy request.
- @param SourceBuffer The place to copy from.
- @param Length The number of bytes to copy.
-
- @return Destination.
-
-**/
-VOID *
-EFIAPI
-InternalMemCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Set Buffer to Value for Size bytes.
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set.
- @param Value The value of the set operation.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 16-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 32-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 64-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Set Buffer to 0 for Size bytes.
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-InternalMemZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- );
-
-/**
- Compares two memory buffers of a given length.
-
- @param DestinationBuffer The first memory buffer.
- @param SourceBuffer The second memory buffer.
- @param Length The length of DestinationBuffer and SourceBuffer memory
- regions to compare. Must be non-zero.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-InternalMemCompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the
- matching 8-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 8-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the
- matching 16-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 16-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the
- matching 32-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 32-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the
- matching 64-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 64-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Checks whether the contents of a buffer are all zeros.
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-InternalMemIsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- );
-
-#endif
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem16Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem16Wrapper.c
deleted file mode 100644
index 7b37607..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem16Wrapper.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/** @file
- ScanMem16() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a 16-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem32Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem32Wrapper.c
deleted file mode 100644
index 654306a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem32Wrapper.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file
- ScanMem32() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a 32-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem64Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem64Wrapper.c
deleted file mode 100644
index 9606caa..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem64Wrapper.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/** @file
- ScanMem64() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a 64-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem8Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem8Wrapper.c
deleted file mode 100644
index 613e667..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ScanMem8Wrapper.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/** @file
- ScanMem8() and ScanMemN() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for an 8-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
-
- return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
-}
-
-/**
- Scans a target buffer for a UINTN sized value, and returns a pointer to the matching
- UINTN sized value in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from the lowest
- address to the highest address for a UINTN sized value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a UINTN boundary, then ASSERT().
- If Length is not aligned on a UINTN boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Value
-The value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMemN (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINTN Value
- )
-{
- if (sizeof (UINTN) == sizeof (UINT64)) {
- return ScanMem64 (Buffer, Length, (UINT64)Value);
- } else {
- return ScanMem32 (Buffer, Length, (UINT32)Value);
- }
-}
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMem16Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMem16Wrapper.c
deleted file mode 100644
index 8e6daa3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMem16Wrapper.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
- SetMem16() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 16-bit value specified by
- Value, and returns Buffer. Value is repeated every 16-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem16 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMem32Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMem32Wrapper.c
deleted file mode 100644
index 7758e1f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMem32Wrapper.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
- SetMem32() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 32-bit value specified by
- Value, and returns Buffer. Value is repeated every 32-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem32 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMem64Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMem64Wrapper.c
deleted file mode 100644
index 5273a86..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMem64Wrapper.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
- SetMem64() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 64-bit value specified by
- Value, and returns Buffer. Value is repeated every 64-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem64 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMemWrapper.c
deleted file mode 100644
index f9ed175..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/SetMemWrapper.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/** @file
- SetMem() and SetMemN() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with a byte value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with Value, and returns Buffer.
-
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
-
- return InternalMemSetMem (Buffer, Length, Value);
-}
-
-/**
- Fills a target buffer with a value that is size UINTN, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the UINTN sized value specified by
- Value, and returns Buffer. Value is repeated every sizeof(UINTN) bytes for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a UINTN boundary, then ASSERT().
- If Length is not aligned on a UINTN boundary, then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The number of bytes in Buffer to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMemN (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINTN Value
- )
-{
- if (sizeof (UINTN) == sizeof (UINT64)) {
- return SetMem64 (Buffer, Length, (UINT64)Value);
- } else {
- return SetMem32 (Buffer, Length, (UINT32)Value);
- }
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.S
deleted file mode 100644
index eef1ccb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.S
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from CompareMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CompareMem.S
-#
-# Abstract:
-#
-# CompareMem function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# INTN
-# EFIAPI
-# InternalMemCompareMem (
-# IN CONST VOID *DestinationBuffer,
-# IN CONST VOID *SourceBuffer,
-# IN UINTN Length
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- pushq %rsi
- pushq %rdi
- movq %rcx, %rsi
- movq %rdx, %rdi
- movq %r8, %rcx
- repe cmpsb
- movzbq -1(%rsi) , %rax
- movzbq -1(%rdi) , %rdx
- sub %dl, %al
- popq %rdi
- popq %rsi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.nasm
deleted file mode 100644
index cb0d886..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.nasm
+++ /dev/null
@@ -1,58 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CompareMem.Asm
-;
-; Abstract:
-;
-; CompareMem function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; INTN
-; EFIAPI
-; InternalMemCompareMem (
-; IN CONST VOID *DestinationBuffer,
-; IN CONST VOID *SourceBuffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- push rsi
- push rdi
- mov rsi, rcx
- mov rdi, rdx
- mov rcx, r8
- repe cmpsb
- movzx rax, byte [rsi - 1]
- movzx rdx, byte [rdi - 1]
- sub rax, rdx
- pop rdi
- pop rsi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.S
deleted file mode 100644
index 4d96623..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.S
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from CopyMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CopyMem.S
-#
-# Abstract:
-#
-# CopyMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemCopyMem (
-# IN VOID *Destination,
-# IN VOID *Source,
-# IN UINTN Count
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- pushq %rsi
- pushq %rdi
- movq %rdx, %rsi # rsi <- Source
- movq %rcx, %rdi # rdi <- Destination
- leaq -1(%rsi,%r8,), %r9 # r9 <- Last byte of Source
- cmpq %rdi, %rsi
- movq %rdi, %rax # rax <- Destination as return value
- jae L0 # Copy forward if Source > Destination
- cmpq %rdi, %r9 # Overlapped?
- jae L_CopyBackward # Copy backward if overlapped
-L0:
- xorq %rcx, %rcx
- subq %rdi, %rcx # rcx <- -rdi
- andq $15, %rcx # rcx + rsi should be 16 bytes aligned
- jz L1 # skip if rcx == 0
- cmpq %r8, %rcx
- cmova %r8, %rcx
- subq %rcx, %r8
- rep movsb
-L1:
- movq %r8, %rcx
- andq $15, %r8
- shrq $4, %rcx # rcx <- # of DQwords to copy
- jz L_CopyBytes
- movdqu %xmm0, 0x18(%rsp) # save xmm0 on stack
-L2:
- movdqu (%rsi), %xmm0 # rsi may not be 16-byte aligned
- movntdq %xmm0, (%rdi) # rdi should be 16-byte aligned
- addq $16, %rsi
- addq $16, %rdi
- loop L2
- mfence
- movdqa 0x18(%rsp), %xmm0 # restore xmm0
- jmp L_CopyBytes # copy remaining bytes
-L_CopyBackward:
- movq %r9, %rsi # rsi <- Last byte of Source
- leaq -1(%rdi, %r8,), %rdi # rdi <- Last byte of Destination
- std
-L_CopyBytes:
- movq %r8, %rcx
- rep movsb
- cld
- popq %rdi
- popq %rsi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.nasm
deleted file mode 100644
index 9fe45d4..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.nasm
+++ /dev/null
@@ -1,83 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CopyMem.nasm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemCopyMem (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- push rsi
- push rdi
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- Last byte of Source
- cmp rsi, rdi
- mov rax, rdi ; rax <- Destination as return value
- jae .0 ; Copy forward if Source > Destination
- cmp r9, rdi ; Overlapped?
- jae @CopyBackward ; Copy backward if overlapped
-.0:
- xor rcx, rcx
- sub rcx, rdi ; rcx <- -rdi
- and rcx, 15 ; rcx + rsi should be 16 bytes aligned
- jz .1 ; skip if rcx == 0
- cmp rcx, r8
- cmova rcx, r8
- sub r8, rcx
- rep movsb
-.1:
- mov rcx, r8
- and r8, 15
- shr rcx, 4 ; rcx <- # of DQwords to copy
- jz @CopyBytes
- movdqa [rsp + 0x18], xmm0 ; save xmm0 on stack
-.2:
- movdqu xmm0, [rsi] ; rsi may not be 16-byte aligned
- movntdq [rdi], xmm0 ; rdi should be 16-byte aligned
- add rsi, 16
- add rdi, 16
- loop .2
- mfence
- movdqa xmm0, [rsp + 0x18] ; restore xmm0
- jmp @CopyBytes ; copy remaining bytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- Last byte of Source
- lea rdi, [rdi + r8 - 1] ; rdi <- Last byte of Destination
- std
-@CopyBytes:
- mov rcx, r8
- rep movsb
- cld
- pop rdi
- pop rsi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/IsZeroBuffer.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/IsZeroBuffer.nasm
deleted file mode 100644
index 3b855a7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/IsZeroBuffer.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; IsZeroBuffer.nasm
-;
-; Abstract:
-;
-; IsZeroBuffer function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; BOOLEAN
-; EFIAPI
-; InternalMemIsZeroBuffer (
-; IN CONST VOID *Buffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemIsZeroBuffer)
-ASM_PFX(InternalMemIsZeroBuffer):
- push rdi
- mov rdi, rcx ; rdi <- Buffer
- mov rcx, rdx ; rcx <- Length
- shr rcx, 3 ; rcx <- number of qwords
- and rdx, 7 ; rdx <- number of trailing bytes
- xor rax, rax ; rax <- 0, also set ZF
- repe scasq
- jnz @ReturnFalse ; ZF=0 means non-zero element found
- mov rcx, rdx
- repe scasb
- jnz @ReturnFalse
- pop rdi
- mov rax, 1 ; return TRUE
- ret
-@ReturnFalse:
- pop rdi
- xor rax, rax
- ret ; return FALSE
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.S
deleted file mode 100644
index ea82f55..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.S
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem16.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem16.S
-#
-# Abstract:
-#
-# ScanMem16 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem16 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT16 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemScanMem16)
-ASM_PFX(InternalMemScanMem16):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- movq %rdx, %rcx
- repne scasw
- leaq -2(%rdi), %rax
- cmovnz %rcx, %rax
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.nasm
deleted file mode 100644
index 9f0de63..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem16.Asm
-;
-; Abstract:
-;
-; ScanMem16 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem16 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT16 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem16)
-ASM_PFX(InternalMemScanMem16):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasw
- lea rax, [rdi - 2]
- cmovnz rax, rcx
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.S
deleted file mode 100644
index 7ff1c08..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.S
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem32.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem32.S
-#
-# Abstract:
-#
-# ScanMem32 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem32 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT32 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemScanMem32)
-ASM_PFX(InternalMemScanMem32):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- movq %rdx, %rcx
- repne scasl
- leaq -4(%rdi), %rax
- cmovnz %rcx, %rax
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.nasm
deleted file mode 100644
index 5c9ae5d..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem32.Asm
-;
-; Abstract:
-;
-; ScanMem32 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem32 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT32 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem32)
-ASM_PFX(InternalMemScanMem32):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasd
- lea rax, [rdi - 4]
- cmovnz rax, rcx
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.S
deleted file mode 100644
index 1948c16..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.S
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem64.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem64.S
-#
-# Abstract:
-#
-# ScanMem64 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem64 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemScanMem64)
-ASM_PFX(InternalMemScanMem64):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- movq %rdx, %rcx
- repne scasq
- leaq -8(%rdi), %rax
- cmovnz %rcx, %rax
- popq %rdi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.nasm
deleted file mode 100644
index b98c6de..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem64.Asm
-;
-; Abstract:
-;
-; ScanMem64 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem64 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem64)
-ASM_PFX(InternalMemScanMem64):
- push rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasq
- lea rax, [rdi - 8]
- cmovnz rax, rcx
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.S
deleted file mode 100644
index 688884f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.S
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem8.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem8.S
-#
-# Abstract:
-#
-# ScanMem8 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem8 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT8 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- pushq %rdi
- movq %rcx, %rdi
- movq %rdx, %rcx
- movq %r8, %rax
- repne scasb
- leaq -1(%rdi), %rax
- cmovnz %rcx, %rax # set rax to 0 if not found
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.nasm
deleted file mode 100644
index 8499795..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem8.Asm
-;
-; Abstract:
-;
-; ScanMem8 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem8 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- push rdi
- mov rdi, rcx
- mov rcx, rdx
- mov rax, r8
- repne scasb
- lea rax, [rdi - 1]
- cmovnz rax, rcx ; set rax to 0 if not found
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.S
deleted file mode 100644
index 7219c5c..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.S
+++ /dev/null
@@ -1,57 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem.S
-#
-# Abstract:
-#
-# SetMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemSetMem (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT8 Value
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- pushq %rdi
- pushq %rbx
- pushq %rcx # push Buffer
- movq %r8, %rax # rax = Value
- andq $0xff, %rax # rax = lower 8 bits of r8, upper 56 bits are 0
- movb %al, %ah # ah = al
- movw %ax, %bx # bx = ax
- shlq $0x10, %rax # rax = ax << 16
- movw %bx, %ax # ax = bx
- movq %rax, %rbx # ebx = eax
- shlq $0x20, %rax # rax = rax << 32
- orq %rbx, %rax # eax = ebx
- movq %rcx, %rdi # rdi = Buffer
- movq %rdx, %rcx # rcx = Count
- shrq $3, %rcx # rcx = rcx / 8
- cld
- rep stosq
- movq %rdx, %rcx # rcx = rdx
- andq $7, %rcx # rcx = rcx & 7
- rep stosb
- popq %rax # rax = Buffer
- popq %rbx
- popq %rdi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.nasm
deleted file mode 100644
index 48d69ab..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.nasm
+++ /dev/null
@@ -1,62 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem.Asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT8 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- push rdi
- push rbx
- push rcx ; push Buffer
- mov rax, r8 ; rax = Value
- and rax, 0xff ; rax = lower 8 bits of r8, upper 56 bits are 0
- mov ah, al ; ah = al
- mov bx, ax ; bx = ax
- shl rax, 0x10 ; rax = ax << 16
- mov ax, bx ; ax = bx
- mov rbx, rax ; ebx = eax
- shl rax, 0x20 ; rax = rax << 32
- or rax, rbx ; eax = ebx
- mov rdi, rcx ; rdi = Buffer
- mov rcx, rdx ; rcx = Count
- shr rcx, 3 ; rcx = rcx / 8
- cld
- rep stosq
- mov rcx, rdx ; rcx = rdx
- and rcx, 7 ; rcx = rcx & 7
- rep stosb
- pop rax ; rax = Buffer
- pop rbx
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.S
deleted file mode 100644
index d6f570f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.S
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem16.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem16.S
-#
-# Abstract:
-#
-# SetMem16 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemSetMem16 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT16 Value
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- xchg %rdx, %rcx
- rep stosw
- movq %rdx, %rax
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.nasm
deleted file mode 100644
index d9a3d35..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.nasm
+++ /dev/null
@@ -1,47 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem16.Asm
-;
-; Abstract:
-;
-; SetMem16 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem16 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT16 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- push rdi
- push rcx
- mov rdi, rcx
- mov rax, r8
- xchg rcx, rdx
- rep stosw
- pop rax
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.S
deleted file mode 100644
index 7dba067..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.S
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem32.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem32.S
-#
-# Abstract:
-#
-# SetMem32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemSetMem32 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT32 Value
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- xchgq %rdx, %rcx
- rep stosl
- movq %rdx, %rax
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.nasm
deleted file mode 100644
index 6f97704..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.nasm
+++ /dev/null
@@ -1,47 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem32.Asm
-;
-; Abstract:
-;
-; SetMem32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem32 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT32 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- push rdi
- push rcx
- mov rdi, rcx
- mov rax, r8
- xchg rcx, rdx
- rep stosd
- pop rax
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.S
deleted file mode 100644
index a94f038..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem64.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem64.S
-#
-# Abstract:
-#
-# SetMem64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem64 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT64 Value
-# )
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- xchg %rdx, %rcx
- rep stosq
- movq %rdx, %rax
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.nasm
deleted file mode 100644
index 9b0b8ac..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.nasm
+++ /dev/null
@@ -1,46 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem64.Asm
-;
-; Abstract:
-;
-; SetMem64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem64 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT64 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- push rdi
- push rcx
- mov rdi, rcx
- mov rax, r8
- xchg rcx, rdx
- rep stosq
- pop rax
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.S
deleted file mode 100644
index 38b8678..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.S
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ZeroMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ZeroMem.S
-#
-# Abstract:
-#
-# ZeroMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemZeroMem (
-# IN VOID *Buffer,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- pushq %rdi
- pushq %rcx
- xorq %rax, %rax
- movq %rcx, %rdi
- movq %rdx, %rcx
- shrq $3, %rcx
- andq $7, %rdx
- cld
- rep stosq
- movq %rdx, %rcx
- rep stosb
- popq %rax
- popq %rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.nasm
deleted file mode 100644
index 12c1da9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.nasm
+++ /dev/null
@@ -1,50 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ZeroMem.Asm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- DEFAULT REL
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- push rdi
- push rcx ; push Buffer
- xor rax, rax ; rax = 0
- mov rdi, rcx ; rdi = Buffer
- mov rcx, rdx ; rcx = Count
- shr rcx, 3 ; rcx = rcx / 8
- and rdx, 7 ; rdx = rdx & 7
- cld
- rep stosq
- mov rcx, rdx ; rcx = rdx
- rep stosb
- pop rax ; rax = Buffer
- pop rdi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ZeroMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ZeroMemWrapper.c
deleted file mode 100644
index d768dd1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptDxe/ZeroMemWrapper.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/** @file
- ZeroMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Fills a target buffer with zeros, and returns the target buffer.
-
- This function fills Length bytes of Buffer with zeros, and returns Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to fill with zeros.
- @param Length The number of bytes in Buffer to fill with zeros.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-ZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
- return InternalMemZeroMem (Buffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf
deleted file mode 100644
index ef3b909..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf
+++ /dev/null
@@ -1,130 +0,0 @@
-## @file
-# Instance of Base Memory Library optimized for use in PEI phase.
-#
-# Base Memory Library that is optimized for use in PEI phase.
-# Uses REP, MMX, XMM registers as required for best performance.
-#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = BaseMemoryLibOptPei
- MODULE_UNI_FILE = BaseMemoryLibOptPei.uni
- FILE_GUID = D6F43B1B-0F21-462b-B8B7-A033C3EB4261
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = BaseMemoryLib
-
-
-#
-# VALID_ARCHITECTURES = IA32 X64
-#
-
-[Sources]
- MemLibInternals.h
-
-[Sources.Ia32]
- Ia32/ScanMem64.nasm
- Ia32/ScanMem64.S
- Ia32/ScanMem32.nasm
- Ia32/ScanMem32.S
- Ia32/ScanMem16.nasm
- Ia32/ScanMem16.S
- Ia32/ScanMem8.nasm
- Ia32/ScanMem8.S
- Ia32/CompareMem.nasm
- Ia32/CompareMem.S
- Ia32/ZeroMem.nasm
- Ia32/ZeroMem.S
- Ia32/SetMem64.nasm
- Ia32/SetMem64.S
- Ia32/SetMem32.nasm
- Ia32/SetMem32.S
- Ia32/SetMem16.nasm
- Ia32/SetMem16.S
- Ia32/SetMem.nasm
- Ia32/SetMem.S
- Ia32/CopyMem.nasm
- Ia32/CopyMem.S
- Ia32/ScanMem64.nasm
- Ia32/ScanMem32.nasm
- Ia32/ScanMem16.nasm
- Ia32/ScanMem8.nasm
- Ia32/CompareMem.nasm
- Ia32/ZeroMem.nasm
- Ia32/SetMem64.nasm
- Ia32/SetMem32.nasm
- Ia32/SetMem16.nasm
- Ia32/SetMem.nasm
- Ia32/CopyMem.nasm
- Ia32/IsZeroBuffer.nasm
- ScanMem64Wrapper.c
- ScanMem32Wrapper.c
- ScanMem16Wrapper.c
- ScanMem8Wrapper.c
- ZeroMemWrapper.c
- CompareMemWrapper.c
- SetMem64Wrapper.c
- SetMem32Wrapper.c
- SetMem16Wrapper.c
- SetMemWrapper.c
- CopyMemWrapper.c
- IsZeroBufferWrapper.c
- MemLibGuid.c
-
-[Sources.X64]
- X64/ScanMem64.nasm
- X64/ScanMem64.S
- X64/ScanMem32.nasm
- X64/ScanMem32.S
- X64/ScanMem16.nasm
- X64/ScanMem16.S
- X64/ScanMem8.nasm
- X64/ScanMem8.S
- X64/CompareMem.nasm
- X64/CompareMem.S
- X64/ZeroMem.nasm
- X64/ZeroMem.S
- X64/SetMem64.nasm
- X64/SetMem64.S
- X64/SetMem32.nasm
- X64/SetMem32.S
- X64/SetMem16.nasm
- X64/SetMem16.S
- X64/SetMem.nasm
- X64/SetMem.S
- X64/CopyMem.nasm
- X64/CopyMem.S
- X64/IsZeroBuffer.nasm
- ScanMem64Wrapper.c
- ScanMem32Wrapper.c
- ScanMem16Wrapper.c
- ScanMem8Wrapper.c
- ZeroMemWrapper.c
- CompareMemWrapper.c
- SetMem64Wrapper.c
- SetMem32Wrapper.c
- SetMem16Wrapper.c
- SetMemWrapper.c
- CopyMemWrapper.c
- IsZeroBufferWrapper.c
- MemLibGuid.c
-
-
-[Packages]
- MdePkg/MdePkg.dec
-
-[LibraryClasses]
- DebugLib
- BaseLib
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.uni b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.uni
deleted file mode 100644
index dda230e..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.uni
+++ /dev/null
@@ -1,22 +0,0 @@
-// /** @file
-// Instance of Base Memory Library optimized for use in PEI phase.
-//
-// Base Memory Library that is optimized for use in PEI phase.
-// Uses REP, MMX, XMM registers as required for best performance.
-//
-// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "Instance of Base Memory Library optimized for use in the PEI phase"
-
-#string STR_MODULE_DESCRIPTION #language en-US "This is the Base Memory Library that is optimized for use in the PEI phase. It uses REP, MMX, XMM registers, as required for best performance."
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c
deleted file mode 100644
index 161171b..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/CompareMemWrapper.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file
- CompareMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Compares the contents of two buffers.
-
- This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer.
- If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the
- value returned is the first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
- If Length > 0 and DestinationBuffer is NULL, then ASSERT().
- If Length > 0 and SourceBuffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer The pointer to the destination buffer to compare.
- @param SourceBuffer The pointer to the source buffer to compare.
- @param Length The number of bytes to compare.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-CompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- if (Length == 0 || DestinationBuffer == SourceBuffer) {
- return 0;
- }
- ASSERT (DestinationBuffer != NULL);
- ASSERT (SourceBuffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
-
- return InternalMemCompareMem (DestinationBuffer, SourceBuffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/CopyMemWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/CopyMemWrapper.c
deleted file mode 100644
index 1a01fbe..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/CopyMemWrapper.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file
- CopyMem() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Copies a source buffer to a destination buffer, and returns the destination buffer.
-
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
- DestinationBuffer. The implementation must be reentrant, and it must handle the case
- where SourceBuffer overlaps DestinationBuffer.
-
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer The pointer to the destination buffer of the memory copy.
- @param SourceBuffer The pointer to the source buffer of the memory copy.
- @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer.
-
- @return DestinationBuffer.
-
-**/
-VOID *
-EFIAPI
-CopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return DestinationBuffer;
- }
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
-
- if (DestinationBuffer == SourceBuffer) {
- return DestinationBuffer;
- }
- return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.S
deleted file mode 100644
index a430453..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.S
+++ /dev/null
@@ -1,55 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CompareMem.S
-#
-# Abstract:
-#
-# CompareMem function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemCompareMem)
-
-#------------------------------------------------------------------------------
-# INTN
-# EFIAPI
-# InternalMemCompareMem (
-# IN CONST VOID *DestinationBuffer,
-# IN CONST VOID *SourceBuffer,
-# IN UINTN Length
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemCompareMem):
- push %esi
- push %edi
- movl 12(%esp), %esi
- movl 16(%esp), %edi
- movl 20(%esp), %ecx
- repe cmpsb
- movzbl -1(%esi), %eax
- movzbl -1(%edi), %edx
- subl %edx, %eax
- pop %edi
- pop %esi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.nasm
deleted file mode 100644
index e8d1abd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CompareMem.nasm
+++ /dev/null
@@ -1,57 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CompareMem.Asm
-;
-; Abstract:
-;
-; CompareMem function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; INTN
-; EFIAPI
-; InternalMemCompareMem (
-; IN CONST VOID *DestinationBuffer,
-; IN CONST VOID *SourceBuffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- push esi
- push edi
- mov esi, [esp + 12]
- mov edi, [esp + 16]
- mov ecx, [esp + 20]
- repe cmpsb
- movzx eax, byte [esi - 1]
- movzx edx, byte [edi - 1]
- sub eax, edx
- pop edi
- pop esi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.S
deleted file mode 100644
index 1200675..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.S
+++ /dev/null
@@ -1,62 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# CopyMem.S
-#
-# Abstract:
-#
-# CopyMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemCopyMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemCopyMem (
-# IN VOID *Destination,
-# IN VOID *Source,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemCopyMem):
- push %esi
- push %edi
- movl 16(%esp), %esi # esi <- Source
- movl 12(%esp), %edi # edi <- Destination
- movl 20(%esp), %edx # edx <- Count
- cmpl %esi, %edi
- je L_CopyDone
- cmpl $0, %edx
- je L_CopyDone
- leal -1(%esi, %edx), %eax # eax <- End of Source
- cmpl %edi, %esi
- jae L_CopyBytes
- cmpl %edi, %eax
- jb L_CopyBytes # Copy backward if overlapped
- movl %eax, %esi # esi <- End of Source
- leal -1(%edi, %edx), %edi # edi <- End of Destination
- std
-L_CopyBytes:
- movl %edx, %ecx
- rep
- movsb # Copy bytes backward
- cld
-L_CopyDone:
- movl 12(%esp), %eax # eax <- Destination as return value
- pop %edi
- pop %esi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.nasm
deleted file mode 100644
index d7e62aa..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/CopyMem.nasm
+++ /dev/null
@@ -1,62 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; CopyMem.Asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemCopyMem (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- push esi
- push edi
- mov esi, [esp+16] ; esi <- Source
- mov edi, [esp+12] ; edi <- Destination
- mov edx, [esp+20] ; edx <- Count
- cmp esi, edi
- je @CopyDone
- cmp edx, 0
- je @CopyDone
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- jae @CopyBytes
- cmp eax, edi
- jb @CopyBytes ; Copy backward if overlapped
- mov esi, eax ; esi <- End of Source
- lea edi, [edi + edx - 1] ; edi <- End of Destination
- std
-@CopyBytes:
- mov ecx, edx
- rep movsb ; Copy bytes backward
- cld
-@CopyDone:
- mov eax, [esp + 12] ; eax <- Destination as return value
- pop edi
- pop esi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/IsZeroBuffer.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/IsZeroBuffer.nasm
deleted file mode 100644
index cfd41a6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/IsZeroBuffer.nasm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2016, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; IsZeroBuffer.nasm
-;
-; Abstract:
-;
-; IsZeroBuffer function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; BOOLEAN
-; EFIAPI
-; InternalMemIsZeroBuffer (
-; IN CONST VOID *Buffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemIsZeroBuffer)
-ASM_PFX(InternalMemIsZeroBuffer):
- push edi
- mov edi, [esp + 8] ; edi <- Buffer
- mov ecx, [esp + 12] ; ecx <- Length
- mov edx, ecx ; edx <- ecx
- shr ecx, 2 ; ecx <- number of dwords
- and edx, 3 ; edx <- number of trailing bytes
- xor eax, eax ; eax <- 0, also set ZF
- repe scasd
- jnz @ReturnFalse ; ZF=0 means non-zero element found
- mov ecx, edx
- repe scasb
- jnz @ReturnFalse
- pop edi
- mov eax, 1 ; return TRUE
- ret
-@ReturnFalse:
- pop edi
- xor eax, eax
- ret ; return FALSE
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.S
deleted file mode 100644
index 9e383c2..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem16.S
-#
-# Abstract:
-#
-# ScanMem16 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem16)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem16 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT16 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem16):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movl 16(%esp), %eax
- repne scasw
- leal -2(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.nasm
deleted file mode 100644
index 78d9f30..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem16.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem16.Asm
-;
-; Abstract:
-;
-; ScanMem16 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem16 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT16 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem16)
-ASM_PFX(InternalMemScanMem16):
- push edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov eax, [esp + 16]
- repne scasw
- lea eax, [edi - 2]
- cmovnz eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.S
deleted file mode 100644
index a9b4975..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem32.Asm
-#
-# Abstract:
-#
-# ScanMem32 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem32)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem32 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT32 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem32):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movl 16(%esp), %eax
- repne scasl
- leal -4(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.nasm
deleted file mode 100644
index bbacf38..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem32.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem32.Asm
-;
-; Abstract:
-;
-; ScanMem32 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem32 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT32 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem32)
-ASM_PFX(InternalMemScanMem32):
- push edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov eax, [esp + 16]
- repne scasd
- lea eax, [edi - 4]
- cmovnz eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.S
deleted file mode 100644
index 6e42856..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.S
+++ /dev/null
@@ -1,61 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem64.S
-#
-# Abstract:
-#
-# ScanMem64 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem64)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem64 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem64):
- push %edi
- movl 12(%esp), %ecx
- movl 16(%esp), %eax
- movl 20(%esp), %edx
- movl 8(%esp), %edi
-L0:
- cmpl (%edi), %eax
- leal 8(%edi), %edi
- loopne L0
- jne L1
- cmpl -4(%edi), %edx
- jecxz L1
- jne L0
-L1:
- leal -8(%edi), %eax
- cmovne %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.nasm
deleted file mode 100644
index e994d4a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem64.nasm
+++ /dev/null
@@ -1,63 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem64.Asm
-;
-; Abstract:
-;
-; ScanMem64 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem64 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem64)
-ASM_PFX(InternalMemScanMem64):
- push edi
- mov ecx, [esp + 12]
- mov eax, [esp + 16]
- mov edx, [esp + 20]
- mov edi, [esp + 8]
-.0:
- cmp eax, [edi]
- lea edi, [edi + 8]
- loopne .0
- jne .1
- cmp edx, [edi - 4]
- jecxz .1
- jne .0
-.1:
- lea eax, [edi - 8]
- cmovne eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.S
deleted file mode 100644
index 02bb27f..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.S
+++ /dev/null
@@ -1,52 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ScanMem8.S
-#
-# Abstract:
-#
-# ScanMem8 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances contain the same copy of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-# BaseMemoryLibOptDxe
-# BaseMemoryLibOptPei
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemScanMem8)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem8 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT8 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem8):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movb 16(%esp), %al
- repne scasb
- leal -1(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.nasm
deleted file mode 100644
index d13c9c7..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ScanMem8.nasm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ScanMem8.Asm
-;
-; Abstract:
-;
-; ScanMem8 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances contain the same copy of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-; BaseMemoryLibOptDxe
-; BaseMemoryLibOptPei
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem8 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- push edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov al, [esp + 16]
- repne scasb
- lea eax, [edi - 1]
- cmovnz eax, ecx
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.S
deleted file mode 100644
index ee0b659..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.S
+++ /dev/null
@@ -1,50 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem.S
-#
-# Abstract:
-#
-# SetMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT8 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem):
- push %edi
- movl 12(%esp),%ecx
- movb 16(%esp),%al
- movb %al, %ah
- shrd $16, %eax, %edx
- shld $16, %edx, %eax
- movl %ecx, %edx
- movl 8(%esp),%edi
- shr $2, %ecx
- rep stosl
- movl %edx, %ecx
- andl $3, %ecx
- rep stosb
- movl 8(%esp),%eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.nasm
deleted file mode 100644
index 3a75363..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem.nasm
+++ /dev/null
@@ -1,52 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem.Asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT8 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- push edi
- mov ecx, [esp + 12]
- mov al, [esp + 16]
- mov ah, al
- shrd edx, eax, 16
- shld eax, edx, 16
- mov edx, ecx
- mov edi, [esp + 8]
- shr ecx, 2
- rep stosd
- mov ecx, edx
- and ecx, 3
- rep stosb
- mov eax, [esp + 8]
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.S
deleted file mode 100644
index 8989bdd..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem16.S
-#
-# Abstract:
-#
-# SetMem16 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem16)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem16 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT16 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem16):
- push %edi
- movl 16(%esp), %eax
- movl 8(%esp), %edi
- movl 12(%esp), %ecx
- rep
- stosw
- movl 8(%esp), %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.nasm
deleted file mode 100644
index cfa4906..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem16.nasm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem16.Asm
-;
-; Abstract:
-;
-; SetMem16 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem16 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT16 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- push edi
- mov eax, [esp + 16]
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- rep stosw
- mov eax, [esp + 8]
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.S
deleted file mode 100644
index b2c9a85..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem32.S
-#
-# Abstract:
-#
-# SetMem32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem32)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem32 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT32 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem32):
- push %edi
- movl 16(%esp),%eax
- movl 8(%esp),%edi
- movl 12(%esp),%ecx
- rep
- stosl
- movl 8(%esp),%eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.nasm
deleted file mode 100644
index 78e09b3..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem32.nasm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem32.Asm
-;
-; Abstract:
-;
-; SetMem32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem32 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT32 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- push edi
- mov eax, [esp + 16]
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- rep stosd
- mov eax, [esp + 8]
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.S
deleted file mode 100644
index f25dfe1..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# SetMem64.S
-#
-# Abstract:
-#
-# SetMem64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemSetMem64)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem64 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT64 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem64):
- push %edi
- movl 12(%esp), %ecx
- movl 16(%esp), %eax
- movl 20(%esp), %edx
- movl 8(%esp), %edi
-L0:
- mov %eax, -8(%edi, %ecx, 8)
- mov %edx, -4(%edi, %ecx, 8)
- loop L0
- movl %edi, %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.nasm
deleted file mode 100644
index d0afacb..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/SetMem64.nasm
+++ /dev/null
@@ -1,48 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; SetMem64.Asm
-;
-; Abstract:
-;
-; SetMem64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem64 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT64 Value
-; )
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- push edi
- mov ecx, [esp + 12]
- mov eax, [esp + 16]
- mov edx, [esp + 20]
- mov edi, [esp + 8]
-.0:
- mov [edi + ecx*8 - 8], eax
- mov [edi + ecx*8 - 4], edx
- loop .0
- mov eax, edi
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.S b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.S
deleted file mode 100644
index 70cede6..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.S
+++ /dev/null
@@ -1,49 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-# Module Name:
-#
-# ZeroMem.S
-#
-# Abstract:
-#
-# ZeroMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-ASM_GLOBAL ASM_PFX(InternalMemZeroMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemZeroMem (
-# IN VOID *Buffer,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemZeroMem):
- push %edi
- xorl %eax,%eax
- movl 8(%esp),%edi
- movl 12(%esp),%ecx
- movl %ecx,%edx
- shrl $2,%ecx
- andl $3,%edx
- pushl %edi
- rep
- stosl
- movl %edx,%ecx
- rep
- stosb
- popl %eax
- pop %edi
- ret
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.nasm b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.nasm
deleted file mode 100644
index 31efb6a..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/Ia32/ZeroMem.nasm
+++ /dev/null
@@ -1,49 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Module Name:
-;
-; ZeroMem.Asm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- SECTION .text
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-global ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- push edi
- xor eax, eax
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- mov edx, ecx
- shr ecx, 2
- and edx, 3
- push edi
- rep stosd
- mov ecx, edx
- rep stosb
- pop eax
- pop edi
- ret
-
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/IsZeroBufferWrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/IsZeroBufferWrapper.c
deleted file mode 100644
index 078c924..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/IsZeroBufferWrapper.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
- Implementation of IsZeroBuffer function.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Checks if the contents of a buffer are all zeros.
-
- This function checks whether the contents of a buffer are all zeros. If the
- contents are all zeros, return TRUE. Otherwise, return FALSE.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- )
-{
- ASSERT (!(Buffer == NULL && Length > 0));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return InternalMemIsZeroBuffer (Buffer, Length);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
deleted file mode 100644
index 28b08c9..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/MemLibGuid.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/** @file
- Implementation of GUID functions.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "MemLibInternals.h"
-
-/**
- Copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid to
- DestinationGuid, and returns DestinationGuid.
-
- If DestinationGuid is NULL, then ASSERT().
- If SourceGuid is NULL, then ASSERT().
-
- @param DestinationGuid The pointer to the destination GUID.
- @param SourceGuid The pointer to the source GUID.
-
- @return DestinationGuid.
-
-**/
-GUID *
-EFIAPI
-CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
- )
-{
- WriteUnaligned64 (
- (UINT64*)DestinationGuid,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid)
- );
- WriteUnaligned64 (
- (UINT64*)DestinationGuid + 1,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid + 1)
- );
- return DestinationGuid;
-}
-
-/**
- Compares two GUIDs.
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
- If there are any bit differences in the two GUIDs, then FALSE is returned.
-
- If Guid1 is NULL, then ASSERT().
- If Guid2 is NULL, then ASSERT().
-
- @param Guid1 A pointer to a 128 bit GUID.
- @param Guid2 A pointer to a 128 bit GUID.
-
- @retval TRUE Guid1 and Guid2 are identical.
- @retval FALSE Guid1 and Guid2 are not identical.
-
-**/
-BOOLEAN
-EFIAPI
-CompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
- )
-{
- UINT64 LowPartOfGuid1;
- UINT64 LowPartOfGuid2;
- UINT64 HighPartOfGuid1;
- UINT64 HighPartOfGuid2;
-
- LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
- LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
- HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
- HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);
-
- return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);
-}
-
-/**
- Scans a target buffer for a GUID, and returns a pointer to the matching GUID
- in the target buffer.
-
- This function searches the target buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the 128-bit
- GUID value that matches Guid. If a match is found, then a pointer to the matching
- GUID in the target buffer is returned. If no match is found, then NULL is returned.
- If Length is 0, then NULL is returned.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 128-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The number of bytes in Buffer to scan.
- @param Guid The value to search for in the target buffer.
-
- @return A pointer to the matching Guid in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
- )
-{
- CONST GUID *GuidPtr;
-
- ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
- ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
- ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
-
- GuidPtr = (GUID*)Buffer;
- Buffer = GuidPtr + Length / sizeof (*GuidPtr);
- while (GuidPtr < (CONST GUID*)Buffer) {
- if (CompareGuid (GuidPtr, Guid)) {
- return (VOID*)GuidPtr;
- }
- GuidPtr++;
- }
- return NULL;
-}
-
-/**
- Checks if the given GUID is a zero GUID.
-
- This function checks whether the given GUID is a zero GUID. If the GUID is
- identical to a zero GUID then TRUE is returned. Otherwise, FALSE is returned.
-
- If Guid is NULL, then ASSERT().
-
- @param Guid The pointer to a 128 bit GUID.
-
- @retval TRUE Guid is a zero GUID.
- @retval FALSE Guid is not a zero GUID.
-
-**/
-BOOLEAN
-EFIAPI
-IsZeroGuid (
- IN CONST GUID *Guid
- )
-{
- UINT64 LowPartOfGuid;
- UINT64 HighPartOfGuid;
-
- LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
- HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
-
- return (BOOLEAN) (LowPartOfGuid == 0 && HighPartOfGuid == 0);
-}
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/MemLibInternals.h b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/MemLibInternals.h
deleted file mode 100644
index 0c5bbe0..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/MemLibInternals.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/** @file
- Declaration of internal functions for Base Memory Library.
-
- The following BaseMemoryLib instances contain the same copy of this file:
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
-
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __MEM_LIB_INTERNALS__
-#define __MEM_LIB_INTERNALS__
-
-#include
-#include
-#include
-#include
-
-/**
- Copy Length bytes from Source to Destination.
-
- @param DestinationBuffer The target of the copy request.
- @param SourceBuffer The place to copy from.
- @param Length The number of bytes to copy.
-
- @return Destination
-
-**/
-VOID *
-EFIAPI
-InternalMemCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Set Buffer to Value for Size bytes.
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set.
- @param Value The value of the set operation.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 16-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 32-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- @param Buffer The pointer to the target buffer to fill.
- @param Length The count of 64-bit value to fill.
- @param Value The value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Set Buffer to 0 for Size bytes.
-
- @param Buffer The memory to set.
- @param Length The number of bytes to set
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- );
-
-/**
- Compares two memory buffers of a given length.
-
- @param DestinationBuffer The first memory buffer.
- @param SourceBuffer The second memory buffer.
- @param Length The length of DestinationBuffer and SourceBuffer memory
- regions to compare. Must be non-zero.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-InternalMemCompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the
- matching 8-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 8-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the
- matching 16-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 16-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the
- matching 32-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 32-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the
- matching 64-bit value in the target buffer.
-
- @param Buffer The pointer to the target buffer to scan.
- @param Length The count of 64-bit value to scan. Must be non-zero.
- @param Value The value to search for in the target buffer.
-
- @return The pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Checks whether the contents of a buffer are all zeros.
-
- @param Buffer The pointer to the buffer to be checked.
- @param Length The size of the buffer (in bytes) to be checked.
-
- @retval TRUE Contents of the buffer are all zeros.
- @retval FALSE Contents of the buffer are not all zeros.
-
-**/
-BOOLEAN
-EFIAPI
-InternalMemIsZeroBuffer (
- IN CONST VOID *Buffer,
- IN UINTN Length
- );
-
-#endif
diff --git a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c b/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c
deleted file mode 100644
index 7b37607..0000000
--- a/Voyager/Voyager/edk2/MdePkg/Library/BaseMemoryLibOptPei/ScanMem16Wrapper.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/** @file
- ScanMem16() implementation.
-
- The following BaseMemoryLib instances contain the same copy of this file:
-
- BaseMemoryLib
- BaseMemoryLibMmx
- BaseMemoryLibSse2
- BaseMemoryLibRepStr
- BaseMemoryLibOptDxe
- BaseMemoryLibOptPei
- PeiMemoryLib
- UefiMemoryLib
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.