Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * |
| 3 | * Module Name: rsaddr - Address resource descriptors (16/32/64) |
| 4 | * |
| 5 | ******************************************************************************/ |
| 6 | |
| 7 | /* |
David E. Box | 82a8094 | 2015-02-05 15:20:45 +0800 | [diff] [blame] | 8 | * Copyright (C) 2000 - 2015, Intel Corp. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | * All rights reserved. |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or without |
| 12 | * modification, are permitted provided that the following conditions |
| 13 | * are met: |
| 14 | * 1. Redistributions of source code must retain the above copyright |
| 15 | * notice, this list of conditions, and the following disclaimer, |
| 16 | * without modification. |
| 17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 18 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 19 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 20 | * including a substantially similar Disclaimer requirement for further |
| 21 | * binary redistribution. |
| 22 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 23 | * of any contributors may be used to endorse or promote products derived |
| 24 | * from this software without specific prior written permission. |
| 25 | * |
| 26 | * Alternatively, this software may be distributed under the terms of the |
| 27 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 28 | * Software Foundation. |
| 29 | * |
| 30 | * NO WARRANTY |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 41 | * POSSIBILITY OF SUCH DAMAGES. |
| 42 | */ |
| 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #include <acpi/acpi.h> |
Len Brown | e2f7a77 | 2009-01-09 00:30:03 -0500 | [diff] [blame] | 45 | #include "accommon.h" |
| 46 | #include "acresrc.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
| 48 | #define _COMPONENT ACPI_RESOURCES |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 49 | ACPI_MODULE_NAME("rsaddr") |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 51 | /******************************************************************************* |
| 52 | * |
| 53 | * acpi_rs_convert_address16 - All WORD (16-bit) address resources |
| 54 | * |
| 55 | ******************************************************************************/ |
| 56 | struct acpi_rsconvert_info acpi_rs_convert_address16[5] = { |
| 57 | {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_ADDRESS16, |
| 58 | ACPI_RS_SIZE(struct acpi_resource_address16), |
| 59 | ACPI_RSC_TABLE_SIZE(acpi_rs_convert_address16)}, |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 60 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 61 | {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_ADDRESS16, |
| 62 | sizeof(struct aml_resource_address16), |
| 63 | 0}, |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 64 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 65 | /* Resource Type, General Flags, and Type-Specific Flags */ |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 66 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 67 | {ACPI_RSC_ADDRESS, 0, 0, 0}, |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 68 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 69 | /* |
| 70 | * These fields are contiguous in both the source and destination: |
| 71 | * Address Granularity |
| 72 | * Address Range Minimum |
| 73 | * Address Range Maximum |
| 74 | * Address Translation Offset |
| 75 | * Address Length |
| 76 | */ |
Lv Zheng | a45de93 | 2015-01-26 16:58:56 +0800 | [diff] [blame] | 77 | {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.address16.address.granularity), |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 78 | AML_OFFSET(address16.granularity), |
| 79 | 5}, |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 80 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 81 | /* Optional resource_source (Index and String) */ |
| 82 | |
| 83 | {ACPI_RSC_SOURCE, ACPI_RS_OFFSET(data.address16.resource_source), |
| 84 | 0, |
| 85 | sizeof(struct aml_resource_address16)} |
| 86 | }; |
| 87 | |
| 88 | /******************************************************************************* |
| 89 | * |
| 90 | * acpi_rs_convert_address32 - All DWORD (32-bit) address resources |
| 91 | * |
| 92 | ******************************************************************************/ |
| 93 | |
| 94 | struct acpi_rsconvert_info acpi_rs_convert_address32[5] = { |
| 95 | {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_ADDRESS32, |
| 96 | ACPI_RS_SIZE(struct acpi_resource_address32), |
| 97 | ACPI_RSC_TABLE_SIZE(acpi_rs_convert_address32)}, |
| 98 | |
| 99 | {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_ADDRESS32, |
| 100 | sizeof(struct aml_resource_address32), |
| 101 | 0}, |
| 102 | |
| 103 | /* Resource Type, General Flags, and Type-Specific Flags */ |
| 104 | |
| 105 | {ACPI_RSC_ADDRESS, 0, 0, 0}, |
| 106 | |
| 107 | /* |
| 108 | * These fields are contiguous in both the source and destination: |
| 109 | * Address Granularity |
| 110 | * Address Range Minimum |
| 111 | * Address Range Maximum |
| 112 | * Address Translation Offset |
| 113 | * Address Length |
| 114 | */ |
Lv Zheng | a45de93 | 2015-01-26 16:58:56 +0800 | [diff] [blame] | 115 | {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.address32.address.granularity), |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 116 | AML_OFFSET(address32.granularity), |
| 117 | 5}, |
| 118 | |
| 119 | /* Optional resource_source (Index and String) */ |
| 120 | |
| 121 | {ACPI_RSC_SOURCE, ACPI_RS_OFFSET(data.address32.resource_source), |
| 122 | 0, |
| 123 | sizeof(struct aml_resource_address32)} |
| 124 | }; |
| 125 | |
| 126 | /******************************************************************************* |
| 127 | * |
| 128 | * acpi_rs_convert_address64 - All QWORD (64-bit) address resources |
| 129 | * |
| 130 | ******************************************************************************/ |
| 131 | |
| 132 | struct acpi_rsconvert_info acpi_rs_convert_address64[5] = { |
| 133 | {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_ADDRESS64, |
| 134 | ACPI_RS_SIZE(struct acpi_resource_address64), |
| 135 | ACPI_RSC_TABLE_SIZE(acpi_rs_convert_address64)}, |
| 136 | |
| 137 | {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_ADDRESS64, |
| 138 | sizeof(struct aml_resource_address64), |
| 139 | 0}, |
| 140 | |
| 141 | /* Resource Type, General Flags, and Type-Specific Flags */ |
| 142 | |
| 143 | {ACPI_RSC_ADDRESS, 0, 0, 0}, |
| 144 | |
| 145 | /* |
| 146 | * These fields are contiguous in both the source and destination: |
| 147 | * Address Granularity |
| 148 | * Address Range Minimum |
| 149 | * Address Range Maximum |
| 150 | * Address Translation Offset |
| 151 | * Address Length |
| 152 | */ |
Lv Zheng | a45de93 | 2015-01-26 16:58:56 +0800 | [diff] [blame] | 153 | {ACPI_RSC_MOVE64, ACPI_RS_OFFSET(data.address64.address.granularity), |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 154 | AML_OFFSET(address64.granularity), |
| 155 | 5}, |
| 156 | |
| 157 | /* Optional resource_source (Index and String) */ |
| 158 | |
| 159 | {ACPI_RSC_SOURCE, ACPI_RS_OFFSET(data.address64.resource_source), |
| 160 | 0, |
| 161 | sizeof(struct aml_resource_address64)} |
| 162 | }; |
| 163 | |
| 164 | /******************************************************************************* |
| 165 | * |
| 166 | * acpi_rs_convert_ext_address64 - All Extended (64-bit) address resources |
| 167 | * |
| 168 | ******************************************************************************/ |
| 169 | |
| 170 | struct acpi_rsconvert_info acpi_rs_convert_ext_address64[5] = { |
| 171 | {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, |
| 172 | ACPI_RS_SIZE(struct acpi_resource_extended_address64), |
| 173 | ACPI_RSC_TABLE_SIZE(acpi_rs_convert_ext_address64)}, |
| 174 | |
| 175 | {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64, |
| 176 | sizeof(struct aml_resource_extended_address64), |
| 177 | 0}, |
| 178 | |
| 179 | /* Resource Type, General Flags, and Type-Specific Flags */ |
| 180 | |
| 181 | {ACPI_RSC_ADDRESS, 0, 0, 0}, |
| 182 | |
| 183 | /* Revision ID */ |
| 184 | |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 185 | {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.ext_address64.revision_ID), |
| 186 | AML_OFFSET(ext_address64.revision_ID), |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 187 | 1}, |
| 188 | /* |
| 189 | * These fields are contiguous in both the source and destination: |
| 190 | * Address Granularity |
| 191 | * Address Range Minimum |
| 192 | * Address Range Maximum |
| 193 | * Address Translation Offset |
| 194 | * Address Length |
| 195 | * Type-Specific Attribute |
| 196 | */ |
Lv Zheng | a45de93 | 2015-01-26 16:58:56 +0800 | [diff] [blame] | 197 | {ACPI_RSC_MOVE64, |
| 198 | ACPI_RS_OFFSET(data.ext_address64.address.granularity), |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 199 | AML_OFFSET(ext_address64.granularity), |
| 200 | 6} |
| 201 | }; |
| 202 | |
| 203 | /******************************************************************************* |
| 204 | * |
| 205 | * acpi_rs_convert_general_flags - Flags common to all address descriptors |
| 206 | * |
| 207 | ******************************************************************************/ |
| 208 | |
| 209 | static struct acpi_rsconvert_info acpi_rs_convert_general_flags[6] = { |
| 210 | {ACPI_RSC_FLAGINIT, 0, AML_OFFSET(address.flags), |
| 211 | ACPI_RSC_TABLE_SIZE(acpi_rs_convert_general_flags)}, |
| 212 | |
| 213 | /* Resource Type (Memory, Io, bus_number, etc.) */ |
| 214 | |
| 215 | {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.address.resource_type), |
| 216 | AML_OFFSET(address.resource_type), |
| 217 | 1}, |
| 218 | |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 219 | /* General flags - Consume, Decode, min_fixed, max_fixed */ |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 220 | |
| 221 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.producer_consumer), |
| 222 | AML_OFFSET(address.flags), |
| 223 | 0}, |
| 224 | |
| 225 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.decode), |
| 226 | AML_OFFSET(address.flags), |
| 227 | 1}, |
| 228 | |
| 229 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.min_address_fixed), |
| 230 | AML_OFFSET(address.flags), |
| 231 | 2}, |
| 232 | |
| 233 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.max_address_fixed), |
| 234 | AML_OFFSET(address.flags), |
| 235 | 3} |
| 236 | }; |
| 237 | |
| 238 | /******************************************************************************* |
| 239 | * |
| 240 | * acpi_rs_convert_mem_flags - Flags common to Memory address descriptors |
| 241 | * |
| 242 | ******************************************************************************/ |
| 243 | |
| 244 | static struct acpi_rsconvert_info acpi_rs_convert_mem_flags[5] = { |
| 245 | {ACPI_RSC_FLAGINIT, 0, AML_OFFSET(address.specific_flags), |
| 246 | ACPI_RSC_TABLE_SIZE(acpi_rs_convert_mem_flags)}, |
| 247 | |
| 248 | /* Memory-specific flags */ |
| 249 | |
| 250 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.info.mem.write_protect), |
| 251 | AML_OFFSET(address.specific_flags), |
| 252 | 0}, |
| 253 | |
| 254 | {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.address.info.mem.caching), |
| 255 | AML_OFFSET(address.specific_flags), |
| 256 | 1}, |
| 257 | |
| 258 | {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.address.info.mem.range_type), |
| 259 | AML_OFFSET(address.specific_flags), |
| 260 | 3}, |
| 261 | |
| 262 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.info.mem.translation), |
| 263 | AML_OFFSET(address.specific_flags), |
| 264 | 5} |
| 265 | }; |
| 266 | |
| 267 | /******************************************************************************* |
| 268 | * |
| 269 | * acpi_rs_convert_io_flags - Flags common to I/O address descriptors |
| 270 | * |
| 271 | ******************************************************************************/ |
| 272 | |
| 273 | static struct acpi_rsconvert_info acpi_rs_convert_io_flags[4] = { |
| 274 | {ACPI_RSC_FLAGINIT, 0, AML_OFFSET(address.specific_flags), |
| 275 | ACPI_RSC_TABLE_SIZE(acpi_rs_convert_io_flags)}, |
| 276 | |
| 277 | /* I/O-specific flags */ |
| 278 | |
| 279 | {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.address.info.io.range_type), |
| 280 | AML_OFFSET(address.specific_flags), |
| 281 | 0}, |
| 282 | |
| 283 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.address.info.io.translation), |
| 284 | AML_OFFSET(address.specific_flags), |
| 285 | 4}, |
| 286 | |
| 287 | {ACPI_RSC_1BITFLAG, |
| 288 | ACPI_RS_OFFSET(data.address.info.io.translation_type), |
| 289 | AML_OFFSET(address.specific_flags), |
| 290 | 5} |
| 291 | }; |
| 292 | |
| 293 | /******************************************************************************* |
| 294 | * |
| 295 | * FUNCTION: acpi_rs_get_address_common |
| 296 | * |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 297 | * PARAMETERS: resource - Pointer to the internal resource struct |
| 298 | * aml - Pointer to the AML resource descriptor |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 299 | * |
| 300 | * RETURN: TRUE if the resource_type field is OK, FALSE otherwise |
| 301 | * |
| 302 | * DESCRIPTION: Convert common flag fields from a raw AML resource descriptor |
| 303 | * to an internal resource descriptor |
| 304 | * |
| 305 | ******************************************************************************/ |
| 306 | |
| 307 | u8 |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 308 | acpi_rs_get_address_common(struct acpi_resource *resource, |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 309 | union aml_resource *aml) |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 310 | { |
| 311 | ACPI_FUNCTION_ENTRY(); |
| 312 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 313 | /* Validate the Resource Type */ |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 314 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 315 | if ((aml->address.resource_type > 2) |
| 316 | && (aml->address.resource_type < 0xC0)) { |
| 317 | return (FALSE); |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 318 | } |
| 319 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 320 | /* Get the Resource Type and General Flags */ |
| 321 | |
| 322 | (void)acpi_rs_convert_aml_to_resource(resource, aml, |
| 323 | acpi_rs_convert_general_flags); |
| 324 | |
| 325 | /* Get the Type-Specific Flags (Memory and I/O descriptors only) */ |
| 326 | |
| 327 | if (resource->data.address.resource_type == ACPI_MEMORY_RANGE) { |
| 328 | (void)acpi_rs_convert_aml_to_resource(resource, aml, |
| 329 | acpi_rs_convert_mem_flags); |
| 330 | } else if (resource->data.address.resource_type == ACPI_IO_RANGE) { |
| 331 | (void)acpi_rs_convert_aml_to_resource(resource, aml, |
| 332 | acpi_rs_convert_io_flags); |
| 333 | } else { |
| 334 | /* Generic resource type, just grab the type_specific byte */ |
| 335 | |
| 336 | resource->data.address.info.type_specific = |
| 337 | aml->address.specific_flags; |
| 338 | } |
| 339 | |
| 340 | return (TRUE); |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 341 | } |
| 342 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 343 | /******************************************************************************* |
| 344 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 345 | * FUNCTION: acpi_rs_set_address_common |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 346 | * |
Bob Moore | ba494be | 2012-07-12 09:40:10 +0800 | [diff] [blame] | 347 | * PARAMETERS: aml - Pointer to the AML resource descriptor |
| 348 | * resource - Pointer to the internal resource struct |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 349 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 350 | * RETURN: None |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 351 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 352 | * DESCRIPTION: Convert common flag fields from a resource descriptor to an |
| 353 | * AML descriptor |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 354 | * |
| 355 | ******************************************************************************/ |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 356 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 357 | void |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 358 | acpi_rs_set_address_common(union aml_resource *aml, |
| 359 | struct acpi_resource *resource) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 360 | { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 361 | ACPI_FUNCTION_ENTRY(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 362 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 363 | /* Set the Resource Type and General Flags */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 364 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 365 | (void)acpi_rs_convert_resource_to_aml(resource, aml, |
| 366 | acpi_rs_convert_general_flags); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 368 | /* Set the Type-Specific Flags (Memory and I/O descriptors only) */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 369 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 370 | if (resource->data.address.resource_type == ACPI_MEMORY_RANGE) { |
| 371 | (void)acpi_rs_convert_resource_to_aml(resource, aml, |
| 372 | acpi_rs_convert_mem_flags); |
| 373 | } else if (resource->data.address.resource_type == ACPI_IO_RANGE) { |
| 374 | (void)acpi_rs_convert_resource_to_aml(resource, aml, |
| 375 | acpi_rs_convert_io_flags); |
| 376 | } else { |
| 377 | /* Generic resource type, just copy the type_specific byte */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 378 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 379 | aml->address.specific_flags = |
| 380 | resource->data.address.info.type_specific; |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 381 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 382 | } |