tape-kernel 1.0
a modular modern independent kernel
Loading...
Searching...
No Matches
cpu.h File Reference
#include "../lib/types.h"
Include dependency graph for cpu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define getcpu   __getcpu

Functions

void __getcpu (char *buffer, uint32_t buffer_size)
 getcpu detects cpu vendor and model information

Macro Definition Documentation

◆ getcpu

#define getcpu   __getcpu

Definition at line 6 of file cpu.h.

Referenced by __shell().

Function Documentation

◆ __getcpu()

void __getcpu ( char * buffer,
uint32_t buffer_len )

getcpu detects cpu vendor and model information

getcpu is a function that uses the cpuid instruction to detect the cpu vendor string and model information and formats it into a readable string

Parameters
buffer,theoutput buffer for the cpu description string
buffer_len,thesize of the output buffer

using getcpu is done with

#include "../kernel/cpu.h" //or just cpu.h
char cpu[64];
getcpu(cpu, sizeof(cpu));
#define getcpu
Definition cpu.h:6
See also
__cpuid_supported(), shell() info cmd

Definition at line 29 of file cpu.c.

References __cpuid_get_features(), __cpuid_get_vendor(), __cpuid_supported(), itoa(), NULL, strcat(), and strcpy().