Print this page
acpica-unix2-20130823
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/io/acpica/resources/rsirq.c
+++ new/usr/src/common/acpica/components/resources/rsirq.c
1 1 /*******************************************************************************
2 2 *
3 3 * Module Name: rsirq - IRQ resource descriptors
4 4 *
5 5 ******************************************************************************/
6 6
7 7 /*
8 - * Copyright (C) 2000 - 2011, Intel Corp.
8 + * Copyright (C) 2000 - 2013, Intel Corp.
9 9 * All rights reserved.
10 10 *
11 11 * Redistribution and use in source and binary forms, with or without
12 12 * modification, are permitted provided that the following conditions
13 13 * are met:
14 14 * 1. Redistributions of source code must retain the above copyright
15 15 * notice, this list of conditions, and the following disclaimer,
16 16 * without modification.
17 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 18 * substantially similar to the "NO WARRANTY" disclaimer below
19 19 * ("Disclaimer") and any redistribution must be conditioned upon
20 20 * including a substantially similar Disclaimer requirement for further
21 21 * binary redistribution.
22 22 * 3. Neither the names of the above-listed copyright holders nor the names
23 23 * of any contributors may be used to endorse or promote products derived
24 24 * from this software without specific prior written permission.
25 25 *
26 26 * Alternatively, this software may be distributed under the terms of the
27 27 * GNU General Public License ("GPL") version 2 as published by the Free
28 28 * Software Foundation.
29 29 *
30 30 * NO WARRANTY
31 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 41 * POSSIBILITY OF SUCH DAMAGES.
42 42 */
43 43
44 44 #define __RSIRQ_C__
45 45
46 46 #include "acpi.h"
47 47 #include "accommon.h"
48 48 #include "acresrc.h"
49 49
↓ open down ↓ |
31 lines elided |
↑ open up ↑ |
50 50 #define _COMPONENT ACPI_RESOURCES
51 51 ACPI_MODULE_NAME ("rsirq")
52 52
53 53
54 54 /*******************************************************************************
55 55 *
56 56 * AcpiRsGetIrq
57 57 *
58 58 ******************************************************************************/
59 59
60 -ACPI_RSCONVERT_INFO AcpiRsGetIrq[8] =
60 +ACPI_RSCONVERT_INFO AcpiRsGetIrq[9] =
61 61 {
62 62 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ,
63 63 ACPI_RS_SIZE (ACPI_RESOURCE_IRQ),
64 64 ACPI_RSC_TABLE_SIZE (AcpiRsGetIrq)},
65 65
66 66 /* Get the IRQ mask (bytes 1:2) */
67 67
68 68 {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]),
69 69 AML_OFFSET (Irq.IrqMask),
70 70 ACPI_RS_OFFSET (Data.Irq.InterruptCount)},
71 71
72 72 /* Set default flags (others are zero) */
73 73
74 74 {ACPI_RSC_SET8, ACPI_RS_OFFSET (Data.Irq.Triggering),
75 75 ACPI_EDGE_SENSITIVE,
76 76 1},
77 77
↓ open down ↓ |
7 lines elided |
↑ open up ↑ |
78 78 /* Get the descriptor length (2 or 3 for IRQ descriptor) */
79 79
80 80 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Irq.DescriptorLength),
81 81 AML_OFFSET (Irq.DescriptorType),
82 82 0},
83 83
84 84 /* All done if no flag byte present in descriptor */
85 85
86 86 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
87 87
88 - /* Get flags: Triggering[0], Polarity[3], Sharing[4] */
88 + /* Get flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */
89 89
90 90 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Triggering),
91 91 AML_OFFSET (Irq.Flags),
92 92 0},
93 93
94 94 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Polarity),
95 95 AML_OFFSET (Irq.Flags),
96 96 3},
97 97
98 98 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Sharable),
99 99 AML_OFFSET (Irq.Flags),
100 - 4}
100 + 4},
101 +
102 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.WakeCapable),
103 + AML_OFFSET (Irq.Flags),
104 + 5}
101 105 };
102 106
103 107
104 108 /*******************************************************************************
105 109 *
106 110 * AcpiRsSetIrq
107 111 *
108 112 ******************************************************************************/
109 113
110 -ACPI_RSCONVERT_INFO AcpiRsSetIrq[13] =
114 +ACPI_RSCONVERT_INFO AcpiRsSetIrq[14] =
111 115 {
112 116 /* Start with a default descriptor of length 3 */
113 117
114 118 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ,
115 119 sizeof (AML_RESOURCE_IRQ),
116 120 ACPI_RSC_TABLE_SIZE (AcpiRsSetIrq)},
117 121
118 122 /* Convert interrupt list to 16-bit IRQ bitmask */
119 123
120 124 {ACPI_RSC_BITMASK16,ACPI_RS_OFFSET (Data.Irq.Interrupts[0]),
121 125 AML_OFFSET (Irq.IrqMask),
122 126 ACPI_RS_OFFSET (Data.Irq.InterruptCount)},
123 127
124 - /* Set the flags byte */
128 + /* Set flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */
125 129
126 130 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Triggering),
127 131 AML_OFFSET (Irq.Flags),
128 132 0},
129 133
130 134 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Polarity),
131 135 AML_OFFSET (Irq.Flags),
132 136 3},
133 137
134 138 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Sharable),
135 139 AML_OFFSET (Irq.Flags),
136 140 4},
137 141
142 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.WakeCapable),
143 + AML_OFFSET (Irq.Flags),
144 + 5},
145 +
138 146 /*
139 147 * All done if the output descriptor length is required to be 3
140 148 * (i.e., optimization to 2 bytes cannot be attempted)
141 149 */
142 150 {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
143 151 ACPI_RS_OFFSET(Data.Irq.DescriptorLength),
144 152 3},
145 153
146 154 /* Set length to 2 bytes (no flags byte) */
147 155
148 156 {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_IRQ_NOFLAGS)},
149 157
150 158 /*
151 159 * All done if the output descriptor length is required to be 2.
152 160 *
153 161 * TBD: Perhaps we should check for error if input flags are not
154 162 * compatible with a 2-byte descriptor.
155 163 */
156 164 {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
157 165 ACPI_RS_OFFSET(Data.Irq.DescriptorLength),
158 166 2},
159 167
160 168 /* Reset length to 3 bytes (descriptor with flags byte) */
161 169
162 170 {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_IRQ)},
163 171
164 172 /*
165 173 * Check if the flags byte is necessary. Not needed if the flags are:
166 174 * ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE
167 175 */
168 176 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
169 177 ACPI_RS_OFFSET (Data.Irq.Triggering),
170 178 ACPI_EDGE_SENSITIVE},
171 179
172 180 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
173 181 ACPI_RS_OFFSET (Data.Irq.Polarity),
174 182 ACPI_ACTIVE_HIGH},
175 183
176 184 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
177 185 ACPI_RS_OFFSET (Data.Irq.Sharable),
178 186 ACPI_EXCLUSIVE},
179 187
180 188 /* We can optimize to a 2-byte IrqNoFlags() descriptor */
181 189
↓ open down ↓ |
34 lines elided |
↑ open up ↑ |
182 190 {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_IRQ_NOFLAGS)}
183 191 };
184 192
185 193
186 194 /*******************************************************************************
187 195 *
188 196 * AcpiRsConvertExtIrq
189 197 *
190 198 ******************************************************************************/
191 199
192 -ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[9] =
200 +ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[10] =
193 201 {
194 202 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_IRQ,
195 203 ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_IRQ),
196 204 ACPI_RSC_TABLE_SIZE (AcpiRsConvertExtIrq)},
197 205
198 206 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_EXTENDED_IRQ,
199 207 sizeof (AML_RESOURCE_EXTENDED_IRQ),
200 208 0},
201 209
202 - /* Flag bits */
203 -
210 + /*
211 + * Flags: Producer/Consumer[0], Triggering[1], Polarity[2],
212 + * Sharing[3], Wake[4]
213 + */
204 214 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.ProducerConsumer),
205 215 AML_OFFSET (ExtendedIrq.Flags),
206 216 0},
207 217
208 218 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Triggering),
209 219 AML_OFFSET (ExtendedIrq.Flags),
210 220 1},
211 221
212 222 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Polarity),
213 223 AML_OFFSET (ExtendedIrq.Flags),
214 224 2},
215 225
216 226 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.Sharable),
217 227 AML_OFFSET (ExtendedIrq.Flags),
218 228 3},
219 229
230 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.WakeCapable),
231 + AML_OFFSET (ExtendedIrq.Flags),
232 + 4},
233 +
220 234 /* IRQ Table length (Byte4) */
221 235
222 236 {ACPI_RSC_COUNT, ACPI_RS_OFFSET (Data.ExtendedIrq.InterruptCount),
223 237 AML_OFFSET (ExtendedIrq.InterruptCount),
224 238 sizeof (UINT32)},
225 239
226 240 /* Copy every IRQ in the table, each is 32 bits */
227 241
228 242 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]),
229 243 AML_OFFSET (ExtendedIrq.Interrupts[0]),
230 244 0},
231 245
232 246 /* Optional ResourceSource (Index and String) */
233 247
234 248 {ACPI_RSC_SOURCEX, ACPI_RS_OFFSET (Data.ExtendedIrq.ResourceSource),
235 249 ACPI_RS_OFFSET (Data.ExtendedIrq.Interrupts[0]),
236 250 sizeof (AML_RESOURCE_EXTENDED_IRQ)}
237 251 };
238 252
239 253
240 254 /*******************************************************************************
241 255 *
242 256 * AcpiRsConvertDma
243 257 *
244 258 ******************************************************************************/
245 259
246 260 ACPI_RSCONVERT_INFO AcpiRsConvertDma[6] =
247 261 {
248 262 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_DMA,
249 263 ACPI_RS_SIZE (ACPI_RESOURCE_DMA),
250 264 ACPI_RSC_TABLE_SIZE (AcpiRsConvertDma)},
251 265
252 266 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_DMA,
253 267 sizeof (AML_RESOURCE_DMA),
254 268 0},
255 269
256 270 /* Flags: transfer preference, bus mastering, channel speed */
257 271
258 272 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Dma.Transfer),
259 273 AML_OFFSET (Dma.Flags),
260 274 0},
261 275
262 276 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Dma.BusMaster),
263 277 AML_OFFSET (Dma.Flags),
264 278 2},
265 279
266 280 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Dma.Type),
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
267 281 AML_OFFSET (Dma.Flags),
268 282 5},
269 283
270 284 /* DMA channel mask bits */
271 285
272 286 {ACPI_RSC_BITMASK, ACPI_RS_OFFSET (Data.Dma.Channels[0]),
273 287 AML_OFFSET (Dma.DmaChannelMask),
274 288 ACPI_RS_OFFSET (Data.Dma.ChannelCount)}
275 289 };
276 290
291 +
292 +/*******************************************************************************
293 + *
294 + * AcpiRsConvertFixedDma
295 + *
296 + ******************************************************************************/
297 +
298 +ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[4] =
299 +{
300 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_DMA,
301 + ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_DMA),
302 + ACPI_RSC_TABLE_SIZE (AcpiRsConvertFixedDma)},
303 +
304 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_DMA,
305 + sizeof (AML_RESOURCE_FIXED_DMA),
306 + 0},
307 +
308 + /*
309 + * These fields are contiguous in both the source and destination:
310 + * RequestLines
311 + * Channels
312 + */
313 + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.FixedDma.RequestLines),
314 + AML_OFFSET (FixedDma.RequestLines),
315 + 2},
316 +
317 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.FixedDma.Width),
318 + AML_OFFSET (FixedDma.Width),
319 + 1},
320 +};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX