mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 22:25:03 +00:00
RISC-V: simplify software interrupt / IPI code
Rename handle_ipi to riscv_software_interrupt, drop the unused return value and move the prototype to irq.h together with riscv_timer_interupt. This allows simplifying the upcoming interrupt handling support. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
parent
b9490350f7
commit
b9d5535746
3 changed files with 3 additions and 7 deletions
|
@ -22,6 +22,7 @@
|
||||||
#define INTERRUPT_CAUSE_EXTERNAL 9
|
#define INTERRUPT_CAUSE_EXTERNAL 9
|
||||||
|
|
||||||
void riscv_timer_interrupt(void);
|
void riscv_timer_interrupt(void);
|
||||||
|
void riscv_software_interrupt(void);
|
||||||
|
|
||||||
#include <asm-generic/irq.h>
|
#include <asm-generic/irq.h>
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,6 @@ void arch_send_call_function_single_ipi(int cpu);
|
||||||
*/
|
*/
|
||||||
#define raw_smp_processor_id() (*((int*)((char*)get_current() + TASK_TI_CPU)))
|
#define raw_smp_processor_id() (*((int*)((char*)get_current() + TASK_TI_CPU)))
|
||||||
|
|
||||||
/* Interprocessor interrupt handler */
|
|
||||||
irqreturn_t handle_ipi(void);
|
|
||||||
|
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
|
||||||
#endif /* _ASM_RISCV_SMP_H */
|
#endif /* _ASM_RISCV_SMP_H */
|
||||||
|
|
|
@ -45,7 +45,7 @@ int setup_profiling_timer(unsigned int multiplier)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
irqreturn_t handle_ipi(void)
|
void riscv_software_interrupt(void)
|
||||||
{
|
{
|
||||||
unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits;
|
unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits;
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ irqreturn_t handle_ipi(void)
|
||||||
|
|
||||||
ops = xchg(pending_ipis, 0);
|
ops = xchg(pending_ipis, 0);
|
||||||
if (ops == 0)
|
if (ops == 0)
|
||||||
return IRQ_HANDLED;
|
return;
|
||||||
|
|
||||||
if (ops & (1 << IPI_RESCHEDULE))
|
if (ops & (1 << IPI_RESCHEDULE))
|
||||||
scheduler_ipi();
|
scheduler_ipi();
|
||||||
|
@ -73,8 +73,6 @@ irqreturn_t handle_ipi(void)
|
||||||
/* Order data access and bit testing. */
|
/* Order data access and bit testing. */
|
||||||
mb();
|
mb();
|
||||||
}
|
}
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue