diff options
author | Anup Patel <anup.patel@wdc.com> | 2019-01-22 12:17:03 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2019-01-23 06:09:26 +0300 |
commit | 9895d446ae947c2c3d060808bcb66870afaeb659 (patch) | |
tree | a548ceec34b355e59679bc379a06633d0341378a /lib | |
parent | 74fd2e5bb217278fcb2c0020038ea5f19bd5d22f (diff) | |
download | opensbi-9895d446ae947c2c3d060808bcb66870afaeb659.tar.xz |
lib: Remove target_hart and hartid parameter from TIMER callbacks
The target_hart and hartid paramter of TIMER callbacks is not
required because it always current hartid which can be obtained
using sbi_current_hartid() API.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sbi_ecall.c | 4 | ||||
-rw-r--r-- | lib/sbi_init.c | 4 | ||||
-rw-r--r-- | lib/sbi_timer.c | 16 | ||||
-rw-r--r-- | lib/sbi_trap.c | 2 |
4 files changed, 12 insertions, 14 deletions
diff --git a/lib/sbi_ecall.c b/lib/sbi_ecall.c index dc90488..9341ea8 100644 --- a/lib/sbi_ecall.c +++ b/lib/sbi_ecall.c @@ -38,10 +38,10 @@ int sbi_ecall_handler(u32 hartid, ulong mcause, switch (regs->a7) { case SBI_ECALL_SET_TIMER: #if __riscv_xlen == 32 - sbi_timer_event_start(scratch, hartid, + sbi_timer_event_start(scratch, (((u64)regs->a1 << 32) || (u64)regs->a0)); #else - sbi_timer_event_start(scratch, hartid, (u64)regs->a0); + sbi_timer_event_start(scratch, (u64)regs->a0); #endif ret = 0; break; diff --git a/lib/sbi_init.c b/lib/sbi_init.c index f783992..3e5de51 100644 --- a/lib/sbi_init.c +++ b/lib/sbi_init.c @@ -53,7 +53,7 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) if (rc) sbi_hart_hang(); - rc = sbi_timer_init(scratch, hartid, TRUE); + rc = sbi_timer_init(scratch, TRUE); if (rc) sbi_hart_hang(); @@ -119,7 +119,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid) if (rc) sbi_hart_hang(); - rc = sbi_timer_init(scratch, hartid, FALSE); + rc = sbi_timer_init(scratch, FALSE); if (rc) sbi_hart_hang(); diff --git a/lib/sbi_timer.c b/lib/sbi_timer.c index 8dfc753..93b4d7e 100644 --- a/lib/sbi_timer.c +++ b/lib/sbi_timer.c @@ -47,29 +47,27 @@ u64 sbi_timer_value(struct sbi_scratch *scratch) return get_ticks(); } -void sbi_timer_event_stop(struct sbi_scratch *scratch, u32 hartid) +void sbi_timer_event_stop(struct sbi_scratch *scratch) { - sbi_platform_timer_event_stop(sbi_platform_ptr(scratch), hartid); + sbi_platform_timer_event_stop(sbi_platform_ptr(scratch)); } -void sbi_timer_event_start(struct sbi_scratch *scratch, u32 hartid, - u64 next_event) +void sbi_timer_event_start(struct sbi_scratch *scratch, u64 next_event) { sbi_platform_timer_event_start(sbi_platform_ptr(scratch), - hartid, next_event); + next_event); csr_clear(mip, MIP_STIP); csr_set(mie, MIP_MTIP); } -void sbi_timer_process(struct sbi_scratch *scratch, u32 hartid) +void sbi_timer_process(struct sbi_scratch *scratch) { csr_clear(mie, MIP_MTIP); csr_set(mip, MIP_STIP); } -int sbi_timer_init(struct sbi_scratch *scratch, u32 hartid, - bool cold_boot) +int sbi_timer_init(struct sbi_scratch *scratch, bool cold_boot) { return sbi_platform_timer_init(sbi_platform_ptr(scratch), - hartid, cold_boot); + cold_boot); } diff --git a/lib/sbi_trap.c b/lib/sbi_trap.c index d628c4c..c6a6b3f 100644 --- a/lib/sbi_trap.c +++ b/lib/sbi_trap.c @@ -147,7 +147,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs, mcause &= ~(1UL << (__riscv_xlen - 1)); switch (mcause) { case IRQ_M_TIMER: - sbi_timer_process(scratch, hartid); + sbi_timer_process(scratch); break; case IRQ_M_SOFT: sbi_ipi_process(scratch); |