aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2013-12-02 15:45:07 +0000
committerDan Handley <dan.handley@arm.com>2013-12-12 16:06:48 +0000
commit34edaed563e78081ce17ff1f682628c11d337bf2 (patch)
tree9e12df147d801ba67d1a03b42b278eb1c02a3315
parentba6980a8db0215ba42c103b80f8981cfda80171c (diff)
BL2: Sanity check value in x0 in the entry point code
Change-Id: Icef68e314e6ba0f3694189b57f4b1dbbea5ba255
-rw-r--r--bl2/aarch64/bl2_entrypoint.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/bl2/aarch64/bl2_entrypoint.S b/bl2/aarch64/bl2_entrypoint.S
index 75970f7..03d0848 100644
--- a/bl2/aarch64/bl2_entrypoint.S
+++ b/bl2/aarch64/bl2_entrypoint.S
@@ -78,6 +78,14 @@ bl2_entrypoint:; .type bl2_entrypoint, %function
isb
/* ---------------------------------------------
+ * Check the opcodes out of paranoia.
+ * ---------------------------------------------
+ */
+ mov x0, #RUN_IMAGE
+ cmp x0, x20
+ b.ne _panic
+
+ /* ---------------------------------------------
* Zero out NOBITS sections. There are 2 of them:
* - the .bss section;
* - the coherent memory section.