2 Header file for CPU Cache info Library.
4 Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _CPU_CACHE_INFO_LIB_H_
10 #define _CPU_CACHE_INFO_LIB_H_
18 // Core type of logical processor.
19 // Value = CPUID.1Ah:EAX[31:24]
23 // Level of the cache that this package's this type of logical processor corresponds to.
24 // Value = CPUID.04h:EAX[07:05]
28 // Type of the cache that this package's this type of logical processor corresponds to.
29 // Value = CPUID.04h:EAX[04:00]
33 // Ways of associativity.
34 // Value = CPUID.04h:EBX[31:22]
36 UINT16 CacheWays
: 10;
38 // Fully associative cache.
39 // Value = CPUID.04h:EAX[09]
41 UINT16 FullyAssociativeCache
: 1;
43 // Direct mapped cache.
44 // Value = CPUID.04h:EDX[02]
46 UINT16 DirectMappedCache
: 1;
49 // Size of single cache that this package's this type of logical processor corresponds to.
50 // Value = (CPUID.04h:EBX[31:22] + 1) * (CPUID.04h:EBX[21:12] + 1) *
51 // (CPUID.04h:EBX[11:00] + 1) * (CPUID.04h:ECX[31:00] + 1)
55 // Number of the cache that this package's this type of logical processor corresponds to.
56 // Have subtracted the number of caches that are shared.
62 Get CpuCacheInfo data array.
64 @param[in, out] CpuCacheInfo Pointer to the CpuCacheInfo array.
65 @param[in, out] CpuCacheInfoCount As input, point to the length of response CpuCacheInfo array.
66 As output, point to the actual length of response CpuCacheInfo array.
68 @retval EFI_SUCCESS Function completed successfully.
69 @retval EFI_INVALID_PARAMETER CpuCacheInfoCount is NULL.
70 @retval EFI_INVALID_PARAMETER CpuCacheInfo is NULL while CpuCacheInfoCount contains the value
72 @retval EFI_UNSUPPORTED Processor does not support CPUID_CACHE_PARAMS Leaf.
73 @retval EFI_OUT_OF_RESOURCES Required resources could not be allocated.
74 @retval EFI_BUFFER_TOO_SMALL CpuCacheInfoCount is too small to hold the response CpuCacheInfo
75 array. CpuCacheInfoCount has been updated with the length needed
76 to complete the request.
81 IN OUT CPU_CACHE_INFO
*CpuCacheInfo
,
82 IN OUT UINTN
*CpuCacheInfoCount