mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
include: sbi_platform: Improve sbi_platform_hart_disabled() API
The sbi_platform_hart_disabled() should return TRUE for HART id greater than platform hart count. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
@@ -237,22 +237,6 @@ static inline const char *sbi_platform_name(const struct sbi_platform *plat)
|
|||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether the given HART is disabled
|
|
||||||
*
|
|
||||||
* @param plat pointer to struct sbi_platform
|
|
||||||
* @param hartid HART ID
|
|
||||||
*
|
|
||||||
* @return TRUE if HART is disabled and FALSE otherwise
|
|
||||||
*/
|
|
||||||
static inline bool sbi_platform_hart_disabled(const struct sbi_platform *plat,
|
|
||||||
u32 hartid)
|
|
||||||
{
|
|
||||||
if (plat && sbi_platform_ops(plat)->hart_disabled)
|
|
||||||
return sbi_platform_ops(plat)->hart_disabled(hartid);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get platform specific tlb range flush maximum value. Any request with size
|
* Get platform specific tlb range flush maximum value. Any request with size
|
||||||
* higher than this is upgraded to a full flush.
|
* higher than this is upgraded to a full flush.
|
||||||
@@ -297,6 +281,26 @@ static inline u32 sbi_platform_hart_stack_size(const struct sbi_platform *plat)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether the given HART is disabled
|
||||||
|
*
|
||||||
|
* @param plat pointer to struct sbi_platform
|
||||||
|
* @param hartid HART ID
|
||||||
|
*
|
||||||
|
* @return TRUE if HART is disabled and FALSE otherwise
|
||||||
|
*/
|
||||||
|
static inline bool sbi_platform_hart_disabled(const struct sbi_platform *plat,
|
||||||
|
u32 hartid)
|
||||||
|
{
|
||||||
|
if (plat) {
|
||||||
|
if (sbi_platform_hart_count(plat) <= hartid)
|
||||||
|
return TRUE;
|
||||||
|
if (sbi_platform_ops(plat)->hart_disabled)
|
||||||
|
return sbi_platform_ops(plat)->hart_disabled(hartid);
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bringup a given hart from previous stage. Platform should implement this
|
* Bringup a given hart from previous stage. Platform should implement this
|
||||||
* operation if they support a custom mechanism to start a hart. Otherwise,
|
* operation if they support a custom mechanism to start a hart. Otherwise,
|
||||||
|
Reference in New Issue
Block a user