blob: 67b0fb40ec20459be63400dbc73d7b7dfc320022 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
/** @file
Header file for CPU Cache info Library.
Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef _CPU_CACHE_INFO_LIB_H_
#define _CPU_CACHE_INFO_LIB_H_
typedef struct {
//
// Package number.
//
UINT32 Package;
//
// Core type of logical processor.
// Value = CPUID.1Ah:EAX[31:24]
//
UINT8 CoreType;
//
// Level of the cache that this package's this type of logical processor corresponds to.
// Value = CPUID.04h:EAX[07:05]
//
UINT8 CacheLevel : 3;
//
// Type of the cache that this package's this type of logical processor corresponds to.
// Value = CPUID.04h:EAX[04:00]
//
UINT8 CacheType : 5;
//
// Ways of associativity.
// Value = CPUID.04h:EBX[31:22]
//
UINT16 CacheWays : 10;
//
// Fully associative cache.
// Value = CPUID.04h:EAX[09]
//
UINT16 FullyAssociativeCache : 1;
//
// Direct mapped cache.
// Value = CPUID.04h:EDX[02]
//
UINT16 DirectMappedCache : 1;
UINT16 Reserved : 4;
//
// Size of single cache that this package's this type of logical processor corresponds to.
// Value = (CPUID.04h:EBX[31:22] + 1) * (CPUID.04h:EBX[21:12] + 1) *
// (CPUID.04h:EBX[11:00] + 1) * (CPUID.04h:ECX[31:00] + 1)
//
UINT32 CacheSizeinKB;
//
// Number of the cache that this package's this type of logical processor corresponds to.
// Have subtracted the number of caches that are shared.
//
UINT16 CacheCount;
} CPU_CACHE_INFO;
/**
Get CpuCacheInfo data array.
@param[in, out] CpuCacheInfo Pointer to the CpuCacheInfo array.
@param[in, out] CpuCacheInfoCount As input, point to the length of response CpuCacheInfo array.
As output, point to the actual length of response CpuCacheInfo array.
@retval EFI_SUCCESS Function completed successfully.
@retval EFI_INVALID_PARAMETER CpuCacheInfoCount is NULL.
@retval EFI_INVALID_PARAMETER CpuCacheInfo is NULL while CpuCacheInfoCount contains the value
greater than zero.
@retval EFI_UNSUPPORTED Processor does not support CPUID_CACHE_PARAMS Leaf.
@retval EFI_OUT_OF_RESOURCES Required resources could not be allocated.
@retval EFI_BUFFER_TOO_SMALL CpuCacheInfoCount is too small to hold the response CpuCacheInfo
array. CpuCacheInfoCount has been updated with the length needed
to complete the request.
**/
EFI_STATUS
EFIAPI
GetCpuCacheInfo (
IN OUT CPU_CACHE_INFO *CpuCacheInfo,
IN OUT UINTN *CpuCacheInfoCount
);
#endif
|