]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/FlushCacheLine.nasm
8afd4cbdced73cb950536c365309ada388a7ede4
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / FlushCacheLine.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; FlushCacheLine.Asm
9 ;
10 ; Abstract:
11 ;
12 ; AsmFlushCacheLine function
13 ;
14 ; Notes:
15 ;
16 ;------------------------------------------------------------------------------
17
18 SECTION .text
19
20 ;------------------------------------------------------------------------------
21 ; VOID *
22 ; EFIAPI
23 ; AsmFlushCacheLine (
24 ; IN VOID *LinearAddress
25 ; );
26 ;------------------------------------------------------------------------------
27 global ASM_PFX(AsmFlushCacheLine)
28 ASM_PFX(AsmFlushCacheLine):
29 ;
30 ; If the CPU does not support CLFLUSH instruction,
31 ; then promote flush range to flush entire cache.
32 ;
33 mov eax, 1
34 push ebx
35 cpuid
36 pop ebx
37 mov eax, [esp + 4]
38 test edx, BIT19
39 jz .0
40 clflush [eax]
41 ret
42 .0:
43 wbinvd
44 ret
45