#ifndef __ASM_SMP_H
#define __ASM_SMP_H
-#include <linux/config.h>
#ifdef CONFIG_SMP
#include <linux/cpumask.h>
#include <asm/atomic.h>
-#define smp_processor_id() (current_thread_info()->cpu)
+#define raw_smp_processor_id() (current_thread_info()->cpu)
/* Map from cpu id to sequential logical cpu number. This will only
not be idempotent when cpus failed to come on-line. */
#define SMP_CALL_FUNCTION 0x2
extern cpumask_t phys_cpu_present_map;
-extern cpumask_t cpu_online_map;
#define cpu_possible_map phys_cpu_present_map
-#define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
-
extern cpumask_t cpu_callout_map;
/* We don't mark CPUs online until __cpu_up(), so we need another measure */
static inline int num_booting_cpus(void)
return cpus_weight(cpu_callout_map);
}
-/* These are defined by the board-specific code. */
+/*
+ * These are defined by the board-specific code.
+ */
/*
* Cause the function described by call_data to be executed on the passed
*/
extern void core_send_ipi(int cpu, unsigned int action);
-/*
- * Detect available CPUs, populate phys_cpu_present_map
- */
-extern void prom_build_cpu_map(void);
-
/*
* Firmware CPU startup hook
*/
extern void prom_init_secondary(void);
/*
- * Callout to firmware before smp_init
+ * Populate cpu_possible_map before smp_init, called from setup_arch.
*/
-extern void prom_prepare_cpus(unsigned int max_cpus);
+extern void plat_smp_setup(void);
/*
- * Do whatever setup needs to be done for SMP at the board level. Return
- * the number of cpus in the system, including this one
+ * Called in smp_prepare_cpus.
*/
-extern int prom_setup_smp(void);
+extern void plat_prepare_cpus(unsigned int max_cpus);
/*
* Last chance for the board code to finish SMP initialization before