-extern __inline__ int cpu_number(void)
-{
- register int cpu;
-
- __asm__ volatile ("movl " CC_SYM_PREFIX "lapic_id, %0\n"
- " movl 0(%0), %0\n"
- " shrl %1, %0\n"
- " andl %2, %0"
- : "=r" (cpu)
- : "i" (LAPIC_ID_SHIFT), "i" (LAPIC_ID_MASK));
-
- return(cpu);
-}
-#else /* MP_V1_1 */
-/*
- * At least one corollary cpu type does not have local memory at all.
- * The only way I found to store the cpu number was in some 386/486
- * system register. cr3 has bits 0, 1, 2 and 5, 6, 7, 8, 9, 10, 11
- * available. Right now we use 0, 1 and 2. So we are limited to 8 cpus.
- * For more cpus, we could use bits 5 - 11 with a shift.
- *
- * Even for other machines, like COMPAQ this is much faster the inb/outb
- * 4 cycles instead of 10 to 30.
- */
-#if defined(__GNUC__)
-#if NCPUS > 8
-#error cpu_number() definition only works for #cpus <= 8
-#else
-
-extern __inline__ int cpu_number(void)
-{
- register int cpu;
-
- __asm__ volatile ("movl %%cr3, %0\n"
- " andl $0x7, %0"
- : "=r" (cpu));
- return(cpu);
-}
-#endif
-#endif /* defined(__GNUC__) */
-
-#endif /* MP_V1_1 */
-
-#endif /* MACH_KERNEL_PRIVATE */