<Filename SupArchList="IA32">Unaligned.c</Filename>\r
<Filename SupArchList="IA32">Ia32/Non-existing.c</Filename>\r
<Filename SupArchList="IA32">Ia32/InternalSwitchStack.c</Filename>\r
- <Filename SupArchList="IA32">Ia32/LShiftU64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/RShiftU64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ARShiftU64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/LRotU64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/RRotU64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/MultU64x32.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/MultU64x64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/DivU64x32.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ModU64x32.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/DivU64x32Remainder.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/DivU64x64Remainder.asm</Filename>\r
+\r
+ <Filename SupArchList="IA32">Ia32/ARShiftU64.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/CpuBreakpoint.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/CpuFlushTlb.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/CpuSleep.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/CpuId.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/CpuIdEx.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/CpuPause.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/DisableInterrupts.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/DisablePaging32.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/DivU64x32.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/DivU64x32Remainder.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/DivU64x64Remainder.c</Filename>\r
<Filename SupArchList="IA32">Ia32/DivS64x64Remainder.c</Filename>\r
- <Filename SupArchList="IA32">Ia32/SwapBytes64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/SetJump.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/LongJump.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/CpuId.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/CpuIdEx.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadEflags.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadMsr64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteMsr64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadCr0.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadCr2.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadCr3.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadCr4.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteCr0.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteCr2.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteCr3.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteCr4.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadDr0.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadDr1.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadDr2.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadDr3.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadDr4.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadDr5.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadDr6.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadDr7.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteDr0.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteDr1.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteDr2.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteDr3.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteDr4.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteDr5.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteDr6.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteDr7.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadCs.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadDs.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadEs.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadFs.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadGs.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadSs.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadTr.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadGdtr.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteGdtr.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadIdtr.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteIdtr.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadLdtr.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteLdtr.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/FxSave.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/FxRestore.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadMm0.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadMm1.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadMm2.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadMm3.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadMm4.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadMm5.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadMm6.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadMm7.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteMm0.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteMm1.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteMm2.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteMm3.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteMm4.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteMm5.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteMm6.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/WriteMm7.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadTsc.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/ReadPmc.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/Monitor.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/Mwait.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/EnablePaging32.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/DisablePaging32.asm</Filename>\r
+\r
+ <Filename SupArchList="IA32">Ia32/EnableDisableInterrupts.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/EnableInterrupts.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/EnablePaging32.c</Filename>\r
<Filename SupArchList="IA32">Ia32/EnablePaging64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/Wbinvd.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/Invd.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/FlushCacheLine.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/InterlockedIncrement.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/InterlockedDecrement.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/InterlockedCompareExchange32.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/InterlockedCompareExchange64.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/EnableInterrupts.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/DisableInterrupts.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/EnableDisableInterrupts.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/CpuSleep.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/CpuPause.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/CpuBreakpoint.asm</Filename>\r
- <Filename SupArchList="IA32">Ia32/CpuFlushTlb.asm</Filename>\r
+ \r
+ <Filename SupArchList="IA32">Ia32/FlushCacheLine.c</Filename>\r
+\r
+ <Filename SupArchList="IA32">Ia32/FxSave.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/FxRestore.c</Filename>\r
+\r
+ <Filename SupArchList="IA32">Ia32/InterlockedIncrement.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/InterlockedDecrement.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/InterlockedCompareExchange32.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/InterlockedCompareExchange64.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/Invd.c</Filename>\r
+ \r
+ <Filename SupArchList="IA32">Ia32/LongJump.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/LRotU64.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/LShiftU64.c</Filename>\r
+\r
+ <Filename SupArchList="IA32">Ia32/MultU64x32.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/MultU64x64.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ModU64x32.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/Monitor.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/Mwait.c</Filename>\r
+\r
+ <Filename SupArchList="IA32">Ia32/ReadCr0.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadCr2.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadCr3.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadCr4.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadDr0.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadDr1.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadDr2.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadDr3.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadDr4.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadDr5.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadDr6.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadDr7.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadEflags.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadMm0.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadMm1.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadMm2.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadMm3.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadMm4.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadMm5.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadMm6.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadMm7.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadMsr64.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadCs.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadDs.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadEs.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadFs.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadGs.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadSs.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadTr.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadGdtr.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadIdtr.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadLdtr.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadTsc.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/ReadPmc.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/RShiftU64.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/RRotU64.c</Filename>\r
+\r
+ <Filename SupArchList="IA32">Ia32/SetJump.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/SwapBytes64.c</Filename>\r
<Filename SupArchList="IA32">Ia32/Thunk16.asm</Filename>\r
+\r
+ <Filename SupArchList="IA32">Ia32/WriteMsr64.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteCr0.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteCr2.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteCr3.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteCr4.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteDr0.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteDr1.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteDr2.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteDr3.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteDr4.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteDr5.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteDr6.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteDr7.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteGdtr.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteIdtr.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteLdtr.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteMm0.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteMm1.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteMm2.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteMm3.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteMm4.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteMm5.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteMm6.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/WriteMm7.c</Filename>\r
+ <Filename SupArchList="IA32">Ia32/Wbinvd.c</Filename>\r
+ \r
<!-- GCC assembly code is with .S extension -->\r
<Filename SupArchList="IA32">Ia32/LShiftU64.S</Filename>\r
<Filename SupArchList="IA32">Ia32/RShiftU64.S</Filename>\r
--- /dev/null
+/** @file\r
+ 64-bit arithmetic right shift function for IA-32.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathARShiftU64 (\r
+ IN UINT64 Operand,\r
+ IN UINTN Count\r
+ )\r
+{\r
+ _asm {\r
+ mov cl, byte ptr [Count]\r
+ mov eax, dword ptr [Operand + 4]\r
+ cdq\r
+ test cl, 32\r
+ cmovz edx, eax\r
+ cmovz eax, dword ptr [Operand + 0]\r
+ shrd eax, edx, cl\r
+ sar edx, cl\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ CpuBreakpoint function.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+CpuBreakpoint (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ int 3\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ CpuFlushTlb function.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+CpuFlushTlb (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, cr3\r
+ mov cr3, eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmCpuid function.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+AsmCpuid (\r
+ IN UINT32 Index,\r
+ OUT UINT32 *RegisterEax, OPTIONAL\r
+ OUT UINT32 *RegisterEbx, OPTIONAL\r
+ OUT UINT32 *RegisterEcx, OPTIONAL\r
+ OUT UINT32 *RegisterEdx OPTIONAL\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Index\r
+ cpuid\r
+ push ecx\r
+ mov ecx, RegisterEax\r
+ jecxz SkipEax\r
+ mov [ecx], eax\r
+SkipEax:\r
+ mov ecx, RegisterEbx\r
+ jecxz SkipEbx\r
+ mov [ecx], ebx\r
+SkipEbx:\r
+ pop eax\r
+ mov ecx, RegisterEcx\r
+ jecxz SkipEcx\r
+ mov [ecx], eax\r
+SkipEcx:\r
+ mov ecx, RegisterEdx\r
+ jecxz SkipEdx\r
+ mov [ecx], edx\r
+SkipEdx:\r
+ mov eax, Index\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmCpuidEx function.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+AsmCpuidEx (\r
+ IN UINT32 Index,\r
+ IN UINT32 SubIndex,\r
+ OUT UINT32 *RegisterEax, OPTIONAL\r
+ OUT UINT32 *RegisterEbx, OPTIONAL\r
+ OUT UINT32 *RegisterEcx, OPTIONAL\r
+ OUT UINT32 *RegisterEdx OPTIONAL\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Index\r
+ mov ecx, SubIndex\r
+ cpuid\r
+ push ecx\r
+ mov ecx, RegisterEax\r
+ jecxz SkipEax\r
+ mov [ecx], eax\r
+SkipEax:\r
+ mov ecx, RegisterEbx\r
+ jecxz SkipEbx\r
+ mov [ecx], ebx\r
+SkipEbx:\r
+ pop eax\r
+ mov ecx, RegisterEcx\r
+ jecxz SkipEcx\r
+ mov [ecx], eax\r
+SkipEcx:\r
+ mov ecx, RegisterEdx\r
+ jecxz SkipEdx\r
+ mov [ecx], edx\r
+SkipEdx:\r
+ mov eax, Index\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ CpuPause function.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+CpuPause (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ pause\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ CpuSleep function.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+CpuSleep (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ hlt\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ DisableInterrupts function.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+DisableInterrupts (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ cli\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmDisablePaging32 function.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+__declspec (naked)\r
+VOID\r
+EFIAPI\r
+InternalX86DisablePaging32 (\r
+ IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
+ IN VOID *Context1, OPTIONAL\r
+ IN VOID *Context2, OPTIONAL\r
+ IN VOID *NewStack\r
+ )\r
+{\r
+ _asm {\r
+ push ebp\r
+ mov ebp, esp\r
+ mov ebx, EntryPoint\r
+ mov ecx, Context1\r
+ mov edx, Context2\r
+ pushfd\r
+ pop edi // save EFLAGS to edi\r
+ cli\r
+ mov eax, cr0\r
+ btr eax, 31\r
+ mov esp, NewStack\r
+ mov cr0, eax\r
+ push edi\r
+ popfd // restore EFLAGS from edi\r
+ push edx\r
+ push ecx\r
+ call ebx\r
+ jmp $ // EntryPoint() should not return\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ Calculate the quotient of a 64-bit integer by a 32-bit integer\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathDivU64x32 (\r
+ IN UINT64 Dividend,\r
+ IN UINT32 Divisor\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, dword ptr [Dividend + 4]\r
+ mov ecx, Divisor\r
+ xor edx, edx\r
+ div ecx\r
+ push eax ; save quotient on stack\r
+ mov eax, dword ptr [Dividend]\r
+ div ecx\r
+ pop edx ; restore high-order dword of the quotient\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ Set error flag for all division functions\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathDivRemU64x32 (\r
+ IN UINT64 Dividend,\r
+ IN UINT32 Divisor,\r
+ OUT UINT32 *Remainder\r
+ )\r
+{\r
+ _asm {\r
+ mov ecx, Divisor\r
+ mov eax, dword ptr [Dividend + 4]\r
+ xor edx, edx\r
+ div ecx\r
+ push eax\r
+ mov eax, dword ptr [Dividend + 0]\r
+ div ecx\r
+ mov ecx, Remainder\r
+ jecxz RemainderNull // abandon remainder if Remainder == NULL\r
+ mov [ecx], edx\r
+RemainderNull:\r
+ pop edx\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ Calculate the quotient of a 64-bit integer by a 64-bit integer and returns\r
+ both the quotient and the remainderSet error flag for all division functions\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathDivRemU64x64 (\r
+ IN UINT64 Dividend,\r
+ IN UINT64 Divisor,\r
+ OUT UINT64 *Remainder OPTIONAL\r
+ )\r
+{\r
+ _asm {\r
+ mov edx, dword ptr [Dividend + 4]\r
+ mov eax, dword ptr [Dividend + 0] // edx:eax <- dividend\r
+ mov edi, edx\r
+ mov esi, eax // edi:esi <- dividend\r
+ mov ebx, dword ptr [Divisor + 0] // ecx:ebx <- divisor\r
+BitLoop:\r
+ shr edx, 1\r
+ rcr eax, 1\r
+ shrd ebx, ecx, 1\r
+ shr ecx, 1\r
+ jnz BitLoop\r
+ div ebx\r
+ mov ebx, eax // ebx <- quotient\r
+ mov ecx, dword ptr [Divisor + 4]\r
+ mul dword ptr [Divisor]\r
+ imul ecx, ebx\r
+ add edx, ecx\r
+ mov ecx, Remainder\r
+ jc TooLarge // product > 2^64\r
+ cmp edi, edx // compare high 32 bits\r
+ ja Correct\r
+ jb TooLarge // product > dividend\r
+ cmp esi, eax\r
+ jae Correct // product <= dividend\r
+TooLarge:\r
+ dec ebx // adjust quotient by -1\r
+ jecxz Return // return if Remainder == NULL\r
+ sub eax, dword ptr [Divisor + 0]\r
+ sbb edx, dword ptr [Divisor + 4]\r
+Correct:\r
+ jecxz Return\r
+ sub esi, eax\r
+ sbb edi, edx // edi:esi <- remainder\r
+ mov [ecx], esi\r
+ mov [ecx + 4], edi\r
+Return:\r
+ mov eax, ebx // eax <- quotient\r
+ xor edx, edx\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ EnableDisableInterrupts function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+EnableDisableInterrupts (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ sti\r
+ nop\r
+ nop\r
+ cli\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ EnableInterrupts function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+EnableInterrupts (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ sti\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmEnablePaging32 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+__declspec (naked)\r
+VOID\r
+EFIAPI\r
+InternalX86EnablePaging32 (\r
+ IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
+ IN VOID *Context1, OPTIONAL\r
+ IN VOID *Context2, OPTIONAL\r
+ IN VOID *NewStack\r
+ )\r
+{\r
+ _asm {\r
+ push ebp\r
+ mov ebp, esp\r
+ mov ebx, EntryPoint\r
+ mov ecx, Context1\r
+ mov edx, Context2\r
+ pushfd\r
+ pop edi\r
+ cli\r
+ mov eax, cr0\r
+ bts eax, 31\r
+ mov esp, NewStack\r
+ mov cr0, eax\r
+ push edi\r
+ popfd\r
+ push edx\r
+ push ecx\r
+ call ebx\r
+ jmp $\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmFlushCacheLine function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID *\r
+EFIAPI\r
+AsmFlushCacheLine (\r
+ IN VOID *LinearAddress\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, LinearAddress\r
+ clflush [eax]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmFxRestore function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86FxRestore (\r
+ IN CONST IA32_FX_BUFFER *Buffer\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Buffer\r
+ fxrstor [eax]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmFxSave function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86FxSave (\r
+ OUT IA32_FX_BUFFER *Buffer\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Buffer\r
+ fxsave [eax]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ InterlockedCompareExchange32 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+InternalSyncCompareExchange32 (\r
+ IN UINT32 *Value,\r
+ IN UINT32 CompareValue,\r
+ IN UINT32 ExchangeValue\r
+ )\r
+{\r
+ _asm {\r
+ mov ecx, Value\r
+ mov eax, CompareValue\r
+ mov edx, ExchangeValue\r
+ lock cmpxchg [ecx], edx\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ InterlockedCompareExchange64 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalSyncCompareExchange64 (\r
+ IN UINT64 *Value,\r
+ IN UINT64 CompareValue,\r
+ IN UINT64 ExchangeValue\r
+ )\r
+{\r
+ _asm {\r
+ mov esi, Value\r
+ mov eax, dword ptr [CompareValue + 0]\r
+ mov edx, dword ptr [CompareValue + 4]\r
+ mov ebx, dword ptr [ExchangeValue + 0]\r
+ mov ecx, dword ptr [ExchangeValue + 4]\r
+ lock cmpxchg8b qword ptr [esi]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ InterlockedDecrement function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+InternalSyncDecrement (\r
+ IN UINT32 *Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ lock dec dword ptr [eax]\r
+ mov eax, [eax]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ InterLockedIncrement function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+InternalSyncIncrement (\r
+ IN UINT32 *Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ lock inc dword ptr [eax]\r
+ mov eax, [eax]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmInvd function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmInvd (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ invd\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ 64-bit left rotation for Ia32\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathLRotU64 (\r
+ IN UINT64 Operand,\r
+ IN UINTN Count\r
+ )\r
+{\r
+ _asm {\r
+ mov cl, byte ptr [Count]\r
+ mov edx, dword ptr [Operand + 4]\r
+ mov eax, dword ptr [Operand + 0]\r
+ shld ebx, edx, cl\r
+ shld edx, eax, cl\r
+ ror ebx, cl\r
+ shld eax, ebx, cl\r
+ test cl, 32 ; Count >= 32?\r
+ cmovnz ecx, eax\r
+ cmovnz eax, edx\r
+ cmovnz edx, ecx\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ 64-bit left shift function for IA-32.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathLShiftU64 (\r
+ IN UINT64 Operand,\r
+ IN UINTN Count\r
+ )\r
+{\r
+ _asm {\r
+ mov cl, byte ptr [Count]\r
+ xor eax, eax\r
+ mov edx, dword ptr [Operand + 0]\r
+ test cl, 32 // Count >= 32?\r
+ cmovz eax, edx\r
+ cmovz edx, dword ptr [Operand + 4]\r
+ shld edx, eax, cl\r
+ shl eax, cl\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ Implementation of _LongJump() on IA-32.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+__declspec (naked)\r
+VOID\r
+EFIAPI\r
+InternalLongJump (\r
+ IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,\r
+ IN UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ pop eax ; skip return address\r
+ pop edx ; edx <- JumpBuffer\r
+ pop eax ; eax <- Value\r
+ mov ebx, [edx]\r
+ mov esi, [edx + 4]\r
+ mov edi, [edx + 8]\r
+ mov ebp, [edx + 12]\r
+ mov esp, [edx + 16]\r
+ jmp dword ptr [edx + 20]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ Calculate the remainder of a 64-bit integer by a 32-bit integer\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT32\r
+EFIAPI\r
+InternalMathModU64x32 (\r
+ IN UINT64 Dividend,\r
+ IN UINT32 Divisor\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, dword ptr [Dividend + 4]\r
+ mov ecx, Divisor\r
+ xor edx, edx\r
+ div ecx\r
+ mov eax, dword ptr [Dividend + 0]\r
+ div ecx\r
+ mov eax, edx\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmMonitor function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmMonitor (\r
+ IN UINTN RegisterEax,\r
+ IN UINTN RegisterEcx,\r
+ IN UINTN RegisterEdx\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, RegisterEax\r
+ mov ecx, RegisterEcx\r
+ mov edx, RegisterEdx\r
+ _emit 0x0f // monitor\r
+ _emit 0x01\r
+ _emit 0xc8\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ Calculate the product of a 64-bit integer and a 32-bit integer\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathMultU64x32 (\r
+ IN UINT64 Multiplicand,\r
+ IN UINT32 Multiplier\r
+ )\r
+{\r
+ _asm {\r
+ mov ecx, Multiplier\r
+ mov eax, ecx\r
+ imul ecx, dword ptr [Multiplicand + 4] // overflow not detectable\r
+ mul dword ptr [Multiplicand + 0]\r
+ add edx, ecx\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ Calculate the product of a 64-bit integer and another 64-bit integer\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathMultU64x64 (\r
+ IN UINT64 Multiplicand,\r
+ IN UINT64 Multiplier\r
+ )\r
+{\r
+ _asm {\r
+ mov ebx, dword ptr [Multiplicand + 0]\r
+ mov edx, dword ptr [Multiplier + 0]\r
+ mov ecx, ebx\r
+ mov eax, edx\r
+ imul ebx, dword ptr [Multiplier + 4]\r
+ imul edx, dword ptr [Multiplicand + 4]\r
+ add ebx, edx\r
+ mul ecx\r
+ add edx, ebx\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmMwait function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmMwait (\r
+ IN UINTN RegisterEax,\r
+ IN UINTN RegisterEcx\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, RegisterEax\r
+ mov ecx, RegisterEcx\r
+ _emit 0x0f // mwait\r
+ _emit 0x01\r
+ _emit 0xC9\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ 64-bit right rotation for Ia32\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathRRotU64 (\r
+ IN UINT64 Operand,\r
+ IN UINTN Count\r
+ )\r
+{\r
+ _asm {\r
+ mov cl, byte ptr [Count]\r
+ mov eax, dword ptr [Operand + 0]\r
+ mov edx, dword ptr [Operand + 4]\r
+ shrd ebx, eax, cl\r
+ shrd eax, edx, cl\r
+ rol ebx, cl\r
+ shrd edx, ebx, cl\r
+ test cl, 32 // Count >= 32?\r
+ cmovnz ecx, eax\r
+ cmovnz eax, edx\r
+ cmovnz edx, ecx\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ 64-bit logical right shift function for IA-32\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathRShiftU64 (\r
+ IN UINT64 Operand,\r
+ IN UINTN Count\r
+ )\r
+{\r
+ _asm {\r
+ mov cl, byte ptr [Count]\r
+ xor edx, edx\r
+ mov eax, dword ptr [Operand + 4]\r
+ test cl, 32\r
+ cmovz edx, eax\r
+ cmovz eax, dword ptr [Operand + 0]\r
+ shrd eax, edx, cl\r
+ shr edx, cl\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadCr0 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadCr0 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ mov eax, cr0\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadCr2 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadCr2 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ mov eax, cr2\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadCr3 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadCr3 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ mov eax, cr3\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadCr4 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadCr4 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ _emit 0x0f // mov eax, cr4\r
+ _emit 0x20\r
+ _emit 0xE0\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadCs function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadCs (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ xor eax, eax\r
+ mov ax, cs\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadDr0 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr0 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ mov eax, dr0\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadDr1 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr1 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ mov eax, dr1\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadDr2 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr2 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ mov eax, dr2\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadDr3 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr3 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ mov eax, dr3\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadDr4 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr4 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ _emit 0x0f\r
+ _emit 0x21\r
+ _emit 0xe0\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadDr5 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr5 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ _emit 0x0f\r
+ _emit 0x21\r
+ _emit 0xe8\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadDr6 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr6 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ mov eax, dr6\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadDr7 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadDr7 (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ mov eax, dr7\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadDs function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadDs (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ xor eax, eax\r
+ mov ax, ds\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadEflags function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmReadEflags (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ pushfd\r
+ pop eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadEs function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadEs (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ xor eax, eax\r
+ mov ax, es\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadFs function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadFs (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ xor eax, eax\r
+ mov ax, fs\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadGdtr function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86ReadGdtr (\r
+ OUT IA32_DESCRIPTOR *Gdtr\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Gdtr\r
+ sgdt fword ptr [eax]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadGs function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadGs (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ xor eax, eax\r
+ mov ax, gs\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadIdtr function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86ReadIdtr (\r
+ OUT IA32_DESCRIPTOR *Idtr\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Idtr\r
+ sidt fword ptr [eax]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadLdtr function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadLdtr (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ sldt ax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadMm0 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm0 (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ push eax\r
+ push eax\r
+ movq [esp], mm0\r
+ pop eax\r
+ pop edx\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadMm1 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm1 (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ push eax\r
+ push eax\r
+ movq [esp], mm1\r
+ pop eax\r
+ pop edx\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadMm2 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm2 (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ push eax\r
+ push eax\r
+ movq [esp], mm2\r
+ pop eax\r
+ pop edx\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadMm3 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm3 (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ push eax\r
+ push eax\r
+ movq [esp], mm3\r
+ pop eax\r
+ pop edx\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadMm4 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm4 (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ push eax\r
+ push eax\r
+ movq [esp], mm4\r
+ pop eax\r
+ pop edx\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadMm5 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm5 (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ push eax\r
+ push eax\r
+ movq [esp], mm5\r
+ pop eax\r
+ pop edx\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadMm6 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm6 (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ push eax\r
+ push eax\r
+ movq [esp], mm6\r
+ pop eax\r
+ pop edx\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadMm7 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMm7 (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ push eax\r
+ push eax\r
+ movq [esp], mm7\r
+ pop eax\r
+ pop edx\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadMsr64 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadMsr64 (\r
+ IN UINT32 Index\r
+ )\r
+{\r
+ _asm {\r
+ mov ecx, Index\r
+ rdmsr\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadPmc function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadPmc (\r
+ IN UINT32 PmcIndex\r
+ )\r
+{\r
+ _asm {\r
+ mov ecx, PmcIndex\r
+ rdpmc\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadSs function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadSs (\r
+ VOID\r
+ )\r
+{\r
+ __asm {\r
+ xor eax, eax\r
+ mov ax, ss\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadTr function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT16\r
+EFIAPI\r
+AsmReadTr (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ str ax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmReadTsc function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmReadTsc (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ rdtsc\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ Implementation of SetJump() on IA-32.\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalAssertJumpBuffer (\r
+ IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer\r
+ );\r
+\r
+_declspec (naked)\r
+UINTN\r
+EFIAPI\r
+SetJump (\r
+ OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer\r
+ )\r
+{ \r
+ _asm {\r
+ push [esp + 4]\r
+ call InternalAssertJumpBuffer\r
+ pop ecx\r
+ pop ecx\r
+ mov edx, [esp]\r
+ mov [edx], ebx\r
+ mov [edx + 4], esi\r
+ mov [edx + 8], edi\r
+ mov [edx + 12], ebp\r
+ mov [edx + 16], esp\r
+ mov [edx + 20], ecx\r
+ xor eax, eax\r
+ jmp ecx\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ Implementation of 64-bit swap bytes\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+InternalMathSwapBytes64 (\r
+ IN UINT64 Operand\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, dword ptr [Operand + 4]\r
+ mov edx, dword ptr [Operand + 0]\r
+ bswap eax\r
+ bswap edx\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWbinvd function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWbinvd (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ wbinvd\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteCr0 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr0 (\r
+ UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ mov cr0, eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteCr2 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr2 (\r
+ UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ mov cr2, eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteCr3 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr3 (\r
+ UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ mov cr3, eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteCr4 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr4 (\r
+ UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ _emit 0x0f // mov cr4, eax\r
+ _emit 0x22\r
+ _emit 0xE0\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteDr0 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr0 (\r
+ IN UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ mov dr0, eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteDr1 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr1 (\r
+ IN UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ mov dr1, eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteDr2 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr2 (\r
+ IN UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ mov dr2, eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteDr3 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr3 (\r
+ IN UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ mov dr3, eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteDr4 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr4 (\r
+ IN UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ _emit 0x0f // mov dr4, eax\r
+ _emit 0x23\r
+ _emit 0xe0\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteDr5 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr5 (\r
+ IN UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ _emit 0x0f // mov dr5, eax\r
+ _emit 0x23\r
+ _emit 0xe8\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteDr6 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr6 (\r
+ IN UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ mov dr6, eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteDr7 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr7 (\r
+ IN UINTN Value\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Value\r
+ mov dr7, eax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteGdtr function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86WriteGdtr (\r
+ IN CONST IA32_DESCRIPTOR *Gdtr\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Gdtr\r
+ lgdt fword ptr [eax]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteIdtr function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+InternalX86WriteIdtr (\r
+ IN CONST IA32_DESCRIPTOR *Idtr\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, Idtr\r
+ lidt fword ptr [eax]\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteLdtr function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteLdtr (\r
+ IN UINT16 Ldtr\r
+ )\r
+{\r
+ _asm {\r
+ xor eax, eax\r
+ mov ax, Ldtr\r
+ lldt ax\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteMm0 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm0 (\r
+ IN UINT64 Value\r
+ )\r
+{\r
+ _asm {\r
+ movq mm0, qword ptr [Value]\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteMm1 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm1 (\r
+ IN UINT64 Value\r
+ )\r
+{\r
+ _asm {\r
+ movq mm1, qword ptr [Value]\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteMm2 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm2 (\r
+ IN UINT64 Value\r
+ )\r
+{\r
+ _asm {\r
+ movq mm2, qword ptr [Value]\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteMm3 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm3 (\r
+ IN UINT64 Value\r
+ )\r
+{\r
+ _asm {\r
+ movq mm3, qword ptr [Value]\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteMm4 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm4 (\r
+ IN UINT64 Value\r
+ )\r
+{\r
+ _asm {\r
+ movq mm4, qword ptr [Value]\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteMm5 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm5 (\r
+ IN UINT64 Value\r
+ )\r
+{\r
+ _asm {\r
+ movq mm5, qword ptr [Value]\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteMm6 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm6 (\r
+ IN UINT64 Value\r
+ )\r
+{\r
+ _asm {\r
+ movq mm6, qword ptr [Value]\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteMm7 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+VOID\r
+EFIAPI\r
+AsmWriteMm7 (\r
+ IN UINT64 Value\r
+ )\r
+{\r
+ _asm {\r
+ movq mm7, qword ptr [Value]\r
+ emms\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+ AsmWriteMsr64 function\r
+\r
+ Copyright (c) 2006, Intel Corporation<BR>\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+UINT64\r
+EFIAPI\r
+AsmWriteMsr64 (\r
+ IN UINT32 Index,\r
+ IN UINT64 Value\r
+ )\r
+{\r
+ _asm {\r
+ mov edx, dword ptr [Value + 4]\r
+ mov eax, dword ptr [Value + 0]\r
+ mov ecx, Index\r
+ wrmsr\r
+ }\r
+}\r
+\r
+#endif\r