From 835ca8ee640c670f5e21ba30e4441c6526bdce12 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sat, 30 Mar 2019 17:35:56 +0100 Subject: arch/x86/cpu: Add functions to determine CPU vendor Add two functions to determine if CPU is made by a specific vendor. Use Kconfig symbols to allow link time optimizations. Change-Id: I1bd6c3b59cfd992f7ba507bc9f9269669920b24f Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/32130 Tested-by: build bot (Jenkins) Reviewed-by: HAOUAS Elyes Reviewed-by: Julien Viard de Galbert Reviewed-by: Patrick Georgi --- src/arch/x86/include/arch/cpu.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h index b40dd1bc9e..3e464e4486 100644 --- a/src/arch/x86/include/arch/cpu.h +++ b/src/arch/x86/include/arch/cpu.h @@ -166,6 +166,16 @@ void smm_init_completion(void); void smm_lock(void); void smm_setup_structures(void *gnvs, void *tcg, void *smi1); +static inline bool cpu_is_amd(void) +{ + return CONFIG(CPU_AMD_AGESA) || CONFIG(CPU_AMD_PI); +} + +static inline bool cpu_is_intel(void) +{ + return CONFIG(CPU_INTEL_COMMON) || CONFIG(SOC_INTEL_COMMON); +} + #ifndef __SIMPLE_DEVICE__ struct device; -- cgit v1.2.3