2 * smp.h: PPC64 specific SMP code.
4 * Original was a copy of sparc smp.h. Now heavily modified
7 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
8 * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com>
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.
20 #include <linux/config.h>
21 #include <linux/kernel.h>
22 #include <linux/threads.h> /* for NR_CPUS */
30 struct current_set_struct {
31 struct task_struct *task;
32 unsigned long *sp_real;
35 extern unsigned long cpu_online_map;
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);
42 extern void smp_message_recv(int, struct pt_regs *);
44 #define NO_PROC_ID 0xFF /* No processor magic marker */
45 #define PROC_CHANGE_PENALTY 20
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];
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)
58 /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
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
67 void smp_init_iSeries(void);
68 void smp_init_pSeries(void);
70 #endif /* __ASSEMBLY__ */
71 #endif /* !(CONFIG_SMP) */
72 #endif /* !(_PPC64_SMP_H) */
73 #endif /* __KERNEL__ */