ReactOS 0.4.17-dev-1133-gc25e4fd
cacheinfo.c File Reference
#include <ntoskrnl.h>
#include <x86x64/Cpuid.h>
#include <debug.h>
Include dependency graph for cacheinfo.c:

Go to the source code of this file.

Classes

struct  INTEL_CACHE_DESCRIPTOR
 

Macros

#define NDEBUG
 

Functions

 C_ASSERT (sizeof(INTEL_CACHE_DESCRIPTOR)==6)
 
static const INTEL_CACHE_DESCRIPTOR * FindIntelCacheDescriptor (_In_ UCHAR DescriptorCode)
 Finds the cache descriptor for the given descriptor value.
 
static ULONG GetCacheInfoIntelLeaf2 (_Out_cap_(MaxCount) PCACHE_DESCRIPTOR CacheDescriptors, _In_ ULONG MaxCount)
 Retrieves cache information using CPUID leaf 2 for Intel processors.
 
static ULONG GetCacheInfoAmdLegacy (_Out_cap_(MaxCount) PCACHE_DESCRIPTOR CacheDescriptors, _In_ ULONG MaxCount)
 Retrieves cache information for legacy AMD processors.
 
static ULONG KiGetCacheInfoModern (_Out_cap_(MaxCount) PCACHE_DESCRIPTOR CacheDescriptors, _In_ ULONG MaxCount, _In_ ULONG CpuIdLeaf)
 Retrieves cache information for modern Intel/AMD processors.
 
static ULONG NormalizeCacheDescriptors (_Inout_updates_(MaxCount) PCACHE_DESCRIPTOR CacheDescriptors, _In_ ULONG CacheCount, _In_ ULONG MaxCount)
 Normalizes the cache descriptors by removing duplicates and sorting them.
 
ULONG NTAPI KiGetCpuCacheDescriptors (_Out_writes_(MaxCount) PCACHE_DESCRIPTOR CacheDescriptors, _In_ ULONG MaxCount, _In_ CPU_VENDORS Vendor)
 Retrieves cache descriptors for the current CPU.
 

Variables

static const INTEL_CACHE_DESCRIPTOR IntelCacheDescriptors []
 Table of known Intel cache descriptors, as defined in the Intel SDM.
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file cacheinfo.c.

Function Documentation

◆ C_ASSERT()

C_ASSERT ( sizeof(INTEL_CACHE_DESCRIPTOR)  = =6)

◆ FindIntelCacheDescriptor()

static const INTEL_CACHE_DESCRIPTOR * FindIntelCacheDescriptor ( _In_ UCHAR  DescriptorCode)
static

Finds the cache descriptor for the given descriptor value.

Parameters
[in]DescriptorCode- The cache descriptor code to find
Returns
A pointer to the INTEL_CACHE_DESCRIPTOR structure if found, or NULL if not found.

Definition at line 168 of file cacheinfo.c.

169{
170 ULONG Low = 0;
172
173 while (Low < High)
174 {
175 ULONG Mid = Low + (High - Low) / 2;
176 const INTEL_CACHE_DESCRIPTOR* CacheDesc = &IntelCacheDescriptors[Mid];
177 if (DescriptorCode < CacheDesc->Code)
178 {
179 High = Mid;
180 }
181 else if (DescriptorCode > CacheDesc->Code)
182 {
183 Low = Mid + 1;
184 }
185 else
186 {
187 return CacheDesc;
188 }
189 }
190
191 return NULL;
192}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
static const INTEL_CACHE_DESCRIPTOR IntelCacheDescriptors[]
Table of known Intel cache descriptors, as defined in the Intel SDM.
Definition: cacheinfo.c:39
#define NULL
Definition: types.h:112
@ High
Definition: strmini.h:378
@ Low
Definition: strmini.h:380
uint32_t ULONG
Definition: typedefs.h:59
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
Definition: wdfdevice.h:1707

Referenced by GetCacheInfoIntelLeaf2().

◆ GetCacheInfoAmdLegacy()

static ULONG GetCacheInfoAmdLegacy ( _Out_cap_(MaxCount) PCACHE_DESCRIPTOR  CacheDescriptors,
_In_ ULONG  MaxCount 
)
static

Retrieves cache information for legacy AMD processors.

Parameters
[out]CacheDescriptors- An array to receive cache descriptors
[in]MaxCount- The maximum number of cache descriptors to fill
Returns
The number of cache descriptors filled
See also

Definition at line 281 of file cacheinfo.c.

284{
285 CPUID_L1_TLB_INFO_REGS L1TlbInfo;
287 ULONG Count = 0;
288 static const UCHAR AssocMap[16] =
289 {
290 0, 1, 2, 0, 4, 0, 8, 0, 16, 0, 32, 48, 64, 96, 128, 0xFF
291 };
292
294
295 /* L1 data cache */
296 if ((L1TlbInfo.Amd.Ecx.Bits.L1DcSize != 0) && (Count < MaxCount))
297 {
298 CacheDescriptors[Count].Level = 1;
299 CacheDescriptors[Count].Type = CacheData;
300 CacheDescriptors[Count].Size = L1TlbInfo.Amd.Ecx.Bits.L1DcSize * 1024;
301 CacheDescriptors[Count].Associativity = L1TlbInfo.Amd.Ecx.Bits.L1DcAssoc;
302 CacheDescriptors[Count].LineSize = L1TlbInfo.Amd.Ecx.Bits.L1DcLineSize;
303 Count++;
304 }
305
306 /* L1 instruction cache */
307 if ((L1TlbInfo.Amd.Edx.Bits.L1IcSize != 0) && (Count < MaxCount))
308 {
309 CacheDescriptors[Count].Level = 1;
310 CacheDescriptors[Count].Type = CacheInstruction;
311 CacheDescriptors[Count].Size = L1TlbInfo.Amd.Edx.Bits.L1IcSize * 1024;
312 CacheDescriptors[Count].Associativity = L1TlbInfo.Amd.Edx.Bits.L1IcAssoc;
313 CacheDescriptors[Count].LineSize = L1TlbInfo.Amd.Edx.Bits.L1IcLineSize;
314 Count++;
315 }
316
318
319 /* L2 unified cache (Assoc 9 means look at leaf 0x8000001D) */
320 if ((CacheInfoRegs.Ecx.Bits.L2Size != 0) && (CacheInfoRegs.Ecx.Bits.L2Assoc != 9) && (Count < MaxCount))
321 {
322 CacheDescriptors[Count].Level = 2;
323 CacheDescriptors[Count].Type = CacheUnified;
324 CacheDescriptors[Count].Size = CacheInfoRegs.Ecx.Bits.L2Size * 1024;
325 CacheDescriptors[Count].Associativity = AssocMap[CacheInfoRegs.Ecx.Bits.L2Assoc];
326 CacheDescriptors[Count].LineSize = CacheInfoRegs.Ecx.Bits.L2LineSize;
327 Count++;
328 }
329
330 /* L3 unified cache (Assoc 9 means look at leaf 0x8000001D) */
331 if ((CacheInfoRegs.Edx.Bits.L3Size != 0) && (CacheInfoRegs.Edx.Bits.L3Assoc != 9) && (Count < MaxCount))
332 {
333 CacheDescriptors[Count].Level = 3;
334 CacheDescriptors[Count].Type = CacheUnified;
335 CacheDescriptors[Count].Size = CacheInfoRegs.Edx.Bits.L3Size * 512 * 1024;
336 CacheDescriptors[Count].Associativity = AssocMap[CacheInfoRegs.Edx.Bits.L3Assoc];
337 CacheDescriptors[Count].LineSize = CacheInfoRegs.Edx.Bits.L3LineSize;
338 Count++;
339 }
340
341 return Count;
342}
#define CPUID_L1_TLB_INFO
Definition: Cpuid.h:180
#define CPUID_EXTENDED_CACHE_INFO
Definition: Cpuid.h:3998
PPC_QUAL void __cpuid(int CPUInfo[], const int InfoType)
Definition: intrin_ppc.h:682
int Count
Definition: noreturn.cpp:7
unsigned char UCHAR
Definition: typedefs.h:53
struct CPUID_AMD_EXTENDED_CACHE_INFO_ECX::@4435 Bits
struct CPUID_AMD_EXTENDED_CACHE_INFO_EDX::@4436 Bits
CPUID_AMD_EXTENDED_CACHE_INFO_EDX Edx
Definition: Cpuid.h:317
CPUID_AMD_EXTENDED_CACHE_INFO_ECX Ecx
Definition: Cpuid.h:316
struct CPUID_L1_TLB_INFO_REGS::@4431 Amd
INT32 AsInt32[4]
Definition: Cpuid.h:233
@ CacheInstruction
Definition: ketypes.h:45
@ CacheUnified
Definition: ketypes.h:44
@ CacheData
Definition: ketypes.h:46

Referenced by KiGetCpuCacheDescriptors().

◆ GetCacheInfoIntelLeaf2()

static ULONG GetCacheInfoIntelLeaf2 ( _Out_cap_(MaxCount) PCACHE_DESCRIPTOR  CacheDescriptors,
_In_ ULONG  MaxCount 
)
static

Retrieves cache information using CPUID leaf 2 for Intel processors.

Parameters
[out]CacheDescriptors- An array to receive the cache descriptors
[in]MaxCount- The maximum number of cache descriptors to fill
Returns
The number of cache descriptors retrieved.

\See "Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 1: Basic Architecture"

  • "Table 21-12. Encoding of CPUID Leaf 2 Descriptors"

Definition at line 207 of file cacheinfo.c.

210{
211 CPUID_CACHE_INFO_REGS CacheInfoRegs;
212 ULONG Passes, Pass, Reg, Byte;
213 ULONG Count = 0;
214
215 /* Query the cache info. The number of passes is stored in EAX[7..0] */
216 __cpuid(CacheInfoRegs.AsInt32, CPUID_CACHE_INFO);
217 Passes = CacheInfoRegs.Eax.CacheDescriptor[0];
218
219 /* Now loop through each pass. Every CPUID call gives the next chunk
220 of information. After n passes we have all info. The order is not
221 deterministic. */
222 for (Pass = 0; Pass < Passes; Pass++)
223 {
224 /* Query the information for the next pass */
225 __cpuid(CacheInfoRegs.AsInt32, CPUID_CACHE_INFO);
226
227 /* Loop through each register in the cache info */
228 for (Reg = 0; Reg < ARRAYSIZE(CacheInfoRegs.Regs); Reg++)
229 {
230 const CPUID_CACHE_INFO_CACHE_TLB *CpuidReg = &CacheInfoRegs.Regs[Reg];
231
232 if (CpuidReg->Bits.NotValid)
233 continue;
234
235 /* Loop through each byte in the register. For EAX we need to skip the first. */
236 for (Byte = (Reg == 0) ? 1 : 0; Byte < 4; Byte++)
237 {
238 const INTEL_CACHE_DESCRIPTOR* IntelCacheDesc;
239 UCHAR DescriptorCode = CpuidReg->CacheDescriptor[Byte];
240 if (DescriptorCode == 0)
241 continue;
242
243 IntelCacheDesc = FindIntelCacheDescriptor(DescriptorCode);
244 if (IntelCacheDesc != NULL)
245 {
246 /* Make sure there is enough space in the array */
247 if (Count >= MaxCount)
248 {
249 return Count;
250 }
251
252 CacheDescriptors[Count].Level = IntelCacheDesc->Level;
253 CacheDescriptors[Count].Associativity = IntelCacheDesc->Associativity;
254 CacheDescriptors[Count].LineSize = IntelCacheDesc->LineSize;
255 CacheDescriptors[Count].Size = IntelCacheDesc->SizeinKB * 1024;
256 CacheDescriptors[Count].Type = IntelCacheDesc->Type;
257 Count++;
258 }
259 }
260 }
261 }
262
263 return Count;
264}
#define CPUID_CACHE_INFO
Definition: Cpuid.h:710
static const INTEL_CACHE_DESCRIPTOR * FindIntelCacheDescriptor(_In_ UCHAR DescriptorCode)
Finds the cache descriptor for the given descriptor value.
Definition: cacheinfo.c:168
#define ARRAYSIZE(a)
Definition: cat.c:25
unsigned char Byte
Definition: zlib.h:37
static struct proto Pass[]
Definition: mkg3states.c:56
struct CPUID_CACHE_INFO_CACHE_TLB::@4514 Bits
UINT8 CacheDescriptor[4]
Definition: Cpuid.h:731
CPUID_CACHE_INFO_CACHE_TLB Eax
Definition: Cpuid.h:43
CPUID_CACHE_INFO_CACHE_TLB Regs[4]
Definition: Cpuid.h:48
INT32 AsInt32[4]
Definition: Cpuid.h:40

Referenced by KiGetCpuCacheDescriptors().

◆ KiGetCacheInfoModern()

static ULONG KiGetCacheInfoModern ( _Out_cap_(MaxCount) PCACHE_DESCRIPTOR  CacheDescriptors,
_In_ ULONG  MaxCount,
_In_ ULONG  CpuIdLeaf 
)
static

Retrieves cache information for modern Intel/AMD processors.

Parameters
[out]CacheDescriptors- An array to receive cache descriptors
[in]MaxCount- The maximum number of cache descriptors to fill
[in]CpuIdLeaf- The CPUID leaf to use (0x04 for Intel, 0x8000001D for AMD)
Returns
The number of cache descriptors filled

Definition at line 355 of file cacheinfo.c.

359{
361 ULONG Subleaf;
362 ULONG Count;
363
364 Count = 0;
365
366 /* Iterate through subleaves, bail out at 32 or when all descriptors are filled */
367 for (Subleaf = 0; (Subleaf < 32) && (Count < MaxCount); Subleaf++)
368 {
369 __cpuidex(Regs.AsInt32, CpuIdLeaf, Subleaf);
370
371 switch (Regs.Eax.Bits.CacheType)
372 {
374 CacheDescriptors[Count].Type = CacheData;
375 break;
376
378 CacheDescriptors[Count].Type = CacheInstruction;
379 break;
380
382 CacheDescriptors[Count].Type = CacheUnified;
383 break;
384
386 return Count;
387
388 default:
389 continue;
390 }
391
392 if (Regs.Eax.Bits.FullyAssociativeCache)
393 {
394 CacheDescriptors[Count].Associativity = 0xFF;
395 }
396 else
397 {
398 ULONG Ways = Regs.Ebx.Bits.Ways + 1;
399 CacheDescriptors[Count].Associativity = (Ways > 0xFE) ? 0xFE : (UCHAR)Ways;
400 }
401
402 CacheDescriptors[Count].Level = (UCHAR)Regs.Eax.Bits.CacheLevel;
403 CacheDescriptors[Count].LineSize = (USHORT)(Regs.Ebx.Bits.LineSize + 1);
404 CacheDescriptors[Count].Size = (Regs.Ebx.Bits.Ways + 1) *
405 (Regs.Ebx.Bits.LinePartitions + 1) *
406 (Regs.Ebx.Bits.LineSize + 1) *
407 (Regs.NumberOfSets + 1);
408 Count++;
409 }
410
411 return Count;
412}
#define CPUID_CACHE_PARAMS_CACHE_TYPE_UNIFIED
Definition: Cpuid.h:869
#define CPUID_CACHE_PARAMS_CACHE_TYPE_NULL
Definition: Cpuid.h:866
#define CPUID_CACHE_PARAMS_CACHE_TYPE_INSTRUCTION
Definition: Cpuid.h:868
#define CPUID_CACHE_PARAMS_CACHE_TYPE_DATA
Definition: Cpuid.h:867
__INTRIN_INLINE void __cpuidex(int CPUInfo[4], int InfoType, int ECXValue)
Definition: intrin_x86.h:1680
unsigned short USHORT
Definition: pedump.c:61
struct CPUID_CACHE_PARAMS_EAX::@4515 Bits
struct CPUID_CACHE_PARAMS_EBX::@4516 Bits
INT32 AsInt32[4]
Definition: Cpuid.h:54
CPUID_CACHE_PARAMS_EBX Ebx
Definition: Cpuid.h:58
CPUID_CACHE_PARAMS_EAX Eax
Definition: Cpuid.h:57

Referenced by KiGetCpuCacheDescriptors().

◆ KiGetCpuCacheDescriptors()

ULONG NTAPI KiGetCpuCacheDescriptors ( _Out_writes_(MaxCount) PCACHE_DESCRIPTOR  CacheDescriptors,
_In_ ULONG  MaxCount,
_In_ CPU_VENDORS  Vendor 
)

Retrieves cache descriptors for the current CPU.

Parameters
[out]CacheDescriptors- An array to receive the cache descriptors
[in]MaxCount- The maximum number of cache descriptors to fill
[in]Vendor- The CPU vendor
Returns
The number of cache descriptors retrieved

Definition at line 484 of file cacheinfo.c.

488{
490 CPUID_EXTENDED_FUNCTION_REGS ExtendedFunction;
491 ULONG Count = 0;
492
493 /* Get the maximum leaf and maximum extended leaf */
495 __cpuid(ExtendedFunction.AsInt32, CPUID_EXTENDED_FUNCTION);
496
497 /* Distinguish by vendor: AMD (and Hygon) have their own custom cpuid leaves. */
498 if (Vendor == CPU_AMD)
499 {
500 if (ExtendedFunction.MaxLeaf >= CPUID_CACHE_PARAMS_AMD)
501 {
502 Count = KiGetCacheInfoModern(CacheDescriptors, MaxCount, CPUID_CACHE_PARAMS_AMD);
503 }
504
505 if ((Count == 0) && (ExtendedFunction.MaxLeaf >= CPUID_EXTENDED_CACHE_INFO))
506 {
507 Count = GetCacheInfoAmdLegacy(CacheDescriptors, MaxCount);
508 }
509 }
510 else
511 {
512 if (Signature.MaxLeaf >= CPUID_CACHE_PARAMS)
513 {
514 Count = KiGetCacheInfoModern(CacheDescriptors, MaxCount, CPUID_CACHE_PARAMS);
515 }
516
517 if ((Count == 0) && (Signature.MaxLeaf >= CPUID_CACHE_INFO))
518 {
519 Count = GetCacheInfoIntelLeaf2(CacheDescriptors, MaxCount);
520 }
521 }
522
523 /* Normalize the descriptors */
524 Count = NormalizeCacheDescriptors(CacheDescriptors, Count, MaxCount);
525
526 return Count;
527}
#define CPUID_CACHE_PARAMS_AMD
Definition: Cpuid.h:393
#define CPUID_EXTENDED_FUNCTION
Definition: Cpuid.h:3802
#define CPUID_SIGNATURE
Definition: Cpuid.h:45
#define CPUID_CACHE_PARAMS
Definition: Cpuid.h:802
static ULONG NormalizeCacheDescriptors(_Inout_updates_(MaxCount) PCACHE_DESCRIPTOR CacheDescriptors, _In_ ULONG CacheCount, _In_ ULONG MaxCount)
Normalizes the cache descriptors by removing duplicates and sorting them.
Definition: cacheinfo.c:425
static ULONG GetCacheInfoIntelLeaf2(_Out_cap_(MaxCount) PCACHE_DESCRIPTOR CacheDescriptors, _In_ ULONG MaxCount)
Retrieves cache information using CPUID leaf 2 for Intel processors.
Definition: cacheinfo.c:207
static ULONG KiGetCacheInfoModern(_Out_cap_(MaxCount) PCACHE_DESCRIPTOR CacheDescriptors, _In_ ULONG MaxCount, _In_ ULONG CpuIdLeaf)
Retrieves cache information for modern Intel/AMD processors.
Definition: cacheinfo.c:355
static ULONG GetCacheInfoAmdLegacy(_Out_cap_(MaxCount) PCACHE_DESCRIPTOR CacheDescriptors, _In_ ULONG MaxCount)
Retrieves cache information for legacy AMD processors.
Definition: cacheinfo.c:281
static const WCHAR Signature[]
Definition: parser.c:141
@ CPU_AMD
Definition: ketypes.h:99

Referenced by KiGetCacheInformation().

◆ NormalizeCacheDescriptors()

static ULONG NormalizeCacheDescriptors ( _Inout_updates_(MaxCount) PCACHE_DESCRIPTOR  CacheDescriptors,
_In_ ULONG  CacheCount,
_In_ ULONG  MaxCount 
)
static

Normalizes the cache descriptors by removing duplicates and sorting them.

Parameters
[in,out]CacheDescriptors- An array of cache descriptors
[in]CacheCount- The number of cache descriptors
[in]MaxCount- The maximum number of cache descriptors to fill
Returns
The number of valid cache descriptors after normalization

Definition at line 425 of file cacheinfo.c.

429{
430 ULONG l, r, i;
431 ULONG NewCount = 0;
432
433 /* Sort the array */
434 for (l = 0; l < CacheCount; l++)
435 {
436 for (r = l + 1; r < CacheCount; r++)
437 {
438 /* Sort order: 1. Level (ascending), 2. Type (enum value, descending) */
439 if ((CacheDescriptors[l].Level > CacheDescriptors[r].Level) ||
440 ((CacheDescriptors[l].Level == CacheDescriptors[r].Level) &&
441 (CacheDescriptors[l].Type < CacheDescriptors[r].Type)))
442 {
443 CACHE_DESCRIPTOR Temp = CacheDescriptors[l];
444 CacheDescriptors[l] = CacheDescriptors[r];
445 CacheDescriptors[r] = Temp;
446 }
447 }
448 }
449
450 /* Remove duplicates */
451 if (CacheCount > 0)
452 {
453 CacheDescriptors[0] = CacheDescriptors[0];
454 NewCount = 1;
455 for (i = 1; i < CacheCount; i++)
456 {
457 if ((CacheDescriptors[i].Level != CacheDescriptors[i - 1].Level) ||
458 (CacheDescriptors[i].Type != CacheDescriptors[i - 1].Type))
459 {
460 CacheDescriptors[NewCount] = CacheDescriptors[i];
461 NewCount++;
462 }
463 }
464 }
465
466 /* Clear stray entries */
467 RtlZeroMemory(&CacheDescriptors[NewCount],
468 sizeof(CACHE_DESCRIPTOR) * (MaxCount - NewCount));
469
470 return NewCount;
471}
Type
Definition: Type.h:7
r l[0]
Definition: byte_order.h:168
_In_ ULONG _In_ UCHAR Level
Definition: dispmprt.h:1329
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

Referenced by KiGetCpuCacheDescriptors().

Variable Documentation

◆ IntelCacheDescriptors

const INTEL_CACHE_DESCRIPTOR IntelCacheDescriptors[]
static

Table of known Intel cache descriptors, as defined in the Intel SDM.

Only data, instruction and unified caches are listed, TLBs and trace caches are ignored.

See also
"Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 1: Basic Architecture" - "Table 21-12. Encoding of CPUID Leaf 2 Descriptors"
Note
For code 0x49 the L3 cache interpretation is used, which matches what Linux does:

Definition at line 39 of file cacheinfo.c.

Referenced by FindIntelCacheDescriptor().