forked from Mirrors/opensbi
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>
This commit is contained in:
@@ -24,11 +24,11 @@ int clint_cold_ipi_init(unsigned long base, u32 hart_count);
|
||||
|
||||
u64 clint_timer_value(void);
|
||||
|
||||
void clint_timer_event_stop(u32 target_hart);
|
||||
void clint_timer_event_stop(void);
|
||||
|
||||
void clint_timer_event_start(u32 target_hart, u64 next_event);
|
||||
void clint_timer_event_start(u64 next_event);
|
||||
|
||||
int clint_warm_timer_init(u32 target_hart);
|
||||
int clint_warm_timer_init(void);
|
||||
|
||||
int clint_cold_timer_init(unsigned long base, u32 hart_count);
|
||||
|
||||
|
@@ -90,8 +90,10 @@ u64 clint_timer_value(void)
|
||||
return readq_relaxed(clint_time_val);
|
||||
}
|
||||
|
||||
void clint_timer_event_stop(u32 target_hart)
|
||||
void clint_timer_event_stop(void)
|
||||
{
|
||||
u32 target_hart = sbi_current_hartid();
|
||||
|
||||
if (clint_time_hart_count <= target_hart)
|
||||
return;
|
||||
|
||||
@@ -99,8 +101,10 @@ void clint_timer_event_stop(u32 target_hart)
|
||||
writeq_relaxed(-1ULL, &clint_time_cmp[target_hart]);
|
||||
}
|
||||
|
||||
void clint_timer_event_start(u32 target_hart, u64 next_event)
|
||||
void clint_timer_event_start(u64 next_event)
|
||||
{
|
||||
u32 target_hart = sbi_current_hartid();
|
||||
|
||||
if (clint_time_hart_count <= target_hart)
|
||||
return;
|
||||
|
||||
@@ -108,8 +112,10 @@ void clint_timer_event_start(u32 target_hart, u64 next_event)
|
||||
writeq_relaxed(next_event, &clint_time_cmp[target_hart]);
|
||||
}
|
||||
|
||||
int clint_warm_timer_init(u32 target_hart)
|
||||
int clint_warm_timer_init(void)
|
||||
{
|
||||
u32 target_hart = sbi_current_hartid();
|
||||
|
||||
if (clint_time_hart_count <= target_hart ||
|
||||
!clint_time_base)
|
||||
return -1;
|
||||
|
@@ -68,7 +68,7 @@ static int k210_ipi_init(bool cold_boot)
|
||||
return clint_warm_ipi_init();
|
||||
}
|
||||
|
||||
static int k210_timer_init(u32 hartid, bool cold_boot)
|
||||
static int k210_timer_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -79,7 +79,7 @@ static int k210_timer_init(u32 hartid, bool cold_boot)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return clint_warm_timer_init(hartid);
|
||||
return clint_warm_timer_init();
|
||||
}
|
||||
|
||||
static int k210_system_reboot(u32 type)
|
||||
|
@@ -105,7 +105,7 @@ static int sifive_u_ipi_init(bool cold_boot)
|
||||
return clint_warm_ipi_init();
|
||||
}
|
||||
|
||||
static int sifive_u_timer_init(u32 hartid, bool cold_boot)
|
||||
static int sifive_u_timer_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -116,7 +116,7 @@ static int sifive_u_timer_init(u32 hartid, bool cold_boot)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return clint_warm_timer_init(hartid);
|
||||
return clint_warm_timer_init();
|
||||
}
|
||||
|
||||
static int sifive_u_system_down(u32 type)
|
||||
|
@@ -106,7 +106,7 @@ static int virt_ipi_init(bool cold_boot)
|
||||
return clint_warm_ipi_init();
|
||||
}
|
||||
|
||||
static int virt_timer_init(u32 hartid, bool cold_boot)
|
||||
static int virt_timer_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -117,7 +117,7 @@ static int virt_timer_init(u32 hartid, bool cold_boot)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return clint_warm_timer_init(hartid);
|
||||
return clint_warm_timer_init();
|
||||
}
|
||||
|
||||
static int virt_system_down(u32 type)
|
||||
|
@@ -158,7 +158,7 @@ static int fu540_ipi_init(bool cold_boot)
|
||||
return clint_warm_ipi_init();
|
||||
}
|
||||
|
||||
static int fu540_timer_init(u32 hartid, bool cold_boot)
|
||||
static int fu540_timer_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -169,7 +169,7 @@ static int fu540_timer_init(u32 hartid, bool cold_boot)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return clint_warm_timer_init(hartid);
|
||||
return clint_warm_timer_init();
|
||||
}
|
||||
|
||||
static int fu540_system_down(u32 type)
|
||||
|
Reference in New Issue
Block a user