FreeBSD/Linux Kernel Cross Reference
sys/i386/pic.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: pic.h,v $
29 * Revision 2.11 93/02/04 07:56:50 danner
30 * Added PS2 to #ifdef AT386 cases.
31 * [93/01/25 rvb]
32 *
33 * Revision 2.10 91/06/19 11:55:24 rvb
34 * cputypes.h->platforms.h
35 * [91/06/12 13:45:13 rvb]
36 *
37 * Revision 2.9 91/05/14 16:14:02 mrt
38 * Correcting copyright
39 *
40 * Revision 2.8 91/05/08 12:41:27 dbg
41 * Use platforms.h to get CPU names.
42 * [91/03/21 dbg]
43 *
44 * Revision 2.7 91/02/05 17:13:51 mrt
45 * Changed to new Mach copyright
46 * [91/02/01 17:36:57 mrt]
47 *
48 * Revision 2.6 90/12/04 14:46:25 jsb
49 * iPSC2 -> iPSC386.
50 * [90/12/04 11:17:51 jsb]
51 *
52 * Revision 2.5 90/11/26 16:27:50 rvb
53 * It appears that I_AM_A_{SLAVE,MASTER} were always wrong
54 * but iPSC386 seems to care.
55 *
56 * Revision 2.4 90/11/26 14:48:39 rvb
57 * Change Prime copyright as per Peter J. Weyman authorization.
58 * [90/11/19 rvb]
59 *
60 * Revision 2.2.1.2 90/07/10 11:42:35 rvb
61 * EXL out
62 * iPSC386 in
63 * [90/06/18 rvb]
64 *
65 * Revision 2.2.1.1 89/10/22 11:31:25 rvb
66 * Flush stuff that belongs in pic.c -- undoe damage of Prime merge.
67 * [89/10/20 rvb]
68 *
69 * Revision 2.2 89/09/25 12:32:34 rvb
70 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Prime Computer, Inc.
71 * [89/09/23 rvb]
72 *
73 */
74
75 /*
76 Copyright (c) 1988,1989 Prime Computer, Inc. Natick, MA 01760
77 All Rights Reserved.
78
79 Permission to use, copy, modify, and distribute this
80 software and its documentation for any purpose and
81 without fee is hereby granted, provided that the above
82 copyright notice appears in all copies and that both the
83 copyright notice and this permission notice appear in
84 supporting documentation, and that the name of Prime
85 Computer, Inc. not be used in advertising or publicity
86 pertaining to distribution of the software without
87 specific, written prior permission.
88
89 THIS SOFTWARE IS PROVIDED "AS IS", AND PRIME COMPUTER,
90 INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
91 SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
92 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
93 NO EVENT SHALL PRIME COMPUTER, INC. BE LIABLE FOR ANY
94 SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
95 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
96 PROFITS, WHETHER IN ACTION OF CONTRACT, NEGLIGENCE, OR
97 OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION
98 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
99 */
100
101 #ifndef _I386_PIC_H_
102 #define _I386_PIC_H_
103
104 #include <platforms.h>
105
106 #define NINTR 0x10
107 #define NPICS 0x02
108
109 /*
110 ** The following are definitions used to locate the PICs in the system
111 */
112
113 #if defined(AT386) || defined(PS2)
114 #define ADDR_PIC_BASE 0x20
115 #define OFF_ICW 0x00
116 #define OFF_OCW 0x01
117 #define SIZE_PIC 0x80
118 #endif /* defined(AT386) || defined(PS2) */
119
120 #ifdef iPSC386
121 #define ADDR_PIC_BASE 0xC0
122 #define OFF_ICW 0x00
123 #define OFF_OCW 0x02
124 #define SIZE_PIC 0x04
125 #endif iPSC386
126
127 /*
128 ** The following banks of definitions ICW1, ICW2, ICW3, and ICW4 are used
129 ** to define the fields of the various ICWs for initialisation of the PICs
130 */
131
132 /*
133 ** ICW1
134 */
135
136 #define ICW_TEMPLATE 0x10
137
138 #define LEVL_TRIGGER 0x08
139 #define EDGE_TRIGGER 0x00
140 #define ADDR_INTRVL4 0x04
141 #define ADDR_INTRVL8 0x00
142 #define SINGLE__MODE 0x02
143 #define CASCADE_MODE 0x00
144 #define ICW4__NEEDED 0x01
145 #define NO_ICW4_NEED 0x00
146
147 /*
148 ** ICW2
149 */
150
151 #if defined(AT386) || defined(PS2)
152 #define PICM_VECTBASE 0x40
153 #define PICS_VECTBASE PICM_VECTBASE + 0x08
154 #endif /* defined(AT386) || defined(PS2) */
155
156 #ifdef iPSC386
157 #define PICM_VECTBASE 0x40
158 #define PICS_VECTBASE PICM_VECTBASE + 0x08
159 #endif iPSC386
160
161 /*
162 ** ICW3
163 */
164
165 #define SLAVE_ON_IR0 0x01
166 #define SLAVE_ON_IR1 0x02
167 #define SLAVE_ON_IR2 0x04
168 #define SLAVE_ON_IR3 0x08
169 #define SLAVE_ON_IR4 0x10
170 #define SLAVE_ON_IR5 0x20
171 #define SLAVE_ON_IR6 0x40
172 #define SLAVE_ON_IR7 0x80
173
174 #define I_AM_SLAVE_0 0x00
175 #define I_AM_SLAVE_1 0x01
176 #define I_AM_SLAVE_2 0x02
177 #define I_AM_SLAVE_3 0x03
178 #define I_AM_SLAVE_4 0x04
179 #define I_AM_SLAVE_5 0x05
180 #define I_AM_SLAVE_6 0x06
181 #define I_AM_SLAVE_7 0x07
182
183 /*
184 ** ICW4
185 */
186
187 #define SNF_MODE_ENA 0x10
188 #define SNF_MODE_DIS 0x00
189 #define BUFFERD_MODE 0x08
190 #define NONBUFD_MODE 0x00
191 #if iPSC386
192 #define I_AM_A_SLAVE 0x00
193 #define I_AM_A_MASTR 0x04
194 #endif iPSC386
195 #define AUTO_EOI_MOD 0x02
196 #define NRML_EOI_MOD 0x00
197 #define I8086_EMM_MOD 0x01
198 #define SET_MCS_MODE 0x00
199
200 /*
201 ** OCW1
202 */
203 #define PICM_MASK 0xFF
204 #define PICS_MASK 0xFF
205 /*
206 ** OCW2
207 */
208
209 #define NON_SPEC_EOI 0x20
210 #define SPECIFIC_EOI 0x30
211 #define ROT_NON_SPEC 0x50
212 #define SET_ROT_AEOI 0x40
213 #define RSET_ROTAEOI 0x00
214 #define ROT_SPEC_EOI 0x70
215 #define SET_PRIORITY 0x60
216 #define NO_OPERATION 0x20
217
218 #define SEND_EOI_IR0 0x00
219 #define SEND_EOI_IR1 0x01
220 #define SEND_EOI_IR2 0x02
221 #define SEND_EOI_IR3 0x03
222 #define SEND_EOI_IR4 0x04
223 #define SEND_EOI_IR5 0x05
224 #define SEND_EOI_IR6 0x06
225 #define SEND_EOI_IR7 0x07
226
227 /*
228 ** OCW3
229 */
230
231 #define OCW_TEMPLATE 0x08
232 #define SPECIAL_MASK 0x40
233 #define MASK_MDE_SET 0x20
234 #define MASK_MDE_RST 0x00
235 #define POLL_COMMAND 0x04
236 #define NO_POLL_CMND 0x00
237 #define READ_NEXT_RD 0x02
238 #define READ_IR_ONRD 0x00
239 #define READ_IS_ONRD 0x01
240
241 #endif _I386_PIC_H_
Cache object: dc194adfefc8a2346432c3d7173fbd6f
|