[Skiboot] [PATCH 3/4] init: Save away first 16 bytes of memory

Michael Neuling mikey at neuling.org
Mon Mar 7 13:27:33 AEDT 2016


Currently the null branch catcher blows away the first 16 bytes of
memory.

This patch saves this away in case we need to reinstate them later

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 core/init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/core/init.c b/core/init.c
index 1d2f6e0..1d9ef70 100644
--- a/core/init.c
+++ b/core/init.c
@@ -49,6 +49,7 @@ enum proc_gen proc_gen;
 
 static uint64_t kernel_entry;
 static bool kernel_32bit;
+static char zero_location[16];
 
 #ifdef SKIBOOT_GCOV
 void skiboot_gcov_done(void);
@@ -539,6 +540,7 @@ static void setup_branch_null_catcher(void)
 	 * ABI v1 (ie. big endian).  This will be broken if we ever
 	 * move to ABI v2 (ie little endian)
 	 */
+	memcpy(zero_location, 0, 16); /* Save away in case we need it later */
 	memcpy(0, bn, 16);
 }
 
-- 
2.5.0



More information about the Skiboot mailing list