2 * arch/ubicom32/include/asm/smp.h
3 * SMP definitions for Ubicom32 architecture.
5 * (C) Copyright 2009, Ubicom, Inc.
7 * This file is part of the Ubicom32 Linux Kernel Port.
9 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10 * it and/or modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation, either version 2 of the
12 * License, or (at your option) any later version.
14 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with the Ubicom32 Linux Kernel Port. If not,
21 * see <http://www.gnu.org/licenses/>.
23 * Ubicom32 implementation derived from (with many thanks):
28 #ifndef _ASM_UBICOM32_SMP_H
29 #define _ASM_UBICOM32_SMP_H
32 #error you should not include smp.h if smp is off
36 #include <linux/bitops.h>
37 #include <linux/threads.h>
38 #include <linux/cpumask.h>
39 #include <asm/ip5000.h>
41 typedef unsigned long address_t
;
42 extern unsigned int smp_ipi_irq
;
45 * This magic constant controls our willingness to transfer
46 * a process across CPUs.
48 * Such a transfer incurs cache and tlb
49 * misses. The current value is inherited from i386. Still needs
50 * to be tuned for parisc.
52 #define PROC_CHANGE_PENALTY 15 /* Schedule penalty */
53 #define NO_PROC_ID 0xFF /* No processor magic marker */
54 #define ANY_PROC_ID 0xFF /* Any processor magic marker */
57 #define raw_smp_processor_id() (current_thread_info()->cpu)
58 #endif /* CONFIG_SMP */
60 static inline int __cpu_disable (void)
65 static inline void __cpu_die (unsigned int cpu
)
71 extern int __cpu_up(unsigned int cpu
);
72 extern void smp_send_timer_all(void);
73 extern void smp_timer_broadcast(const struct cpumask
*mask
);
74 extern void smp_set_affinity(unsigned int irq
, const struct cpumask
*dest
);
75 extern void arch_send_call_function_single_ipi(int cpu
);
76 #define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask
77 extern void arch_send_call_function_ipi_mask(const struct cpumask
*mask
);
80 * TODO: Once these are fully tested, we should turn them into
81 * inline macros for performance.
83 extern unsigned long smp_get_affinity(unsigned int irq
, int *all
);
84 extern void smp_reset_ipi(unsigned long mask
);
86 #endif /* !ASSEMBLY */
87 #endif /* _ASM_UBICOM32_SMP_H */