]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/FlushCacheLine.c
Code Scrub for MdePkg.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / FlushCacheLine.c
1 /** @file
2 AsmFlushCacheLine function
3
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 //
16 // Include common header file for this module.
17 //
18
19
20 /**
21 Flushes a cache line from all the instruction and data caches within the
22 coherency domain of the CPU.
23
24 Flushed the cache line specified by LinearAddress, and returns LinearAddress.
25 This function is only available on IA-32 and X64.
26
27 @param LinearAddress The address of the cache line to flush. If the CPU is
28 in a physical addressing mode, then LinearAddress is a
29 physical address. If the CPU is in a virtual
30 addressing mode, then LinearAddress is a virtual
31 address.
32
33 @return LinearAddress
34 **/
35 VOID *
36 EFIAPI
37 AsmFlushCacheLine (
38 IN VOID *LinearAddress
39 )
40 {
41 _asm {
42 mov eax, LinearAddress
43 clflush [eax]
44 }
45 }
46