source: trunk/lisp/sys/qcom.lisp @ 292

Last change on this file since 292 was 292, checked in by rjs, 3 years ago

System 78.

File size: 48.8 KB
Line 
1;-*-MODE:LISP; BASE:8; PACKAGE:SYSTEM-INTERNALS -*-
2
3;       ** (c) Copyright 1980 Massachusetts Institute of Technology **
4
5;LOADING THIS WITH A BASE OF OTHER THAN 8 CAN REALLY CAUSE BIZARRE EFFECTS
6(OR (= IBASE 8) (BREAK IBASE-NOT-8))
7
8(SETQ AREA-LIST '(
9        RESIDENT-SYMBOL-AREA                    ;T AND NIL
10        SYSTEM-COMMUNICATION-AREA               ;USED BY PAGING, CONSOLE, PDP10 I/O, ETC.
11        SCRATCH-PAD-INIT-AREA                   ;LOAD MICRO CODE VARIABLES UPON STARTUP
12        MICRO-CODE-SYMBOL-AREA                  ;600 QS MISC DISPATCH, UCODE ENTRY DISPATCH
13        PAGE-TABLE-AREA                         ;PAGE HASH TABLE
14        PHYSICAL-PAGE-DATA                      ;GC DATA,,PHT INDEX
15                                                ;-1 IF OUT OF SERVICE
16                                                ;PHT-INDEX=-1 IF FIXED-WIRED (NO PHT ENTRY)
17                                                ;GC-DATA=0 IF NOT IN USE
18        REGION-ORIGIN                           ;FIXNUM BASE ADDRESS INDEXED BY REGION #
19        REGION-LENGTH                           ;FIXNUM LENGTH INDEXED BY REGION #
20        REGION-BITS                             ;FIXNUM, SEE %%REGION- SYMS FOR FIELDS
21        ADDRESS-SPACE-MAP                       ;SEE %ADDRESS-SPACE-MAP-BYTE-SIZE BELOW
22                ;END WIRED AREAS
23        REGION-FREE-POINTER                     ;FIXNUM, RELATIVE ALLOCATION POINT.
24        REGION-GC-POINTER                       ;GC USE, MAINLY RELATIVE DIRTY/CLEAN BOUNDARY
25        REGION-LIST-THREAD                      ;NEXT REGION# IN AREA, OR 1_23.+AREA#
26                                                ; THREADS FREE REGION SLOTS, TOO.
27        AREA-NAME                               ;ATOMIC NAME INDEXED BY AREA #
28        AREA-REGION-LIST                        ;FIRST REGION# IN AREA
29        AREA-REGION-SIZE                        ;RECOMMENDED SIZE FOR NEW REGIONS
30        AREA-MAXIMUM-SIZE                       ;APPROXIMATE MAXIMUM #WDS ALLOWED IN THIS AREA
31        AREA-SWAP-RECOMMENDATIONS               ;FIXNUM, SEE %%AREA-SWAP- SYMS FOR FIELDS
32        GC-TABLE-AREA                           ;GARBAGE COLLECTOR TABLES
33        SUPPORT-ENTRY-VECTOR                    ;CONSTANTS NEEDED BY BASIC MICROCODE
34        CONSTANTS-AREA                          ;COMMON CONSTANTS USED BY MACROCODE
35        EXTRA-PDL-AREA                          ;SEPARATELY GC-ABLE AREA, MAINLY EXTENDED NUMS
36                                                ; MUST BE RIGHT BEFORE MICRO-CODE-ENTRY-AREA
37        MICRO-CODE-ENTRY-AREA                   ;MICRO ENTRY ADDRESS
38                                                ;OR LOCATIVE INDIRECT MICRO-CODE-SYMBOL-AREA
39        MICRO-CODE-ENTRY-NAME-AREA              ;MICRO ENTRY NAME
40        MICRO-CODE-ENTRY-ARGS-INFO-AREA         ;MICRO ENTRY %ARGS-INFO
41        MICRO-CODE-ENTRY-MAX-PDL-USAGE          ;MICRO ENTRY PDL DEPTH INCL MICRO-MICRO CALLS
42                ;AREAS AFTER HERE ARE NOT "INITIAL", NOT KNOWN SPECIALLY BY MICROCODE
43        MICRO-CODE-ENTRY-ARGLIST-AREA           ;VALUE FOR ARGLIST FUNCTION TO RETURN
44        MICRO-CODE-SYMBOL-NAME-AREA             ;NAMES OF MICRO-CODE-SYMBOL-AREA ENTRIES
45        LINEAR-PDL-AREA                         ;MAIN PDL
46        LINEAR-BIND-PDL-AREA                    ;CORRESPONDING BIND PDL
47        INIT-LIST-AREA                          ;LIST CONSTANTS CREATED BY COLD LOAD
48                ;END FIXED AREAS, WHICH MUST HAVE ONLY ONE REGION
49        WORKING-STORAGE-AREA                    ;ORDINARY CONSING HAPPENS HERE
50        PERMANENT-STORAGE-AREA                  ;PUT "PERMANENT" DATA STRUCTURES HERE
51        PROPERTY-LIST-AREA                      ;EXISTS FOR PAGING REASONS
52        P-N-STRING                              ;PRINT NAMES AND STRINGS
53        CONTROL-TABLES                          ;OBARRAY, READTABLE (SEMI-OBSOLETE)
54        OBT-TAILS                               ;OBARRAY BUCKET CONSES (SEMI-OBSOLETE)
55        NR-SYM                                  ;SYMBOLS NOT IN RESIDENT-SYMBOL-AREA
56        MACRO-COMPILED-PROGRAM                  ;MACRO CODE LOADED HERE
57        PDL-AREA                                ;PUT STACK-GROUP REGULAR-PDLS HERE
58        FASL-TABLE-AREA                         ;FASLOAD'S TABLE IS HERE
59        FASL-TEMP-AREA                          ;FASLOAD TEMPORARY CONSING
60        FASL-CONSTANTS-AREA                     ;FASLOAD LOADS CONSTANTS HERE
61  ))
62
63;Assuming no more than 256 regions
64(SETQ %ADDRESS-SPACE-MAP-BYTE-SIZE 8
65      %ADDRESS-SPACE-QUANTUM-SIZE 40000)
66;Each quantum has a byte in the ADDRESS-SPACE-MAP area,
67;which is the region number, or 0 if free or fixed area.
68;INIT-LIST-AREA is the last fixed area.
69
70 ;THESE AREAS ARE ENCACHED IN THE PDL BUFFER.
71(SETQ PDL-BUFFER-AREA-LIST '(
72        LINEAR-PDL-AREA                         ;MAIN PDL
73        PDL-AREA                                ;PDLS FOR MISC STACK GROUPS
74))
75
76 ;NOTE THAT AT PRESENT ALL AREAS UP THROUGH ADDRESS-SPACE-MAP MUST BE WIRED.
77 ;THE REASON IS THAT WHEN THE MICROCODE STARTS UP IT STRAIGHT-MAPS THAT
78 ;AMOUNT OF VIRTUAL MEMORY, WITHOUT CHECKING SEPARATELY FOR EACH PAGE.
79 ;IT WOULD LOSE BIG IF ONE OF THOSE STRAIGHT-MAPPED PAGES GOT SWAPPED OUT.
80 ;EXCEPT, UNUSED PORTIONS OF PAGE-TABLE-AREA AND PHYSICAL-PAGE-DATA GET UNWIRED
81(SETQ WIRED-AREA-LIST '(                        ;AREAS THAT MAY NOT BE MOVED NOR SWAPPED OUT
82        RESIDENT-SYMBOL-AREA                    ;NO GOOD REASON
83        SYSTEM-COMMUNICATION-AREA               ;FOR CONSOLE, PDP10, MICRO INTERRUPT, ETC.
84        SCRATCH-PAD-INIT-AREA                   ;LOAD MICRO CODE VARIABLES UPON STARTUP
85        MICRO-CODE-SYMBOL-AREA                  ;NO GOOD REASON, ACTUALLY
86        PAGE-TABLE-AREA                         ;USED BY PAGE FAULT HANDLER
87        PHYSICAL-PAGE-DATA                      ;USED BY PAGE FAULT HANDLER
88        REGION-ORIGIN                           ;USED BY PAGE FAULT HANDLER
89        REGION-LENGTH                           ;USED BY PAGE FAULT HANDLER
90        REGION-BITS                             ;USED BY PAGE FAULT HANDLER
91        ADDRESS-SPACE-MAP                       ;USED BY PAGE FAULT HANDLER
92))
93
94;THIS LIST ISN'T NECESSARILY UP TO DATE.  FEATURE ISN'T REALLY USED YET.
95(SETQ READ-ONLY-AREA-LIST '(                    ;AREAS TO BE SET UP READ ONLY BY COLD LOAD
96        SCRATCH-PAD-INIT-AREA
97        MICRO-CODE-SYMBOL-AREA
98        SUPPORT-ENTRY-VECTOR
99        CONSTANTS-AREA
100        INIT-LIST-AREA
101        MICRO-CODE-SYMBOL-NAME-AREA
102))
103
104(SETQ COLD-LOAD-AREA-SIZES                      ;DEFAULT AREA SIZE IS ONE PAGE
105      '(P-N-STRING 600 OBT-TAILS 100 NR-SYM 500 MACRO-COMPILED-PROGRAM 1000
106        PAGE-TABLE-AREA 128.    ;ENOUGH FOR 2 MEGAWORDS OF MAIN MEMORY
107        PHYSICAL-PAGE-DATA 32.  ;ENOUGH FOR 2 MEGAWORDS OF MAIN MEMORY
108        ADDRESS-SPACE-MAP 1     ;ASSUMING 8-BIT BYTES
109        GC-TABLE-AREA 400       ;64K
110        LINEAR-PDL-AREA 100 LINEAR-BIND-PDL-AREA 10 PDL-AREA 300
111        WORKING-STORAGE-AREA 400 PERMANENT-STORAGE-AREA 200 PROPERTY-LIST-AREA 100
112        CONTROL-TABLES 13 INIT-LIST-AREA 64
113        MICRO-CODE-ENTRY-AREA 2 MICRO-CODE-ENTRY-NAME-AREA 2
114        MICRO-CODE-ENTRY-ARGS-INFO-AREA 2 MICRO-CODE-ENTRY-ARGLIST-AREA 2
115        MICRO-CODE-ENTRY-MAX-PDL-USAGE 2
116        MICRO-CODE-SYMBOL-NAME-AREA 2 MICRO-CODE-SYMBOL-AREA 2
117        FASL-TABLE-AREA 201  ;3 TIMES LENGTH-OF-FASL-TABLE PLUS 1 PAGE
118        FASL-CONSTANTS-AREA 600 EXTRA-PDL-AREA 10
119        FASL-TEMP-AREA 40))
120
121(SETQ COLD-LOAD-REGION-SIZES                    ;DEFAULT REGION SIZE IS 16K
122      '(WORKING-STORAGE-AREA 400000 MACRO-COMPILED-PROGRAM 200000
123        P-N-STRING 200000 NR-SYM 200000 FASL-CONSTANTS-AREA 200000
124        PROPERTY-LIST-AREA 200000))
125
126;In the cold-load, areas have only one region, so you can only use one
127;representation type per area.  These are the list areas, the rest are structure areas.
128(SETQ LIST-STRUCTURED-AREAS '(
129        SYSTEM-COMMUNICATION-AREA SCRATCH-PAD-INIT-AREA MICRO-CODE-SYMBOL-AREA
130        PAGE-TABLE-AREA PHYSICAL-PAGE-DATA REGION-ORIGIN REGION-LENGTH
131        REGION-BITS REGION-FREE-POINTER REGION-GC-POINTER
132        REGION-LIST-THREAD AREA-NAME AREA-REGION-LIST AREA-REGION-SIZE
133        AREA-MAXIMUM-SIZE AREA-SWAP-RECOMMENDATIONS SUPPORT-ENTRY-VECTOR CONSTANTS-AREA
134        MICRO-CODE-ENTRY-AREA MICRO-CODE-ENTRY-NAME-AREA
135        MICRO-CODE-ENTRY-ARGS-INFO-AREA MICRO-CODE-ENTRY-MAX-PDL-USAGE
136        MICRO-CODE-ENTRY-ARGLIST-AREA
137        MICRO-CODE-SYMBOL-NAME-AREA INIT-LIST-AREA PROPERTY-LIST-AREA
138        OBT-TAILS FASL-CONSTANTS-AREA
139))
140
141(SETQ STATIC-AREAS '(   ;not including Fixed areas
142        INIT-LIST-AREA PERMANENT-STORAGE-AREA P-N-STRING CONTROL-TABLES
143        NR-SYM MACRO-COMPILED-PROGRAM
144        FASL-TABLE-AREA FASL-TEMP-AREA FASL-CONSTANTS-AREA
145))
146
147; Numeric values of data types, shifted over into the data type field,
148; suitable for being added to the pointer to produce the contents of a Q.
149; These do NOT go into the cold load.
150; What are these used for nowadays?  They are not used in UCADR. -- RMS
151(SETQ DATA-TYPES '(QZTRAP QZNULL QZFREE                 ;ERRORS
152 QZSYM QZSYMH QZFIX QZXNUM                              ;ORDINARY ATOMS
153 QZHDR
154 QZGCF QZEVCP QZ1QF QZHF QXBF                           ;FORWARDS
155 QZLOC                                                  ;LOCATIVES
156 QZLIST                                                 ;LISTS
157 QZUENT                                                 ;FUNCTIONS, ETC...
158 QZFEFP QZARYP QZARYH                                   ;...
159 QZSTKG QZCLOS
160 QZSFLO QZSMTH QZINST QZINSH QZENTY QZSCLS
161 ))
162
163; Numeric values of data types, suitable for being DPB'd into the
164; data type field, or returned by (%DATA-TYPE ...).
165(SETQ Q-DATA-TYPES '(DTP-TRAP DTP-NULL DTP-FREE
166 DTP-SYMBOL DTP-SYMBOL-HEADER DTP-FIX DTP-EXTENDED-NUMBER DTP-HEADER
167 DTP-GC-FORWARD DTP-EXTERNAL-VALUE-CELL-POINTER DTP-ONE-Q-FORWARD
168 DTP-HEADER-FORWARD DTP-BODY-FORWARD
169 DTP-LOCATIVE
170 DTP-LIST
171 DTP-U-ENTRY
172 DTP-FEF-POINTER DTP-ARRAY-POINTER DTP-ARRAY-HEADER
173 DTP-STACK-GROUP DTP-CLOSURE DTP-SMALL-FLONUM DTP-SELECT-METHOD
174 DTP-INSTANCE DTP-INSTANCE-HEADER DTP-ENTITY
175 DTP-STACK-CLOSURE
176 ))
177
178; Numeric values of CDR codes, right-justified in word for %P-CDR-CODE, etc.
179(SETQ Q-CDR-CODES '(CDR-NORMAL CDR-ERROR CDR-NIL CDR-NEXT))
180
181; Byte pointers at the parts of a Q or other thing, and their values.
182; Q-FIELD-VALUES does NOT itself go into the cold load.
183(SETQ Q-FIELD-VALUES '(%%Q-CDR-CODE 3602 %%Q-FLAG-BIT 3501
184      %%Q-DATA-TYPE 3005 %%Q-POINTER 0030  %%Q-POINTER-WITHIN-PAGE 0007
185      %%Q-TYPED-POINTER 0035 %%Q-ALL-BUT-TYPED-POINTER 3503
186      %%Q-ALL-BUT-POINTER 3010 %%Q-ALL-BUT-CDR-CODE 0036
187      %%Q-HIGH-HALF 2020 %%Q-LOW-HALF 0020 ;USE THESE FOR REFERENCING MACRO INSTRUCTIONS
188      %%CH-FONT 1010 %%CH-CHAR 0010 ;FIELDS IN A 16-BIT CHARACTER
189      %%KBD-CHAR 0010 %%KBD-CONTROL-META 1004
190      %%KBD-CONTROL 1001 %%KBD-META 1101 %%KBD-SUPER 1201 %%KBD-HYPER 1301
191      %%KBD-MOUSE 1701 %%KBD-MOUSE-BUTTON 0003 %%KBD-MOUSE-N-CLICKS 0303))
192
193; Assign the byte pointers their values. Q-FIELDS becomes a list of just names.
194; It goes into the cold load, along with the names and their values.
195(ASSIGN-ALTERNATE Q-FIELD-VALUES)
196(SETQ Q-FIELDS (GET-ALTERNATE Q-FIELD-VALUES))
197
198(SETQ %Q-FLAG-BIT (DPB -1 %%Q-FLAG-BIT 0))  ;USED BY QLF IN COLD MODE
199
200;;; Stuff in the REGION-BITS array, some of these bits also appear in the
201;;; map in the same orientation. 
202
203(SETQ Q-REGION-BITS-VALUES '(
204        %%REGION-MAP-BITS 1612          ;10 bits to go into the map (access/status/meta)
205         ;2404                          ;access and status bits
206         %%REGION-OLDSPACE-META-BIT 2301 ;0=old or free, 1=new or static or fixed.
207                                         ;0 causes transport-trap for read of ptr to here
208         %%REGION-EXTRA-PDL-META-BIT 2201 ;0=extra-pdl, 1=normal.
209                                          ;0 traps writing of ptr to here into "random" mem
210         %%REGION-REPRESENTATION-TYPE 2002  ;Data representation type code:
211          %REGION-REPRESENTATION-TYPE-LIST 0
212          %REGION-REPRESENTATION-TYPE-STRUCTURE 1   ;2 and 3 reserved for future
213         ;1602 spare meta bits
214        ;1501 spare (formerly unimplemented compact-cons flag)
215        %%REGION-SPACE-TYPE 1104        ;Code for type of space:
216         %REGION-SPACE-FREE 0           ;0 free region slot
217         %REGION-SPACE-OLD 1            ;1 oldspace region of dynamic area
218         %REGION-SPACE-NEW 2            ;2 permanent newspace region of dynamic area
219         %REGION-SPACE-NEW1 3           ;3 temporary space, level 1
220         %REGION-SPACE-NEW2 4           ;4 ..
221         %REGION-SPACE-NEW3 5           ;5 ..
222         %REGION-SPACE-NEW4 6           ;6 ..
223         %REGION-SPACE-NEW5 7           ;7 ..
224         %REGION-SPACE-NEW6 10          ;10 ..
225         %REGION-SPACE-STATIC 11        ;11 static area
226         %REGION-SPACE-FIXED 12         ;12 fixed, static+not growable+no consing allowed
227         %REGION-SPACE-EXTRA-PDL 13     ;13 An extra-pdl for some stack-group
228         %REGION-SPACE-COPY 14          ;14 Like newspace, stuff copied from oldspace goes
229                                        ;   here while newly-consed stuff goes to newspace
230                                        ;   This is for permanent data
231                                        ;15-17 [not used]
232
233        %%REGION-SCAVENGE-ENABLE 1001   ;If 1, scavenger touches this region
234        ;0503 spare bits.
235        %%REGION-SWAPIN-QUANTUM  0005   ;swap this +1 pages in one disk op on swapin
236                                        ;  if possible.
237))
238
239(ASSIGN-ALTERNATE Q-REGION-BITS-VALUES)
240(SETQ Q-REGION-BITS (GET-ALTERNATE Q-REGION-BITS-VALUES))
241
242(SETQ Q-AREA-SWAP-BITS-VALUES '(
243        %%AREA-SWAP-SWAPIN-TRANSFER-SIZE 0006     ;# of pages to bring in with single disk
244                                                  ; op if possible.  0 says always 1.
245                                                  ; Otherwise this is a base number which
246                                                  ; may be further increased in
247                                                  ; context-switch mode.
248   ))
249
250(ASSIGN-ALTERNATE Q-AREA-SWAP-BITS-VALUES)
251(SETQ Q-AREA-SWAP-BITS (GET-ALTERNATE Q-AREA-SWAP-BITS-VALUES))
252
253(SETQ SYSTEM-COMMUNICATION-AREA-QS '(   ;LOCATIONS RELATIVE TO 400 IN CADR
254          ;locations 400-437 are miscellaneous Qs declared below
255          ;locations 440-477 are the reverse first level map
256          ;locations 500-511 are the keyboard buffer header (buffer is 200-377)
257          ;locations 600-637 are the disk-error log
258          ;locations 700-777 are reserved for disk CCW's (only 777 used now)
259          ;In CADR, location 777 is used (for now) by the disk code for the CCW.
260          ; --actually it seems to use locations 12-377 for the CCW most of the time.
261        %SYS-COM-AREA-ORIGIN-PNTR               ;ADDRESS OF AREA-ORIGIN AREA
262        %SYS-COM-VALID-SIZE                     ;IN A SAVED BAND, NUMBER OF WORDS USED
263        %SYS-COM-PAGE-TABLE-PNTR                ;ADDRESS OF PAGE-TABLE-AREA
264        %SYS-COM-PAGE-TABLE-SIZE                ;NUMBER OF QS
265        %SYS-COM-OBARRAY-PNTR                   ;CURRENT OBARRAY, COULD BE AN ARRAY-POINTER
266                                                ;BUT NOW IS USUALLY A SYMBOL WHOSE VALUE
267                                                ;IS THE CURRENTLY-SELECTED OBARRAY (PACKAGE)
268                ;Ether net interrupt-handler variables
269        %SYS-COM-ETHER-FREE-LIST
270        %SYS-COM-ETHER-TRANSMIT-LIST
271        %SYS-COM-ETHER-RECEIVE-LIST
272
273        %SYS-COM-SPARE-1                        ;Available for recycling
274        %SYS-COM-SPARE-2                        ;Available for recycling
275
276        %SYS-COM-UNIBUS-INTERRUPT-LIST          ;SEE LMIO;UNIBUS (LIST OF UNIBUS CHANNELS)
277
278        %SYS-COM-TEMPORARY                      ;MICROCODE BASHES THIS AT EXTRA-PDL-PURGE
279
280        %SYS-COM-FREE-AREA/#-LIST               ;THREADED THROUGH AREA-REGION-LIST, END=0
281        %SYS-COM-FREE-REGION/#-LIST             ;THREADED THROUGH REGION-LIST-THREAD, END=0
282        %SYS-COM-MEMORY-SIZE                    ;NUMBER OF WORDS OF MAIN MEMORY
283        %SYS-COM-WIRED-SIZE                     ;# WORDS OF LOW MEMORY WIRED DOWN
284                                                ;NOT ALL OF THESE WORDS ARE WIRED, THIS
285                                                ;IS REALLY THE VIRTUAL ADDRESS OF THE START
286                                                ;OF NORMAL PAGEABLE MEMORY
287
288                ;Chaos net interrupt-handler variables
289        %SYS-COM-CHAOS-FREE-LIST
290        %SYS-COM-CHAOS-TRANSMIT-LIST
291        %SYS-COM-CHAOS-RECEIVE-LIST
292
293                ;Debugger locations  (*** these seem not to be used ***)
294        %SYS-COM-DEBUGGER-REQUESTS              ;REQUEST TO POWER CONTROL/DEBUGGER
295        %SYS-COM-DEBUGGER-KEEP-ALIVE            ;KEEP ALIVE FLAG WORD
296        %SYS-COM-DEBUGGER-DATA-1                ;FOR INTERCOMMUNICATION
297        %SYS-COM-DEBUGGER-DATA-2
298
299                ;*** This does not appear to be initialized or used
300        %SYS-COM-MAJOR-VERSION          ;MAJOR COLD LOAD VERSION AS FIXNUM.  AVAILABLE TO
301                                        ; MICROCODE FOR DOWNWARD COMPATIBILITY.
302        %SYS-COM-DESIRED-MICROCODE-VERSION      ;Microcode version this world expects
303                ;TO BE ADDED:
304                ;SWAP OUT SCHEDULER AND DISK STUFF
305                ;EVENTUALLY THIS MAY REPLACE SCRATCH-PAD-INIT-AREA
306                ;THOSE OF THESE THAT DON'T NEED TO SURVIVE WARM BOOT COULD BE IN A-MEMORY
307))
308
309(AND (> (LENGTH SYSTEM-COMMUNICATION-AREA-QS) 40)
310     (ERROR '|SYSTEM COMMUNICATION AREA OVERFLOW|))
311
312;;; Next three symbols are treated bletcherously, because there isnt the right kind of
313;;; LDB available
314
315;VIRTUAL ADDRESS OF 0@A.  MUST AGREE WITH VALUE IN UCADR.
316;(unfortunately called LOWEST-A-MEM-VIRTUAL-ADDRESS).
317(SETQ A-MEMORY-VIRTUAL-ADDRESS (%P-LDB-OFFSET 0030 76776000 1))
318
319;Virtual address of X-BUS IO space.
320;Must agree with LOWEST-IO-SPACE-VIRTUAL-ADDRESS in UCADR.
321(SETQ IO-SPACE-VIRTUAL-ADDRESS (%P-LDB-OFFSET 0030 77000000 1))
322
323;Virtual address of UNIBUS IO space.
324;Must agree with LOWEST-UNIBUS-VIRTUAL-ADDRESS in UCADR.
325(SETQ UNIBUS-VIRTUAL-ADDRESS (%P-LDB-OFFSET 0030 77400000 1))
326
327(SETQ %INITIALLY-DISABLE-TRAPPING NIL)    ;THIS NON-NIL INHIBITS LISP-REINITIALIZE FROM
328                                          ; DOING AN (ENABLE-TRAPPING)
329(SETQ INHIBIT-SCHEDULING-FLAG NIL)        ;THIS NON-NIL INHIBITS CLOCK & SCHEDULING
330
331(SETQ HEADER-FIELD-VALUES '(%%HEADER-TYPE-FIELD 2305 %%HEADER-REST-FIELD 0023))
332(SETQ HEADER-FIELDS (GET-ALTERNATE HEADER-FIELD-VALUES))
333
334; These are the values that go in the %%HEADER-TYPE-FIELD of a Q of
335; data type DTP-HEADER.
336(SETQ Q-HEADER-TYPES '(%HEADER-TYPE-ERROR %HEADER-TYPE-FEF
337                        %HEADER-TYPE-ARRAY-LEADER
338                       %HEADER-TYPE-unused %HEADER-TYPE-FLONUM %HEADER-TYPE-COMPLEX
339                       %HEADER-TYPE-BIGNUM %HEADER-TYPE-RATIONAL-BIGNUM))
340
341; These are the header types, shifted so they can be added directly into a Q.
342; These do NOT go in the cold load.
343(SETQ HEADER-TYPES '(HEADER-TYPE-ERROR HEADER-TYPE-FEF
344                        HEADER-TYPE-ARRAY-LEADER
345                     HEADER-TYPE-unused HEADER-TYPE-FLONUM HEADER-TYPE-COMPLEX
346                     HEADER-TYPE-BIGNUM HEADER-TYPE-RATIONAL-BIGNUM))
347
348; These three lists describing the possible types of "argument descriptor info"
349(SETQ ADI-KINDS '(ADI-ERR ADI-RETURN-INFO ADI-RESTART-PC ADI-FEXPR-CALL
350                        ADI-LEXPR-CALL ADI-BIND-STACK-LEVEL ADI-UNUSED-6
351                        ADI-USED-UP-RETURN-INFO))
352
353(SETQ ADI-STORING-OPTIONS '(ADI-ST-ERR ADI-ST-BLOCK ADI-ST-LIST
354        ADI-ST-MAKE-LIST ADI-ST-INDIRECT))
355
356(SETQ ADI-FIELD-VALUES '(%%ADI-TYPE 2403 %%ADI-RET-STORING-OPTION 2103
357      %%ADI-RET-SWAP-SV 2001 %%ADI-RET-NUM-VALS-EXPECTING 0006
358      %%ADI-RPC-MICRO-STACK-LEVEL 0006))
359(ASSIGN-ALTERNATE ADI-FIELD-VALUES)
360(SETQ ADI-FIELDS (GET-ALTERNATE ADI-FIELD-VALUES))
361
362; LINEAR-PDL-QS and LINEAR-PDL-FIELDS, and their elements, go in the real machine.
363(SETQ LINEAR-PDL-QS '(%LP-FEF %LP-ENTRY-STATE %LP-EXIT-STATE %LP-CALL-STATE))
364                ;THESE ARE ASSIGNED VALUES STARTING WITH 0 AND INCREMENTING BY -1
365  (ASSIGN-VALUES-INIT-DELTA LINEAR-PDL-QS 0 0 -1)
366
367(SETQ %LP-CALL-BLOCK-LENGTH (LENGTH LINEAR-PDL-QS))
368(SETQ LLPFRM 4)                 ;# FIXED ALLOC QS IN LINAR PDL BLOCK (OBSOLETE, USE ABOVE)
369
370(SETQ %LP-INITIAL-LOCAL-BLOCK-OFFSET 1)
371
372(SETQ LINEAR-PDL-FIELDS-VALUES '(
373     ;LPCLS (%LP-CALL-STATE).  Stored when this call frame is created.
374     ;bits 27', 25' not used in LPCLS
375     %%LP-CLS-TRAP-ON-EXIT 2601                 ;If set, get error before popping this frame.
376     %%LP-CLS-ADI-PRESENT 2401                  ;ADI words precede this call-block
377     %%LP-CLS-DESTINATION 2004                  ;Where in the caller to put this frame's value
378     %%LP-CLS-DELTA-TO-OPEN-BLOCK 1010          ;Offset back to previous open or active block
379     %%LP-CLS-DELTA-TO-ACTIVE-BLOCK 0010        ;Offset back to previous active block
380                                                ;An active block is one that is executing
381                                                ;An open block is one whose args are being made
382     ;LPEXS (%LP-EXIT-STATE).  Stored when this frame calls out.
383     ;bits 22'-27' not used in LPEXS
384     %%LP-EXS-MICRO-STACK-SAVED 2101            ;A microstack frame exists on special pdl
385     %%LP-EXS-PC-STATUS 2001                    ;Same as below
386     %%LP-EXS-BINDING-BLOCK-PUSHED 2001         ;M-QBBFL STORED HERE IN MACRO EXIT OPERATION
387     %%LP-EXS-EXIT-PC 0017                      ;LC as offset in halfwords from FEF
388                                                ;Meaningless if %LP-FEF not a fef.
389        ;; Don't change %%LP-EXS-EXIT-PC, the numerical value is known by UCADR
390     ;LPENS (%LP-ENTRY-STATE).  Stored when this frame entered.
391     ;bits 16'-27' not used in LPENS
392;    %%LP-ENS-SPECIALS 2601 %%LP-ENS-BINDING-ARROW-DIRECTION 2501
393     %%LP-ENS-ENVIRONMENT-POINTER-POINTS-HERE 1601
394     %%LP-ENS-NUM-ARGS-SUPPLIED 1006
395     %%LP-ENS-MACRO-LOCAL-BLOCK-ORIGIN 0010))
396
397(ASSIGN-ALTERNATE LINEAR-PDL-FIELDS-VALUES)
398(SETQ LINEAR-PDL-FIELDS (GET-ALTERNATE LINEAR-PDL-FIELDS-VALUES))
399
400;; MICRO-STACK-FIELDS and its elements go in the real machine.
401(SETQ MICRO-STACK-FIELDS-VALUES
402              '(        %%US-RPC 1600                      ;RETURN PC
403                        %%US-MACRO-INSTRUCTION-RETURN 1601 ;TRIGGERS INSTRUCTION-STREAM STUFF
404                        %%US-PPBMIA 1701   ;ADI ON MICRO-TO-MICRO-CALL
405                        %%US-PPBSPC 2101)) ;BINDING BLOCK PUSHED
406
407
408(ASSIGN-ALTERNATE MICRO-STACK-FIELDS-VALUES)
409(SETQ MICRO-STACK-FIELDS (GET-ALTERNATE MICRO-STACK-FIELDS-VALUES))
410
411
412; M-FLAGS-FIELDS and M-ERROR-SUBSTATUS-FIELDS and their elements go in the real machine.
413(SETQ M-FLAGS-FIELDS-VALUES '(          ;MUST AGREE WITH DEFS IN UCONS
414        %%M-FLAGS-QBBFL 0001            ;BIND BLOCK OPEN FLAG
415        %%M-FLAGS-CAR-SYM-MODE 0102     ;CAR OF SYMBOL GIVES: ERROR, ERROR EXCEPT
416                                        ; (CAR NIL) -> NIL, NIL, P-NAME POINTER
417        %%M-FLAGS-CAR-NUM-MODE 0302     ;CAR OF NUMBER GIVES: ERROR, NIL, "WHATEVER IT IS"
418        %%M-FLAGS-CDR-SYM-MODE 0502     ;CDR OF SYMBOL GIVES: ERROR, ERROR EXCEPT
419                                        ; (CDR NIL) -> NIL, NIL, PROPERTY-LIST
420        %%M-FLAGS-CDR-NUM-MODE 0702     ;CDR OF NUMBER GIVES: ERROR, NIL, "WHATEVER IT IS"
421        %%M-FLAGS-DONT-SWAP-IN 1101     ;MAGIC FLAG FOR CREATING FRESH PAGES
422        %%M-FLAGS-TRAP-ENABLE 1201      ;1 ENABLE ERROR TRAPPING
423        %%M-FLAGS-MAR-MODE 1302         ;1-BIT = READ-TRAP, 2-BIT = WRITE-TRAP
424        %%M-FLAGS-PGF-WRITE 1501        ;FLAG USED BY PAGE FAULT ROUTINE
425        %%M-FLAGS-INTERRUPT 1601        ;IN MICROCODE INTERRUPT
426        %%M-FLAGS-SCAVENGE 1701         ;IN SCAVENGER
427        %%M-FLAGS-TRANSPORT 2001        ;IN TRANSPORTER
428        %%M-FLAGS-STACK-GROUP-SWITCH 2101       ;SWITCHING STACK GROUPS
429        %%M-FLAGS-DEFERRED-SEQUENCE-BREAK 2201  ;SEQUENCE BREAK PENDING BUT INHIBITED
430        %%M-FLAGS-METER-ENABLE 2301     ;METERING ENABLED FOR THIS STACK GROUP
431        %%M-FLAGS-TRAP-ON-CALL 2401     ;TRAP ON ATTEMPTING TO ACTIVATE NEW FRAME.
432))
433(ASSIGN-ALTERNATE M-FLAGS-FIELDS-VALUES)
434(SETQ M-FLAGS-FIELDS (GET-ALTERNATE M-FLAGS-FIELDS-VALUES))
435
436(SETQ M-ERROR-SUBSTATUS-FIELDS-VALUES '(        ;MUST AGREE WITH DEFS IN UCONS
437        %%M-ESUBS-TOO-FEW-ARGS 0001
438        %%M-ESUBS-TOO-MANY-ARGS 0101
439        %%M-ESUBS-BAD-QUOTED-ARG 0201
440        %%M-ESUBS-BAD-EVALED-ARG 0301
441        %%M-ESUBS-BAD-DT 0401
442        %%M-ESUBS-BAD-QUOTE-STATUS 0501
443))
444(ASSIGN-ALTERNATE M-ERROR-SUBSTATUS-FIELDS-VALUES)
445(SETQ M-ERROR-SUBSTATUS-FIELDS (GET-ALTERNATE M-ERROR-SUBSTATUS-FIELDS-VALUES))
446
447;A "Numeric Argument Description" is what %ARGS-INFO and ARGS-INFO return.
448;Such descriptors can also be hung on symbols' Q-ARGS-PROP properties.
449;The "fast option Q" of a FEF is stored in this format.
450;These symbols go in the real machine.
451(SETQ NUMERIC-ARG-DESC-INFO '(
452        %ARG-DESC-QUOTED-REST 10000000          ;HAS QUOTED REST ARGUMENT
453        %%ARG-DESC-QUOTED-REST 2501
454        %ARG-DESC-EVALED-REST 4000000           ;HAS EVALUATED REST ARGUMENT
455        %%ARG-DESC-EVALED-REST 2401
456        %%ARG-DESC-ANY-REST 2402                ;NON-ZERO IF HAS EITHER KIND OF REST ARG
457        %ARG-DESC-FEF-QUOTE-HAIR 2000000        ;MACRO COMPILED FCN WITH HAIRY QUOTING,
458        %%ARG-DESC-FEF-QUOTE-HAIR 2301          ; CALLER MUST CHECK A-D-L FOR FULL INFO
459        %ARG-DESC-INTERPRETED 1000000           ;THIS IS INTERPRETED FUNCTION,
460        %%ARG-DESC-INTERPRETED 2201             ; NO INFORMATION AVAILABLE (VAL=1000077)
461        %ARG-DESC-FEF-BIND-HAIR 400000          ;MACRO COMPILED FCN WITH HAIRY BINDING,
462        %%ARG-DESC-FEF-BIND-HAIR 2101           ; LINEAR ENTER MUST CHECK A-D-L
463        %%ARG-DESC-MIN-ARGS 0606                ;MINIMUM NUMBER OF REQUIRED ARGS
464        %%ARG-DESC-MAX-ARGS 0006))              ;MAXIMUM NUMBER OF REQUIRED+OPTIONAL
465                                                ; ARGS.  REST ARGS NOT COUNTED.
466
467(ASSIGN-ALTERNATE NUMERIC-ARG-DESC-INFO)
468(SETQ NUMERIC-ARG-DESC-FIELDS (GET-ALTERNATE NUMERIC-ARG-DESC-INFO))
469
470(SETQ ARG-DESC-FIELD-VALUES '(%FEF-ARG-SYNTAX 160 %FEF-QUOTE-STATUS 600
471       %FEF-DES-DT 17000
472       %FEF-INIT-OPTION 17 %FEF-SPECIAL-BIT 1_16 %FEF-NAME-PRESENT 1_20
473;***UNFORTUNATELY, ASSIGN-COMP-VALUES KNOWS ABOUT THESE TOO****
474       %%FEF-NAME-PRESENT 2001
475       %%FEF-SPECIAL-BIT 1601 %%FEF-SPECIALNESS 1602
476       %%FEF-FUNCTIONAL 1501 %%FEF-DES-DT 1104
477       %%FEF-QUOTE-STATUS 0702 %%FEF-ARG-SYNTAX 0403 %%FEF-INIT-OPTION 0004
478))
479
480(ASSIGN-ALTERNATE ARG-DESC-FIELD-VALUES)
481(SETQ ARG-DESC-FIELDS (GET-ALTERNATE ARG-DESC-FIELD-VALUES))
482        ;ARG-DESC-FIELDS GETS SET TO A LIST CONSISTING OF THE ALTERNATING MEMBERS OF
483        ;ARG-DESC-FIELD-VALUES
484
485(SETQ FEF-NAME-PRESENT '(FEF-NM-NO FEF-NM-YES))
486(SETQ FEF-SPECIALNESS '(FEF-LOCAL FEF-SPECIAL FEF-SPECIALNESS-UNUSED FEF-REMOTE))
487(SETQ FEF-FUNCTIONAL '(FEF-FUNCTIONAL-DONTKNOW FEF-FUNCTIONAL-ARG))
488(SETQ FEF-DES-DT '(FEF-DT-DONTCARE FEF-DT-NUMBER FEF-DT-FIXNUM FEF-DT-SYM
489                         FEF-DT-ATOM FEF-DT-LIST FEF-DT-FRAME))
490(SETQ FEF-QUOTE-STATUS '(FEF-QT-DONTCARE FEF-QT-EVAL FEF-QT-QT))
491(SETQ FEF-ARG-SYNTAX '(FEF-ARG-REQ FEF-ARG-OPT FEF-ARG-REST FEF-ARG-AUX
492                         FEF-ARG-FREE FEF-ARG-INTERNAL FEF-ARG-INTERNAL-AUX))
493(SETQ FEF-INIT-OPTION '(FEF-INI-NONE FEF-INI-NIL FEF-INI-PNTR FEF-INI-C-PNTR
494                         FEF-INI-OPT-SA FEF-INI-COMP-C FEF-INI-EFF-ADR
495                         FEF-INI-SELF))
496
497
498(SETQ ARRAY-FIELD-VALUES '(
499        %%ARRAY-TYPE-FIELD 2305 %%ARRAY-LEADER-BIT 2101
500        %%ARRAY-DISPLACED-BIT 2001 %%ARRAY-FLAG-BIT 1701
501        %%ARRAY-NUMBER-DIMENSIONS 1403 %%ARRAY-LONG-LENGTH-FLAG 1301
502        %%ARRAY-NAMED-STRUCTURE-FLAG 1201
503        %%ARRAY-INDEX-LENGTH-IF-SHORT 0012 %ARRAY-MAX-SHORT-INDEX-LENGTH 1777))
504
505(SETQ ARRAY-LEADER-FIELD-VALUES '(%ARRAY-LEADER-LENGTH 777777
506       %%ARRAY-LEADER-LENGTH 0022))
507
508(SETQ ARRAY-MISC-VALUES '(ARRAY-DIM-MULT 1_14 ARRAY-DIMENSION-SHIFT -14
509   ARRAY-TYPE-SHIFT -23 ARRAY-LEADER-BIT 1_21 ARRAY-DISPLACED-BIT 1_20
510   ARRAY-LONG-LENGTH-FLAG 1_13 ARRAY-NAMED-STRUCTURE-FLAG 1_12))
511
512(SETQ ARRAY-FIELDS (GET-ALTERNATE ARRAY-FIELD-VALUES))
513
514(SETQ ARRAY-LEADER-FIELDS (GET-ALTERNATE ARRAY-LEADER-FIELD-VALUES))
515
516(SETQ ARRAY-MISCS (GET-ALTERNATE ARRAY-MISC-VALUES))
517
518(SETQ ARRAY-TYPES '(ART-ERROR ART-1B ART-2B ART-4B ART-8B ART-16B ART-32B
519         ART-Q ART-Q-LIST ART-STRING ART-STACK-GROUP-HEAD ART-SPECIAL-PDL ART-HALF-FIX
520         ART-REG-PDL ART-FLOAT ART-FPS-FLOAT ART-FAT-STRING))
521
522(SETQ ARRAY-ELEMENTS-PER-Q '((ART-Q . 1) (ART-STRING . 4) (ART-1B . 40) (ART-2B . 20)
523     (ART-4B . 10) (ART-8B . 4) (ART-16B . 2) (ART-32B . 1) (ART-Q-LIST . 1)
524     (ART-STACK-GROUP-HEAD . 1) (ART-SPECIAL-PDL . 1) (ART-HALF-FIX . 2)
525     (ART-REG-PDL . 1) (ART-FLOAT . -2) (ART-FPS-FLOAT . 1) (ART-FAT-STRING . 2)))
526
527;NIL for Q-type arrays
528(SETQ ARRAY-BITS-PER-ELEMENT '((ART-Q . NIL) (ART-STRING . 8) (ART-1B . 1) (ART-2B . 2)
529     (ART-4B . 4) (ART-8B . 8) (ART-16B . 16.) (ART-32B . 24.) (ART-Q-LIST . NIL)
530     (ART-STACK-GROUP-HEAD . NIL) (ART-SPECIAL-PDL . NIL) (ART-HALF-FIX . 16.)
531     (ART-REG-PDL . NIL) (ART-FLOAT . 32.) (ART-FPS-FLOAT . 32.) (ART-FAT-STRING . 16.)))
532
533;FEF HEADER FIELDS
534(SETQ FEFH-CONSTANT-VALUES '(%FEFH-PC 177777    ;There are 19 available bits in this word!
535      %FEFH-NO-ADL 1_18.
536      %FEFH-FAST-ARG 1_17. %FEFH-SV-BIND 1_16.
537      %%FEFH-PC 0020 %%FEFH-PC-IN-WORDS 0117 %%FEFH-NO-ADL 2201
538      %%FEFH-FAST-ARG 2101 %%FEFH-SV-BIND 2001))
539
540(ASSIGN-ALTERNATE FEFH-CONSTANT-VALUES)
541
542(SETQ FEFH-CONSTANTS (GET-ALTERNATE FEFH-CONSTANT-VALUES))
543
544;FEF HEADER Q INDEXES
545
546(SETQ FEFHI-INDEXES '(%FEFHI-IPC %FEFHI-STORAGE-LENGTH %FEFHI-FCTN-NAME %FEFHI-FAST-ARG-OPT
547                      %FEFHI-SV-BITMAP %FEFHI-MISC %FEFHI-SPECIAL-VALUE-CELL-PNTRS))
548
549(SETQ IFEFOFF (1- (LENGTH FEFHI-INDEXES)))      ;Q'S IN FIXED ALLOC PART OF FEF
550(SETQ %FEF-HEADER-LENGTH IFEFOFF)               ;BETTER NAME FOR ABOVE
551
552(SETQ FEFHI-VALUES '(%%FEFHI-FSO-MIN-ARGS 0606 %%FEFHI-FSO-MAX-ARGS 0006
553      %%FEFHI-MS-LOCAL-BLOCK-LENGTH 0007 %%FEFHI-MS-ARG-DESC-ORG 0710
554      %%FEFHI-MS-BIND-DESC-LENGTH 1710
555      %%FEFHI-MS-DEBUG-INFO-PRESENT 2701
556      %%FEFHI-SVM-ACTIVE 2601
557      %FEFHI-SVM-ACTIVE 1_26
558      %%FEFHI-SVM-BITS 0026
559      %%FEFHI-SVM-HIGH-BIT 2501))
560
561(SETQ FEFHI-FIELDS (GET-ALTERNATE FEFHI-VALUES))
562
563;PAGE TABLE STUFF ETC.
564
565(SETQ PAGE-VALUES '(
566
567      ; DEFINITIONS OF FIELDS IN PAGE HASH TABLE
568
569      ;WORD 1
570      %%PHT1-SCAVENGER-WS-FLAG %%Q-FLAG-BIT  ;IF SET, PAGE IN SCAVENGER WORKING SET.
571      %%PHT1-VIRTUAL-PAGE-NUMBER 1020   ;ALIGNED SAME AS VMA
572        %PHT-DUMMY-VIRTUAL-ADDRESS 177777 ;ALL ONES MEANS THIS IS DUMMY ENTRY
573                                        ;WHICH JUST REMEMBERS A FREE CORE PAGE
574      %%PHT1-SWAP-STATUS-CODE 0003
575        %PHT-SWAP-STATUS-NORMAL 1       ;ORDINARY PAGE
576        %PHT-SWAP-STATUS-FLUSHABLE 2    ;SAFELY REUSABLE TO SWAP PAGES INTO
577                                        ;MAY NEED TO BE WRITTEN TO DISK FIRST
578        %PHT-SWAP-STATUS-PREPAGE 3      ;SAME AS FLUSHABLE, BUT CAME IN VIA PREPAGE
579        %PHT-SWAP-STATUS-AGE-TRAP 4     ;LIKE NORMAL BUT TRYING TO MAKE FLUSHABLE
580        %PHT-SWAP-STATUS-WIRED 5        ;NOT SWAPPABLE
581
582      %%PHT1-AGE 0302                   ;NUMBER OF TIMES AGED
583
584      %%PHT1-MODIFIED-BIT 0501          ;1 IF PAGE MODIFIED, BUT THE FACT NOT RECORDED
585                                        ; IN THE MAP-STATUS, BECAUSE IT IS NOMINALLY READ-ONLY
586                                        ; OR NOMINALLY READ-WRITE-FIRST.
587
588      %%PHT1-VALID-BIT 0601             ;1 IF THIS HASH TABLE SLOT IS OCCUPIED.
589
590      ;PHT WORD 2.  THIS IS IDENTICAL TO THE LEVEL-2 MAP
591      %%PHT2-META-BITS 1606                             ;SEE %%REGION-MAP-BITS
592
593      %%PHT2-MAP-STATUS-CODE 2403
594        %PHT-MAP-STATUS-MAP-NOT-VALID 0         ;LEVEL 1 OR 2 MAP NOT SET UP
595        %PHT-MAP-STATUS-META-BITS-ONLY 1        ;HAS META BITS BUT NO PHYSICAL ADDRESS
596        %PHT-MAP-STATUS-READ-ONLY 2             ;GARBAGE COLLECTOR CAN STILL WRITE IN IT
597        %PHT-MAP-STATUS-READ-WRITE-FIRST 3      ;READ/WRITE BUT NOT MODIFIED
598        %PHT-MAP-STATUS-READ-WRITE 4            ;READ/WRITE AND MODIFIED
599        %PHT-MAP-STATUS-PDL-BUFFER 5            ;MAY RESIDE IN PDL BUFFER
600        %PHT-MAP-STATUS-MAR 6                   ;MAR SET SOMEWHERE ON THIS PAGE
601
602      %%PHT2-MAP-ACCESS-CODE 2602
603      %%PHT2-ACCESS-STATUS-AND-META-BITS 1612
604      %%PHT2-ACCESS-AND-STATUS-BITS 2404
605      %%PHT2-PHYSICAL-PAGE-NUMBER 0016
606))
607
608(ASSIGN-ALTERNATE PAGE-VALUES)
609(SETQ PAGE-HASH-TABLE-FIELDS (GET-ALTERNATE PAGE-VALUES))
610
611;;; See LISPM2;SGDEFS
612(SETQ STACK-GROUP-HEAD-LEADER-QS '(SG-NAME
613      SG-REGULAR-PDL SG-REGULAR-PDL-LIMIT SG-SPECIAL-PDL SG-SPECIAL-PDL-LIMIT
614      SG-INITIAL-FUNCTION-INDEX
615      SG-UCODE
616;END STATIC SECTION, BEGIN DEBUGGING SECTION
617      SG-TRAP-TAG   ;SYMBOLIC TAG CORRESPONDING TO SG-TRAP-MICRO-PC.  GOTTEN VIA
618                    ; MICROCODE-ERROR-TABLE, ETC.  PROPERTIES OFF THIS SYMBOL
619                    ; DRIVE VARIOUS STAGES IN ERROR RECOVERY, ETC.
620      SG-RECOVERY-HISTORY  ;AVAILABLE FOR HAIRY SG MUNGING ROUTINES TO LEAVE TRACKS IN
621                        ; FOR DEBUGGING PURPOSES.
622      SG-FOOTHOLD-DATA  ;STRUCTURE WHICH SAVES DYNAMIC SECTION OF "REAL" SG WHEN
623                        ; EXECUTING IN THE FOOTHOLD.
624; LOCATIONS BELOW HERE ARE ACTUALLY LOADED/STORED ON SG-ENTER/SG-LEAVE
625;END DEBUGGING SECTION, BEGIN "HIGH LEVEL" SECTION
626      SG-STATE SG-PREVIOUS-STACK-GROUP SG-CALLING-ARGS-POINTER
627      SG-CALLING-ARGS-NUMBER ;SG-FOLLOWING-STACK-GROUP
628      SG-TRAP-AP-LEVEL
629;END HIGH-LEVEL SECTION, BEGIN "DYNAMIC" SECTION --BELOW HERE IS SAVED IN
630; SG-FOOTHOLD-DATA WHEN %%SG-ST-FOOTHOLD-EXECUTING IS SET.
631      SG-REGULAR-PDL-POINTER SG-SPECIAL-PDL-POINTER
632      SG-AP SG-IPMARK
633      SG-TRAP-MICRO-PC  ;PC SAVED FROM OPCS AT MICRO-LOCATION TRAP
634;     SG-ERROR-HANDLING-SG SG-INTERRUPT-HANDLING-SG
635;       HAVING THESE BE PART OF THE SG IS BASICALLY A GOOD IDEA, BUT IT
636;       DOESNT BUY ANYTHING FOR THE TIME BEING AND COSTS A COUPLE OF MICROINSTRUCTIONS
637      SG-SAVED-QLARYH SG-SAVED-QLARYL SG-SAVED-M-FLAGS 
638      SG-AC-K SG-AC-S SG-AC-J
639      SG-AC-I SG-AC-Q SG-AC-R SG-AC-T SG-AC-E SG-AC-D SG-AC-C
640      SG-AC-B SG-AC-A SG-AC-ZR SG-AC-2 SG-AC-1 SG-VMA-M1-M2-TAGS SG-SAVED-VMA SG-PDL-PHASE))
641
642;FIELDS IN SG-STATE Q
643(SETQ SG-STATE-FIELD-VALUES '(%%SG-ST-CURRENT-STATE 0006
644      %%SG-ST-FOOTHOLD-EXECUTING 0601
645      %%SG-ST-PROCESSING-ERROR 0701 %%SG-ST-PROCESSING-INTERRRUPT-REQUEST 1001
646      %%SG-ST-SAFE 1101
647      %%SG-ST-INST-DISP 1202
648      %%SG-ST-IN-SWAPPED-STATE 2601
649      %%SG-ST-SWAP-SV-ON-CALL-OUT 2501
650      %%SG-ST-SWAP-SV-OF-SG-THAT-CALLS-ME 2401))
651(SETQ SG-STATE-FIELDS (GET-ALTERNATE SG-STATE-FIELD-VALUES))
652
653(SETQ SG-INST-DISPATCHES '(
654      SG-MAIN-DISPATCH                  ;MAIN INSTRUCTION DISPATCH
655      SG-DEBUG-DISPATCH                 ;DEBUGGING DISPATCH
656      SG-SINGLE-STEP-DISPATCH           ;DISPATCH ONCE, AND THEN BREAK
657      SG-SINGLE-STEP-TRAP               ;FOR SEQUENCE BREAKS OUT OF TRAPPING INSTRUCTIONS
658      ))
659
660(SETQ SG-STATES '(
661      SG-STATE-ERROR         ;0 SHOULD NEVER GET THIS
662      SG-STATE-ACTIVE        ;ACTUALLY EXECUTING ON MACHINE.
663      SG-STATE-RESUMABLE     ;REACHED BY INTERRUPT OR  ERROR RECOVERY COMPLETED
664                             ; JUST RESTORE STATE AND DO A UCODE POPJ TO RESUME.
665      SG-STATE-AWAITING-RETURN    ;AFTER DOING A "LEGITIMATE" SG-CALL.  TO RESUME THIS
666                                  ; RELOAD SG THEN RETURN A VALUE BY TRANSFERRING TO
667                                  ; QMEX1.
668      SG-STATE-INVOKE-CALL-ON-RETURN  ;TO RESUME THIS, RELOAD SG, THEN SIMULATE
669                                      ; A STORE IN DESTINATION-LAST.  THE ERROR
670                                      ; SYSTEM CAN PRODUCE THIS STATE WHEN IT WANTS
671                                      ; TO ACTIVATE THE FOOTHOLD OR PERFORM A RETRY.
672      SG-STATE-INTERRUPTED-DIRTY  ;GET THIS IF FORCED TO TAKE AN INTERRUPT AT AN
673                                  ; INOPPORTUNE TIME.
674      SG-STATE-AWAITING-ERROR-RECOVERY   ;IMMEDIATEDLY AFTER ERROR, BEFORE RECOVERY
675      SG-STATE-AWAITING-CALL
676      SG-STATE-AWAITING-INITIAL-CALL
677      SG-STATE-EXHAUSTED))
678
679(SETQ SPECIAL-PDL-LEADER-QS '(SPECIAL-PDL-SG-HEAD-POINTER))
680(SETQ REG-PDL-LEADER-QS '(REG-PDL-SG-HEAD-POINTER))
681
682(SETQ PAGE-SIZE 400)
683
684(SETQ LENGTH-OF-FASL-TABLE 37773)
685
686(SETQ LENGTH-OF-ATOM-HEAD 5)
687
688(SETQ SIZE-OF-OB-TBL 177)        ;USED BY PRE-PACKAGE INTERN KLUDGE
689
690(SETQ SIZE-OF-AREA-ARRAYS 377)
691
692;SIZE OF VARIOUS HARDWARE MEMORIES IN "ADDRESSIBLE LOCATIONS"
693(SETQ SIZE-OF-HARDWARE-CONTROL-MEMORY   40000)
694(SETQ SIZE-OF-HARDWARE-DISPATCH-MEMORY  4000)
695(SETQ SIZE-OF-HARDWARE-A-MEMORY         2000)
696(SETQ SIZE-OF-HARDWARE-M-MEMORY           40)
697(SETQ SIZE-OF-HARDWARE-PDL-BUFFER       2000)
698(SETQ SIZE-OF-HARDWARE-MICRO-STACK        40)
699(SETQ SIZE-OF-HARDWARE-LEVEL-1-MAP      4000)
700(SETQ SIZE-OF-HARDWARE-LEVEL-2-MAP      2000)
701(SETQ SIZE-OF-HARDWARE-UNIBUS-MAP         20)
702
703(SETQ A-MEMORY-LOCATION-NAMES '(        ;LIST IN ORDER OF CONTENTS OF A-MEMORY STARTING AT 40
704  %MICROCODE-VERSION-NUMBER             ;SECOND FILE NAME OF MICROCODE SOURCE FILE AS A NUMBER
705  %NUMBER-OF-MICRO-ENTRIES              ;NUMBER OF SLOTS USED IN MICRO-CODE-ENTRY-AREA
706  DEFAULT-CONS-AREA                     ;DEFAULT AREA FOR CONS, LIST, ETC.
707  NUMBER-CONS-AREA                      ;FOR BIGNUMS, BIG-FLOATS, ETC.  CAN BE
708                                        ; EXTRA-PDL-AREA OR JUST REGULAR AREA.
709  %INITIAL-FEF                          ;POINTER TO FEF OF FUNCTION MACHINE STARTS UP IN
710  %ERROR-HANDLER-STACK-GROUP            ;SG TO SWITCH TO ON TRAPS
711  %CURRENT-STACK-GROUP                  ;CURRENT STACK-GROUP
712  %INITIAL-STACK-GROUP                  ;STACK-GROUP MACHINE STARTS UP IN
713  %CURRENT-STACK-GROUP-STATE            ;SG-STATE Q OF CURRENT STACK GROUP
714  %CURRENT-STACK-GROUP-PREVIOUS-STACK-GROUP     ;
715  %CURRENT-STACK-GROUP-CALLING-ARGS-POINTER     ;
716  %CURRENT-STACK-GROUP-CALLING-ARGS-NUMBER      ;
717; %CURRENT-STACK-GROUP-FOLLOWING-STACK-GROUP    ;
718  %TRAP-MICRO-PC                        ;PC GOTTEN OUT OF OPCS BY TRAP
719  %COUNTER-BLOCK-A-MEM-ADDRESS          ;LOC OF BEGINNING OF COUNTER BLOCK RELATIVE TO
720                                        ; A MEMORY AS A FIXNUM.
721  %CHAOS-CSR-ADDRESS                    ;XBUS ADDRESS
722  %MAR-LOW                              ;FIXNUM MAR LOWER BOUND (INCLUSIVE)
723  %MAR-HIGH                             ;FIXNUM MAR UPPER BOUND (INCLUSIVE)
724                                        ;%%M-FLAGS-MAR-MODE CONTROLS THE ABOVE
725  SELF                                  ;SELF POINTER FOR DTP-INSTANCE, ETC
726  %METHOD-SEARCH-POINTER                ;Method list element were last method found.
727  INHIBIT-SCHEDULING-FLAG               ;NON-NIL SUPPRESSES SEQUENCE BREAKS
728  INHIBIT-SCAVENGING-FLAG               ;NON-NIL TURNS OFF THE SCAVENGER
729  %DISK-RUN-LIGHT                       ;ADDRESS OF DISK RUN LIGHT, THAT+2 IS PROC RUN LIGHT
730  %LOADED-BAND                          ;LOW 24 BITS (FIXNUM) OF BOOTED BAND NAME (E.G. "OD3")
731  %DISK-BLOCKS-PER-TRACK                ;(FROM LABEL) BLOCKS PER TRACK, USUALLY 17.
732  %DISK-BLOCKS-PER-CYLINDER             ;(FROM LABEL) 85. ON T-80, 323. ON T-300
733                ;THE GARBAGE-COLLECTOR PROCESS HANGS ON THESE VARIABLES
734  %REGION-CONS-ALARM                    ;COUNTS NEW REGIONS CREATED
735  %PAGE-CONS-ALARM                      ;COUNTS PAGES ALLOCATED TO REGIONS
736  %GC-FLIP-READY                        ;If non-NIL, there are no pointers to oldspace
737  %INHIBIT-READ-ONLY                    ;If non-NIL, you can write in read-only
738  %SCAVENGER-WS-ENABLE                  ;If non-NIL, scavenger working set hack enabled
739  %METHOD-SUBROUTINE-POINTER            ;Continuation point for SELECT-METHOD subroutine
740                                        ; or NIL.
741  %QLARYH                               ;Header of last array ref'ed as function
742  %QLARYL                               ;Element # of last array ref'ed as function
743  %SCHEDULER-STACK-GROUP                ;Force call to this on sequence-break.  This
744                                        ;stack group must bind on INHIBIT-SCHEDULING-FLAG as
745                                        ;part of the stack-group switch for proper operation.
746  %CURRENT-SHEET                        ;Sheet or screen currently selected by microcode
747  %DISK-SWITCHES                        ;Fixnum: 1 r/c after read, 2 r/c after write
748                                        ; 4 enables multiple page swapouts
749                                        ; was called %READ-COMPARE-ENABLES
750  %MC-CODE-EXIT-VECTOR                  ;Exit vector used by microcompiled code to ref Q
751                                        ; quantities.
752  ALPHABETIC-CASE-AFFECTS-STRING-COMPARISON ;If T, upper and lower case are not equal
753  ZUNDERFLOW                            ;If non-NIL, floating pointer underflow yields zero
754  %GC-GENERATION-NUMBER                 ;Increments whenever any new oldspace is created.
755                                        ; Thus if this has changed, objects' addresses
756                                        ; may have changed.
757  %METER-GLOBAL-ENABLE                  ;NIL means metering on per stack group basis
758                                        ;T means all stack groups
759  %METER-BUFFER-POINTER                 ;Pointer to the buffer as a fixnum
760  %METER-DISK-ADDRESS                   ;disk address to write out the meter info
761  %METER-DISK-COUNT                     ;count of disk blocks to write out
762  CURRENTLY-PREPARED-SHEET              ;Error checking for the TV:PREPARE-SHEET macro
763  MOUSE-CURSOR-STATE                    ;0 disabled, 1 open, 2 off, 3 on
764  MOUSE-X                               ;Relative to mouse-sheet
765  MOUSE-Y
766  MOUSE-CURSOR-X-OFFSET                 ;From top-left of pattern
767  MOUSE-CURSOR-Y-OFFSET                 ;to the reference point
768  MOUSE-CURSOR-WIDTH
769  MOUSE-CURSOR-HEIGHT
770  MOUSE-X-SPEED                         ;100ths per second, time averaged
771  MOUSE-Y-SPEED                         ;with time constant of 1/6 second
772  MOUSE-BUTTONS-BUFFER-IN-INDEX
773  MOUSE-BUTTONS-BUFFER-OUT-INDEX
774  MOUSE-WAKEUP                          ;Set to T when move or click
775  LEXICAL-ENVIRONMENT
776  AMEM-EVCP-VECTOR                      ;Value is an array as long as this list plus 40,
777                                        ;which holds the EVCP when one of these vars
778                                        ;is bound by a closure.
779  BACKGROUND-CONS-AREA                  ;Used for conses that are not explicitly requested
780                                        ;and shouldn't go in a temp area.
781))
782
783(SETQ A-MEMORY-COUNTER-BLOCK-NAMES '(
784  %COUNT-FIRST-LEVEL-MAP-RELOADS        ;# FIRST LEVEL MAP RELOADS
785  %COUNT-SECOND-LEVEL-MAP-RELOADS       ;# SECOND LEVEL MAP RELOADS
786  %COUNT-PDL-BUFFER-READ-FAULTS         ;# TOOK PGF AND DID READ FROM PDL-BUFFER
787  %COUNT-PDL-BUFFER-WRITE-FAULTS        ;# TOOK PGF AND DID WRITE TO PDL-BUFFER
788  %COUNT-PDL-BUFFER-MEMORY-FAULTS       ;# TOOK PGF FOR PDL-BUF, BUT DATA IN MAIN MEM.
789  %COUNT-DISK-PAGE-READS                ;COUNT OF PAGES READ FROM DISK
790  %COUNT-DISK-PAGE-WRITES               ;COUNT OF PAGES WRITTEN TO DISK
791  %COUNT-DISK-ERRORS                    ;COUNT OF RECOVERABLE ERRS
792  %COUNT-FRESH-PAGES                    ;COUNT OF FRESH PAGES
793                                        ; GENERATED IN CORE INSTEAD OF READ FROM DISK
794  %COUNT-AGED-PAGES                     ;NUMBER OF TIMES AGER SET AGE TRAP
795  %COUNT-AGE-FLUSHED-PAGES              ;NUMBER OF TIMES AGE TRAP -> FLUSHABLE
796  %COUNT-DISK-READ-COMPARE-REWRITES     ;COUNT OF WRITES REDONE DUE TO FAILURE TO READ-COMPARE
797  %COUNT-DISK-RECALIBRATES              ;DUE TO SEEK ERRORS
798  %COUNT-META-BITS-MAP-RELOADS          ;# SECOND LEVEL MAP RELOADS TO META-BITS-ONLY
799  %COUNT-CHAOS-TRANSMIT-ABORTS          ;Number of transmit aborts in microcode
800  %COUNT-DISK-READ-COMPARE-DIFFERENCES  ;Number of read-compare differences without
801                                        ; accompanying disk read error
802  %COUNT-CONS-WORK                      ;GC parameter
803  %COUNT-SCAVENGER-WORK                 ;..
804  %TV-CLOCK-RATE                        ;TV frame rate divided by this is seq brk clock
805  %AGING-DEPTH                          ;Number of laps to age a page.  Don't make > 3!!
806  %COUNT-DISK-ECC-CORRECTED-ERRORS      ;Number of soft ECC errors
807  %COUNT-FINDCORE-STEPS                 ;Number of iterations finding mem to swap out
808  %COUNT-FINDCORE-EMERGENCIES           ;Number of times FINDCORE had to age all pages
809  %COUNT-DISK-READ-COMPARE-REREADS      ;Reads done over due to r/c diff or error
810  %COUNT-DISK-PAGE-READ-OPERATIONS      ;Read operations (count once even if multipage)
811  %COUNT-DISK-PAGE-WRITE-OPERATIONS     ;Write operations (count once even if multipage)
812  %COUNT-DISK-PAGE-WRITE-WAITS          ;Waiting for a page to get written, to reclaim core
813  %COUNT-DISK-PAGE-WRITE-BUSYS          ;Waiting for a page to get written, to use disk
814  %COUNT-DISK-PREPAGES-USED             ;Counts prepaged pages that were wanted
815  %COUNT-DISK-PREPAGES-NOT-USED         ;Counts prepaged pages that were reclaimed
816  %DISK-ERROR-LOG-POINTER               ;Address of next 4-word block in 600-637
817  %DISK-WAIT-TIME                       ;Microseconds of waiting for disk time
818  %COUNT-DISK-PAGE-WRITE-APPENDS        ;Pages appended to swapout operations.
819  %COUNT-DISK-PAGE-READ-APPENDS         ;Pages appended to swapin operations.
820))
821
822(SETQ M-MEMORY-LOCATION-NAMES              ;M-MEM LOCNS ARE ASSIGNED PIECEMEAL..
823      '(%MODE-FLAGS %SEQUENCE-BREAK-SOURCE-ENABLE %METER-MICRO-ENABLES))
824  (PUTPROP '%MODE-FLAGS
825           (+ A-MEMORY-VIRTUAL-ADDRESS 26)
826           'FORWARDING-VIRTUAL-ADDRESS)
827  (PUTPROP '%SEQUENCE-BREAK-SOURCE-ENABLE
828           (+ A-MEMORY-VIRTUAL-ADDRESS 34)
829           'FORWARDING-VIRTUAL-ADDRESS)
830  (PUTPROP '%METER-MICRO-ENABLES
831           (+ A-MEMORY-VIRTUAL-ADDRESS 35)
832           'FORWARDING-VIRTUAL-ADDRESS)
833
834(SETQ DISK-RQ-LEADER-QS '(%DISK-RQ-LEADER-N-HWDS        ;NUMBER HALFWORDS REALLY USED
835                                                        ; ON FIRST PAGE BEFORE CCW LIST.
836                          %DISK-RQ-LEADER-N-PAGES       ;NUMBER OF BUFFER PAGES ALLOCATED
837                          %DISK-RQ-LEADER-BUFFER        ;DISPLACED ART-16B ARRAY TO BUFFER PGS
838                          %DISK-RQ-LEADER-THREAD        ;LINK TO NEXT FREE RQB
839                          %DISK-RQ-LEADER-8-BIT-BUFFER) ;DISPLACED ART-8B ARRAY.
840      DISK-RQ-HWDS '(%DISK-RQ-DONE-FLAG                 ;0 RQ ENTERED, -1 COMPLETED
841                     %DISK-RQ-DONE-FLAG-HIGH
842                     ;; These are set up by the requester
843                     %DISK-RQ-COMMAND                   ;DISK COMMAND REGISTER
844                     %DISK-RQ-COMMAND-HIGH
845                     %DISK-RQ-CCW-LIST-POINTER-LOW      ;CLP LOW 16
846                     %DISK-RQ-CCW-LIST-POINTER-HIGH     ;CLP HIGH 6
847                     %DISK-RQ-SURFACE-SECTOR            ;DISK ADDRESS REG LOW
848                     %DISK-RQ-UNIT-CYLINDER             ;DISK ADDRESS REG HIGH
849                     ;; These are stored when the operation completes
850                     %DISK-RQ-STATUS-LOW                ;DISK STATUS REG LOW 16
851                     %DISK-RQ-STATUS-HIGH               ;DISK STATUS REG HIGH 16
852                     %DISK-RQ-MEM-ADDRESS-LOW           ;LAST MEM REF ADDR LOW 16
853                     %DISK-RQ-MEM-ADDRESS-HIGH          ;LAST MEM REF ADDR HIGH 6
854                     %DISK-RQ-FINAL-SURFACE-SECTOR      ;DISK ADDRESS REG LOW
855                     %DISK-RQ-FINAL-UNIT-CYLINDER       ;DISK ADDRESS REG HIGH
856                     %DISK-RQ-ECC-POSITION
857                     %DISK-RQ-ECC-PATTERN
858                     %DISK-RQ-CCW-LIST)                 ;CCW list customarily starts here
859      DISK-HARDWARE-VALUES '(
860        %%DISK-STATUS-HIGH-BLOCK-COUNTER 1010 %%DISK-STATUS-HIGH-INTERNAL-PARITY 0701
861        %%DISK-STATUS-HIGH-READ-COMPARE-DIFFERENCE 0601 %%DISK-STATUS-HIGH-CCW-CYCLE 0501
862        %%DISK-STATUS-HIGH-NXM 0401 %%DISK-STATUS-HIGH-MEM-PARITY 0301
863        %%DISK-STATUS-HIGH-HEADER-COMPARE 0201 %%DISK-STATUS-HIGH-HEADER-ECC 0101
864        %%DISK-STATUS-HIGH-ECC-HARD 0001
865        %DISK-STATUS-HIGH-ERROR 237 ;Mask for bits which are errors normally
866        %%DISK-STATUS-LOW-ECC-SOFT 1701 %%DISK-STATUS-LOW-OVERRUN 1601
867        %%DISK-STATUS-LOW-TRANSFER-ABORTED 1501 %%DISK-STATUS-LOW-START-BLOCK-ERROR 1401
868        %%DISK-STATUS-LOW-TIMEOUT 1301 %%DISK-STATUS-LOW-SEEK-ERROR 1201
869        %%DISK-STATUS-LOW-OFF-LINE 1101 %%DISK-STATUS-LOW-OFF-CYLINDER 1001
870        %%DISK-STATUS-LOW-READ-ONLY 0701 %%DISK-STATUS-LOW-FAULT 0601
871        %%DISK-STATUS-LOW-NO-SELECT 0501 %%DISK-STATUS-LOW-MULTIPLE-SELECT 0401
872        %%DISK-STATUS-LOW-INTERRUPT 0301 %%DISK-STATUS-LOW-SEL-UNIT-ATTENTION 0201
873        %%DISK-STATUS-LOW-ATTENTION 0101 %%DISK-STATUS-LOW-READY 0001
874        %DISK-STATUS-LOW-ERROR 177560  ;Mask for bits which are errors normally
875        %DISK-COMMAND-DONE-INTERRUPT-ENABLE 1_11.
876        %DISK-COMMAND-ATTENTION-INTERRUPT-ENABLE 1_10.  ;Trident only
877        %DISK-COMMAND-RECALIBRATE 10001005
878        %DISK-COMMAND-FAULT-CLEAR 10000405      ;Recalibrate on Marksman
879        %DISK-COMMAND-DATA-STROBE-LATE 200      ;These are all different on Marksman
880        %DISK-COMMAND-DATA-STROBE-EARLY 100     ;..
881        %DISK-COMMAND-SERVO-OFFSET 40           ;..
882        %DISK-COMMAND-SERVO-OFFSET-FORWARD 20   ;..
883        %DISK-COMMAND-READ 0
884        %DISK-COMMAND-READ-COMPARE 10
885        %DISK-COMMAND-WRITE 11
886        %DISK-COMMAND-READ-ALL 2
887        %DISK-COMMAND-WRITE-ALL 13
888        %DISK-COMMAND-SEEK 20000004
889        %%DISK-COMMAND-SEEK-CYLINDER 3010       ;Only used by Marksman
890        %DISK-COMMAND-AT-EASE 5                 ;Get status on Marksman
891        %DISK-COMMAND-OFFSET-CLEAR 6            ;NOP on marksman
892        %DISK-COMMAND-RESET-CONTROLLER 16))
893                ;Marksman also has get-status commands, not listed here.
894
895(ASSIGN-VALUES DISK-RQ-LEADER-QS 0)
896(ASSIGN-VALUES DISK-RQ-HWDS 0)
897(ASSIGN-ALTERNATE DISK-HARDWARE-VALUES)
898(SETQ DISK-HARDWARE-SYMBOLS (GET-ALTERNATE DISK-HARDWARE-VALUES))
899
900;;; Definitions for interrupt-driven Unibus input channels
901;;; Note that these start at 1 rather than at 0, to leave room for an array header
902
903(SETQ UNIBUS-CHANNEL-QS '(
904        %UNIBUS-CHANNEL-LINK                    ;Address of next or 0 to end list
905        %UNIBUS-CHANNEL-VECTOR-ADDRESS          ;Interrupt vector address of device
906        %UNIBUS-CHANNEL-CSR-ADDRESS             ;Virtual address of status register
907        %UNIBUS-CHANNEL-CSR-BITS                ;Bits which must be on in CSR
908        %UNIBUS-CHANNEL-DATA-ADDRESS            ;Virtual address of data register(s)
909                                                ;The %%Q-FLAG bit means there are 2 data regs
910        %UNIBUS-CHANNEL-BUFFER-START            ;Start address of buffer
911        %UNIBUS-CHANNEL-BUFFER-END              ;End address+1 of buffer
912        %UNIBUS-CHANNEL-BUFFER-IN-PTR           ;Address of next word to store
913                                                ;The flag bit enables seq breaks per channel.
914        %UNIBUS-CHANNEL-BUFFER-OUT-PTR          ;Address of next word to extract
915  ;**this last does not really exist now.  It should be carried thru on the next cold load.
916  ;  It is required for the non-local unibus hack to work in general, altho we can get along
917  ;  without it for the time being since the keyboard is always interrupt enabled.**
918        %UNIBUS-CHANNEL-INTERRUPT-ENABLE-BITS ;Bit(s) in CSR which enable interrupts.
919        %UNIBUS-CHANNEL-OUTPUT-TURNOFF-ADDRESS  ;Address to write to shut down output channel
920        %UNIBUS-CHANNEL-OUTPUT-TURNOFF-BITS))   ;Value to write into that address
921
922(ASSIGN-VALUES-INIT-DELTA UNIBUS-CHANNEL-QS 0 1 1)
923
924;;; Definitions for Chaos net hardware and microcode
925
926;;;  Command/Status register fields
927
928(SETQ CHAOS-HARDWARE-VALUES '(
929        %%CHAOS-CSR-TIMER-INTERRUPT-ENABLE 0001
930        %%CHAOS-CSR-LOOP-BACK 0101
931        %%CHAOS-CSR-RECEIVE-ALL 0201
932        %%CHAOS-CSR-RECEIVER-CLEAR 0301
933        %%CHAOS-CSR-RECEIVE-ENABLE 0401
934        %%CHAOS-CSR-TRANSMIT-ENABLE 0501
935         %%CHAOS-CSR-INTERRUPT-ENABLES 0402
936        %%CHAOS-CSR-TRANSMIT-ABORT 0601
937        %%CHAOS-CSR-TRANSMIT-DONE 0701
938        %%CHAOS-CSR-TRANSMITTER-CLEAR 1001
939        %%CHAOS-CSR-LOST-COUNT 1104
940        %%CHAOS-CSR-RESET 1501
941        %%CHAOS-CSR-CRC-ERROR 1601
942        %%CHAOS-CSR-RECEIVE-DONE 1701
943
944;;; Offsets of other registers from CSR
945;;; These are in words, not bytes
946
947        %CHAOS-MY-NUMBER-OFFSET 1
948        %CHAOS-WRITE-BUFFER-OFFSET 1
949        %CHAOS-READ-BUFFER-OFFSET 2
950        %CHAOS-BIT-COUNT-OFFSET 3
951        %CHAOS-START-TRANSMIT-OFFSET 5))
952
953;;; Leader of a wired Chaos buffer
954
955(SETQ CHAOS-BUFFER-LEADER-QS '(
956        %CHAOS-LEADER-WORD-COUNT                ;Fill pointer for ART-16B array
957        %CHAOS-LEADER-THREAD                    ;Next buffer in wired list (free, rcv, xmt)
958                                                ;NIL for end of list
959        %CHAOS-LEADER-CSR-1                     ;Receive stores CSR before reading out here
960        %CHAOS-LEADER-CSR-2                     ;Receive stores CSR after reading out here
961                                                ;Get lost-count from here
962        %CHAOS-LEADER-BIT-COUNT))               ;Receive stores bit-count before reading out
963
964(ASSIGN-VALUES CHAOS-BUFFER-LEADER-QS 0)
965(ASSIGN-ALTERNATE CHAOS-HARDWARE-VALUES)
966(SETQ CHAOS-HARDWARE-SYMBOLS (GET-ALTERNATE CHAOS-HARDWARE-VALUES))
967
968;;; Ethernet
969
970;;; Offsets from the base of the ether registers to the specific registers
971(setq ether-register-offsets '(
972  %ether-output-word-count-offset               ;0
973  %ether-output-buffer-pointer-offset           ;1
974  %ether-output-csr-offset                      ;2
975  %ether-output-delay-offset                    ;3
976  %ether-input-word-count-offset                ;4
977  %ether-input-buffer-pointer-offset            ;5
978  %ether-input-csr-offset                       ;6
979  %ether-device-address                         ;7
980))
981(assign-values ether-register-offsets 0)
982
983;;; Offsets of the leader elements
984(setq ether-leader-offsets '(
985  %ether-leader-thread                          ;0
986  %ether-leader-csr                             ;1
987  %ether-leader-active-length                   ;2
988  %ether-leader-transmit-count                  ;3
989))
990(assign-values ether-leader-offsets 0)
991
992;;; Random parameters
993(setq ether-random-parameters '(
994  ether-maximum-packet-length 430               ;Max length of packet in words = (// 560. 2)
995  ether-unibus-block 0                          ;Use unibus blocks 0-3
996))
997(assign-alternate ether-random-parameters)
998
999
1000(SETQ A-MEMORY-ARRAY-LOCATIONS '(
1001        MOUSE-CURSOR-PATTERN    1600
1002        MOUSE-BUTTONS-BUFFER    1640
1003        MOUSE-X-SCALE-ARRAY     1700
1004        MOUSE-Y-SCALE-ARRAY     1720))
1005
1006(SETQ A-MEMORY-ARRAY-SYMBOLS (GET-ALTERNATE A-MEMORY-ARRAY-LOCATIONS))
1007
1008
1009;Use of DTP-INSTANCE.  Points to a structure whose header is of
1010;type DTP-INSTANCE-HEADER; the pointer field of that header points
1011;to a structure (generally an array) which contains the fields described
1012;below.  This structure is called an instance-descriptor and contains
1013;the constant or shared part of the instance.  The instance structure,
1014;after its DTP-INSTANCE-HEADER, contains several words used as value
1015;cells of instance variables, which are the variable or unshared
1016;part of the instance.
1017;Note that these are offsets, not indices into the array.  They
1018;are defined here this way because microcode uses them.  This could
1019;be a cdr-coded list or an instance rather than an array.
1020(SETQ INSTANCE-DESCRIPTOR-OFFSETS '(
1021        %INSTANCE-DESCRIPTOR-HEADER             ;The array header.
1022        %INSTANCE-DESCRIPTOR-RESERVED           ;e.g. for named-structure symbol
1023        %INSTANCE-DESCRIPTOR-SIZE               ;The size of the instance; this is one more
1024                                                ;than the number of instance-variable slots.
1025                                                ;This is looked at by the garbage collector.
1026        %INSTANCE-DESCRIPTOR-BINDINGS
1027                ;Describes bindings to perform when the instance
1028                ;is called.  If this is a list, then SELF is bound
1029                ;to the instance and the elements of the list are
1030                ;locatives to cells which are bound to EVCP's
1031                ;to successive instance-variable slots of the
1032                ;instance.  If this is not a list, it is something
1033                ;reserved for future facilities based on the same
1034                ;primitives.  NIL is a list.
1035                ;Note that if this is a list, it must be CDR-CODED!
1036                ;The microcode depends on this for a little extra speed.
1037        %INSTANCE-DESCRIPTOR-FUNCTION           ;Function to be called when the instance
1038                                                ; is called.  Typically a DTP-SELECT-METHOD
1039        %INSTANCE-DESCRIPTOR-TYPENAME           ;A symbol which is returned by TYPEP
1040))      ;Additional slots may exist, defined by the particular class system employed.
1041        ;If the instance-descriptor is an array, it must not be so long as to
1042        ;contain a long-length Q.
1043(ASSIGN-VALUES INSTANCE-DESCRIPTOR-OFFSETS 0)
1044
1045(SETQ METER-ENABLES-VALUES '(
1046        %%METER-PAGE-FAULT-ENABLE 0001                  ;Page fault metering
1047        %%METER-CONS-ENABLE 0101                        ;Cons metering
1048        %%METER-FUNCTION-ENTRY-EXIT-ENABLE 0201         ;Function call metering
1049        %%METER-STACK-GROUP-SWITCH-ENABLE 0301          ;Stack group metering
1050        )
1051
1052      METER-EVENTS '(
1053        %METER-PAGE-IN-EVENT
1054        %METER-PAGE-OUT-EVENT
1055        %METER-CONS-EVENT
1056        %METER-FUNCTION-ENTRY-EVENT
1057        %METER-FUNCTION-EXIT-EVENT
1058        %METER-FUNCTION-UNWIND-EVENT
1059        %METER-STACK-GROUP-SWITCH-EVENT
1060        ))
1061
1062(ASSIGN-ALTERNATE METER-ENABLES-VALUES)
1063(SETQ METER-ENABLES (GET-ALTERNATE METER-ENABLES-VALUES))
1064(ASSIGN-VALUES METER-EVENTS 0 1)
1065
1066(DEFUN ASSIGN-QCOM-VALUES NIL
1067        (ASSIGN-VALUES ADI-KINDS 0)
1068        (ASSIGN-VALUES ADI-STORING-OPTIONS 0)
1069        (ASSIGN-ALTERNATE ARG-DESC-FIELD-VALUES)
1070        (ASSIGN-ALTERNATE ARRAY-FIELD-VALUES)
1071        (ASSIGN-ALTERNATE ARRAY-LEADER-FIELD-VALUES)
1072        (ASSIGN-ALTERNATE ARRAY-MISC-VALUES)
1073        (ASSIGN-VALUES ARRAY-TYPES 19.)
1074        (ASSIGN-VALUES DATA-TYPES 24.)
1075        (ASSIGN-VALUES FEF-ARG-SYNTAX 4)
1076        (ASSIGN-VALUES FEF-DES-DT 11)
1077        (ASSIGN-VALUES FEF-FUNCTIONAL 15)
1078        (ASSIGN-VALUES FEF-INIT-OPTION 0)
1079        (ASSIGN-VALUES FEF-NAME-PRESENT 20)
1080        (ASSIGN-VALUES FEF-QUOTE-STATUS 7)
1081        (ASSIGN-VALUES FEF-SPECIALNESS 16)
1082        (ASSIGN-VALUES FEFHI-INDEXES 0)
1083        (ASSIGN-ALTERNATE FEFHI-VALUES)
1084        (ASSIGN-ALTERNATE HEADER-FIELD-VALUES)
1085        (ASSIGN-VALUES HEADER-TYPES 23)
1086        (ASSIGN-VALUES Q-CDR-CODES 0)
1087        (ASSIGN-VALUES Q-DATA-TYPES 0)
1088        (ASSIGN-VALUES Q-HEADER-TYPES 0)
1089        (ASSIGN-ALTERNATE SG-STATE-FIELD-VALUES)
1090        (ASSIGN-VALUES SG-STATES 0)
1091        (ASSIGN-VALUES SG-INST-DISPATCHES 0)
1092        (ASSIGN-VALUES SPECIAL-PDL-LEADER-QS 0)
1093        (ASSIGN-VALUES STACK-GROUP-HEAD-LEADER-QS 0)
1094        (ASSIGN-VALUES SYSTEM-COMMUNICATION-AREA-QS 0)
1095        (ASSIGN-VALUES REG-PDL-LEADER-QS 0)
1096)
1097
1098(ASSIGN-QCOM-VALUES)  ;FOO.   ASSIGN-VALUES, ETC HAD BETTER BE DEFINED.
Note: See TracBrowser for help on using the repository browser.