Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / riscv / include / asm / smp.h
blob85e4220839b0ab505f09e4eb6c715b75ae278031
1 /*
2 * Copyright (C) 2012 Regents of the University of California
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #ifndef _ASM_RISCV_SMP_H
15 #define _ASM_RISCV_SMP_H
17 /* This both needs asm-offsets.h and is used when generating it. */
18 #ifndef GENERATING_ASM_OFFSETS
19 #include <asm/asm-offsets.h>
20 #endif
22 #include <linux/cpumask.h>
23 #include <linux/irqreturn.h>
25 #ifdef CONFIG_SMP
27 /* SMP initialization hook for setup_arch */
28 void __init init_clockevent(void);
30 /* SMP initialization hook for setup_arch */
31 void __init setup_smp(void);
33 /* Hook for the generic smp_call_function_many() routine. */
34 void arch_send_call_function_ipi_mask(struct cpumask *mask);
36 /* Hook for the generic smp_call_function_single() routine. */
37 void arch_send_call_function_single_ipi(int cpu);
40 * This is particularly ugly: it appears we can't actually get the definition
41 * of task_struct here, but we need access to the CPU this task is running on.
42 * Instead of using C we're using asm-offsets.h to get the current processor
43 * ID.
45 #define raw_smp_processor_id() (*((int*)((char*)get_current() + TASK_TI_CPU)))
47 /* Interprocessor interrupt handler */
48 irqreturn_t handle_ipi(void);
50 #endif /* CONFIG_SMP */
52 #endif /* _ASM_RISCV_SMP_H */