Author: blueswirl Date: 2009-01-25 08:31:15 +0100 (Sun, 25 Jan 2009) New Revision: 424
Modified: openbios-devel/arch/sparc64/tree.fs Log: Add UPA decode and encode methods
Modified: openbios-devel/arch/sparc64/tree.fs =================================================================== --- openbios-devel/arch/sparc64/tree.fs 2009-01-25 07:30:45 UTC (rev 423) +++ openbios-devel/arch/sparc64/tree.fs 2009-01-25 07:31:15 UTC (rev 424) @@ -1,11 +1,29 @@ +\ ------------------------------------------------------------------------- +\ 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 +; + " /" find-device 2 encode-int " #address-cells" property 2 encode-int " #size-cells" property " sun4u" encode-string " compatible" property
- \ : encode-unit encode-unit-sbus ; - \ : decode-unit decode-unit-sbus ; + : encode-unit encode-unit-upa ; + : decode-unit decode-unit-upa ;
new-device " memory" device-name