Import 2.3.5
[davej-history.git] / include / linux / smp.h
blobeae1290701ba29c2923c4a4390c368eed5566dbf
1 #ifndef __LINUX_SMP_H
2 #define __LINUX_SMP_H
4 /*
5 * Generic SMP support
6 * Alan Cox. <alan@redhat.com>
7 */
9 #ifdef __SMP__
11 #include <asm/smp.h>
14 * main cross-CPU interfaces, handles INIT, TLB flush, STOP, etc.
15 * (defined in asm header):
16 */
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 FASTCALL(smp_send_reschedule(int cpu));
30 * Boot processor call to load the other CPU's
32 extern void smp_boot_cpus(void);
35 * Processor call in. Must hold processors until ..
37 extern void smp_callin(void);
40 * Multiprocessors may now schedule
42 extern void smp_commence(void);
45 * Call a function on all other processors
47 extern int smp_call_function (void (*func) (void *info), void *info,
48 int retry, int wait);
51 * True once the per process idle is forked
53 extern int smp_threads_ready;
55 extern int smp_num_cpus;
57 extern volatile unsigned long smp_msg_data;
58 extern volatile int smp_src_cpu;
59 extern volatile int smp_msg_id;
61 #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */
62 #define MSG_ALL 0x8001
64 #define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */
65 #define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's
66 * when rebooting
68 #define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU*/
69 #define MSG_CALL_FUNCTION 0x0004 /* Call function on all other CPUs */
71 #else
74 * These macros fold the SMP functionality into a single CPU system
77 #define smp_num_cpus 1
78 #define smp_processor_id() 0
79 #define hard_smp_processor_id() 0
80 #define smp_threads_ready 1
81 #define kernel_lock()
82 #define cpu_logical_map(cpu) 0
83 #define smp_call_function(func,info,retry,wait)
85 #endif
86 #endif