From 39c2c3c8de8b2f3a18315e2001eac05fe52c0956 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 12 Aug 2025 22:50:51 -0400 Subject: kernel/amd64: cpu: Report CPU vendor type This commit introduces a vendor field within the 'cpu_info' structure. This allows kernel code to detect the CPU vendor by comparing it with the CPU_VENDOR_* defines that have also been added. Signed-off-by: Ian Moffett --- sys/include/arch/amd64/cpu.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/include/arch/amd64/cpu.h') diff --git a/sys/include/arch/amd64/cpu.h b/sys/include/arch/amd64/cpu.h index 4586163..b02ed5f 100644 --- a/sys/include/arch/amd64/cpu.h +++ b/sys/include/arch/amd64/cpu.h @@ -45,11 +45,17 @@ #define CPU_FEAT_SMAP BIT(0) #define CPU_FEAT_SMEP BIT(1) +/* CPU vendors */ +#define CPU_VENDOR_OTHER 0x00000000 +#define CPU_VENDOR_INTEL 0x00000001 +#define CPU_VENDOR_AMD 0x00000002 + typedef uint16_t ipi_pend_t; struct cpu_info { uint32_t apicid; uint32_t feat; + uint32_t vendor; /* Vendor (see CPU_VENDOR_*) */ uint8_t ipi_dispatch : 1; /* 1: IPIs being dispatched */ uint8_t ipi_id; ipi_pend_t ipi_pending[N_IPIVEC]; -- cgit v1.2.3