summaryrefslogtreecommitdiffstats
path: root/core/opal.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-11-29 15:36:59 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-03 22:10:55 -0600
commitb41553c2240240fee094830b0ef80699791ca47d (patch)
treed491ae7ca1ff455678e7ba2797ead513bd6855df /core/opal.c
parent9c565ee6bca4b665d9d1120bfff5e88ee80615bc (diff)
downloadtalos-skiboot-b41553c2240240fee094830b0ef80699791ca47d.tar.gz
talos-skiboot-b41553c2240240fee094830b0ef80699791ca47d.zip
asm/head: move opal entry token check into C
Move opal_check_token from asm to C. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/opal.c')
-rw-r--r--core/opal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/opal.c b/core/opal.c
index 5143692d..4d528279 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -118,15 +118,20 @@ static void opal_trace_entry(struct stack_frame *eframe __unused)
#endif
}
+static int64_t opal_check_token(uint64_t token);
+
/* Called from head.S, thus no prototype */
int64_t opal_entry_check(struct stack_frame *eframe);
-int64_t __attrconst opal_entry_check(struct stack_frame *eframe)
+int64_t opal_entry_check(struct stack_frame *eframe)
{
uint64_t token = eframe->gpr[0];
opal_trace_entry(eframe);
+ if (!opal_check_token(token))
+ return opal_bad_token(token);
+
return OPAL_SUCCESS;
}
OpenPOWER on IntegriCloud