cleanup
[linux-2.4.21-pre4.git] / include / asm-ppc64 / smp.h
1 /* 
2  * smp.h: PPC64 specific SMP code.
3  *
4  * Original was a copy of sparc smp.h.  Now heavily modified
5  * for PPC.
6  *
7  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
8  * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com>
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version
13  * 2 of the License, or (at your option) any later version.
14  */
15
16 #ifdef __KERNEL__
17 #ifndef _PPC64_SMP_H
18 #define _PPC64_SMP_H
19
20 #include <linux/config.h>
21 #include <linux/kernel.h>
22 #include <linux/threads.h>      /* for NR_CPUS */
23
24 #ifdef CONFIG_SMP
25
26 #ifndef __ASSEMBLY__
27
28 #include <asm/paca.h>
29
30 struct current_set_struct {
31         struct task_struct *task;
32         unsigned long *sp_real;
33 };
34
35 extern unsigned long cpu_online_map;
36
37 extern void smp_message_pass(int target, int msg, unsigned long data, int wait);
38 extern void smp_store_cpu_info(int id);
39 extern void smp_send_tlb_invalidate(int);
40 extern void smp_send_xmon_break(int cpu);
41 struct pt_regs;
42 extern void smp_message_recv(int, struct pt_regs *);
43
44 #define NO_PROC_ID              0xFF            /* No processor magic marker */
45 #define PROC_CHANGE_PENALTY     20
46
47 /* 1 to 1 mapping on PPC -- Cort */
48 #define cpu_logical_map(cpu) (cpu)
49 #define cpu_number_map(x) (x)
50 extern volatile unsigned long cpu_callin_map[NR_CPUS];
51
52 #define smp_processor_id() (get_paca()->xPacaIndex)
53 #define hard_smp_processor_id() (get_paca()->xHwProcNum)
54 #define get_hard_smp_processor_id(CPU) (paca[(CPU)].xHwProcNum)
55
56
57
58 /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
59  *
60  * Make sure this matches openpic_request_IPIs in open_pic.c, or what shows up
61  * in /proc/interrupts will be wrong!!! --Troy */
62 #define PPC_MSG_CALL_FUNCTION   0
63 #define PPC_MSG_RESCHEDULE      1
64 #define PPC_MSG_INVALIDATE_TLB  2
65 #define PPC_MSG_XMON_BREAK      3
66
67 void smp_init_iSeries(void);
68 void smp_init_pSeries(void);
69
70 #endif /* __ASSEMBLY__ */
71 #endif /* !(CONFIG_SMP) */
72 #endif /* !(_PPC64_SMP_H) */
73 #endif /* __KERNEL__ */