6 * Alan Cox. <alan@redhat.com>
9 #include <lwk/kernel.h>
10 #include <lwk/compiler.h>
14 * main cross-CPU interfaces, handles INIT, TLB flush, STOP, etc.
15 * (defined in asm header):
19 * stops all CPUs but the current one:
21 extern void smp_send_stop(void);
24 * sends a 'reschedule' event to another CPU:
26 extern void smp_send_reschedule(int cpu);
30 * Prepare machine for booting other CPUs.
32 extern void smp_prepare_cpus(unsigned int max_cpus);
37 extern int __cpu_up(unsigned int cpunum);
40 * Final polishing of CPUs
42 extern void smp_cpus_done(unsigned int max_cpus);
45 * Call a function on all other processors
47 int smp_call_function(void(*func)(void *info), void *info, int retry, int wait);
50 * Call a function on all processors
52 int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait);
54 #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */
55 #define MSG_ALL 0x8001
57 #define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */
58 #define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's
61 #define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU*/
62 #define MSG_CALL_FUNCTION 0x0004 /* Call function on all other CPUs */
65 * Mark the boot cpu "online" so that it can call console drivers in
66 * printk() and can access its per-cpu storage.
68 void smp_prepare_boot_cpu(void);
70 #define smp_processor_id() raw_smp_processor_id()
71 #define get_cpu() smp_processor_id()
72 #define put_cpu() do { } while (0)
73 #define put_cpu_no_resched() do { } while (0)
76 * Returns the current CPU's logical ID.
78 #define this_cpu smp_processor_id()
80 void __init arch_boot_cpu(unsigned int cpu);
81 void __init cpu_init(void);
83 #endif /* _LWK_SMP_H */