2009-01-25 07:31:15 +00:00
|
|
|
\ -------------------------------------------------------------------------
|
|
|
|
|
\ UPA encode/decode unit
|
|
|
|
|
\ -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
: decode-unit-upa ( str len -- id lun )
|
|
|
|
|
ascii , left-split
|
|
|
|
|
( addr-R len-R addr-L len-L )
|
|
|
|
|
parse-hex
|
|
|
|
|
-rot parse-hex
|
|
|
|
|
swap
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
: encode-unit-upa ( id lun -- str len)
|
|
|
|
|
swap
|
|
|
|
|
pocket tohexstr
|
|
|
|
|
" ," pocket tmpstrcat >r
|
|
|
|
|
rot pocket tohexstr r> tmpstrcat drop
|
|
|
|
|
;
|
2006-06-10 01:37:53 +00:00
|
|
|
|
|
|
|
|
" /" find-device
|
|
|
|
|
2 encode-int " #address-cells" property
|
2008-08-06 18:20:12 +00:00
|
|
|
2 encode-int " #size-cells" property
|
2008-07-12 09:41:08 +00:00
|
|
|
" sun4u" encode-string " compatible" property
|
2006-06-10 01:37:53 +00:00
|
|
|
|
2009-01-25 07:31:15 +00:00
|
|
|
: encode-unit encode-unit-upa ;
|
|
|
|
|
: decode-unit decode-unit-upa ;
|
2006-06-10 01:37:53 +00:00
|
|
|
|
|
|
|
|
new-device
|
|
|
|
|
" memory" device-name
|
2009-07-31 11:16:24 +00:00
|
|
|
" memory" device-type
|
2006-06-10 01:37:53 +00:00
|
|
|
external
|
|
|
|
|
: open true ;
|
|
|
|
|
: close ;
|
2010-08-25 16:58:55 +00:00
|
|
|
\ see arch/sparc64/lib.c for methods
|
2006-06-10 01:37:53 +00:00
|
|
|
finish-device
|
|
|
|
|
|
|
|
|
|
new-device
|
|
|
|
|
" virtual-memory" device-name
|
|
|
|
|
external
|
2010-08-25 16:58:55 +00:00
|
|
|
\ see arch/sparc64/lib.c for methods
|
2006-06-10 01:37:53 +00:00
|
|
|
finish-device
|
|
|
|
|
|
|
|
|
|
" /options" find-device
|
|
|
|
|
" disk" encode-string " boot-from" property
|
|
|
|
|
|
2008-08-06 18:20:12 +00:00
|
|
|
" /openprom" find-device
|
|
|
|
|
" OBP 3.10.24 1999/01/01 01:01" encode-string " version" property
|