Final Platform Layer 0.9.8-beta
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions
Hardware Infos

This category contains functions for retrieving hardware information such as memory usage, CPU info, etc. More...

Data Structures

struct  fplCPUCapabilities
 A structure that containing the processor capabilities, like MMX,SSE,AVX etc. More...
 
union  fplCPUIDLeaf
 A structure containing the 4-registers (EAX, EBX, ECX, EDX) for a CPU-Leaf. More...
 

Typedefs

typedef enum fplCPUArchType fplCPUArchType
 An enumeration of architecture types.
 
typedef struct fplCPUCapabilities fplCPUCapabilities
 A structure that containing the processor capabilities, like MMX,SSE,AVX etc.
 
typedef union fplCPUIDLeaf fplCPUIDLeaf
 A structure containing the 4-registers (EAX, EBX, ECX, EDX) for a CPU-Leaf.
 

Enumerations

enum  fplCPUArchType {
  fplCPUArchType_Unknown , fplCPUArchType_x86 , fplCPUArchType_x86_64 , fplCPUArchType_x64 ,
  fplCPUArchType_Arm32 , fplCPUArchType_Arm64 , fplCPUArchType_First , fplCPUArchType_Last
}
 An enumeration of architecture types. More...
 

Functions

fpl_platform_api fplCPUArchType fplCPUGetArchitecture ()
 Gets the processor architecture type.
 
fpl_common_api const char * fplCPUGetArchName (const fplCPUArchType type)
 Gets the string representation of the given architecture type.
 
fpl_common_api bool fplCPUGetCapabilities (fplCPUCapabilities *outCaps)
 Gets the capabilities of the processor.
 
fpl_platform_api size_t fplCPUGetCoreCount ()
 Retrieves the total number of processor cores.
 
fpl_common_api size_t fplCPUGetName (char *destBuffer, const size_t maxDestBufferLen)
 Retrieves the name of the processor.
 
fpl_common_api void fplCPUID (fplCPUIDLeaf *outLeaf, const uint32_t functionId)
 Queries the x86 CPUID leaf register (EAX, EBX, ECX, EDX) for the given function id.
 
fpl_common_api uint64_t fplCPURDTSC ()
 Reads the current time stamp counter (RDTSC)
 
fpl_common_api uint64_t fplCPUXCR0 ()
 Gets the x86 extended control register for index zero.
 

Detailed Description

This category contains functions for retrieving hardware information such as memory usage, CPU info, etc.

Enumeration Type Documentation

◆ fplCPUArchType

An enumeration of architecture types.

Enumerator
fplCPUArchType_Unknown 

Unknown architecture.

fplCPUArchType_x86 

X86 architecture.

fplCPUArchType_x86_64 

X86 with 64-bit architecture.

fplCPUArchType_x64 

X64 only architecture.

fplCPUArchType_Arm32 

ARM32 architecture.

fplCPUArchType_Arm64 

ARM64 architecture.

fplCPUArchType_First 

First fplCPUArchType.

fplCPUArchType_Last 

Last fplCPUArchType.

Definition at line 3355 of file final_platform_layer.h.

Function Documentation

◆ fplCPUGetArchitecture()

fpl_platform_api fplCPUArchType fplCPUGetArchitecture ( )

Gets the processor architecture type.

Returns
Returns the processor architecture type
See also
Get CPU architecture

◆ fplCPUGetArchName()

fpl_common_api const char * fplCPUGetArchName ( const fplCPUArchType  type)

Gets the string representation of the given architecture type.

Parameters
typeThe fplCPUArchType enumeration value
Returns
Returns a string for the given architecture type
See also
Get CPU architecture

◆ fplCPUGetCapabilities()

fpl_common_api bool fplCPUGetCapabilities ( fplCPUCapabilities outCaps)

Gets the capabilities of the processor.

Parameters
outCapsPointer to the output fplCPUCapabilities
Returns
Returns true when the capabilities could be retrieved, false otherwise.
See also
Query CPU Capabilities

◆ fplCPUGetCoreCount()

fpl_platform_api size_t fplCPUGetCoreCount ( )

Retrieves the total number of processor cores.

Returns
Returns the total number of processor cores.
See also
Get number of CPU-Cores

◆ fplCPUGetName()

fpl_common_api size_t fplCPUGetName ( char *  destBuffer,
const size_t  maxDestBufferLen 
)

Retrieves the name of the processor.

Parameters
destBufferThe destination buffer
maxDestBufferLenThe max length of the destination buffer
Returns
Returns the number of required/written characters, excluding the null-terminator
See also
Get the CPU Name

◆ fplCPUID()

fpl_common_api void fplCPUID ( fplCPUIDLeaf outLeaf,
const uint32_t  functionId 
)

Queries the x86 CPUID leaf register (EAX, EBX, ECX, EDX) for the given function id.

Parameters
outLeafThe target fplCPUIDLeaf reference
functionIdThe CPUID function id
Warning
This function works on X86 architectures only

◆ fplCPURDTSC()

fpl_common_api uint64_t fplCPURDTSC ( )

Reads the current time stamp counter (RDTSC)

Returns
Returns the number of cycles since the system start or zero for non-x86 architectures.
Warning
This function works on X86 architectures only

◆ fplCPUXCR0()

fpl_common_api uint64_t fplCPUXCR0 ( )

Gets the x86 extended control register for index zero.

Returns
Returns the extended control register on x86 or zero for non-x86 architectures.
Warning
This function works on X86 architectures only