summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-05-23 20:28:06 +0200
committerRichard Braun <rbraun@sceen.net>2017-05-23 20:28:06 +0200
commitea5c6b46ca704a05186f18bfe1ae9cd986806150 (patch)
treec51eec3c537f4cc34871c358cf03806ed0f3f545
parent4fd4db00fcd59872106591863f321b44ed35740c (diff)
x86/cpu: new cpu_apic_id function
-rw-r--r--arch/x86/machine/cpu.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/machine/cpu.h b/arch/x86/machine/cpu.h
index 2360ea7d..b384e555 100644
--- a/arch/x86/machine/cpu.h
+++ b/arch/x86/machine/cpu.h
@@ -596,13 +596,19 @@ void cpu_mp_setup(void);
*/
void cpu_ap_setup(void);
+static inline unsigned int
+cpu_apic_id(unsigned int cpu)
+{
+ return cpu_from_id(cpu)->apic_id;
+}
+
/*
* Send a cross-call interrupt to a remote processor.
*/
static inline void
cpu_send_xcall(unsigned int cpu)
{
- lapic_ipi_send(cpu_from_id(cpu)->apic_id, TRAP_XCALL);
+ lapic_ipi_send(cpu_apic_id(cpu), TRAP_XCALL);
}
/*
@@ -616,7 +622,7 @@ void cpu_xcall_intr(struct trap_frame *frame);
static inline void
cpu_send_thread_schedule(unsigned int cpu)
{
- lapic_ipi_send(cpu_from_id(cpu)->apic_id, TRAP_THREAD_SCHEDULE);
+ lapic_ipi_send(cpu_apic_id(cpu), TRAP_THREAD_SCHEDULE);
}
/*