mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-31 19:21:44 +00:00
include: sbi_system: Remove scratch parameter and redundant functions
This patch removes scratch parameter and redundant functions from sbi_system. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
parent
9e52a45f4b
commit
ec0d80f5b4
4 changed files with 11 additions and 39 deletions
|
@ -12,18 +12,8 @@
|
||||||
|
|
||||||
#include <sbi/sbi_types.h>
|
#include <sbi/sbi_types.h>
|
||||||
|
|
||||||
struct sbi_scratch;
|
void __noreturn sbi_system_reboot(u32 type);
|
||||||
|
|
||||||
int sbi_system_early_init(struct sbi_scratch *scratch, bool cold_boot);
|
void __noreturn sbi_system_shutdown(u32 type);
|
||||||
|
|
||||||
int sbi_system_final_init(struct sbi_scratch *scratch, bool cold_boot);
|
|
||||||
|
|
||||||
void sbi_system_early_exit(struct sbi_scratch *scratch);
|
|
||||||
|
|
||||||
void sbi_system_final_exit(struct sbi_scratch *scratch);
|
|
||||||
|
|
||||||
void __noreturn sbi_system_reboot(struct sbi_scratch *scratch, u32 type);
|
|
||||||
|
|
||||||
void __noreturn sbi_system_shutdown(struct sbi_scratch *scratch, u32 type);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -102,7 +102,7 @@ static int sbi_ecall_legacy_handler(unsigned long extid, unsigned long funcid,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SBI_EXT_0_1_SHUTDOWN:
|
case SBI_EXT_0_1_SHUTDOWN:
|
||||||
sbi_system_shutdown(scratch, 0);
|
sbi_system_shutdown(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = SBI_ENOTSUPP;
|
ret = SBI_ENOTSUPP;
|
||||||
|
|
|
@ -160,7 +160,7 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
|
||||||
if (rc)
|
if (rc)
|
||||||
sbi_hart_hang();
|
sbi_hart_hang();
|
||||||
|
|
||||||
rc = sbi_system_early_init(scratch, TRUE);
|
rc = sbi_platform_early_init(plat, TRUE);
|
||||||
if (rc)
|
if (rc)
|
||||||
sbi_hart_hang();
|
sbi_hart_hang();
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
|
||||||
if (rc)
|
if (rc)
|
||||||
sbi_hart_hang();
|
sbi_hart_hang();
|
||||||
|
|
||||||
rc = sbi_system_final_init(scratch, TRUE);
|
rc = sbi_platform_final_init(plat, TRUE);
|
||||||
if (rc)
|
if (rc)
|
||||||
sbi_hart_hang();
|
sbi_hart_hang();
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)
|
||||||
if (rc)
|
if (rc)
|
||||||
sbi_hart_hang();
|
sbi_hart_hang();
|
||||||
|
|
||||||
rc = sbi_system_early_init(scratch, FALSE);
|
rc = sbi_platform_early_init(plat, FALSE);
|
||||||
if (rc)
|
if (rc)
|
||||||
sbi_hart_hang();
|
sbi_hart_hang();
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)
|
||||||
if (rc)
|
if (rc)
|
||||||
sbi_hart_hang();
|
sbi_hart_hang();
|
||||||
|
|
||||||
rc = sbi_system_final_init(scratch, FALSE);
|
rc = sbi_platform_final_init(plat, FALSE);
|
||||||
if (rc)
|
if (rc)
|
||||||
sbi_hart_hang();
|
sbi_hart_hang();
|
||||||
|
|
||||||
|
|
|
@ -17,30 +17,11 @@
|
||||||
#include <sbi/sbi_ipi.h>
|
#include <sbi/sbi_ipi.h>
|
||||||
#include <sbi/sbi_init.h>
|
#include <sbi/sbi_init.h>
|
||||||
|
|
||||||
int sbi_system_early_init(struct sbi_scratch *scratch, bool cold_boot)
|
void __noreturn sbi_system_reboot(u32 type)
|
||||||
{
|
|
||||||
return sbi_platform_early_init(sbi_platform_ptr(scratch), cold_boot);
|
|
||||||
}
|
|
||||||
|
|
||||||
int sbi_system_final_init(struct sbi_scratch *scratch, bool cold_boot)
|
|
||||||
{
|
|
||||||
return sbi_platform_final_init(sbi_platform_ptr(scratch), cold_boot);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sbi_system_early_exit(struct sbi_scratch *scratch)
|
|
||||||
{
|
|
||||||
sbi_platform_early_exit(sbi_platform_ptr(scratch));
|
|
||||||
}
|
|
||||||
|
|
||||||
void sbi_system_final_exit(struct sbi_scratch *scratch)
|
|
||||||
{
|
|
||||||
sbi_platform_final_exit(sbi_platform_ptr(scratch));
|
|
||||||
}
|
|
||||||
|
|
||||||
void __noreturn sbi_system_reboot(struct sbi_scratch *scratch, u32 type)
|
|
||||||
{
|
{
|
||||||
ulong hbase = 0, hmask;
|
ulong hbase = 0, hmask;
|
||||||
u32 cur_hartid = current_hartid();
|
u32 cur_hartid = current_hartid();
|
||||||
|
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
|
||||||
|
|
||||||
/* Send HALT IPI to every hart other than the current hart */
|
/* Send HALT IPI to every hart other than the current hart */
|
||||||
while (!sbi_hsm_hart_started_mask(hbase, &hmask)) {
|
while (!sbi_hsm_hart_started_mask(hbase, &hmask)) {
|
||||||
|
@ -61,10 +42,11 @@ void __noreturn sbi_system_reboot(struct sbi_scratch *scratch, u32 type)
|
||||||
sbi_exit(scratch);
|
sbi_exit(scratch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __noreturn sbi_system_shutdown(struct sbi_scratch *scratch, u32 type)
|
void __noreturn sbi_system_shutdown(u32 type)
|
||||||
{
|
{
|
||||||
ulong hbase = 0, hmask;
|
ulong hbase = 0, hmask;
|
||||||
u32 cur_hartid = current_hartid();
|
u32 cur_hartid = current_hartid();
|
||||||
|
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
|
||||||
|
|
||||||
/* Send HALT IPI to every hart other than the current hart */
|
/* Send HALT IPI to every hart other than the current hart */
|
||||||
while (!sbi_hsm_hart_started_mask(hbase, &hmask)) {
|
while (!sbi_hsm_hart_started_mask(hbase, &hmask)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue