Print this page
acpica-unix2-20130823
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/io/acpica/resources/rsio.c
+++ new/usr/src/common/acpica/components/resources/rsio.c
1 1 /*******************************************************************************
2 2 *
3 3 * Module Name: rsio - IO and DMA 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 __RSIO_C__
45 45
46 46 #include "acpi.h"
47 47 #include "accommon.h"
48 48 #include "acresrc.h"
49 49
50 50 #define _COMPONENT ACPI_RESOURCES
51 51 ACPI_MODULE_NAME ("rsio")
52 52
53 53
54 54 /*******************************************************************************
55 55 *
56 56 * AcpiRsConvertIo
57 57 *
58 58 ******************************************************************************/
59 59
60 60 ACPI_RSCONVERT_INFO AcpiRsConvertIo[5] =
61 61 {
62 62 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IO,
63 63 ACPI_RS_SIZE (ACPI_RESOURCE_IO),
64 64 ACPI_RSC_TABLE_SIZE (AcpiRsConvertIo)},
65 65
66 66 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IO,
67 67 sizeof (AML_RESOURCE_IO),
68 68 0},
69 69
70 70 /* Decode flag */
71 71
72 72 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Io.IoDecode),
73 73 AML_OFFSET (Io.Flags),
74 74 0},
75 75 /*
76 76 * These fields are contiguous in both the source and destination:
77 77 * Address Alignment
78 78 * Length
79 79 * Minimum Base Address
80 80 * Maximum Base Address
81 81 */
82 82 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Io.Alignment),
83 83 AML_OFFSET (Io.Alignment),
84 84 2},
85 85
86 86 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Io.Minimum),
87 87 AML_OFFSET (Io.Minimum),
88 88 2}
89 89 };
90 90
91 91
92 92 /*******************************************************************************
93 93 *
94 94 * AcpiRsConvertFixedIo
95 95 *
96 96 ******************************************************************************/
97 97
98 98 ACPI_RSCONVERT_INFO AcpiRsConvertFixedIo[4] =
99 99 {
100 100 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_IO,
101 101 ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_IO),
102 102 ACPI_RSC_TABLE_SIZE (AcpiRsConvertFixedIo)},
103 103
104 104 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_IO,
105 105 sizeof (AML_RESOURCE_FIXED_IO),
106 106 0},
107 107 /*
108 108 * These fields are contiguous in both the source and destination:
109 109 * Base Address
110 110 * Length
111 111 */
112 112 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.FixedIo.AddressLength),
113 113 AML_OFFSET (FixedIo.AddressLength),
114 114 1},
115 115
116 116 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.FixedIo.Address),
117 117 AML_OFFSET (FixedIo.Address),
118 118 1}
119 119 };
120 120
121 121
122 122 /*******************************************************************************
123 123 *
124 124 * AcpiRsConvertGenericReg
125 125 *
126 126 ******************************************************************************/
127 127
128 128 ACPI_RSCONVERT_INFO AcpiRsConvertGenericReg[4] =
129 129 {
130 130 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GENERIC_REGISTER,
131 131 ACPI_RS_SIZE (ACPI_RESOURCE_GENERIC_REGISTER),
132 132 ACPI_RSC_TABLE_SIZE (AcpiRsConvertGenericReg)},
133 133
134 134 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GENERIC_REGISTER,
135 135 sizeof (AML_RESOURCE_GENERIC_REGISTER),
136 136 0},
137 137 /*
138 138 * These fields are contiguous in both the source and destination:
139 139 * Address Space ID
140 140 * Register Bit Width
141 141 * Register Bit Offset
142 142 * Access Size
143 143 */
144 144 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.GenericReg.SpaceId),
145 145 AML_OFFSET (GenericReg.AddressSpaceId),
146 146 4},
147 147
148 148 /* Get the Register Address */
149 149
150 150 {ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.GenericReg.Address),
151 151 AML_OFFSET (GenericReg.Address),
152 152 1}
153 153 };
154 154
155 155
156 156 /*******************************************************************************
157 157 *
158 158 * AcpiRsConvertEndDpf
159 159 *
160 160 ******************************************************************************/
161 161
162 162 ACPI_RSCONVERT_INFO AcpiRsConvertEndDpf[2] =
163 163 {
164 164 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_END_DEPENDENT,
165 165 ACPI_RS_SIZE_MIN,
166 166 ACPI_RSC_TABLE_SIZE (AcpiRsConvertEndDpf)},
167 167
168 168 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_END_DEPENDENT,
169 169 sizeof (AML_RESOURCE_END_DEPENDENT),
170 170 0}
171 171 };
172 172
173 173
174 174 /*******************************************************************************
175 175 *
176 176 * AcpiRsConvertEndTag
177 177 *
178 178 ******************************************************************************/
179 179
180 180 ACPI_RSCONVERT_INFO AcpiRsConvertEndTag[2] =
181 181 {
182 182 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_END_TAG,
183 183 ACPI_RS_SIZE_MIN,
184 184 ACPI_RSC_TABLE_SIZE (AcpiRsConvertEndTag)},
185 185
186 186 /*
187 187 * Note: The checksum field is set to zero, meaning that the resource
188 188 * data is treated as if the checksum operation succeeded.
189 189 * (ACPI Spec 1.0b Section 6.4.2.8)
190 190 */
191 191 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_END_TAG,
192 192 sizeof (AML_RESOURCE_END_TAG),
193 193 0}
194 194 };
195 195
196 196
197 197 /*******************************************************************************
198 198 *
199 199 * AcpiRsGetStartDpf
200 200 *
201 201 ******************************************************************************/
202 202
203 203 ACPI_RSCONVERT_INFO AcpiRsGetStartDpf[6] =
204 204 {
205 205 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_START_DEPENDENT,
206 206 ACPI_RS_SIZE (ACPI_RESOURCE_START_DEPENDENT),
207 207 ACPI_RSC_TABLE_SIZE (AcpiRsGetStartDpf)},
208 208
209 209 /* Defaults for Compatibility and Performance priorities */
210 210
211 211 {ACPI_RSC_SET8, ACPI_RS_OFFSET (Data.StartDpf.CompatibilityPriority),
212 212 ACPI_ACCEPTABLE_CONFIGURATION,
213 213 2},
214 214
215 215 /* Get the descriptor length (0 or 1 for Start Dpf descriptor) */
216 216
217 217 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.DescriptorLength),
218 218 AML_OFFSET (StartDpf.DescriptorType),
219 219 0},
220 220
221 221 /* All done if there is no flag byte present in the descriptor */
222 222
223 223 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 1},
224 224
225 225 /* Flag byte is present, get the flags */
226 226
227 227 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.CompatibilityPriority),
228 228 AML_OFFSET (StartDpf.Flags),
229 229 0},
230 230
231 231 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.PerformanceRobustness),
232 232 AML_OFFSET (StartDpf.Flags),
233 233 2}
234 234 };
235 235
236 236
237 237 /*******************************************************************************
238 238 *
239 239 * AcpiRsSetStartDpf
240 240 *
241 241 ******************************************************************************/
242 242
243 243 ACPI_RSCONVERT_INFO AcpiRsSetStartDpf[10] =
244 244 {
245 245 /* Start with a default descriptor of length 1 */
246 246
247 247 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_START_DEPENDENT,
248 248 sizeof (AML_RESOURCE_START_DEPENDENT),
249 249 ACPI_RSC_TABLE_SIZE (AcpiRsSetStartDpf)},
250 250
251 251 /* Set the default flag values */
252 252
253 253 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.CompatibilityPriority),
254 254 AML_OFFSET (StartDpf.Flags),
255 255 0},
256 256
257 257 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.StartDpf.PerformanceRobustness),
258 258 AML_OFFSET (StartDpf.Flags),
259 259 2},
260 260 /*
261 261 * All done if the output descriptor length is required to be 1
262 262 * (i.e., optimization to 0 bytes cannot be attempted)
263 263 */
264 264 {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
265 265 ACPI_RS_OFFSET(Data.StartDpf.DescriptorLength),
266 266 1},
267 267
268 268 /* Set length to 0 bytes (no flags byte) */
269 269
270 270 {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO)},
271 271
272 272 /*
273 273 * All done if the output descriptor length is required to be 0.
274 274 *
275 275 * TBD: Perhaps we should check for error if input flags are not
276 276 * compatible with a 0-byte descriptor.
277 277 */
278 278 {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
279 279 ACPI_RS_OFFSET(Data.StartDpf.DescriptorLength),
280 280 0},
281 281
282 282 /* Reset length to 1 byte (descriptor with flags byte) */
283 283
284 284 {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_START_DEPENDENT)},
285 285
286 286
287 287 /*
288 288 * All done if flags byte is necessary -- if either priority value
289 289 * is not ACPI_ACCEPTABLE_CONFIGURATION
290 290 */
291 291 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
292 292 ACPI_RS_OFFSET (Data.StartDpf.CompatibilityPriority),
↓ open down ↓ |
274 lines elided |
↑ open up ↑ |
293 293 ACPI_ACCEPTABLE_CONFIGURATION},
294 294
295 295 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
296 296 ACPI_RS_OFFSET (Data.StartDpf.PerformanceRobustness),
297 297 ACPI_ACCEPTABLE_CONFIGURATION},
298 298
299 299 /* Flag byte is not necessary */
300 300
301 301 {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO)}
302 302 };
303 -
304 -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX