diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-08-05 10:56:23 +1000 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2013-08-05 14:15:37 +1000 |
commit | 2920dd597a51920912a2c1172f145e94b00bc486 (patch) | |
tree | 425877f8108e4e8069274b2ba0956cc37fcc0ac0 /slof | |
parent | e42570623577b8598a95128da362ed88948106ba (diff) | |
download | SLOF-qemu-slof-20130805.zip SLOF-qemu-slof-20130805.tar.gz SLOF-qemu-slof-20130805.tar.bz2 |
Fix $cat-instance-unitqemu-slof-20130805
We were incorrectly checking ig instance>#units was 0 (forgot to
actually load the value before testing it) and then didn't properly
fallback to printing the node unit in that case.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'slof')
-rw-r--r-- | slof/fs/node.fs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/slof/fs/node.fs b/slof/fs/node.fs index 81a741f..73aa75c 100644 --- a/slof/fs/node.fs +++ b/slof/fs/node.fs @@ -13,6 +13,8 @@ \ Device nodes. +false VALUE debug-find-component? + VARIABLE device-tree VARIABLE current-node : get-node current-node @ dup 0= ABORT" No active device tree node" ; @@ -218,7 +220,11 @@ CREATE $indent 100 allot VARIABLE indent 0 indent ! : $cat-instance-unit dup parent 0= IF drop EXIT THEN - dup instance>#units 0= IF drop EXIT THEN + \ No instance unit, use node unit + dup instance>#units @ 0= IF + ihandle>phandle $cat-unit + EXIT + THEN dup >r push-my-self ['] my-unit CATCH IF pop-my-self r> drop EXIT THEN pop-my-self @@ -529,6 +535,7 @@ CREATE search-unit 4 cells allot \ XXX This is an old hack that allows wildcard nodes to work \ by not having a #address-cells in the parent and no \ decode unit. This should be removed. +\ (It appears to be still used on js2x) : set-instance-unit ( unitaddr len -- ) dup 0= IF 2drop 0 to user-instance-#units EXIT THEN 2dup 0 -rot bounds ?DO @@ -548,7 +555,14 @@ CREATE search-unit 4 cells allot ; : find-component ( path len -- path' len' args len node|0 ) + debug-find-component? IF + ." find-component for " 2dup type cr + THEN split-component ( path'. args. name. unit. ) + debug-find-component? IF + ." -> unit =" 2dup type cr + ." -> stack =" .s cr + THEN ['] set-search-unit CATCH IF \ XXX: See comment in set-instance-unit ." WARNING: Obsolete old wildcard hack " .s cr |