]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/EnableCache.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / EnableCache.c
CommitLineData
9f4f2f0e 1/** @file\r
2 AsmEnableCache function\r
3\r
bb817c56 4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
9f4f2f0e 6\r
7**/\r
8\r
9/**\r
be5f1614 10 Perform a WBINVD and clear both the CD and NW bits of CR0.\r
9f4f2f0e 11\r
be5f1614 12 Enables the caches by executing a WBINVD instruction and then clear both the CD and NW\r
13 bits of CR0 to 0. This function is only available on IA-32 and x64.\r
9f4f2f0e 14\r
15**/\r
16VOID\r
17EFIAPI\r
18AsmEnableCache (\r
19 VOID\r
20 )\r
21{\r
22 _asm {\r
23 wbinvd\r
24 mov eax, cr0\r
25 btr eax, 30\r
26 btr eax, 29\r
27 mov cr0, eax\r
28 }\r
29}\r
30\r