aboutsummaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-11-29 15:36:58 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-03 22:10:55 -0600
commit9c565ee6bca4b665d9d1120bfff5e88ee80615bc (patch)
tree43f958cb7586847fb1babbf225e252afea6441f0 /asm
parentbc74922ab1ed025bf8216b49fb7b214d74de087a (diff)
downloadskiboot-9c565ee6bca4b665d9d1120bfff5e88ee80615bc.zip
skiboot-9c565ee6bca4b665d9d1120bfff5e88ee80615bc.tar.gz
skiboot-9c565ee6bca4b665d9d1120bfff5e88ee80615bc.tar.bz2
asm/head: add entry/exit calls
Add entry and exit C functions that can do some more complex checks before the opal proper call. This requires saving off volatile registers that have arguments in them. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'asm')
-rw-r--r--asm/head.S16
1 files changed, 10 insertions, 6 deletions
diff --git a/asm/head.S b/asm/head.S
index ccf0948..a786ba1 100644
--- a/asm/head.S
+++ b/asm/head.S
@@ -930,8 +930,7 @@ opal_entry:
std %r1,STACK_GPR1(%r12)
mr %r1,%r12
- /* May save arguments for tracing */
-#ifdef OPAL_TRACE_ENTRY
+ /* Save arguments because we call C */
std %r3,STACK_GPR3(%r1)
std %r4,STACK_GPR4(%r1)
std %r5,STACK_GPR5(%r1)
@@ -940,7 +939,7 @@ opal_entry:
std %r8,STACK_GPR8(%r1)
std %r9,STACK_GPR9(%r1)
std %r10,STACK_GPR10(%r1)
-#endif
+
/* Save Token (r0), LR and r13 */
mflr %r12
std %r0,STACK_GPR0(%r1)
@@ -967,9 +966,12 @@ opal_entry:
cmpwi %r12,0
bne 3f
-#ifdef OPAL_TRACE_ENTRY
+ /* Check entry */
mr %r3,%r1
- bl opal_trace_entry
+ bl opal_entry_check
+ cmpdi %r3,0
+ bne 1f
+
ld %r0,STACK_GPR0(%r1)
ld %r3,STACK_GPR3(%r1)
ld %r4,STACK_GPR4(%r1)
@@ -979,7 +981,6 @@ opal_entry:
ld %r8,STACK_GPR8(%r1)
ld %r9,STACK_GPR9(%r1)
ld %r10,STACK_GPR10(%r1)
-#endif /* OPAL_TRACE_ENTRY */
/* Convert our token into a table entry and get the
* function pointer. Also check the token.
@@ -997,6 +998,9 @@ opal_entry:
/* Jump ! */
bctrl
+ mr %r4,%r1
+ bl opal_exit_check
+
1: ld %r12,STACK_LR(%r1)
mtlr %r12
ld %r13,STACK_GPR13(%r1)