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