diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-11-29 15:36:59 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-03 22:10:55 -0600 |
commit | b41553c2240240fee094830b0ef80699791ca47d (patch) | |
tree | d491ae7ca1ff455678e7ba2797ead513bd6855df /core/opal.c | |
parent | 9c565ee6bca4b665d9d1120bfff5e88ee80615bc (diff) | |
download | skiboot-b41553c2240240fee094830b0ef80699791ca47d.zip skiboot-b41553c2240240fee094830b0ef80699791ca47d.tar.gz skiboot-b41553c2240240fee094830b0ef80699791ca47d.tar.bz2 |
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.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/opal.c b/core/opal.c index 5143692..4d52827 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; } |