summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sbi/sbi_platform.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h
index bc7991c0..0264732f 100644
--- a/include/sbi/sbi_platform.h
+++ b/include/sbi/sbi_platform.h
@@ -238,22 +238,6 @@ static inline const char *sbi_platform_name(const struct sbi_platform *plat)
}
/**
- * 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
* higher than this is upgraded to a full flush.
*
@@ -298,6 +282,26 @@ static inline u32 sbi_platform_hart_stack_size(const struct sbi_platform *plat)
}
/**
+ * 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
* operation if they support a custom mechanism to start a hart. Otherwise,
* a generic WFI based approach will be used to start/stop a hart in OpenSBI.