diff options
author | Michael Neuling <mikey@neuling.org> | 2016-05-02 15:26:18 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-05-10 16:04:40 +1000 |
commit | 6b50ff75b5194972a00ba662767c65d70c90a938 (patch) | |
tree | 57abcd5b37a28ef0ae627102155f36036f0a7aaa | |
parent | 840db3b16f5264fb0bdd88f9b786e4222aaea19d (diff) | |
download | skiboot-6b50ff75b5194972a00ba662767c65d70c90a938.zip skiboot-6b50ff75b5194972a00ba662767c65d70c90a938.tar.gz skiboot-6b50ff75b5194972a00ba662767c65d70c90a938.tar.bz2 |
test/hello_world: Call OPAL_CEC_POWER_DOWN at end
Call OPAL_CEC_POWER_DOWN at end rather than using a raw attn
instruction. We are doing this since attn should be disabled in the
host kernel otherwise userspace may crash the machine by calling it.
We are now doing two opal calls so need to save some registers which
are volatile over opal calls.
This bloats the code from 10 instructions up to 16. May god have mercy
on my soul.
Signed-off-by: Michael Neuling <mikey@neuling.org>
[stewart@linux.vnet.ibm.com: change hello world test run to look for power
down rather than ATTN]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | test/hello_world/hello_kernel/hello_kernel.S | 20 | ||||
-rwxr-xr-x | test/hello_world/run_mambo_hello_world.sh | 2 |
2 files changed, 18 insertions, 4 deletions
diff --git a/test/hello_world/hello_kernel/hello_kernel.S b/test/hello_world/hello_kernel/hello_kernel.S index cd1d744..6cc6409 100644 --- a/test/hello_world/hello_kernel/hello_kernel.S +++ b/test/hello_world/hello_kernel/hello_kernel.S @@ -26,7 +26,14 @@ . = 0x0 .globl _start _start: - mr %r2, %r8 /* r8 is the OPAL base passed in by skiboot */ +/* + * Save some values passed in from skiboot into registers that are + * non-volatile over OPAL calls. + * r8 is the OPAL base + * r9 is the OPAL entry point point + */ + mr %r13, %r8 + mr %r14, %r9 bl here here: mflr %r8 /* work out where we are running */ @@ -35,10 +42,17 @@ here: mflr %r8 /* work out where we are running */ li %r3, 0 /* terminal 0 */ addi %r4, %r8, len - here /* ptr to length of string */ addi %r5, %r8, str - here /* ptr to string start */ + mr %r2, %r13 + mtctr %r14 + bctrl - mtctr %r9 /* R9 is the OPAL entry point passed in by skiboot */ + li %r0, 5 /* OPAL_CEC_POWER_DOWN */ + mr %r2, %r13 + mtctr %r14 bctrl - attn + + /* We shouldn't get here but if we do, just wait here */ + b . len: .long 0x00 diff --git a/test/hello_world/run_mambo_hello_world.sh b/test/hello_world/run_mambo_hello_world.sh index e6f4d86..ba28a21 100755 --- a/test/hello_world/run_mambo_hello_world.sh +++ b/test/hello_world/run_mambo_hello_world.sh @@ -38,7 +38,7 @@ spawn $MAMBO_PATH/$MAMBO_BINARY -n -f ../../test/hello_world/run_hello_world.tcl expect { timeout { send_user "\nTimeout waiting for hello world\n"; exit 1 } eof { send_user "\nUnexpected EOF\n;" exit 1 } -"ATTN" +"Execution stopped: Sim Support exit requested stop" } wait exit 0 |