Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | \ ========== Copyright Header Begin ========================================== |
2 | \ | |
3 | \ Hypervisor Software File: sysprims-nofb.fth | |
4 | \ | |
5 | \ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | \ | |
7 | \ - Do no alter or remove copyright notices | |
8 | \ | |
9 | \ - Redistribution and use of this software in source and binary forms, with | |
10 | \ or without modification, are permitted provided that the following | |
11 | \ conditions are met: | |
12 | \ | |
13 | \ - Redistribution of source code must retain the above copyright notice, | |
14 | \ this list of conditions and the following disclaimer. | |
15 | \ | |
16 | \ - Redistribution in binary form must reproduce the above copyright notice, | |
17 | \ this list of conditions and the following disclaimer in the | |
18 | \ documentation and/or other materials provided with the distribution. | |
19 | \ | |
20 | \ Neither the name of Sun Microsystems, Inc. or the names of contributors | |
21 | \ may be used to endorse or promote products derived from this software | |
22 | \ without specific prior written permission. | |
23 | \ | |
24 | \ This software is provided "AS IS," without a warranty of any kind. | |
25 | \ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | |
26 | \ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | |
27 | \ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN | |
28 | \ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR | |
29 | \ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR | |
30 | \ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN | |
31 | \ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR | |
32 | \ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE | |
33 | \ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, | |
34 | \ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF | |
35 | \ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | |
36 | \ | |
37 | \ You acknowledge that this software is not designed, licensed or | |
38 | \ intended for use in the design, construction, operation or maintenance of | |
39 | \ any nuclear facility. | |
40 | \ | |
41 | \ ========== Copyright Header End ============================================ | |
42 | id: @(#)sysprims-nofb.fth 1.1 00/03/14 | |
43 | purpose: | |
44 | copyright: Copyright 1999-2000 Sun Microsystems, Inc. All Rights Reserved | |
45 | ||
46 | hex | |
47 | \ --- Memory allocation and mapping -------------------------------------- | |
48 | \ v1 v2 000 1 (reserved - because alocated by single byte fcodes) | |
49 | ||
50 | v1 v2 001 1 byte-code: obsolete-fcode \ Was dma-alloc ( #bytes -- virtual ) | |
51 | v1 v2 002 1 byte-code: my-address ( -- physical ) | |
52 | v1 v2 003 1 byte-code: my-space ( -- space ) | |
53 | v1 v2 004 1 byte-code: obsolete-fcode \ Was memmap ( physical space size -- virtual ) | |
54 | v1 v2 005 1 byte-code: free-virtual ( virtual len -- ) | |
55 | v1 v2 006 1 byte-code: obsolete-fcode \ Was >physical ( virtual -- physical space ) | |
56 | ||
57 | \ 007 1 | |
58 | \ 008 1 | |
59 | \ 009 1 | |
60 | \ 00a 1 | |
61 | \ 00b 1 | |
62 | \ 00c 1 | |
63 | \ 00d 1 | |
64 | \ 00e 1 | |
65 | ||
66 | v1 v2 00f 1 byte-code: obsolete-fcode \ Was my-params ( -- addr len ) | |
67 | v1 v2 010 1 byte-code: property ( val-adr val-len name-adr name-len -- ) | |
68 | \ Was attribute | |
69 | v1 v2 011 1 byte-code: encode-int ( n1 -- adr len ) | |
70 | \ Was xdrint | |
71 | v1 v2 012 1 byte-code: encode+ ( adr len1 adr len2-- adr len1+2 ) | |
72 | \ Was xdr+ | |
73 | v1 v2 013 1 byte-code: encode-phys ( paddr space -- adr len ) | |
74 | \ Was xdrphys | |
75 | v1 v2 014 1 byte-code: encode-string ( adr len -- adr' len+1 ) | |
76 | \ Was xdrstring | |
77 | v2.1 015 1 byte-code: encode-bytes ( adr len -- adr' len+1 ) | |
78 | \ Was xdrbytes | |
79 | ||
80 | \ --- Shorthand Property Creation -------------------------------------- | |
81 | v1 v2 016 1 byte-code: reg ( physical space size -- ) | |
82 | v1 v2 017 1 byte-code: obsolete-fcode \ Was intr ( int-level vector -- ) | |
83 | v1 018 1 byte-code: obsolete-fcode \ driver ( adr len -- ) | |
84 | v1 v2 019 1 byte-code: model ( adr len -- ) | |
85 | v1 v2 01a 1 byte-code: device-type ( adr len -- ) | |
86 | v2 01b 1 byte-code: parse-2int ( adr len -- address space ) | |
87 | \ Was decode-2int | |
88 | ||
89 | \ --- Driver Installation ------------------------------------------------ | |
90 | v1 v2 01f 1 byte-code: new-device ( -- ) | |
91 | ||
92 | \ --- Selftest ----------------------------------------------------------- | |
93 | v1 v2 020 1 byte-code: diagnostic-mode? ( -- flag ) | |
94 | ||
95 | v1 v2 021 1 byte-code: obsolete-fcode \ Was display-status ( n -- ) | |
96 | v1 v2 022 1 byte-code: memory-test-suite ( adr len -- status) | |
97 | v1 v2 023 1 byte-code: obsolete-fcode \ Was group-code ( -- adr ) | |
98 | v1 v2 024 1 byte-code: mask ( -- adr ) | |
99 | ||
100 | v1 v2 025 1 byte-code: get-msecs ( -- ms ) | |
101 | v1 v2 026 1 byte-code: ms ( n -- ) | |
102 | v1 v2 027 1 byte-code: finish-device ( -- ) | |
103 | ||
104 | v3 028 1 byte-code: decode-phys ( adr1 len2 -- adr2 len2 phys.lo..hi ) | |
105 | v3 029 1 byte-code: push-package ( phandle -- ) | |
106 | v3 02a 1 byte-code: pop-package ( -- ) | |
107 | v3 02b 1 byte-code: interpose ( adr len phandle -- ) | |
108 | \ 02c | |
109 | \ 02d | |
110 | \ 02e | |
111 | \ 02f | |
112 | ||
113 | v1 v2 030 1 byte-code: map-low ( phys size -- virt ) \ Was map-sbus | |
114 | ||
115 | \ --- Sbus Support - now obsolescent | |
116 | v1 v2 031 1 byte-code: sbus-intr>cpu ( sbus-intr# -- cpu-intr# ) | |
117 | \ v1 v2 037 1 -- [S-Bus support] | |
118 | ||
119 | \ --- P4 Bus address spaces - (these moved to /dev/p4bus/fcodeprims.fth) - | |
120 | \ v1 038 1 -- [P4 Bus support] obsolete | |
121 | \ v1 ... -- [P4 Bus support] obsolete | |
122 | \ v1 03f 1 -- [P4 Bus support] obsolete | |
123 | ||
124 | \ --- Interrupts (Think about this!) ------------------------------------- | |
125 | \ 040 1 byte-code: catch-interrupt ( level vector -- ) | |
126 | \ 041 1 byte-code: restore-interrupt ( level -- ) | |
127 | \ 042 1 byte-code: interrupt-occurred? ( -- flag ) | |
128 | \ 043 1 byte-code: enable-interrupt ( level -- ) | |
129 | \ 044 1 byte-code: disable-interrupt ( level -- ) | |
130 | \ 045 1 | |
131 | \ 046 1 | |
132 | \ 047 1 | |
133 | \ 048 1 | |
134 | \ 049 1 | |
135 | \ 04a 1 | |
136 | \ 04b 1 | |
137 | \ 04c 1 | |
138 | \ 04d 1 | |
139 | \ 04e 1 | |
140 | \ 04f 1 | |
141 | ||
142 | \ --- VME Bus address spaces - (these moved to /dev/vmebus/fcodeprims.fth) | |
143 | \ v1 v2 090 1 -- [VME Bus support] | |
144 | \ v1 v2 ... -- [VME Bus support] | |
145 | \ v1 v2 096 1 -- [VME Bus support] | |
146 | ||
147 | \ --- NET OPERATIONS ----------------------------------------------------- | |
148 | \ v1 0a0 1 byte-code: return-buffer | |
149 | \ v1 obs 0a1 1 byte-code: xmit-packet ( bufadr #bytes -- #sent ) | |
150 | \ v1 obs 0a2 1 byte-code: poll-packet ( bufadr #bytes -- #received ) | |
151 | \ v1 0a3 1 byte-code: local-mac-address ( adr len -- ) \ Driver sets this | |
152 | v1 v2 0a4 1 byte-code: mac-address ( -- adr len ) \ System sets this | |
153 | ||
154 | \ 0a5 1 | |
155 | \ 0a6 1 | |
156 | \ 0a7 1 | |
157 | \ 0a8 1 | |
158 | \ 0a9 1 | |
159 | \ 0aa 1 | |
160 | \ 0ab 1 | |
161 | \ 0ac 1 | |
162 | \ 0ad 1 | |
163 | \ 0ae 1 | |
164 | \ 0af 1 | |
165 | ||
166 | \ 0b0 1 | |
167 | \ ... | |
168 | \ 0ff 1 | |
169 | ||
170 | \ --- Package and device handling ---------------------------------------- | |
171 | \ 000 2 (reserved - because alocated by single byte fcodes) | |
172 | v2 001 2 byte-code: device-name ( addr len -- ) | |
173 | v2 002 2 byte-code: my-args ( -- addr len ) | |
174 | v2 003 2 byte-code: my-self ( -- ihandle ) | |
175 | v2 004 2 byte-code: find-package ( adr len -- [phandle] ok? ) | |
176 | v2 005 2 byte-code: open-package ( adr len phandle -- ihandle | 0 ) | |
177 | v2 006 2 byte-code: close-package ( ihandle -- ) | |
178 | v2 007 2 byte-code: find-method ( adr len phandle -- [acf] ok? ) | |
179 | v2 008 2 byte-code: call-package ( acf ihandle -- ) | |
180 | v2 009 2 byte-code: $call-parent ( adr len -- ) | |
181 | v2 00a 2 byte-code: my-parent ( -- ihandle ) | |
182 | v2 00b 2 byte-code: ihandle>phandle ( ihandle -- phandle ) | |
183 | ||
184 | \ 00c 2 | |
185 | ||
186 | v2 00d 2 byte-code: my-unit ( -- offset space ) | |
187 | v2 00e 2 byte-code: $call-method ( adr len ihandle -- ) | |
188 | v2 00f 2 byte-code: $open-package ( arg-adr,len name-adr,len -- ihandle | 0 ) | |
189 | ||
190 | \ --- CPU information ---------------------------------------------------- | |
191 | \ Obs v2 010 2 byte-code: processor-type ( -- processor-type ) | |
192 | v2 011 2 byte-code: obsolete-fcode \ Was firmware-version ( -- n ) | |
193 | v2 012 2 byte-code: obsolete-fcode \ Was fcode-version ( -- n ) | |
194 | ||
195 | \ --- Asyncronous support ------------------------------------------------ | |
196 | v2 013 2 byte-code: alarm ( acf n -- ) | |
197 | ||
198 | \ --- User interface ----------------------------------------------------- | |
199 | v2 014 2 byte-code: (is-user-word) ( adr len acf -- ) | |
200 | ||
201 | \ --- Interpretation ----------------------------------------------------- | |
202 | v2 015 2 byte-code: suspend-fcode ( -- ) | |
203 | ||
204 | \ --- Error handling ----------------------------------------------------- | |
205 | v2 016 2 byte-code: abort ( -- ) | |
206 | v2 017 2 byte-code: catch ( acf -- error-code ) | |
207 | v2 018 2 byte-code: throw ( error-code -- ) | |
208 | v2.1 019 2 byte-code: user-abort ( -- ) | |
209 | ||
210 | \ --- Package attributes ------------------------------------------------- | |
211 | v2 01a 2 byte-code: get-my-property ( nam-adr nam-len -- [val-adr val-len] failed? ) | |
212 | \ Was get-my-attribute | |
213 | v2 01b 2 byte-code: decode-int ( val-adr val-len -- n ) | |
214 | \ Was xdrtoint | |
215 | v2 01c 2 byte-code: decode-string ( val-adr val-len -- adr len ) | |
216 | \ Was xdrtostring | |
217 | v2 01d 2 byte-code: get-inherited-property ( nam-adr nam-len -- [val-adr val-len] failed? ) | |
218 | \ Was get-inherited-attribute | |
219 | v2 01e 2 byte-code: delete-property ( nam-adr nam-len -- ) | |
220 | \ Was delete-attribute | |
221 | v2 01f 2 byte-code: get-package-property ( adr len phandle -- [val-adr val-len] failed? ) | |
222 | \ Was get-package-attribute | |
223 | ||
224 | \ --- aligned, atomic access --------------------------------------------- | |
225 | v2 020 2 byte-code: cpeek ( adr -- { byte true } | false ) | |
226 | v2 021 2 byte-code: wpeek ( adr -- { word true } | false ) | |
227 | v2 022 2 byte-code: lpeek ( adr -- { long true } | false ) | |
228 | ||
229 | v2 023 2 byte-code: cpoke ( byte adr -- ok? ) | |
230 | v2 024 2 byte-code: wpoke ( word adr -- ok? ) | |
231 | v2 025 2 byte-code: lpoke ( long adr -- ok? ) | |
232 | ||
233 | v3 026 2 byte-code: lwflip ( l1 -- l2 ) | |
234 | v3 027 2 byte-code: lbflip ( l1 -- l2 ) | |
235 | v3 028 2 byte-code: lbflips ( adr len -- ) | |
236 | ||
237 | \ v2 029 2 byte-code: adr-mask ( n -- ) | |
238 | \ 02a 2 | |
239 | \ 02b 2 | |
240 | \ 02c 2 | |
241 | \ 02d 2 | |
242 | ||
243 | 64\ v3 02e 2 byte-code: rx@ ( xaddr -- o ) | |
244 | 64\ v3 02f 2 byte-code: rx! ( o xaddr -- ) | |
245 | ||
246 | [ifdef] notdef | |
247 | \ These FCode Functions are installed in the token tables later, after their | |
248 | \ system-dependent implementations are defined. See ./regcodes.fth | |
249 | v2 030 2 byte-code: rb@ ( adr -- byte ) | |
250 | v2 031 2 byte-code: rb! ( byte adr -- ) | |
251 | v2 032 2 byte-code: rw@ ( adr -- word ) | |
252 | v2 033 2 byte-code: rw! ( word adr -- ) | |
253 | v2 034 2 byte-code: rl@ ( adr -- long ) | |
254 | v2 035 2 byte-code: rl! ( long adr -- ) | |
255 | [then] | |
256 | ||
257 | fload ${BP}/pkg/fcode/regcodes.fth | |
258 | ||
259 | v2 036 2 byte-code: wbflips ( adr len -- ) \ Was wflips | |
260 | v2 037 2 byte-code: lwflips ( adr len -- ) \ Was lflips | |
261 | ||
262 | \ --- probing of subordinate devices | |
263 | v2.2 038 2 byte-code: obsolete-fcode \ Was probe ( arg-str reg-str fcode-str -- ) | |
264 | v2.2 039 2 byte-code: obsolete-fcode \ Was probe-virtual ( arg-str reg-str fcode-adr -- ) | |
265 | ||
266 | \ 03a 2 | |
267 | v2.3 03b 2 byte-code: child ( phandle -- phandle' ) | |
268 | v2.3 03c 2 byte-code: peer ( phandle -- phandle' ) | |
269 | v3 03d 2 byte-code: next-property | |
270 | \ ( adr1 len1 phandle -- false | adr2 len2 true ) | |
271 | v3 03e 2 byte-code: byte-load ( adr xt -- ) | |
272 | v3 03f 2 byte-code: set-args ( arg-str unit-str -- ) | |
273 | ||
274 | \ --- parsing argument strings | |
275 | v2 040 2 byte-code: left-parse-string ( adr len char -- adrR lenR adrL lenL ) |