Commit 0b31514d authored by Martin J. Bligh's avatar Martin J. Bligh Committed by Linus Torvalds

[PATCH] create generalised apic_to_node mapping

Create a generalised apicid_to_node mapping, replacing the local
apicid_to_quad I had just locally in NUMA-Q subarch before.
parent 4c55cc62
...@@ -53,6 +53,11 @@ static inline int multi_timer_check(int apic, int irq) ...@@ -53,6 +53,11 @@ static inline int multi_timer_check(int apic, int irq)
return 0; return 0;
} }
static inline int apicid_to_node(int logical_apicid)
{
return 0;
}
static inline int cpu_present_to_apicid(int mps_cpu) static inline int cpu_present_to_apicid(int mps_cpu)
{ {
return mps_cpu; return mps_cpu;
......
...@@ -47,14 +47,14 @@ static inline int generate_logical_apicid(int quad, int phys_apicid) ...@@ -47,14 +47,14 @@ static inline int generate_logical_apicid(int quad, int phys_apicid)
return ( (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1) ); return ( (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1) );
} }
static inline int apicid_to_quad(int logical_apicid) static inline int apicid_to_node(int logical_apicid)
{ {
return (logical_apicid >> 4); return (logical_apicid >> 4);
} }
static inline unsigned long apicid_to_cpu_present(int logical_apicid) static inline unsigned long apicid_to_cpu_present(int logical_apicid)
{ {
return ( (logical_apicid&0xf) << (4*apicid_to_quad(logical_apicid)) ); return ( (logical_apicid&0xf) << (4*apicid_to_node(logical_apicid)) );
} }
static inline int mpc_apic_id(struct mpc_config_processor *m, int quad) static inline int mpc_apic_id(struct mpc_config_processor *m, int quad)
......
...@@ -32,6 +32,11 @@ static inline void clustered_apic_check(void) ...@@ -32,6 +32,11 @@ static inline void clustered_apic_check(void)
(x86_summit ? "Summit" : "Flat"), nr_ioapics); (x86_summit ? "Summit" : "Flat"), nr_ioapics);
} }
static inline int apicid_to_node(int logical_apicid)
{
return (logical_apicid >> 5); /* 2 clusterids per CEC */
}
static inline int cpu_present_to_apicid(int mps_cpu) static inline int cpu_present_to_apicid(int mps_cpu)
{ {
if (x86_summit) if (x86_summit)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment