]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFspPkg/Include/Library/CacheLib.h
Add IntelFspPkg to support create FSP bin based on EDKII.
[mirror_edk2.git] / IntelFspPkg / Include / Library / CacheLib.h
1 /** @file
2
3 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php.
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 **/
13
14 #ifndef _CACHE_LIB_H_
15 #define _CACHE_LIB_H_
16
17 //
18 // EFI_MEMORY_CACHE_TYPE
19 //
20 typedef INT32 EFI_MEMORY_CACHE_TYPE;
21
22 #define EFI_CACHE_UNCACHEABLE 0
23 #define EFI_CACHE_WRITECOMBINING 1
24 #define EFI_CACHE_WRITETHROUGH 4
25 #define EFI_CACHE_WRITEPROTECTED 5
26 #define EFI_CACHE_WRITEBACK 6
27
28 /**
29 Reset all the MTRRs to a known state.
30
31 @retval EFI_SUCCESS All MTRRs have been reset successfully.
32
33 **/
34 EFI_STATUS
35 EFIAPI
36 ResetCacheAttributes (
37 VOID
38 );
39
40 /**
41 Given the memory range and cache type, programs the MTRRs.
42
43 @param[in] MemoryAddress Base Address of Memory to program MTRR.
44 @param[in] MemoryLength Length of Memory to program MTRR.
45 @param[in] MemoryCacheType Cache Type.
46
47 @retval EFI_SUCCESS Mtrr are set successfully.
48 @retval EFI_LOAD_ERROR No empty MTRRs to use.
49 @retval EFI_INVALID_PARAMETER The input parameter is not valid.
50 @retval others An error occurs when setting MTTR.
51
52 **/
53 EFI_STATUS
54 EFIAPI
55 SetCacheAttributes (
56 IN EFI_PHYSICAL_ADDRESS MemoryAddress,
57 IN UINT64 MemoryLength,
58 IN EFI_MEMORY_CACHE_TYPE MemoryCacheType
59 );
60
61 #endif
62