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