c171307513893f9714ee7bd33f18a8fba531b8b4
[its.git] / system / rh11.defs36
1 ; -*- Midas -*-
2 ;;; Copyright (c) 1999 Massachusetts Institute of Technology
3 ;;;
4 ;;; This program is free software; you can redistribute it and/or
5 ;;; modify it under the terms of the GNU General Public License as
6 ;;; published by the Free Software Foundation; either version 2 of the
7 ;;; License, or (at your option) any later version.
8 ;;;
9 ;;; This program is distributed in the hope that it will be useful,
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 ;;; General Public License for more details.
13 ;;;
14 ;;; You should have received a copy of the GNU General Public License
15 ;;; along with this program; if not, write to the Free Software
16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 .AUXIL
19
20 ; Canonical symbol definition macro, FOO==BAR with error check.
21 IFNDEF DEFSYM,[ 
22 DEFINE DEFSYM X/
23 IRPS Z,,[X]
24 IFNDEF Z,X
25 .ELSE [ $$TEM1==Z
26         X
27         IFN Z-$$TEM1,.ERR Z MULTIPLY .QUOTE`.QUOTE/DEFINED/`
28       ]
29 .ISTOP
30 TERMIN TERMIN
31 $$TEMP==1
32 ] ;IFNDEF DEFSYM
33 .ELSE, $$TEMP==0
34 \f
35 ;;; Disk RH11 Interrupt vector:
36 DEFSYM  PHVEC==254              ; Interrupts occur on level 6
37                                 ; (high priority) on UBA #1.
38
39 ;;; Disk RH11 Unibus register addresses:
40
41 DEFSYM  %HRCS1=:776700          ;CTRL AND STATUS 1.
42  DEFSYM %HXSC== 1_15.           ; Special Condition
43  DEFSYM %HXTRE==1_14.           ; Transfer Error
44  DEFSYM %HXMCP==1_13.           ; Mass I/O Control Bus Parity Error
45  DEFSYM %HXDVA==1_11.           ; Drive Available
46  DEFSYM %HXPSE==1_10.           ; Port Select
47  DEFSYM %HXA17==1_9.            ; UB Address Extension Bit 17
48  DEFSYM %HXA16==1_8.            ; UB Address Extension Bit 16
49  DEFSYM %HXRDY==1_7.            ; Ready
50  DEFSYM %HXIE== 1_6.            ; Interrupt Enable
51  DEFSYM $HXCMD==.BP 77          ; Bits 1-5 specify commands.
52  DEFSYM %HXGO== 1_0.            ; GO bit
53
54 ;;; Commands with bit 0 (GO) included:
55
56 DEFSYM  %HMNOP==0       ; No Operation
57 DEFSYM  %HMUNL==3       ; Unload ("Standby" --  the pack doesn't fly off).
58 DEFSYM  %HMREC==7       ; Recalibrate
59 DEFSYM  %HMCLR==11      ; Drive clear (reset errors etc.)
60 DEFSYM  %HMRLS==13      ; Drive release (dual port)
61 DEFSYM  %HMSRC==31      ; Search (for r.p.s.)
62 DEFSYM  %HMWCH==51      ; Write Check (?doesn't work)
63 DEFSYM  %HMWCF==53      ; Write Check Format, Header and Data (?doesn't work)
64 DEFSYM  %HMWRT==61      ; Write Data
65 DEFSYM  %HMWHD==63      ; Write Header And Data (format the pack)
66 DEFSYM  %HMRED==71      ; Read Data
67 DEFSYM  %HMRHD==73      ; Read Header and Data
68 DEFSYM  %HMSEK==5       ; Seek to Cylinder
69 DEFSYM  %HMOFS==15      ; Offset Heads Slightly
70 DEFSYM  %HMCEN==17      ; Return Heads To Centerline
71 DEFSYM  %HMACK==23      ; Acknowledge mounting of pack (required before I/O)
72 DEFSYM  %HMRDP==21      ; Read-In Preset
73
74 DEFSYM  %HRWC=:776702           ;WORD COUNT.
75
76 DEFSYM  %HRBA=:776704           ;UNIBUS ADDRESS.
77
78 DEFSYM  %HRADR=:776706          ;DESIRED ADDRESS.
79 ; DEFSYM        $HATRK==.BP 7700        ; Bits 12-8 are track.
80 ; DEFSYM        $HASEC==.BP 0077        ; Bits 5-0  are sector.
81   DEFSYM        $HATRK==.BP 17400       ; Track 0-22
82   DEFSYM        $HASEC==.BP 37          ; Sector 0-23 (128 words each)
83 \f
84 DEFSYM  %HRCS2=:776710          ;CTRL AND STATUS 2.
85  DEFSYM %HYDLT==1_15.           ; Data Late
86  DEFSYM %HYWCE==1_14.           ; Write Check Error
87  DEFSYM %HYPE== 1_13.           ; Parity Error
88  DEFSYM %HYNED==1_12.           ; Non-existant Drive
89  DEFSYM %HYNEM==1_11.           ; %HRBA is NXM during DMA
90  DEFSYM %HYPGE==1_10.           ; Program Error
91  DEFSYM %HYMXF==1_9.            ; Missed Transfer
92  DEFSYM %HYMDP==1_8.            ; Mass Data Bus Parity Error
93  DEFSYM %HYOR== 1_7.            ; Output Ready (for Silo buffer diag.)
94  DEFSYM %HYIR== 1_6.            ; Input  Ready (for Silo buffer diag.)
95  DEFSYM %HYCLR==1_5.            ; Controller Clear
96  DEFSYM %HYPAT==1_4.            ; Parity Test
97  DEFSYM %HYBAI==1_3.            ; Unibus Address Increment Inhibit
98  DEFSYM $HYDSK==.BP 7           ; Bits 2-0 are the Unit Select.
99
100 DEFSYM  %HRSTS=:776712          ;DRIVE STATUS.
101  DEFSYM %HSATN==1_15.           ; Attention Active
102  DEFSYM %HSERR==1_14.           ; Error
103  DEFSYM %HSPIP==1_13.           ; Positioning In Progress
104  DEFSYM %HSMOL==1_12.           ; Medium On-Line
105  DEFSYM %HSWRL==1_11.           ; Write Locked
106  DEFSYM %HSLST==1_10.           ; Last Sector Transferred
107  DEFSYM %HSPGM==1_9.            ; Programmable
108  DEFSYM %HSDPR==1_8.            ; Drive Present
109  DEFSYM %HSRDY==1_7.            ; Drive Ready
110  DEFSYM %HSVV== 1_6.            ; Volume Valid
111 ; These are RP04-only bits in %HRSTS
112 ; DEFSYM        %HSDE1==1_5.            ; Difference Equals 1
113 ; DEFSYM        %HSL64==1_4.            ; Difference Less Than 64
114 ; DEFSYM        %HSGRV==1_3.            ; Go Reverse
115 ; DEFSYM        %HSDIG==1_2.            ; Drive To Inner Guard Band
116 ; DEFSYM        %HSF20==1_1.            ; Drive Forward 20in/sec
117 ; DEFSYM        %HSF5== 1_0.            ; Drive Forward 5in/sec
118
119 DEFSYM  %HRER1=:776714          ;ERROR 1.
120  DEFSYM %H1ECC==1_15.           ; Data Check
121  DEFSYM %H1UNS==1_14.           ; Unsafe
122  DEFSYM %H1OPI==1_13.           ; Operation Incomplete
123  DEFSYM %H1DTE==1_12.           ; Drive Timing Error
124  DEFSYM %H1WLK==1_11.           ; Write Lock Error
125  DEFSYM %H1IAE==1_10.           ; Invalid Address Error
126  DEFSYM %H1AOE==1_9.            ; Address Overflow Error
127  DEFSYM %H1CRC==1_8.            ; Header CRC Error
128  DEFSYM %H1HCE==1_7.            ; Header Compare Error
129  DEFSYM %H1ECH==1_6.            ; ECC Hard Error
130  DEFSYM %H1WCF==1_5.            ; Write Lock Fail
131  DEFSYM %H1FER==1_4.            ; Format Error
132  DEFSYM %H1PAR==1_3.            ; Parity Error
133  DEFSYM %H1RMR==1_2.            ; Register Modification Refused
134  DEFSYM %H1ILR==1_1.            ; Illegal Register
135  DEFSYM %H1ILF==1_0.            ; Illegal Function
136
137 DEFSYM  %HRATN=:776716          ;ATTENTION SUMMARY.
138         ; Each bit 7-0 corresponds to a drive asserting ATA.
139 \f
140 DEFSYM  %HRLAH=:776720          ;LOOK AHEAD.
141                                 ; 2.2 - 1.7  Sector Count.
142                                 ; 1.6 - 1.5  Encoded Extension Field.
143
144 DEFSYM  %HRBUF=:776722          ;DATA BUFFER.
145
146 DEFSYM  %HRMNT=:776724          ;MAINTENANCE.
147
148 DEFSYM  %HRTYP=:776726          ;DRIVE TYPE.
149                                 ; 2.7  NOT BLOCK ADDRESSED
150                                 ; 2.6  TAPE
151                                 ; 2.5  Moving Head (better be a 1!!)
152                                 ; 2.3  Drive Request Required
153                                 ; 1.9 - 1.1  Drive Type Number:
154                                 ;  RP04 = 20, RP05 = 21,
155                                 ;  RP06 = 22, RM03 = 24
156
157 DEFSYM  %HRSER=:776730          ;SERIAL NUMBER.
158
159 DEFSYM  %HROFS=:776732          ;OFFSET.
160                                 ; 2.7  Sign Change
161                                 ; 2.4  Format Bit (1=16, 0=18)
162                                 ; 2.3  ECC Inhibit
163                                 ; 2.2  Header Compare Inhibit
164                                 ; 1.8 - 1.1  Offset Info
165                                 ;   +400  u"   00010000
166                                 ;   -400  u"   10010000
167                                 ;   +800  u"   00100000
168                                 ;   -800  u"   10100000
169                                 ;   +1200 u"   00110000
170                                 ;   -1200 u"   10110000
171                                 ;   Centerline 00000000
172
173 DEFSYM  %HRCYL=:776734          ;DESIRED CYLINDER.
174
175 DEFSYM  %HRCCY=:776736          ;CURRENT CYLINDER.
176
177 DEFSYM  %HRER2=:776740          ;ERROR 2.
178  DEFSYM %H2NHS==1_10.           ; No Head Selection
179  DEFSYM %H2WRU==1_8.            ; Write Ready Unsafe
180
181 DEFSYM  %HRER3=:776742          ;ERROR 3.
182  DEFSYM %H3OFC==1_15.           ; Off Cylinder
183  DEFSYM %H3SKI==1_14.           ; Seek Incomplete (also sets UNS+ATA+PIP+RDY)
184  DEFSYM %H3DCL==1_6.            ; DC power low (or perhaps AC?)
185  DEFSYM %H3ACL==1_5.            ; AC power low (or perhaps DC?)
186                                 ; (the documentation is confused about
187                                 ; which is which.)
188
189 DEFSYM  %HRPOS=:776744          ;ECC POSITION.
190
191 DEFSYM  %HRPAT=:776746          ;ECC PATTERN.
192
193 IFN $$TEMP,EXPUNG DEFSYM