aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/genapic
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2010-12-24 10:14:36 +0000
committerKeir Fraser <keir@xen.org>2010-12-24 10:14:36 +0000
commit746a4c7dd813590b86edc9b7989f5274bdf6cef2 (patch)
tree659959806806e69b40c4316eaa9460ee30ecfd94 /xen/arch/x86/genapic
parent3f7f21343b4090115c47fa29476864a92efc01af (diff)
downloadxen-746a4c7dd813590b86edc9b7989f5274bdf6cef2.tar.gz
xen-746a4c7dd813590b86edc9b7989f5274bdf6cef2.tar.bz2
xen-746a4c7dd813590b86edc9b7989f5274bdf6cef2.zip
x86: a little bit of genapic cleanup
Eliminate redundancy among the individual handler functions, and mark init-only functions as such. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/genapic')
-rw-r--r--xen/arch/x86/genapic/delivery.c19
-rw-r--r--xen/arch/x86/genapic/x2apic.c27
2 files changed, 13 insertions, 33 deletions
diff --git a/xen/arch/x86/genapic/delivery.c b/xen/arch/x86/genapic/delivery.c
index 54ab6d0c22..25fbf694c7 100644
--- a/xen/arch/x86/genapic/delivery.c
+++ b/xen/arch/x86/genapic/delivery.c
@@ -7,6 +7,11 @@
#include <mach_apic.h>
+const cpumask_t *target_cpus_all(void)
+{
+ return &cpu_online_map;
+}
+
/*
* LOGICAL FLAT DELIVERY MODE (multicast via bitmask to <= 8 logical APIC IDs).
*/
@@ -21,16 +26,11 @@ void init_apic_ldr_flat(void)
apic_write_around(APIC_LDR, val);
}
-void clustered_apic_check_flat(void)
+void __init clustered_apic_check_flat(void)
{
printk("Enabling APIC mode: Flat. Using %d I/O APICs\n", nr_ioapics);
}
-const cpumask_t *target_cpus_flat(void)
-{
- return &cpu_online_map;
-}
-
const cpumask_t *vector_allocation_cpumask_flat(int cpu)
{
return &cpu_online_map;
@@ -54,16 +54,11 @@ void init_apic_ldr_phys(void)
apic_write_around(APIC_LDR, val);
}
-void clustered_apic_check_phys(void)
+void __init clustered_apic_check_phys(void)
{
printk("Enabling APIC mode: Phys. Using %d I/O APICs\n", nr_ioapics);
}
-const cpumask_t *target_cpus_phys(void)
-{
- return &cpu_online_map;
-}
-
const cpumask_t *vector_allocation_cpumask_phys(int cpu)
{
return cpumask_of(cpu);
diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index 86d06ed97d..98afc66b1b 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -40,25 +40,10 @@ static void init_apic_ldr_x2apic_cluster(void)
cpu_2_logical_apicid[cpu] = apic_read(APIC_LDR);
}
-static void clustered_apic_check_x2apic(void)
+static void __init clustered_apic_check_x2apic(void)
{
}
-static const cpumask_t *target_cpus_x2apic(void)
-{
- return &cpu_online_map;
-}
-
-static const cpumask_t *vector_allocation_cpumask_x2apic(int cpu)
-{
- return cpumask_of(cpu);
-}
-
-static unsigned int cpu_mask_to_apicid_x2apic_phys(const cpumask_t *cpumask)
-{
- return cpu_physical_id(cpumask_first(cpumask));
-}
-
static unsigned int cpu_mask_to_apicid_x2apic_cluster(const cpumask_t *cpumask)
{
return cpu_2_logical_apicid[cpumask_first(cpumask)];
@@ -114,9 +99,9 @@ static const struct genapic apic_x2apic_phys = {
.int_dest_mode = 0 /* physical delivery */,
.init_apic_ldr = init_apic_ldr_x2apic_phys,
.clustered_apic_check = clustered_apic_check_x2apic,
- .target_cpus = target_cpus_x2apic,
- .vector_allocation_cpumask = vector_allocation_cpumask_x2apic,
- .cpu_mask_to_apicid = cpu_mask_to_apicid_x2apic_phys,
+ .target_cpus = target_cpus_all,
+ .vector_allocation_cpumask = vector_allocation_cpumask_phys,
+ .cpu_mask_to_apicid = cpu_mask_to_apicid_phys,
.send_IPI_mask = send_IPI_mask_x2apic_phys,
.send_IPI_self = send_IPI_self_x2apic
};
@@ -127,8 +112,8 @@ static const struct genapic apic_x2apic_cluster = {
.int_dest_mode = 1 /* logical delivery */,
.init_apic_ldr = init_apic_ldr_x2apic_cluster,
.clustered_apic_check = clustered_apic_check_x2apic,
- .target_cpus = target_cpus_x2apic,
- .vector_allocation_cpumask = vector_allocation_cpumask_x2apic,
+ .target_cpus = target_cpus_all,
+ .vector_allocation_cpumask = vector_allocation_cpumask_phys,
.cpu_mask_to_apicid = cpu_mask_to_apicid_x2apic_cluster,
.send_IPI_mask = send_IPI_mask_x2apic_cluster,
.send_IPI_self = send_IPI_self_x2apic