arm: powerpc: comment halt(code)
PATCH 1/1 arm: powerpc: comment halt(code)
We're being a bit tricky when we change the prototype of halt() to take 'code' as an argument. Doing this gives us a last chance to see it when inspecting the halted unit test state (it'll be in r0/x0 for arm/arm64 and r3 for powerpc.) Let's comment this trick to avoid confusion.
--- lib/arm/io.c | 10 ++++++++-- lib/powerpc/io.c | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-)
lib/arm/io.c +8 -2
@@ -18,8 +18,6 @@#include "io.h" -extern void halt (int code); -static struct spinlock uart_lock;/* * Use this guess for the uart base in order to make an attempt at
@@ -89,6 +87,14 @@ void puts(const char *s)spin_unlock (&uart_lock); } + +/* +* Defining halt to take 'code' as an argument guarantees that it will +* be in x0/r0 when we halt. That gives us a final chance to see the exit +* status while inspecting the halted unit test state. +*/ +extern void halt (int code); +void exit (int code) {chr_testdev_exit (code);
lib/powerpc/io.c +7 -2
@@ -11,8 +11,6 @@#include <asm/setup.h> #include "io.h" -extern void halt (int code); -static struct spinlock print_lock;void io_init (void )
@@ -28,6 +26,13 @@ void puts(const char *s)spin_unlock (&print_lock); } +/* +* Defining halt to take 'code' as an argument guarantees that it will +* be in r3 when we halt. That gives us a final chance to see the exit +* status while inspecting the halted unit test state. +*/ +extern void halt (int code); +void exit (int code) {// FIXME: change this print-exit/rtas-poweroff to chr_testdev_exit(),
Signature · 1 line
2.20.1
Quoted 55 lines · Andrew Jones
We're being a bit tricky when we change the prototype of
halt()to take 'code' as an argument. Doing this gives us a last chance to see it when inspecting the halted unit test state (it'll be in r0/x0 for arm/arm64 and r3 for powerpc.) Let's comment this trick to avoid confusion.Suggested-by Alexandru Elisei <[email protected]>Signed-off-by Andrew Jones <[email protected]>--- lib/arm/io.c | 10 ++++++++-- lib/powerpc/io.c | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-)lib/arm/io.c +8
-2@@ -18,8 +18,6 @@#include "io.h" -extern void halt (int code); -static struct spinlock uart_lock;/* * Use this guess for the uart base in order to make an attempt at @@ -89,6 +87,14 @@ void puts(const char *s)spin_unlock (&uart_lock); } + +/* +* Defining halt to take 'code' as an argument guarantees that it will +* be in x0/r0 when we halt. That gives us a final chance to see the exit +* status while inspecting the halted unit test state. +*/ +extern void halt (int code); +void exit (int code) {chr_testdev_exit (code);lib/powerpc/io.c +0
-2@@ -11,8 +11,6 @@#include <asm/setup.h> #include "io.h" -extern void halt (int code); -static struct spinlock print_lock;void io_init (void )
lib/powerpc/io.c void puts(const char *s) · line 34
Quoted 9 lines
lib/powerpc/io.c +6
-0@@ -28,6 +26,13 @@ void puts(const char *s)spin_unlock (&print_lock); } +/* +* Defining halt to take 'code' as an argument guarantees that it will +* be in r3 when we halt. That gives us a final chance to see the exit +* status while inspecting the halted unit test state. +*/ +extern void halt (int code);
Quoted 58 lines · Andrew Jones
We're being a bit tricky when we change the prototype of
halt()to take 'code' as an argument. Doing this gives us a last chance to see it when inspecting the halted unit test state (it'll be in r0/x0 for arm/arm64 and r3 for powerpc.) Let's comment this trick to avoid confusion.Suggested-by Alexandru Elisei <[email protected]>Signed-off-by Andrew Jones <[email protected]>--- lib/arm/io.c | 10 ++++++++-- lib/powerpc/io.c | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-)lib/arm/io.c +8
-2@@ -18,8 +18,6 @@#include "io.h" -extern void halt (int code); -static struct spinlock uart_lock;/* * Use this guess for the uart base in order to make an attempt at @@ -89,6 +87,14 @@ void puts(const char *s)spin_unlock (&uart_lock); } + +/* +* Defining halt to take 'code' as an argument guarantees that it will +* be in x0/r0 when we halt. That gives us a final chance to see the exit +* status while inspecting the halted unit test state. +*/ +extern void halt (int code); +void exit (int code) {chr_testdev_exit (code);lib/powerpc/io.c +0
-2@@ -11,8 +11,6 @@#include <asm/setup.h> #include "io.h" -extern void halt (int code); -static struct spinlock print_lock;void io_init (void )@@ -28,6 +26,13 @@ void puts(const char *s)spin_unlock (&print_lock); }
lib/powerpc/io.c void puts(const char *s) · line 38
Quoted 10 lines
lib/powerpc/io.c +7
-0+/* +* Defining halt to take 'code' as an argument guarantees that it will +* be in r3 when we halt. That gives us a final chance to see the exit +* status while inspecting the halted unit test state. +*/ +extern void halt (int code); +void exit (int code) {// FIXME: change this print-exit/rtas-poweroff to chr_testdev_exit(),
Paolo Bonzini
maintainerQuoted 59 lines · Andrew Jones
We're being a bit tricky when we change the prototype of
halt()to take 'code' as an argument. Doing this gives us a last chance to see it when inspecting the halted unit test state (it'll be in r0/x0 for arm/arm64 and r3 for powerpc.) Let's comment this trick to avoid confusion.Suggested-by Alexandru Elisei <[email protected]>Signed-off-by Andrew Jones <[email protected]>--- lib/arm/io.c | 10 ++++++++-- lib/powerpc/io.c | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-)lib/arm/io.c +8
-2@@ -18,8 +18,6 @@#include "io.h" -extern void halt (int code); -static struct spinlock uart_lock;/* * Use this guess for the uart base in order to make an attempt at @@ -89,6 +87,14 @@ void puts(const char *s)spin_unlock (&uart_lock); } + +/* +* Defining halt to take 'code' as an argument guarantees that it will +* be in x0/r0 when we halt. That gives us a final chance to see the exit +* status while inspecting the halted unit test state. +*/ +extern void halt (int code); +void exit (int code) {chr_testdev_exit (code);lib/powerpc/io.c +0
-2@@ -11,8 +11,6 @@#include <asm/setup.h> #include "io.h" -extern void halt (int code); -static struct spinlock print_lock;void io_init (void )@@ -28,6 +26,13 @@ void puts(const char *s)spin_unlock (&print_lock); }
lib/powerpc/io.c void puts(const char *s) · line 38
Quoted 10 lines
lib/powerpc/io.c +7
-0+/* +* Defining halt to take 'code' as an argument guarantees that it will +* be in r3 when we halt. That gives us a final chance to see the exit +* status while inspecting the halted unit test state. +*/ +extern void halt (int code); +void exit (int code) {// FIXME: change this print-exit/rtas-poweroff to chr_testdev_exit(),
Pushed, thanks.
Paolo