]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/DisableCache.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / DisableCache.nasm
CommitLineData
b204f668
JJ
1;------------------------------------------------------------------------------\r
2;\r
3; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
9344f092 4; SPDX-License-Identifier: BSD-2-Clause-Patent\r
b204f668
JJ
5;\r
6; Module Name:\r
7;\r
8; DisableCache.Asm\r
9;\r
10; Abstract:\r
11;\r
12; Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a\r
13; WBINVD instruction.\r
14;\r
15; Notes:\r
16;\r
17;------------------------------------------------------------------------------\r
18\r
19 SECTION .text\r
20\r
21;------------------------------------------------------------------------------\r
22; VOID\r
23; EFIAPI\r
24; AsmDisableCache (\r
25; VOID\r
26; );\r
27;------------------------------------------------------------------------------\r
28global ASM_PFX(AsmDisableCache)\r
29ASM_PFX(AsmDisableCache):\r
30 mov eax, cr0\r
31 bts eax, 30\r
32 btr eax, 29\r
33 mov cr0, eax\r
34 wbinvd\r
35 ret\r
36\r