summaryrefslogtreecommitdiff
path: root/src/include/cpu/x86/lapic.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/cpu/x86/lapic.h')
-rw-r--r--src/include/cpu/x86/lapic.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h
index f7fecf1342..87cf3c77df 100644
--- a/src/include/cpu/x86/lapic.h
+++ b/src/include/cpu/x86/lapic.h
@@ -184,4 +184,16 @@ void enable_lapic_mode(bool try_set_x2apic);
void disable_lapic(void);
void setup_lapic_interrupts(void);
+static inline unsigned int early_lapicid(void)
+{
+ if (!CONFIG(SMP))
+ return 0;
+
+ if (!ENV_RAMSTAGE)
+ return 0;
+
+ enable_lapic();
+ return lapicid();
+}
+
#endif /* CPU_X86_LAPIC_H */