diff options
| author | Martin J. Bligh <mbligh@aracnet.com> | 2002-12-22 18:19:42 -0800 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-12-22 18:19:42 -0800 |
| commit | 43f1c206e9e0cb6d11f13c177fde56f988ada646 (patch) | |
| tree | d811702bb0cd6a31d1a536a6f78aec0c3dab2b94 /include | |
| parent | df0e5a8ffcb7fb0bfe7ef38e2be8bec869efc629 (diff) | |
[PATCH] abstract out mpparse code
Most of code originally by James Cleverdon.
Abstracts out code from the mpparse stuff into:
- mpc_apic_id()
- apicid_to_cpu_present()
instead of using clustered_apic_mode switching.
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-i386/mach-default/mach_apic.h | 14 | ||||
| -rw-r--r-- | include/asm-i386/mach-numaq/mach_apic.h | 26 |
2 files changed, 36 insertions, 4 deletions
diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h index b527dcdc68f7..7d26f6aeedc5 100644 --- a/include/asm-i386/mach-default/mach_apic.h +++ b/include/asm-i386/mach-default/mach_apic.h @@ -57,9 +57,19 @@ static inline int cpu_present_to_apicid(int mps_cpu) return mps_cpu; } -static inline unsigned long apicid_to_cpu_present(int apicid) +static inline unsigned long apicid_to_cpu_present(int phys_apicid) { - return (1ul << apicid); + return (1ul << phys_apicid); +} + +static inline int mpc_apic_id(struct mpc_config_processor *m, int quad) +{ + printk("Processor #%d %ld:%ld APIC version %d\n", + m->mpc_apicid, + (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8, + (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4, + m->mpc_apicver); + return (m->mpc_apicid); } #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h index 82a4a7fae61d..c4b5047a0bcc 100644 --- a/include/asm-i386/mach-numaq/mach_apic.h +++ b/include/asm-i386/mach-numaq/mach_apic.h @@ -40,9 +40,31 @@ static inline int cpu_present_to_apicid(int mps_cpu) return ( ((mps_cpu/4)*16) + (1<<(mps_cpu%4)) ); } -static inline unsigned long apicid_to_cpu_present(int apicid) +static inline int generate_logical_apicid(int quad, int phys_apicid) { - return (1ul << apicid); + return ( (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1) ); +} + +static inline int apicid_to_quad(int logical_apicid) +{ + return (logical_apicid >> 4); +} + +static inline unsigned long apicid_to_cpu_present(int logical_apicid) +{ + return ( (logical_apicid&0xf) << (4*apicid_to_quad(logical_apicid)) ); +} + +static inline int mpc_apic_id(struct mpc_config_processor *m, int quad) +{ + int logical_apicid = generate_logical_apicid(quad, m->mpc_apicid); + + printk("Processor #%d %ld:%ld APIC version %d (quad %d, apic %d)\n", + m->mpc_apicid, + (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8, + (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4, + m->mpc_apicver, quad, logical_apicid); + return logical_apicid; } #endif /* __ASM_MACH_APIC_H */ |
