more changes on original files
[linux-2.4.git] / asm-ppc / smp.h
1 /* smp.h: PPC specific SMP stuff.
2  *
3  * Original was a copy of sparc smp.h.  Now heavily modified
4  * for PPC.
5  *
6  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
7  * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com>
8  */
9 #ifdef __KERNEL__
10 #ifndef _PPC_SMP_H
11 #define _PPC_SMP_H
12
13 #include <linux/config.h>
14 #include <linux/kernel.h>
15
16 #ifdef CONFIG_SMP
17
18 #ifndef __ASSEMBLY__
19
20 struct cpuinfo_PPC {
21         unsigned long loops_per_jiffy;
22         unsigned long pvr;
23         unsigned long *pgd_cache;
24         unsigned long *pte_cache;
25         unsigned long pgtable_cache_sz;
26 };
27
28 extern struct cpuinfo_PPC cpu_data[NR_CPUS];
29 extern unsigned long cpu_online_map;
30 extern unsigned long smp_proc_in_lock[NR_CPUS];
31 extern volatile unsigned long cpu_callin_map[NR_CPUS];
32 extern int smp_tb_synchronized;
33
34 extern void smp_store_cpu_info(int id);
35 extern void smp_send_tlb_invalidate(int);
36 extern void smp_send_xmon_break(int cpu);
37 struct pt_regs;
38 extern void smp_message_recv(int, struct pt_regs *);
39 extern void smp_local_timer_interrupt(struct pt_regs *);
40
41 #define NO_PROC_ID              0xFF            /* No processor magic marker */
42 #define PROC_CHANGE_PENALTY     20
43
44 /* 1 to 1 mapping on PPC -- Cort */
45 #define cpu_logical_map(cpu) (cpu)
46 #define cpu_number_map(x) (x)
47
48 #define smp_processor_id() (current->processor)
49
50 extern int smp_hw_index[NR_CPUS];
51 #define hard_smp_processor_id() (smp_hw_index[smp_processor_id()])
52
53 struct klock_info_struct {
54         unsigned long kernel_flag;
55         unsigned char akp;
56 };
57
58 extern struct klock_info_struct klock_info;
59 #define KLOCK_HELD       0xffffffff
60 #define KLOCK_CLEAR      0x0
61
62 #ifdef CONFIG_750_SMP
63 #define smp_send_tlb_invalidate(x) smp_ppc750_send_tlb_invalidate(x)
64 #else
65 #define smp_send_tlb_invalidate(x) do {} while(0)
66 #endif
67
68 #endif /* __ASSEMBLY__ */
69
70 #else /* !(CONFIG_SMP) */
71
72 #endif /* !(CONFIG_SMP) */
73
74 #endif /* !(_PPC_SMP_H) */
75 #endif /* __KERNEL__ */