j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: mcayland Date: Sat Nov 24 15:43:06 2012 New Revision: 1071 URL: http://tracker.coreboot.org/trac/openbios/changeset/1071
Log: Improve dir word by reducing complexity and adding some more diagnostics.
Since the OF path resolution algorithm automatically passes anything following a ':' as an argument to the specified device, we don't need to bother with handling this ourselves. As a side effect, the auxiliary word split-path-device is no longer needed as we can isolate the path by doing a simple split on ','.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/forth/debugging/client.fs trunk/openbios-devel/forth/lib/split.fs
Modified: trunk/openbios-devel/forth/debugging/client.fs ============================================================================== --- trunk/openbios-devel/forth/debugging/client.fs Fri Nov 23 16:50:43 2012 (r1070) +++ trunk/openbios-devel/forth/debugging/client.fs Sat Nov 24 15:43:06 2012 (r1071) @@ -126,12 +126,14 @@
: dir ( "{paths}<cr>" -- ) linefeed parse - split-path-device - open-dev dup 0= if + ascii , left-split + 2dup open-dev dup 0= if drop + cr ." Unable to locate device " type + 2drop exit then - -rot 2 pick + -rot 2drop -rot 2 pick " dir" rot ['] $call-method catch if 3drop
Modified: trunk/openbios-devel/forth/lib/split.fs ============================================================================== --- trunk/openbios-devel/forth/lib/split.fs Fri Nov 23 16:50:43 2012 (r1070) +++ trunk/openbios-devel/forth/lib/split.fs Sat Nov 24 15:43:06 2012 (r1071) @@ -47,24 +47,3 @@ c@ r@ = if 1- then then r> drop ; - -\ split <param-text> into separate path and device strings -: split-path-device ( str len -- pathstr len devstr len ) - ascii , left-split 2 pick 0= if - \ No comma - so either <dev>:<id> or <dev>:<id><path> - 2dup ascii \ strchr 0= if - \ No backslash so just <dev> or <dev>:<id> - s" " 2swap \ ( pathstr len devstr len ) - else - \ Contains backslash, must be a <dev>:<id><path> - ascii : left-split \ ( pathstr len devstr len ) - then - - \ Remove RHS split (unused) - 4 roll drop - 4 roll drop - else - \ Contains comma so split is already correct - then -; -