]> git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/pic.h
af726c9aea0addc0e6458d13edb29340ece8341e
[apple/xnu.git] / osfmk / i386 / pic.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30 /*
31 * @OSF_COPYRIGHT@
32 */
33
34 /*
35 * Mach Operating System
36 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
37 * All Rights Reserved.
38 *
39 * Permission to use, copy, modify and distribute this software and its
40 * documentation is hereby granted, provided that both the copyright
41 * notice and this permission notice appear in all copies of the
42 * software, derivative works or modified versions, and any portions
43 * thereof, and that both notices appear in supporting documentation.
44 *
45 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
46 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
47 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
48 *
49 * Carnegie Mellon requests users of this software to return to
50 *
51 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
52 * School of Computer Science
53 * Carnegie Mellon University
54 * Pittsburgh PA 15213-3890
55 *
56 * any improvements or extensions that they make and grant Carnegie Mellon
57 * the rights to redistribute these changes.
58 */
59 /*
60 */
61
62 /*
63 Copyright (c) 1988,1989 Prime Computer, Inc. Natick, MA 01760
64 All Rights Reserved.
65
66 Permission to use, copy, modify, and distribute this
67 software and its documentation for any purpose and
68 without fee is hereby granted, provided that the above
69 copyright notice appears in all copies and that both the
70 copyright notice and this permission notice appear in
71 supporting documentation, and that the name of Prime
72 Computer, Inc. not be used in advertising or publicity
73 pertaining to distribution of the software without
74 specific, written prior permission.
75
76 THIS SOFTWARE IS PROVIDED "AS IS", AND PRIME COMPUTER,
77 INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
78 SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
79 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN
80 NO EVENT SHALL PRIME COMPUTER, INC. BE LIABLE FOR ANY
81 SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
82 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
83 PROFITS, WHETHER IN ACTION OF CONTRACT, NEGLIGENCE, OR
84 OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION
85 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
86 */
87
88 #ifndef _I386_PIC_H_
89 #define _I386_PIC_H_
90
91 #include <platforms.h>
92
93 #define NINTR 0x10
94 #define NPICS 0x02
95
96 /*
97 ** The following are definitions used to locate the PICs in the system
98 */
99
100 #define ADDR_PIC_BASE 0x20
101 #define OFF_ICW 0x00
102 #define OFF_OCW 0x01
103 #define SIZE_PIC 0x80
104
105 /*
106 ** The following banks of definitions ICW1, ICW2, ICW3, and ICW4 are used
107 ** to define the fields of the various ICWs for initialisation of the PICs
108 */
109
110 /*
111 ** ICW1
112 */
113
114 #define ICW_TEMPLATE 0x10
115
116 #define LEVL_TRIGGER 0x08
117 #define EDGE_TRIGGER 0x00
118 #define ADDR_INTRVL4 0x04
119 #define ADDR_INTRVL8 0x00
120 #define SINGLE__MODE 0x02
121 #define CASCADE_MODE 0x00
122 #define ICW4__NEEDED 0x01
123 #define NO_ICW4_NEED 0x00
124
125 /*
126 ** ICW2
127 */
128
129 #define PICM_VECTBASE 0x40
130 #define PICS_VECTBASE PICM_VECTBASE + 0x08
131
132 /*
133 ** ICW3
134 */
135
136 #define SLAVE_ON_IR0 0x01
137 #define SLAVE_ON_IR1 0x02
138 #define SLAVE_ON_IR2 0x04
139 #define SLAVE_ON_IR3 0x08
140 #define SLAVE_ON_IR4 0x10
141 #define SLAVE_ON_IR5 0x20
142 #define SLAVE_ON_IR6 0x40
143 #define SLAVE_ON_IR7 0x80
144
145 #define I_AM_SLAVE_0 0x00
146 #define I_AM_SLAVE_1 0x01
147 #define I_AM_SLAVE_2 0x02
148 #define I_AM_SLAVE_3 0x03
149 #define I_AM_SLAVE_4 0x04
150 #define I_AM_SLAVE_5 0x05
151 #define I_AM_SLAVE_6 0x06
152 #define I_AM_SLAVE_7 0x07
153
154 /*
155 ** ICW4
156 */
157
158 #define SNF_MODE_ENA 0x10
159 #define SNF_MODE_DIS 0x00
160 #define BUFFERD_MODE 0x08
161 #define NONBUFD_MODE 0x00
162 #define AUTO_EOI_MOD 0x02
163 #define NRML_EOI_MOD 0x00
164 #define I8086_EMM_MOD 0x01
165 #define SET_MCS_MODE 0x00
166
167 /*
168 ** OCW1
169 */
170 #define PICM_MASK 0xFF
171 #define PICS_MASK 0xFF
172 /*
173 ** OCW2
174 */
175
176 #define NON_SPEC_EOI 0x20
177 #define SPECIFIC_EOI 0x30
178 #define ROT_NON_SPEC 0x50
179 #define SET_ROT_AEOI 0x40
180 #define RSET_ROTAEOI 0x00
181 #define ROT_SPEC_EOI 0x70
182 #define SET_PRIORITY 0x60
183 #define NO_OPERATION 0x20
184
185 #define SEND_EOI_IR0 0x00
186 #define SEND_EOI_IR1 0x01
187 #define SEND_EOI_IR2 0x02
188 #define SEND_EOI_IR3 0x03
189 #define SEND_EOI_IR4 0x04
190 #define SEND_EOI_IR5 0x05
191 #define SEND_EOI_IR6 0x06
192 #define SEND_EOI_IR7 0x07
193
194 /*
195 ** OCW3
196 */
197
198 #define OCW_TEMPLATE 0x08
199 #define SPECIAL_MASK 0x40
200 #define MASK_MDE_SET 0x20
201 #define MASK_MDE_RST 0x00
202 #define POLL_COMMAND 0x04
203 #define NO_POLL_CMND 0x00
204 #define READ_NEXT_RD 0x02
205 #define READ_IR_ONRD 0x00
206 #define READ_IS_ONRD 0x01
207
208 #endif /* _I386_PIC_H_ */