Import 1.3.75
[davej-history.git] / include / linux / smp.h
blob5393660346492873e653f97d51d2b68299737871
1 #ifndef __LINUX_SMP_H
2 #define __LINUX_SMP_H
4 /*
5 * Generic SMP support
6 * Alan Cox. <alan@cymru.net>
7 */
9 #ifdef __SMP__
10 #include <asm/smp.h>
12 externvoidsmp_message_pass(int target,int msg,unsigned long data,int wait);
13 externvoidsmp_boot_cpus(void);/* Boot processor call to load the other CPU's */
14 externvoidsmp_callin(void);/* Processor call in. Must hold processors until .. */
15 externvoidsmp_commence(void);/* Multiprocessors may now schedule */
16 externint smp_num_cpus;
17 externint smp_top_cpu;/* Top CPU number */
18 externint smp_threads_ready;/* True once the per process idle is forked */
19 #ifdef __SMP_PROF__
20 extern volatileunsigned long smp_spins[NR_CPUS];/* count of interrupt spins */
21 extern volatileunsigned long smp_spins_sys_idle[];/* count of idle spins */
22 extern volatileunsigned long smp_spins_syscall[];/* count of syscall spins */
23 extern volatileunsigned long smp_spins_syscall_cur[];/* count of syscall spins for the current
24 call */
25 extern volatileunsigned long smp_idle_count[1+NR_CPUS];/* count idle ticks */
26 extern volatileunsigned long smp_idle_map;/* map with idle cpus */
27 #else
28 extern volatileunsigned long smp_spins;
29 #endif
32 extern volatileunsigned long smp_msg_data;
33 extern volatileint smp_src_cpu;
34 extern volatileint smp_msg_id;
36 #define MSG_ALL_BUT_SELF 0x8000/* Assume <32768 CPU's */
37 #define MSG_ALL 0x8001
39 #define MSG_INVALIDATE_TLB 0x0001/* Remote processor TLB invalidate */
40 #define MSG_STOP_CPU 0x0002/* Sent to shut down slave CPU's when rebooting */
41 #define MSG_RESCHEDULE 0x0003/* Reschedule request from master CPU */
43 #else
46 * These macros fold the SMP functionality into a single CPU system
49 #define smp_num_cpus 1
50 #define smp_processor_id() 0
51 #define smp_top_cpu 0
52 #define smp_message_pass(t,m,d,w)
53 #define smp_threads_ready 1
54 #define kernel_lock()
55 #endif
56 #endif
close