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