Changeset 3021
- Timestamp:
- Jun 29, 2012 10:46:30 PM (12 months ago)
- Files:
-
- 21 edited
-
cpu/arm/mmp2/fw.bth (modified) (1 diff)
-
cpu/arm/mmp2/mmp2.bth (modified) (1 diff)
-
cpu/arm/olpc/banner.fth (modified) (1 diff)
-
cpu/arm/olpc/prefw.fth (modified) (1 diff)
-
cpu/mips/bonito/forthmon.bth (modified) (1 diff)
-
cpu/mips/bonito/fw.bth (modified) (1 diff)
-
cpu/mips/broadcom/avx/fw.bth (modified) (1 diff)
-
cpu/mips/cobalt/fw.bth (modified) (1 diff)
-
cpu/x86/pc/alex/fw.bth (modified) (1 diff)
-
cpu/x86/pc/biosload/fw.bth (modified) (1 diff)
-
cpu/x86/pc/emu/fw.bth (modified) (1 diff)
-
cpu/x86/pc/lxdevel/fw.bth (modified) (1 diff)
-
cpu/x86/pc/neptune/fw.bth (modified) (1 diff)
-
cpu/x86/pc/newton/fw.bth (modified) (1 diff)
-
cpu/x86/pc/olpc/banner.fth (modified) (1 diff)
-
cpu/x86/pc/olpc/fw.bth (modified) (1 diff)
-
cpu/x86/pc/olpc/via/banner.fth (modified) (1 diff)
-
cpu/x86/pc/olpc/via/fw.bth (modified) (1 diff)
-
ofw/core/ofwcore.fth (modified) (34 diffs)
-
ofw/inet/dhcp.fth (modified) (2 diffs)
-
ofw/inetv6/dhcp.fth (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/mmp2/fw.bth
r2899 r3021 48 48 49 49 : (cpu-arch ( -- adr len ) 50 " architecture" ['] root-node get-package-property drop50 " architecture" root-phandle get-package-property drop 51 51 get-encoded-string 52 52 ; -
cpu/arm/mmp2/mmp2.bth
r2390 r3021 73 73 74 74 : (cpu-arch ( -- adr len ) 75 " architecture" ['] root-node get-package-property drop75 " architecture" root-phandle get-package-property drop 76 76 get-encoded-string 77 77 ; -
cpu/arm/olpc/banner.fth
r3005 r3021 114 114 115 115 : .ec 116 " ec-name" ['] root-node get-package-property 0= if ( adr len )116 " ec-name" root-phandle get-package-property 0= if ( adr len ) 117 117 get-encoded-string ." EC Firmware " type 118 118 then -
cpu/arm/olpc/prefw.fth
r2899 r3021 51 51 52 52 : (cpu-arch ( -- adr len ) 53 " architecture" ['] root-node get-package-property drop53 " architecture" root-phandle get-package-property drop 54 54 get-encoded-string 55 55 ; -
cpu/mips/bonito/forthmon.bth
r1201 r3021 39 39 40 40 : (cpu-arch ( -- adr len ) 41 " architecture" ['] root-node get-package-property drop41 " architecture" root-phandle get-package-property drop 42 42 get-encoded-string 43 43 ; -
cpu/mips/bonito/fw.bth
r1201 r3021 45 45 46 46 : (cpu-arch ( -- adr len ) 47 " architecture" ['] root-node get-package-property drop47 " architecture" root-phandle get-package-property drop 48 48 get-encoded-string 49 49 ; -
cpu/mips/broadcom/avx/fw.bth
r1201 r3021 61 61 62 62 : (cpu-arch ( -- adr len ) 63 " architecture" ['] root-node get-package-property drop63 " architecture" root-phandle get-package-property drop 64 64 get-encoded-string 65 65 ; -
cpu/mips/cobalt/fw.bth
r1201 r3021 73 73 74 74 : (cpu-arch ( -- adr len ) 75 " architecture" ['] root-node get-package-property drop75 " architecture" root-phandle get-package-property drop 76 76 get-encoded-string 77 77 ; -
cpu/x86/pc/alex/fw.bth
r2865 r3021 51 51 52 52 : (cpu-arch ( -- adr len ) 53 " architecture" ['] root-node get-package-property drop53 " architecture" root-phandle get-package-property drop 54 54 get-encoded-string 55 55 ; -
cpu/x86/pc/biosload/fw.bth
r2865 r3021 54 54 55 55 : (cpu-arch ( -- adr len ) 56 " architecture" ['] root-node get-package-property drop56 " architecture" root-phandle get-package-property drop 57 57 get-encoded-string 58 58 ; -
cpu/x86/pc/emu/fw.bth
r1050 r3021 51 51 52 52 : (cpu-arch ( -- adr len ) 53 " architecture" ['] root-node get-package-property drop53 " architecture" root-phandle get-package-property drop 54 54 get-encoded-string 55 55 ; -
cpu/x86/pc/lxdevel/fw.bth
r2899 r3021 55 55 56 56 : (cpu-arch ( -- adr len ) 57 " architecture" ['] root-node get-package-property drop57 " architecture" root-phandle get-package-property drop 58 58 get-encoded-string 59 59 ; -
cpu/x86/pc/neptune/fw.bth
r2899 r3021 54 54 55 55 : (cpu-arch ( -- adr len ) 56 " architecture" ['] root-node get-package-property drop56 " architecture" root-phandle get-package-property drop 57 57 get-encoded-string 58 58 ; -
cpu/x86/pc/newton/fw.bth
r2865 r3021 51 51 52 52 : (cpu-arch ( -- adr len ) 53 " architecture" ['] root-node get-package-property drop53 " architecture" root-phandle get-package-property drop 54 54 get-encoded-string 55 55 ; -
cpu/x86/pc/olpc/banner.fth
r2679 r3021 20 20 21 21 : .ec 22 " ec-name" ['] root-node get-package-property 0= if ( adr len )22 " ec-name" root-phandle get-package-property 0= if ( adr len ) 23 23 get-encoded-string ." EC Firmware " type 24 24 then -
cpu/x86/pc/olpc/fw.bth
r2991 r3021 54 54 55 55 : (cpu-arch ( -- adr len ) 56 " architecture" ['] root-node get-package-property drop56 " architecture" root-phandle get-package-property drop 57 57 get-encoded-string 58 58 ; -
cpu/x86/pc/olpc/via/banner.fth
r2865 r3021 114 114 115 115 : .ec 116 " ec-name" ['] root-node get-package-property 0= if ( adr len )116 " ec-name" root-phandle get-package-property 0= if ( adr len ) 117 117 get-encoded-string ." EC Firmware " type 118 118 then -
cpu/x86/pc/olpc/via/fw.bth
r2987 r3021 54 54 55 55 : (cpu-arch ( -- adr len ) 56 " architecture" ['] root-node get-package-property drop56 " architecture" root-phandle get-package-property drop 57 57 get-encoded-string 58 58 ; -
ofw/core/ofwcore.fth
r3006 r3021 683 683 defer voc>phandle ' noop to voc>phandle 684 684 defer phandle>voc ' noop to phandle>voc 685 defer dt-null ' null to dt-null 686 687 \ : : : lastacf .name cr ; 688 689 : rel-voc>phandle ( voc -- ph ) origin - ; ' rel-voc>phandle to voc>phandle 690 : rel-phandle>voc ( ph -- voc ) origin + ; ' rel-phandle>voc to phandle>voc 691 ' 0 to dt-null 685 692 686 693 \ TODO … … 690 697 \ Either implement a true breadth-first search or don't specify it. 691 698 699 : cdev drop context token@ voc>phandle ; 700 : devc drop phandle>voc context token! definitions ; 692 701 2 actions 693 action: drop context token@ voc>phandle;694 action: d rop phandle>voc context token! definitions;702 action: cdev ; 703 action: devc ; 695 704 create current-device use-actions 696 705 … … 726 735 727 736 headers 728 : >parent ( node -- parent-node ) >voc-link link@ voc>phandle ;737 : >parent ( node -- parent-node ) phandle>voc >voc-link link@ voc>phandle ; 729 738 : parent-device ( -- parent-node ) current-device >parent ; 730 739 … … 740 749 741 750 : pop-device ( -- ) 742 parent-device ( parent-voc ) 743 non-null? if push-device then 751 parent-device ( parent-phandle ) 752 dup dt-null <> if push-device else drop then 753 \ non-null? if push-device then 744 754 ; 745 755 … … 1100 1110 \ Internal factor used to implement first-child and next-child 1101 1111 : set-child? ( link-adr -- flag ) 1102 get-token? if push-device true else false then1112 get-token? if voc>phandle push-device true else false then 1103 1113 ; 1104 1114 … … 1126 1136 /devnode-extra unaligned-ualloc drop 1127 1137 1128 lastacf push-device ( parent's-child-field )1138 lastacf voc>phandle push-device ( parent's-child-field ) 1129 1139 ; 1130 1140 : init-properties ( -- ) (vocabulary) lastacf 'properties token! ; … … 1151 1161 : link-to-peer ( parent's-child-field -- ) 1152 1162 dup token@ 'peer token! ( parent's-child-field ) 1153 current-device swap token! ( )1163 current-device phandle>voc swap token! ( ) 1154 1164 ; 1155 1165 : device-node? ( voc -- flag ) … … 1188 1198 headers 1189 1199 : new-node ( -- ) 1190 (vocabulary) current-device link, ( ) \ Up-link to parent device1200 (vocabulary) current-device phandle>voc link, ( ) \ Up-link to parent device 1191 1201 1192 1202 \ Save parent linkage address on stack for later use … … 1267 1277 allot-package-data 1268 1278 device-end 1269 1270 : root-device ( -- ) only forth also ['] root-node push-device ; 1271 1272 : root-device? ( -- flag ) parent-device null = ; 1279 : root-phandle ( -- ph ) ['] root-node voc>phandle ; 1280 1281 : root-device ( -- ) only forth also root-phandle push-device ; 1282 1283 : root-device? ( -- flag ) parent-device dt-null = ; 1273 1284 1274 1285 : finish-device ( -- ) finish-package-data pop-device ; … … 1733 1744 \ otherwise it starts at the current directory 1734 1745 dup 1 >= if ( str$ ) 1735 over c@ ascii / = if 1 /string ['] root-node push-device then1746 over c@ ascii / = if 1 /string root-phandle push-device then 1736 1747 then ( str$ ) 1737 1748 1738 current-device null = ?not-found1749 current-device dt-null = ?not-found 1739 1750 device-context? 0= ?not-found 1740 1751 (find-device) … … 1940 1951 'child token@ ( first-node ) 1941 1952 begin non-null? while ( node ) 1942 push-device( )1953 voc>phandle push-device ( ) 1943 1954 .nodeid ( ) 1944 1955 'peer token@ ( node' ) … … 1971 1982 : .voc-name ( a -- ) 1972 1983 dup device-node? if 1973 current-device swap context token! (pwd) space1984 current-device phandle>voc swap context token! (pwd) space 1974 1985 context token! 1975 1986 else … … 2051 2062 headerless 2052 2063 : relink-device ( -- false ) 2053 current-device relink-voc false2064 current-device phandle>voc relink-voc false 2054 2065 ; 2055 2066 : relink-devices ( -- ) 2056 ['] root-node push-package2067 root-phandle push-package 2057 2068 ['] relink-device (search-preorder) drop 2058 2069 pop-package … … 2077 2088 2078 2089 : find-method ( adr len phandle -- false | acf true ) 2079 fm-hook (search-wordlist)2090 fm-hook phandle>voc (search-wordlist) 2080 2091 ; 2081 2092 … … 2099 2110 : $call-self ( adr len -- ) 2100 2111 my-self if 2101 my-voc fm-hook $find-word if execute exit then2112 my-voc fm-hook phandle>voc $find-word if execute exit then 2102 2113 then 2103 2114 my-self to error-instance … … 2196 2207 : (get-any) ( adr len -- true | adr' len' false ) 2197 2208 begin my-self while ( adr len ) \ Search up parent chain 2198 my-voc current token! ( adr len )2209 my-voc phandle>voc current token! ( adr len ) 2199 2210 2dup get-my-property 0= if ( adr len adr' len' ) 2200 2211 2swap 2drop false exit ( adr' len' false ) \ Found … … 2434 2445 \ Establish the initial parent 2435 2446 also ( path$ ) 2436 null to current-device( path$ )2447 dt-null to current-device ( path$ ) 2437 2448 ['] (open-path) catch dup if nip nip then ( error? ) 2438 2449 previous definitions ( error? ) … … 2597 2608 : (execute-phandle-method) ( method-adr,len phandle -- ??? ) 2598 2609 0 to unit#-valid? ( method-adr,len phandle ) 2599 dup >parent null open-parents ( method-adr,len phandle )2610 dup >parent dt-null open-parents ( method-adr,len phandle ) 2600 2611 push-device ( method-adr,len ) 2601 2612 " " new-instance ( method-adr,len ) … … 2609 2620 current-device >r ( phandle ) 2610 2621 0 to unit#-valid? ( phandle ) 2611 null ['] open-parents catch if ( x x )2622 dt-null ['] open-parents catch if ( x x ) 2612 2623 2drop 0 ( 0 ) 2613 2624 else ( ) … … 2675 2686 \ Root node has no parent, therefore the size of its parent's address 2676 2687 \ space is meaningless 2677 my-voc ['] root-node = if 0 exit then2688 my-voc root-phandle = if 0 exit then 2678 2689 2679 2690 " #size-cells" my-parent ihandle>phandle ( adr len phandle ) … … 2757 2768 ; 2758 2769 headers 2770 : encode-phandle ( name$ -- adr len ) 2771 locate-device abort" encode-phandle - Can't find package" encode-int 2772 ; 2759 2773 2760 2774 \ From finddisp.fth … … 2896 2910 also magic-device-types definitions 2897 2911 : display ( -- ) 2898 'fb-node token@ origin = if current-device 'fb-node token! then2912 'fb-node token@ origin = if current-device phandle>voc 'fb-node token! then 2899 2913 ; 2900 2914 previous definitions … … 2909 2923 \ Create the standard system nodes 2910 2924 2925 hex 2926 \ debug devc 2911 2927 root-device 2912 2928 new-device \ Node for software "library" packages 2913 2929 " packages" device-name 2914 2930 2915 new-device current-device to client-services2931 new-device current-device phandle>voc to client-services 2916 2932 " client-services" device-name 2917 2933 finish-device 2934 2918 2935 finish-device 2919 2936 … … 3249 3266 3250 3267 : do-method? ( -- ) 3251 method-name 2@ current-device (search-wordlist) if ( xt )3268 method-name 2@ current-device phandle>voc (search-wordlist) if ( xt ) 3252 3269 drop pwd$ ( path-adr,len ) 3253 3270 verbose-do-method? if 2dup type cr then … … 3285 3302 3286 3303 : most-tests ( -- exit? ) 3287 " selftest" current-device (search-wordlist) if ( xt )3304 " selftest" current-device phandle>voc (search-wordlist) if ( xt ) 3288 3305 3289 3306 drop ( ) … … 3521 3538 3522 3539 : >dbuf-header ( adr -- 'dbuf ) 3523 dbuf-data> ( 'dbuf ) 3524 dup dbuf-flag@ *dbuf-used* - abort" bad heap address." 3540 dbuf-data> ( 'dbuf ) 3541 dup dbuf-flag@ case ( 'dbuf ) 3542 *dbuf-used* of endof ( 'dbuf ) 3543 *dbuf-free* of 3544 true abort" Freeing or resizing already-free memory" 3545 endof 3546 true abort" bad heap address." 3547 endcase ( 'dbuf ) 3525 3548 ; 3526 3549 : free-memory ( adr -- ) … … 4094 4117 4095 4118 : setnode ( nodeid | 0 -- ) 4096 dup 0= if drop ['] root-nodethen (push-package)4119 dup 0= if drop root-phandle then (push-package) 4097 4120 ; 4098 4121 … … 4193 4216 0 'child ( last-nodeid &next-nodeid ) 4194 4217 begin get-token? while ( last-nodeid next-nodeid ) 4195 nip dup (select-package) ( next-nodeid )4218 nip dup voc>phandle (select-package) ( next-nodeid ) 4196 4219 'peer ( last-nodeid' &next-nodeid ) 4197 4220 repeat ( last-nodeid' ) 4198 4221 (pop-package) ( nodeid ) 4222 dup if voc>phandle then 4199 4223 ; 4200 4224 4201 4225 : peer ( phandle -- phandle' ) 4202 4226 dup 0= if 4203 drop ['] root-node exit4227 drop root-phandle exit 4204 4228 then ( nodeid ) 4205 4229 4206 dup ['] root-node= if4230 dup root-phandle = if 4207 4231 drop 0 exit 4208 4232 then ( nodeid ) … … 4210 4234 \ Select the first child of our parent 4211 4235 dup >parent (push-package) ( nodeid ) 4212 'child token@ (select-package) ( nodeid )4236 'child token@ voc>phandle (select-package) ( nodeid ) 4213 4237 4214 4238 dup current-device = if ( nodeid ) … … 4218 4242 \ Search for the node preceding the argument node 4219 4243 begin ( nodeid ) 4220 'peer token@ 2dup <> ( nodeid next-nodeid flag )4244 'peer token@ voc>phandle 2dup <> ( nodeid next-nodeid flag ) 4221 4245 while ( nodeid next-nodeid ) 4222 4246 push-device ( nodeid ) … … 4228 4252 4229 4253 : parent ( phandle -- phandle' ) 4230 dup ['] root-node= if ( root-phandle )4254 dup root-phandle = if ( root-phandle ) 4231 4255 drop 0 exit ( 0 ) 4232 4256 then ( parent-phandle ) … … 4430 4454 ?dup if ( path$ ) 4431 4455 \ Establish the initial parent 4432 null to current-device ( path$ )4456 dt-null to current-device ( path$ ) 4433 4457 ?expand-alias ( path$ ) 4434 4458 begin canon-node dup 0= until ( path$' ) … … 4803 4827 : resolve-ih-method ( adr len ihandle -- xt ) 4804 4828 dup 0= if 3drop ['] not-colon exit then ( adr len ihandle ) 4805 package( my-voc $find-word )package ?not-colon ( xt )4829 package( my-voc phandle>voc $find-word )package ?not-colon ( xt ) 4806 4830 ; 4807 4831 : resolve-voc-method ( adr len voc -- xt ) … … 4848 4872 4849 4873 dup ['] package-execute = if ( [ adr len ] xt ) 4850 drop 2dup current-device ( adr len voc)4874 drop 2dup current-device ( adr len phandle ) 4851 4875 resolve-ph-method exit ( -- xt ) 4852 4876 then ( xt ) 4853 4877 4854 4878 dup ['] apply-method = if ( [ adr len ] xt ) 4855 drop 2dup my-voc ( adr len voc )4879 drop 2dup my-voc phandle>voc ( adr len voc ) 4856 4880 resolve-voc-method exit ( -- xt ) 4857 4881 then ( xt ) 4858 4882 4859 4883 dup ['] (apply-method) = if ( [ adr len ] xt ) 4860 drop 2dup my-voc ( adr len voc )4884 drop 2dup my-voc phandle>voc ( adr len voc ) 4861 4885 resolve-voc-method exit ( -- xt ) 4862 4886 then ( xt ) -
ofw/inet/dhcp.fth
r1548 r3021 90 90 91 91 : root-property ( name$ -- true | value false ) 92 ['] root-node get-package-property92 root-phandle get-package-property 93 93 ; 94 94 … … 521 521 bootp-name-buf count nip 0= if 522 522 file-name-buf c@ 0= if 523 " architecture" ['] root-node get-package-property 0= if ( prop$ )523 " architecture" root-phandle get-package-property 0= if ( prop$ ) 524 524 get-encoded-string ( name$ ) 525 525 bootp-name-buf place ( ) -
ofw/inetv6/dhcp.fth
r534 r3021 90 90 91 91 : root-property ( name$ -- true | value false ) 92 ['] root-node get-package-property92 root-phandle get-package-property 93 93 ; 94 94 … … 478 478 bootp-name-buf count nip 0= if 479 479 file-name-buf c@ 0= if 480 " architecture" ['] root-node get-package-property 0= if ( prop$ )480 " architecture" root-phandle get-package-property 0= if ( prop$ ) 481 481 get-encoded-string ( name$ ) 482 482 bootp-name-buf place ( )
Note: See TracChangeset
for help on using the changeset viewer.
