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