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>
22 #include <linux/cpumask.h>
23 #include <linux/irqreturn.h>
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
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 */