- Stephen Rothwell: APM updates
[davej-history.git] / include / linux / smp.h
blobcf20a8bd6ed80cb189ab2b46504cb6a90bdc87a0
1 #ifndef __LINUX_SMP_H
2 #define __LINUX_SMP_H
4 /*
5 * Generic SMP support
6 * Alan Cox. <alan@redhat.com>
7 */
9 #include <linux/config.h>
11 #ifdef CONFIG_SMP
13 #include <linux/kernel.h>
14 #include <asm/smp.h>
17 * main cross-CPU interfaces, handles INIT, TLB flush, STOP, etc.
18 * (defined in asm header):
19 */
22 * stops all CPUs but the current one:
24 extern void smp_send_stop(void);
27 * sends a 'reschedule' event to another CPU:
29 extern void FASTCALL(smp_send_reschedule(int cpu));
33 * Boot processor call to load the other CPU's
35 extern void smp_boot_cpus(void);
38 * Processor call in. Must hold processors until ..
40 extern void smp_callin(void);
43 * Multiprocessors may now schedule
45 extern void smp_commence(void);
48 * Call a function on all other processors
50 extern int smp_call_function (void (*func) (void *info), void *info,
51 int retry, int wait);
54 * True once the per process idle is forked
56 extern int smp_threads_ready;
58 extern int smp_num_cpus;
60 extern volatile unsigned long smp_msg_data;
61 extern volatile int smp_src_cpu;
62 extern volatile int smp_msg_id;
64 #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */
65 #define MSG_ALL 0x8001
67 #define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */
68 #define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's
69 * when rebooting
71 #define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU*/
72 #define MSG_CALL_FUNCTION 0x0004 /* Call function on all other CPUs */
74 #else
77 * These macros fold the SMP functionality into a single CPU system
80 #define smp_num_cpus 1
81 #define smp_processor_id() 0
82 #define hard_smp_processor_id() 0
83 #define smp_threads_ready 1
84 #define kernel_lock()
85 #define cpu_logical_map(cpu) 0
86 #define cpu_number_map(cpu) 0
87 #define smp_call_function(func,info,retry,wait) ({ 0; })
88 #define cpu_online_map 1
90 #endif
91 #endif