diff options
author | Richard Braun <rbraun@sceen.net> | 2017-05-23 20:28:06 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-05-23 20:28:06 +0200 |
commit | ea5c6b46ca704a05186f18bfe1ae9cd986806150 (patch) | |
tree | c51eec3c537f4cc34871c358cf03806ed0f3f545 | |
parent | 4fd4db00fcd59872106591863f321b44ed35740c (diff) |
x86/cpu: new cpu_apic_id function
-rw-r--r-- | arch/x86/machine/cpu.h | 10 |
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); } /* |