aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2019-12-04 17:13:00 +1100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2019-12-05 15:18:54 +1100
commitc50195e007319bf39c5315289ab93a2d7d02828b (patch)
tree0cbb88f1b2a923a02b06b4e177dde271c4e7ae94
parent7477a174abc03d3e6f508412f69ea0bbd63b93ac (diff)
downloadSLOF-c50195e007319bf39c5315289ab93a2d7d02828b.zip
SLOF-c50195e007319bf39c5315289ab93a2d7d02828b.tar.gz
SLOF-c50195e007319bf39c5315289ab93a2d7d02828b.tar.bz2
ibm,client-architecture-support: Fix stack handling
fdt-fix-cas-node returns the end address after it's finished which the caller (ibm,client-architecture-support) does not use or drop. This renames fdt-fix-cas-node to (fdt-fix-cas-node) and adds a wrapper on top of that which does the drop. This will be used later for 2-pass tree patching. While at this, exit the function if memory allocation failed. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
-rw-r--r--board-qemu/slof/archsupport.fs8
-rw-r--r--board-qemu/slof/fdt.fs8
2 files changed, 12 insertions, 4 deletions
diff --git a/board-qemu/slof/archsupport.fs b/board-qemu/slof/archsupport.fs
index 33ea765..6512d57 100644
--- a/board-qemu/slof/archsupport.fs
+++ b/board-qemu/slof/archsupport.fs
@@ -18,7 +18,11 @@
\ to come back to right boot device
\ Allocate memory for H_CALL
cas-buffer-size alloc-mem ( vec memaddr )
- dup 0= IF ." out of memory during ibm,client-architecture-support" cr THEN
+ dup 0= IF
+ ." out of memory during ibm,client-architecture-support" cr
+ 2drop TRUE
+ EXIT
+ THEN
swap over cas-buffer-size ( memaddr vec memaddr size )
\ make h_call to hypervisor
hv-cas 0= IF ( memaddr )
@@ -28,7 +32,7 @@
dup 4 + fdt-init
fdt-check-header
fdt-struct fdt-fix-cas-node
- fdt-fix-cas-success NOT
+ fdt-fix-cas-success NOT ( memaddr err? )
s" /" find-node fdt-fix-phandles
ELSE
FALSE
diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs
index 3e4c1b3..5ece270 100644
--- a/board-qemu/slof/fdt.fs
+++ b/board-qemu/slof/fdt.fs
@@ -394,7 +394,7 @@ r> drop
find-node ?dup 0 <> IF set-node THEN
;
-: fdt-fix-cas-node ( start -- end )
+: (fdt-fix-cas-node) ( start -- end )
recursive
fdt-next-tag dup OF_DT_BEGIN_NODE <> IF
." Error " cr
@@ -435,7 +435,7 @@ r> drop
ELSE dup OF_DT_BEGIN_NODE = IF
drop ( drop tag )
4 -
- fdt-fix-cas-node
+ (fdt-fix-cas-node)
get-parent set-node
fdt-debug IF ." Returning back " pwd cr THEN
ELSE
@@ -449,6 +449,10 @@ r> drop
drop \ drop tag
;
+: fdt-fix-cas-node ( start -- )
+ (fdt-fix-cas-node) drop
+;
+
: fdt-fix-cas-success
fdt-cas-fix?
;