LoongArch/smp: Refine some ipi functions on LoongArch platform
authorBibo Mao <maobibo@loongson.cn>
Mon, 6 May 2024 14:00:46 +0000 (22:00 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Mon, 6 May 2024 14:00:46 +0000 (22:00 +0800)
commit316863cb62fe7aaea30e7ef8e6481f1ba414b044
treede50daa122a200f0e64546d60baf5fa423abb253
parentdd5a440a31fae6e459c0d6271dddd62825505361
LoongArch/smp: Refine some ipi functions on LoongArch platform

Refine the ipi handling on LoongArch platform, there are three
modifications:

1. Add generic function get_percpu_irq(), replacing some percpu irq
functions such as get_ipi_irq()/get_pmc_irq()/get_timer_irq() with
get_percpu_irq().

2. Change definition about parameter action called by function
loongson_send_ipi_single() and loongson_send_ipi_mask(), and it is
defined as decimal encoding format at ipi sender side. Normal decimal
encoding is used rather than binary bitmap encoding for ipi action, ipi
hw sender uses decimal encoding code, and ipi receiver will get binary
bitmap encoding, the ipi hw will convert it into bitmap in ipi message
buffer.

3. Add a structure smp_ops on LoongArch platform so that pv ipi can be
used later.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/hardirq.h
arch/loongarch/include/asm/irq.h
arch/loongarch/include/asm/smp.h
arch/loongarch/kernel/irq.c
arch/loongarch/kernel/perf_event.c
arch/loongarch/kernel/smp.c
arch/loongarch/kernel/time.c