1 \ tag: Other FCode functions
3 \ this code implements IEEE 1275-1994 ch. 5.3.7
5 \ Copyright (C) 2003 Stefan Reinauer
7 \ See the file "COPYING" for further information about
8 \ the copyright and warranty status of this work.
11 \ The current diagnostic setting
16 \ 5.3.7 Other FCode functions
28 : cpeek ( addr -- false | byte true )
32 : wpeek ( waddr -- false | w true )
36 : lpeek ( qaddr -- false | quad true )
45 : cpoke ( byte addr -- okay? )
49 : wpoke ( w waddr -- okay? )
53 : lpoke ( quad qaddr -- okay? )
58 \ 5.3.7.2 Device-register access
60 : rb@ ( addr -- byte )
66 : rl@ ( qaddr -- quad )
69 : rb! ( byte addr -- )
75 : rl! ( quad qaddr -- )
80 h# 22e get-token if , else execute then
82 h# 22e get-token drop execute
88 h# 22f get-token if , else execute then
90 h# 22f get-token drop execute
96 \ Pointer to OBP tick value updated by timer interrupt
99 \ Dummy implementation for platforms without a timer interrupt
103 \ If obp-ticks pointer is set, use it. Otherwise fall back to
104 \ dummy implementation
108 dummy-msecs dup 1+ to dummy-msecs
114 begin dup get-msecs < until
122 : user-abort ( ... -- ) ( R: ... -- )
126 \ 5.3.7.4 System information
127 0003.0000 value fcode-revision ( -- n )
129 : mac-address ( -- mac-str mac-len )
133 \ 5.3.7.5 FCode self-test
134 : display-status ( n -- )
137 : memory-test-suite ( addr len -- fail? )
143 : diagnostic-mode? ( -- diag? )
144 \ Return the NVRAM diag-switch? setting
148 \ 5.3.7.6 Start and end.
150 \ Begin program with spread 0 followed by FCode-header.
157 \ Begin program with spread 1 followed by FCode-header.
164 \ Begin program with spread 2 followed by FCode-header.
171 \ Begin program with spread 4 followed by FCode-header.
178 \ Begin program with spread 1 followed by FCode-header.
184 \ Cease evaluating this FCode program.
189 \ Cease evaluating this FCode program.
194 \ Standard FCode number for undefined FCode functions.
196 ." undefined fcode# encountered." cr
200 \ Pause FCode evaluation if desired; can resume later.
201 : suspend-fcode ( -- )
202 \ NOT YET IMPLEMENTED.
206 \ Evaluate FCode beginning at location addr.
208 \ : byte-load ( addr xt -- )
209 \ \ this word is implemented in feval.fs
212 \ Set address and arguments of new device node.
213 : set-args ( arg-str arg-len unit-str unit-len -- )
217 " decode-unit" ['] $call-parent catch if
221 my-self ihandle>phandle >dn.probe-addr \ offset
222 begin depth r@ > while
227 my-self >in.arguments 2@ free-mem
228 strdup my-self >in.arguments 2!
232 s" dma-alloc" $call-parent