diff --git a/arch/x86/include/asm/stddef.h b/arch/x86/include/asm/stddef.h index 90c9b2a1..0d6a6f33 100644 --- a/arch/x86/include/asm/stddef.h +++ b/arch/x86/include/asm/stddef.h @@ -99,14 +99,6 @@ struct state { unsigned int ss; }; -/** @brief Read out APIC CPU ID - * @return The APIC CPU ID - */ -uint32_t apic_cpu_id(void); - -/// Convenience-define constant -#define LOGICAL_CPUID apic_cpu_id() - #ifdef __cplusplus } #endif diff --git a/include/metalsvm/stddef.h b/include/metalsvm/stddef.h index 07d3ed27..5fade774 100644 --- a/include/metalsvm/stddef.h +++ b/include/metalsvm/stddef.h @@ -37,13 +37,13 @@ typedef unsigned int tid_t; #define DEFINE_PER_CORE(type, name, def_value) type name = def_value; #define CORE_ID 0 #else -#define per_core(name) name[LOGICAL_CPUID].var +#define per_core(name) name[smp_id()].var #define DECLARE_PER_CORE(type, name) \ typedef struct { type var __attribute__ ((aligned (CACHE_LINE))); } aligned_##name;\ extern aligned_##name name[MAX_CORES]; #define DEFINE_PER_CORE(type, name, def_value) \ aligned_##name name[MAX_CORES] = {[0 ... MAX_CORES-1] = {def_value}}; -#define CORE_ID LOGICAL_CPUID +#define CORE_ID smp_id() #endif /* needed to find the task, which is currently running on this core */