@@ -622,6 +622,16 @@ static void copy_exception_vectors(void)
static void per_thread_sanity_checks(void)
{
+ struct cpu_thread *cpu = this_cpu();
+
+ /**
+ * @fwts-label UnknownSecondary
+ * @fwts-advice The boot CPU attampted to call in a secondary thread
+ * without initialising the corresponding cpu_thread structure. This may
+ * happen if the HDAT or devicetree reports too few threads or cores for
+ * this processor.
+ */
+ assert(cpu->state != cpu_state_no_cpu);
}
/* Called from head.S, thus no prototype. */
This patch adds a check when to verify that we have initialised the cpu_thread structure for the called in thread. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- core/init.c | 10 ++++++++++ 1 file changed, 10 insertions(+)