]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/X64/EnableCache.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / 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 DEFAULT REL
20 SECTION .text
21
22 ;------------------------------------------------------------------------------
23 ; VOID
24 ; EFIAPI
25 ; AsmEnableCache (
26 ; VOID
27 ; );
28 ;------------------------------------------------------------------------------
29 global ASM_PFX(AsmEnableCache)
30 ASM_PFX(AsmEnableCache):
31 wbinvd
32 mov rax, cr0
33 btr rax, 29
34 btr rax, 30
35 mov cr0, rax
36 ret
37