Ia32/ARShiftU64.c | MSFT \r
Ia32/Thunk16.asm | MSFT\r
Ia32/EnablePaging64.asm | MSFT\r
+ Ia32/EnableCache.c | MSFT\r
+ Ia32/DisableCache.c | MSFT\r
SynchronizationMsc.c | MSFT\r
\r
Ia32/Wbinvd.asm | INTEL \r
Ia32/ARShiftU64.asm | INTEL \r
Ia32/Thunk16.asm | INTEL\r
Ia32/EnablePaging64.asm | INTEL\r
+ Ia32/EnableCache.asm | INTEL\r
+ Ia32/DisableCache.asm | INTEL\r
Synchronization.c | INTEL\r
\r
Ia32/Thunk16.S | GCC \r
Ia32/ARShiftU64.S | GCC \r
Ia32/RShiftU64.S | GCC \r
Ia32/LShiftU64.S | GCC \r
+ Ia32/EnableCache.S | GCC\r
+ Ia32/DisableCache.S | GCC\r
SynchronizationGcc.c | GCC\r
\r
Ia32/DivS64x64Remainder.c\r
X64/SwitchStack.asm\r
X64/InterlockedCompareExchange64.asm \r
X64/InterlockedCompareExchange32.asm \r
+ X64/EnableCache.asm\r
+ X64/DisableCache.asm\r
\r
X64/InterlockedDecrement.c | MSFT \r
X64/InterlockedIncrement.c | MSFT \r
X64/CpuIdEx.S | GCC \r
X64/CpuBreakpoint.S | GCC \r
SynchronizationGcc.c | GCC \r
+ X64/EnableCache.S | GCC\r
+ X64/DisableCache.S | GCC\r
ChkStkGcc.c | GCC \r
\r
[Sources.IPF]\r
--- /dev/null
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006 - 2008, Intel Corporation\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
+# Module Name:\r
+#\r
+# DisableCache.S\r
+#\r
+# Abstract:\r
+#\r
+# Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a\r
+# WBINVD instruction.\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EFIAPI\r
+# AsmDisableCache (\r
+# VOID\r
+# );\r
+#------------------------------------------------------------------------------\r
+.globl ASM_PFX(AsmDisableCache)\r
+ASM_PFX(AsmDisableCache):\r
+ movl %cr0, %eax\r
+ btsl $30, %eax\r
+ btrl $29, %eax\r
+ movl %eax, %cr0\r
+ wbinvd\r
+ ret\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+; DisableCache.Asm\r
+;\r
+; Abstract:\r
+;\r
+; Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a\r
+; WBINVD instruction.\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .386p\r
+ .model flat,C\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmDisableCache (\r
+; VOID\r
+; );\r
+;------------------------------------------------------------------------------\r
+AsmDisableCache PROC\r
+ mov eax, cr0\r
+ bts eax, 30\r
+ btr eax, 29\r
+ mov cr0, eax\r
+ wbinvd\r
+ ret\r
+AsmDisableCache ENDP\r
+\r
+ END\r
--- /dev/null
+/** @file\r
+ AsmDisableCache function\r
+\r
+ Copyright (c) 2006 - 2008, 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
+/**\r
+ Disables caches.\r
+\r
+ Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a\r
+ WBINVD instruction.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmDisableCache (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ mov eax, cr0\r
+ bts eax, 30\r
+ btr eax, 29\r
+ mov cr0, eax\r
+ wbinvd\r
+ }\r
+}\r
+\r
--- /dev/null
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006 - 2008, Intel Corporation\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
+# Module Name:\r
+#\r
+# EnableCache.S\r
+#\r
+# Abstract:\r
+#\r
+# Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear \r
+# the NW bit of CR0 to 0\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EFIAPI\r
+# AsmEnableCache (\r
+# VOID\r
+# );\r
+#------------------------------------------------------------------------------\r
+.globl ASM_PFX(AsmEnableCache)\r
+ASM_PFX(AsmEnableCache):\r
+ wbinvd\r
+ movl %cr0, %eax\r
+ btrl $30, %eax\r
+ btrl $29, %eax\r
+ movl %eax, %cr0\r
+ ret\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+; EnableCache.Asm\r
+;\r
+; Abstract:\r
+;\r
+; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear \r
+; the NW bit of CR0 to 0\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .386p\r
+ .model flat,C\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmEnableCache (\r
+; VOID\r
+; );\r
+;------------------------------------------------------------------------------\r
+AsmEnableCache PROC\r
+ wbinvd\r
+ mov eax, cr0\r
+ btr eax, 29\r
+ btr eax, 30\r
+ mov cr0, eax\r
+ ret\r
+AsmEnableCache ENDP\r
+\r
+ END\r
--- /dev/null
+/** @file\r
+ AsmEnableCache function\r
+\r
+ Copyright (c) 2006 - 2008, 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
+/**\r
+ Enabled caches.\r
+\r
+ Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear \r
+ the NW bit of CR0 to 0\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmEnableCache (\r
+ VOID\r
+ )\r
+{\r
+ _asm {\r
+ wbinvd\r
+ mov eax, cr0\r
+ btr eax, 30\r
+ btr eax, 29\r
+ mov cr0, eax\r
+ }\r
+}\r
+\r
--- /dev/null
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006 - 2008, Intel Corporation\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
+# Module Name:\r
+#\r
+# DisableCache.S\r
+#\r
+# Abstract:\r
+#\r
+# Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a\r
+# WBINVD instruction.\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EFIAPI\r
+# AsmDisableCache (\r
+# VOID\r
+# );\r
+#------------------------------------------------------------------------------\r
+.globl ASM_PFX(AsmDisableCache)\r
+ASM_PFX(AsmDisableCache):\r
+ movl %cr0, %rax\r
+ btsl $30, %rax\r
+ btrl $29, %rax\r
+ movl %rax, %cr0\r
+ wbinvd\r
+ ret\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+; DisableCache.Asm\r
+;\r
+; Abstract:\r
+;\r
+; Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a\r
+; WBINVD instruction.\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmDisableCache (\r
+; VOID\r
+; );\r
+;------------------------------------------------------------------------------\r
+AsmDisableCache PROC\r
+ mov rax, cr0\r
+ bts rax, 30\r
+ btr rax, 29\r
+ mov cr0, rax\r
+ wbinvd\r
+ ret\r
+AsmDisableCache ENDP\r
+\r
+ END\r
--- /dev/null
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006 - 2008, Intel Corporation\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
+# Module Name:\r
+#\r
+# EnableCache.S\r
+#\r
+# Abstract:\r
+#\r
+# Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear \r
+# the NW bit of CR0 to 0\r
+#\r
+# Notes:\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+#------------------------------------------------------------------------------\r
+# VOID\r
+# EFIAPI\r
+# AsmEnableCache (\r
+# VOID\r
+# );\r
+#------------------------------------------------------------------------------\r
+.globl ASM_PFX(AsmEnableCache)\r
+ASM_PFX(AsmEnableCache):\r
+ wbinvd\r
+ movl %cr0, %rax\r
+ btrl $30, %rax\r
+ btrl $29, %rax\r
+ movl %rax, %cr0\r
+ ret\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation\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
+; Module Name:\r
+;\r
+; EnableCache.Asm\r
+;\r
+; Abstract:\r
+;\r
+; Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear \r
+; the NW bit of CR0 to 0\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmEnableCache (\r
+; VOID\r
+; );\r
+;------------------------------------------------------------------------------\r
+AsmEnableCache PROC\r
+ wbinvd\r
+ mov rax, cr0\r
+ btr rax, 29\r
+ btr rax, 30\r
+ mov cr0, rax\r
+ ret\r
+AsmEnableCache ENDP\r
+\r
+ END\r