TianoCore EDK2 master
Loading...
Searching...
No Matches
CpuCacheInfoLib.c File Reference

Go to the source code of this file.

Functions

VOID CpuCacheInfoPrintCpuCacheInfoTable (IN CPU_CACHE_INFO *CpuCacheInfo, IN UINTN CpuCacheInfoCount)
 
INTN EFIAPI CpuCacheInfoCompare (IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
 
UINT32 CpuCacheInfoGetNumberOfPackages (IN CPUID_PROCESSOR_INFO *ProcessorInfo, IN UINTN NumberOfProcessors, IN OUT UINT32 *Package)
 
UINTN CpuCacheInfoGetNumberOfCoreTypePerPackage (IN CPUID_PROCESSOR_INFO *ProcessorInfo, IN UINTN NumberOfProcessors, IN UINTN Package)
 
VOID EFIAPI CpuCacheInfoCollectCoreAndCacheData (IN OUT VOID *Buffer)
 
EFI_STATUS CpuCacheInfoCollectCpuCacheInfoData (IN CPUID_CACHE_DATA *CacheData, IN CPUID_PROCESSOR_INFO *ProcessorInfo, IN UINTN NumberOfProcessors, IN OUT CPU_CACHE_INFO *CacheInfo, IN OUT UINTN *CacheInfoCount)
 
EFI_STATUS EFIAPI GetCpuCacheInfo (IN OUT CPU_CACHE_INFO *CpuCacheInfo, IN OUT UINTN *CpuCacheInfoCount)
 

Detailed Description

Provides cache info for each package, core type, cache level and cache type.

Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CpuCacheInfoLib.c.

Function Documentation

◆ CpuCacheInfoCollectCoreAndCacheData()

VOID EFIAPI CpuCacheInfoCollectCoreAndCacheData ( IN OUT VOID *  Buffer)

Collect core and cache information of calling processor via CPUID instructions.

Parameters
[in,out]BufferThe pointer to private data buffer.

Definition at line 204 of file CpuCacheInfoLib.c.

◆ CpuCacheInfoCollectCpuCacheInfoData()

EFI_STATUS CpuCacheInfoCollectCpuCacheInfoData ( IN CPUID_CACHE_DATA CacheData,
IN CPUID_PROCESSOR_INFO ProcessorInfo,
IN UINTN  NumberOfProcessors,
IN OUT CPU_CACHE_INFO CacheInfo,
IN OUT UINTN CacheInfoCount 
)

Collect CacheInfo data from the CacheData.

Parameters
[in]CacheDataPointer to the CacheData array.
[in]ProcessorInfoPointer to the ProcessorInfo array.
[in]NumberOfProcessorsTotal number of logical processors in the platform.
[in,out]CacheInfoPointer to the CacheInfo array.
[in,out]CacheInfoCountAs input, point to the length of response CacheInfo array. As output, point to the actual length of response CacheInfo array.
Return values
EFI_SUCCESSFunction completed successfully.
EFI_OUT_OF_RESOURCESRequired resources could not be allocated.
EFI_BUFFER_TOO_SMALLCacheInfoCount is too small to hold the response CacheInfo array. CacheInfoCount has been updated with the length needed to complete the request.

Definition at line 276 of file CpuCacheInfoLib.c.

◆ CpuCacheInfoCompare()

INTN EFIAPI CpuCacheInfoCompare ( IN CONST VOID *  Buffer1,
IN CONST VOID *  Buffer2 
)

Function to compare CPU package ID, core type, cache level and cache type for use in QuickSort.

Parameters
[in]Buffer1pointer to CPU_CACHE_INFO poiner to compare
[in]Buffer2pointer to second CPU_CACHE_INFO pointer to compare
Return values
0Buffer1 equal to Buffer2
1Buffer1 is greater than Buffer2
-1Buffer1 is less than Buffer2

Definition at line 62 of file CpuCacheInfoLib.c.

◆ CpuCacheInfoGetNumberOfCoreTypePerPackage()

UINTN CpuCacheInfoGetNumberOfCoreTypePerPackage ( IN CPUID_PROCESSOR_INFO ProcessorInfo,
IN UINTN  NumberOfProcessors,
IN UINTN  Package 
)

Get the number of CoreType of requested package.

Parameters
[in]ProcessorInfoPointer to the ProcessorInfo array.
[in]NumberOfProcessorsTotal number of logical processors in the platform.
[in]PackageThe requested package number.
Return values
Returnthe number of CoreType of requested package.

Definition at line 148 of file CpuCacheInfoLib.c.

◆ CpuCacheInfoGetNumberOfPackages()

UINT32 CpuCacheInfoGetNumberOfPackages ( IN CPUID_PROCESSOR_INFO ProcessorInfo,
IN UINTN  NumberOfProcessors,
IN OUT UINT32 *  Package 
)

Get the total number of package and package ID in the platform.

Parameters
[in]ProcessorInfoPointer to the ProcessorInfo array.
[in]NumberOfProcessorsTotal number of logical processors in the platform.
[in,out]PackagePointer to the Package array.
Return values
Returnthe total number of package and package ID in the platform.

Definition at line 101 of file CpuCacheInfoLib.c.

◆ CpuCacheInfoPrintCpuCacheInfoTable()

VOID CpuCacheInfoPrintCpuCacheInfoTable ( IN CPU_CACHE_INFO CpuCacheInfo,
IN UINTN  CpuCacheInfoCount 
)

Print CpuCacheInfo array.

Parameters
[in]CpuCacheInfoPointer to the CpuCacheInfo array.
[in]CpuCacheInfoCountThe length of CpuCacheInfo array.

Definition at line 19 of file CpuCacheInfoLib.c.

◆ GetCpuCacheInfo()

EFI_STATUS EFIAPI GetCpuCacheInfo ( IN OUT CPU_CACHE_INFO CpuCacheInfo,
IN OUT UINTN CpuCacheInfoCount 
)

Get CpuCacheInfo data array. The array is sorted by CPU package ID, core type, cache level and cache type.

Parameters
[in,out]CpuCacheInfoPointer to the CpuCacheInfo array.
[in,out]CpuCacheInfoCountAs input, point to the length of response CpuCacheInfo array. As output, point to the actual length of response CpuCacheInfo array.
Return values
EFI_SUCCESSFunction completed successfully.
EFI_INVALID_PARAMETERCpuCacheInfoCount is NULL.
EFI_INVALID_PARAMETERCpuCacheInfo is NULL while CpuCacheInfoCount contains the value greater than zero.
EFI_UNSUPPORTEDProcessor does not support CPUID_CACHE_PARAMS Leaf.
EFI_OUT_OF_RESOURCESRequired resources could not be allocated.
EFI_BUFFER_TOO_SMALLCpuCacheInfoCount is too small to hold the response CpuCacheInfo array. CpuCacheInfoCount has been updated with the length needed to complete the request.

Definition at line 420 of file CpuCacheInfoLib.c.