X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseLib%2FIa32%2FFlushCacheLine.asm;h=a64f96bf7e5b75fdcd7f7b58009b39049241231b;hp=cef4a6d6d15bb488330e365eee9b3680a3530289;hb=881813d7a93d9009c873515b043c41c4554779e4;hpb=bb817c56c51fabe92915fe30b168b4833cb2aed9
diff --git a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.asm b/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.asm
index cef4a6d6d1..a64f96bf7e 100644
--- a/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.asm
+++ b/MdePkg/Library/BaseLib/Ia32/FlushCacheLine.asm
@@ -1,10 +1,10 @@
;------------------------------------------------------------------------------
;
-; Copyright (c) 2006, Intel Corporation. All rights reserved.
+; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php
+; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@@ -34,9 +34,20 @@
; );
;------------------------------------------------------------------------------
AsmFlushCacheLine PROC
+ ;
+ ; If the CPU does not support CLFLUSH instruction,
+ ; then promote flush range to flush entire cache.
+ ;
+ mov eax, 1
+ cpuid
mov eax, [esp + 4]
+ test edx, BIT19
+ jz @F
clflush [eax]
ret
+@@:
+ wbinvd
+ ret
AsmFlushCacheLine ENDP
END