diff mbox

[1/3] core/init: add per_thread_sanity_checks()

Message ID 1473053170-3065-1-git-send-email-oohall@gmail.com
State Accepted
Headers show

Commit Message

Oliver O'Halloran Sept. 5, 2016, 5:26 a.m. UTC
This patch adds a function that is called early in the primary thread
and secondary thread init paths. No actual checks are added in this
patch. It just provides a sensible place to add them.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 core/init.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Stewart Smith Sept. 6, 2016, 7:11 a.m. UTC | #1
Oliver O'Halloran <oohall@gmail.com> writes:
> This patch adds a function that is called early in the primary thread
> and secondary thread init paths. No actual checks are added in this
> patch. It just provides a sensible place to add them.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> ---
>  core/init.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)

Series merged to master as of cd649b56867cbf959159c20c6cb3c077f88c7448
diff mbox

Patch

diff --git a/core/init.c b/core/init.c
index 821094fed1c1..79aa048e9e2c 100644
--- a/core/init.c
+++ b/core/init.c
@@ -619,6 +619,11 @@  static void copy_exception_vectors(void)
 	memcpy((void *)0x100, (void *)(SKIBOOT_BASE + 0x100), 0x1f00);
 	sync_icache();
 }
+
+static void per_thread_sanity_checks(void)
+{
+}
+
 /* Called from head.S, thus no prototype. */
 void main_cpu_entry(const void *fdt, u32 master_cpu);
 
@@ -692,6 +697,9 @@  void __noreturn __nomcount main_cpu_entry(const void *fdt, u32 master_cpu)
 		dt_expand(fdt);
 	}
 
+	/* Now that we have a full devicetree, verify that we aren't on fire. */
+	per_thread_sanity_checks();
+
 	/*
 	 * From there, we follow a fairly strict initialization order.
 	 *
@@ -903,6 +911,8 @@  void __noreturn __nomcount secondary_cpu_entry(void)
 {
 	struct cpu_thread *cpu = this_cpu();
 
+	per_thread_sanity_checks();
+
 	prlog(PR_DEBUG, "INIT: CPU PIR 0x%04x called in\n", cpu->pir);
 
 	__secondary_cpu_entry();