forked from Mirrors/opensbi
lib: sbi_hart: Remove HART available mask and related APIs
The HART available mask and related APIs are now totally redundant because of more extensive HART state machine implemented by sbi_hsm. Due to above, we remove HART available mask and related APIs. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
@@ -32,12 +32,6 @@ sbi_hart_switch_mode(unsigned long arg0, unsigned long arg1,
|
|||||||
unsigned long next_addr, unsigned long next_mode,
|
unsigned long next_addr, unsigned long next_mode,
|
||||||
bool next_virt);
|
bool next_virt);
|
||||||
|
|
||||||
void sbi_hart_mark_available(u32 hartid);
|
|
||||||
|
|
||||||
ulong sbi_hart_available_mask(void);
|
|
||||||
|
|
||||||
void sbi_hart_unmark_available(u32 hartid);
|
|
||||||
|
|
||||||
struct sbi_scratch *sbi_hart_id_to_scratch(struct sbi_scratch *scratch,
|
struct sbi_scratch *sbi_hart_id_to_scratch(struct sbi_scratch *scratch,
|
||||||
u32 hartid);
|
u32 hartid);
|
||||||
|
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
#include <sbi/riscv_barrier.h>
|
#include <sbi/riscv_barrier.h>
|
||||||
#include <sbi/riscv_encoding.h>
|
#include <sbi/riscv_encoding.h>
|
||||||
#include <sbi/riscv_fp.h>
|
#include <sbi/riscv_fp.h>
|
||||||
#include <sbi/riscv_locks.h>
|
|
||||||
#include <sbi/sbi_bitops.h>
|
#include <sbi/sbi_bitops.h>
|
||||||
#include <sbi/sbi_console.h>
|
#include <sbi/sbi_console.h>
|
||||||
#include <sbi/sbi_error.h>
|
#include <sbi/sbi_error.h>
|
||||||
@@ -342,34 +341,6 @@ sbi_hart_switch_mode(unsigned long arg0, unsigned long arg1,
|
|||||||
__builtin_unreachable();
|
__builtin_unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
static spinlock_t avail_hart_mask_lock = SPIN_LOCK_INITIALIZER;
|
|
||||||
static volatile unsigned long avail_hart_mask = 0;
|
|
||||||
|
|
||||||
void sbi_hart_mark_available(u32 hartid)
|
|
||||||
{
|
|
||||||
spin_lock(&avail_hart_mask_lock);
|
|
||||||
avail_hart_mask |= (1UL << hartid);
|
|
||||||
spin_unlock(&avail_hart_mask_lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sbi_hart_unmark_available(u32 hartid)
|
|
||||||
{
|
|
||||||
spin_lock(&avail_hart_mask_lock);
|
|
||||||
avail_hart_mask &= ~(1UL << hartid);
|
|
||||||
spin_unlock(&avail_hart_mask_lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
ulong sbi_hart_available_mask(void)
|
|
||||||
{
|
|
||||||
ulong ret;
|
|
||||||
|
|
||||||
spin_lock(&avail_hart_mask_lock);
|
|
||||||
ret = avail_hart_mask;
|
|
||||||
spin_unlock(&avail_hart_mask_lock);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef struct sbi_scratch *(*h2s)(ulong hartid);
|
typedef struct sbi_scratch *(*h2s)(ulong hartid);
|
||||||
|
|
||||||
struct sbi_scratch *sbi_hart_id_to_scratch(struct sbi_scratch *scratch,
|
struct sbi_scratch *sbi_hart_id_to_scratch(struct sbi_scratch *scratch,
|
||||||
|
@@ -196,8 +196,6 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
|
|||||||
|
|
||||||
wake_coldboot_harts(scratch, hartid);
|
wake_coldboot_harts(scratch, hartid);
|
||||||
|
|
||||||
sbi_hart_mark_available(hartid);
|
|
||||||
|
|
||||||
init_count = sbi_scratch_offset_ptr(scratch, init_count_offset);
|
init_count = sbi_scratch_offset_ptr(scratch, init_count_offset);
|
||||||
(*init_count)++;
|
(*init_count)++;
|
||||||
|
|
||||||
@@ -249,8 +247,6 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)
|
|||||||
if (rc)
|
if (rc)
|
||||||
sbi_hart_hang();
|
sbi_hart_hang();
|
||||||
|
|
||||||
sbi_hart_mark_available(hartid);
|
|
||||||
|
|
||||||
init_count = sbi_scratch_offset_ptr(scratch, init_count_offset);
|
init_count = sbi_scratch_offset_ptr(scratch, init_count_offset);
|
||||||
(*init_count)++;
|
(*init_count)++;
|
||||||
|
|
||||||
@@ -326,8 +322,6 @@ void __noreturn sbi_exit(struct sbi_scratch *scratch)
|
|||||||
if (sbi_platform_hart_disabled(plat, hartid))
|
if (sbi_platform_hart_disabled(plat, hartid))
|
||||||
sbi_hart_hang();
|
sbi_hart_hang();
|
||||||
|
|
||||||
sbi_hart_unmark_available(hartid);
|
|
||||||
|
|
||||||
sbi_platform_early_exit(plat);
|
sbi_platform_early_exit(plat);
|
||||||
|
|
||||||
sbi_timer_exit(scratch);
|
sbi_timer_exit(scratch);
|
||||||
|
Reference in New Issue
Block a user