x86: refactor ->setup_portio_remap() subarch methods

Only NUMAQ has a real ->setup_portio_remap() method, the other
subarchitectures define it but keep it empty.

So mark the vector as NULL, extend the generic code to handle
NULL -setup_portio_remap() entries and remove all the empty
handlers.

Also move the NUMAQ method from the header file into the
 apic driver .c file.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Ingo Molnar 2009-01-28 12:43:18 +01:00
parent 8058714a41
commit d83093b504
12 changed files with 22 additions and 30 deletions

View File

@ -95,7 +95,7 @@ static inline physid_mask_t bigsmp_ioapic_phys_id_map(physid_mask_t phys_map)
return physids_promote(0xFFL);
}
static inline void setup_portio_remap(void)
static inline void bigsmp_setup_portio_remap(void)
{
}

View File

@ -127,10 +127,6 @@ static inline physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map)
}
static inline void setup_portio_remap(void)
{
}
extern unsigned int boot_cpu_physical_apicid;
static inline int check_phys_apicid_present(int cpu_physical_apicid)
{

View File

@ -132,10 +132,6 @@ static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)
return physid_mask_of_physid(phys_apicid);
}
static inline void setup_portio_remap(void)
{
}
static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
{
return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);

View File

@ -3,7 +3,6 @@
#include <asm/genapic.h>
#define setup_portio_remap (apic->setup_portio_remap)
#define check_phys_apicid_present (apic->check_phys_apicid_present)
#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)

View File

@ -92,19 +92,6 @@ static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid)
extern void *xquad_portio;
static inline void setup_portio_remap(void)
{
int num_quads = num_online_nodes();
if (num_quads <= 1)
return;
printk("Remapping cross-quad port I/O for %d quads\n", num_quads);
xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
(u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
}
static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
{
return (1);

View File

@ -116,7 +116,7 @@ static inline physid_mask_t summit_apicid_to_cpu_present(int apicid)
return physid_mask_of_physid(0);
}
static inline void setup_portio_remap(void)
static inline void summit_setup_portio_remap(void)
{
}

View File

@ -1170,7 +1170,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
map_cpu_to_logical_apicid();
setup_portio_remap();
if (apic->setup_portio_remap)
apic->setup_portio_remap();
smpboot_setup_io_apic();
/*

View File

@ -84,7 +84,7 @@ struct genapic apic_bigsmp = {
.cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid,
.cpu_present_to_apicid = bigsmp_cpu_present_to_apicid,
.apicid_to_cpu_present = bigsmp_apicid_to_cpu_present,
.setup_portio_remap = setup_portio_remap,
.setup_portio_remap = NULL,
.check_phys_apicid_present = check_phys_apicid_present,
.enable_apic_mode = enable_apic_mode,
.phys_pkg_id = phys_pkg_id,

View File

@ -65,7 +65,7 @@ struct genapic apic_default = {
.cpu_to_logical_apicid = default_cpu_to_logical_apicid,
.cpu_present_to_apicid = default_cpu_present_to_apicid,
.apicid_to_cpu_present = default_apicid_to_cpu_present,
.setup_portio_remap = setup_portio_remap,
.setup_portio_remap = NULL,
.check_phys_apicid_present = check_phys_apicid_present,
.enable_apic_mode = enable_apic_mode,
.phys_pkg_id = phys_pkg_id,

View File

@ -126,7 +126,7 @@ struct genapic apic_es7000 = {
.cpu_to_logical_apicid = es7000_cpu_to_logical_apicid,
.cpu_present_to_apicid = es7000_cpu_present_to_apicid,
.apicid_to_cpu_present = es7000_apicid_to_cpu_present,
.setup_portio_remap = setup_portio_remap,
.setup_portio_remap = NULL,
.check_phys_apicid_present = check_phys_apicid_present,
.enable_apic_mode = enable_apic_mode,
.phys_pkg_id = phys_pkg_id,

View File

@ -44,6 +44,19 @@ static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask)
*retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
}
static void numaq_setup_portio_remap(void)
{
int num_quads = num_online_nodes();
if (num_quads <= 1)
return;
printk("Remapping cross-quad port I/O for %d quads\n", num_quads);
xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
(u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
}
struct genapic apic_numaq = {
.name = "NUMAQ",
@ -71,7 +84,7 @@ struct genapic apic_numaq = {
.cpu_to_logical_apicid = numaq_cpu_to_logical_apicid,
.cpu_present_to_apicid = numaq_cpu_present_to_apicid,
.apicid_to_cpu_present = numaq_apicid_to_cpu_present,
.setup_portio_remap = setup_portio_remap,
.setup_portio_remap = numaq_setup_portio_remap,
.check_phys_apicid_present = check_phys_apicid_present,
.enable_apic_mode = enable_apic_mode,
.phys_pkg_id = phys_pkg_id,

View File

@ -64,7 +64,7 @@ struct genapic apic_summit = {
.cpu_to_logical_apicid = summit_cpu_to_logical_apicid,
.cpu_present_to_apicid = summit_cpu_present_to_apicid,
.apicid_to_cpu_present = summit_apicid_to_cpu_present,
.setup_portio_remap = setup_portio_remap,
.setup_portio_remap = NULL,
.check_phys_apicid_present = check_phys_apicid_present,
.enable_apic_mode = enable_apic_mode,
.phys_pkg_id = phys_pkg_id,