x86/apic: Move common APIC callbacks
Move more apic struct specific functions out of the header and the apic management code into the common source file. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Juergen Gross <jgross@suse.com> Tested-by: Yu Chen <yu.c.chen@intel.com> Acked-by: Juergen Gross <jgross@suse.com> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Alok Kataria <akataria@vmware.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Rui Zhang <rui.zhang@intel.com> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Len Brown <lenb@kernel.org> Link: https://lkml.kernel.org/r/20170913213153.834421893@linutronix.de
This commit is contained in:
@@ -2273,34 +2273,6 @@ int hard_smp_processor_id(void)
|
||||
return read_apic_id();
|
||||
}
|
||||
|
||||
int default_cpu_mask_to_apicid(const struct cpumask *mask,
|
||||
struct irq_data *irqdata,
|
||||
unsigned int *apicid)
|
||||
{
|
||||
unsigned int cpu = cpumask_first(mask);
|
||||
|
||||
if (cpu >= nr_cpu_ids)
|
||||
return -EINVAL;
|
||||
*apicid = per_cpu(x86_cpu_to_apicid, cpu);
|
||||
irq_data_update_effective_affinity(irqdata, cpumask_of(cpu));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int flat_cpu_mask_to_apicid(const struct cpumask *mask,
|
||||
struct irq_data *irqdata,
|
||||
unsigned int *apicid)
|
||||
|
||||
{
|
||||
struct cpumask *effmsk = irq_data_get_effective_affinity_mask(irqdata);
|
||||
unsigned long cpu_mask = cpumask_bits(mask)[0] & APIC_ALL_CPUS;
|
||||
|
||||
if (!cpu_mask)
|
||||
return -EINVAL;
|
||||
*apicid = (unsigned int)cpu_mask;
|
||||
cpumask_bits(effmsk)[0] = cpu_mask;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Override the generic EOI implementation with an optimized version.
|
||||
* Only called during early boot when only one CPU is active and with
|
||||
|
||||
Reference in New Issue
Block a user