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 *);
45 * Retrieve the state of a CPU:
46 * online: CPU is in a normal run state
47 * possible: CPU is a candidate to be made online
48 * available: CPU is candidate for the 'possible' pool
50 #define cpu_possible(cpu) paca[cpu].active
51 #define cpu_available(cpu) paca[cpu].available
53 #define NO_PROC_ID 0xFF /* No processor magic marker */
54 #define PROC_CHANGE_PENALTY 20
56 /* 1 to 1 mapping on PPC -- Cort */
57 #define cpu_logical_map(cpu) (cpu)
58 #define cpu_number_map(x) (x)
59 extern volatile unsigned long cpu_callin_map[NR_CPUS];
61 #define smp_processor_id() (get_paca()->xPacaIndex)
62 #define hard_smp_processor_id() (get_paca()->xHwProcNum)
66 /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
68 * Make sure this matches openpic_request_IPIs in open_pic.c, or what shows up
69 * in /proc/interrupts will be wrong!!! --Troy */
70 #define PPC_MSG_CALL_FUNCTION 0
71 #define PPC_MSG_RESCHEDULE 1
72 #define PPC_MSG_INVALIDATE_TLB 2
73 #define PPC_MSG_XMON_BREAK 3
75 void smp_init_iSeries(void);
76 void smp_init_pSeries(void);
78 #else /* CONFIG_SMP */
79 #define cpu_possible(cpu) ((cpu) == 0)
80 #define cpu_available(cpu) ((cpu) == 0)
82 #endif /* !(CONFIG_SMP) */
83 #endif /* __ASSEMBLY__ */
84 #endif /* !(_PPC64_SMP_H) */
85 #endif /* __KERNEL__ */