[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: a little bit of genapic cleanup



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1293185676 0
# Node ID 609da2035aab670e2c11f445e7eecdb21f88a775
# Parent  7cc87dcf30a13bcf600077aa661694caeb0c290c
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@xxxxxxxxxx>
---
 xen/arch/x86/genapic/delivery.c |   19 +++++++------------
 xen/arch/x86/genapic/x2apic.c   |   27 ++++++---------------------
 xen/include/asm-x86/genapic.h   |    8 ++++----
 3 files changed, 17 insertions(+), 37 deletions(-)

diff -r 7cc87dcf30a1 -r 609da2035aab xen/arch/x86/genapic/delivery.c
--- a/xen/arch/x86/genapic/delivery.c   Fri Dec 24 10:14:01 2010 +0000
+++ b/xen/arch/x86/genapic/delivery.c   Fri Dec 24 10:14:36 2010 +0000
@@ -6,6 +6,11 @@
 #include <asm/hardirq.h>
 #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,14 +26,9 @@ 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)
@@ -54,14 +54,9 @@ 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)
diff -r 7cc87dcf30a1 -r 609da2035aab xen/arch/x86/genapic/x2apic.c
--- a/xen/arch/x86/genapic/x2apic.c     Fri Dec 24 10:14:01 2010 +0000
+++ b/xen/arch/x86/genapic/x2apic.c     Fri Dec 24 10:14:36 2010 +0000
@@ -40,23 +40,8 @@ static void init_apic_ldr_x2apic_cluster
     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)
@@ -114,9 +99,9 @@ static const struct genapic apic_x2apic_
     .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_
     .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
diff -r 7cc87dcf30a1 -r 609da2035aab xen/include/asm-x86/genapic.h
--- a/xen/include/asm-x86/genapic.h     Fri Dec 24 10:14:01 2010 +0000
+++ b/xen/include/asm-x86/genapic.h     Fri Dec 24 10:14:36 2010 +0000
@@ -50,9 +50,10 @@ struct genapic {
 
 extern const struct genapic *genapic;
 
+const cpumask_t *target_cpus_all(void);
+
 void init_apic_ldr_flat(void);
 void clustered_apic_check_flat(void);
-const cpumask_t *target_cpus_flat(void);
 unsigned int cpu_mask_to_apicid_flat(const cpumask_t *cpumask);
 void send_IPI_mask_flat(const cpumask_t *mask, int vector);
 void send_IPI_self_flat(int vector);
@@ -62,7 +63,7 @@ const cpumask_t *vector_allocation_cpuma
        .int_dest_mode = 1 /* logical delivery */, \
        .init_apic_ldr = init_apic_ldr_flat, \
        .clustered_apic_check = clustered_apic_check_flat, \
-       .target_cpus = target_cpus_flat, \
+       .target_cpus = target_cpus_all, \
        .vector_allocation_cpumask = vector_allocation_cpumask_flat, \
        .cpu_mask_to_apicid = cpu_mask_to_apicid_flat, \
        .send_IPI_mask = send_IPI_mask_flat, \
@@ -70,7 +71,6 @@ const cpumask_t *vector_allocation_cpuma
 
 void init_apic_ldr_phys(void);
 void clustered_apic_check_phys(void);
-const cpumask_t *target_cpus_phys(void);
 unsigned int cpu_mask_to_apicid_phys(const cpumask_t *cpumask);
 void send_IPI_mask_phys(const cpumask_t *mask, int vector);
 void send_IPI_self_phys(int vector);
@@ -80,7 +80,7 @@ const cpumask_t *vector_allocation_cpuma
        .int_dest_mode = 0 /* physical delivery */, \
        .init_apic_ldr = init_apic_ldr_phys, \
        .clustered_apic_check = clustered_apic_check_phys, \
-       .target_cpus = target_cpus_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_phys, \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.