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 | /* |
| 8 | * Copyright (C) 2000 - 2005, R. Byron Moore |
| 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> |
| 45 | #include <acpi/acresrc.h> |
| 46 | |
| 47 | #define _COMPONENT ACPI_RESOURCES |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 48 | ACPI_MODULE_NAME("rsaddr") |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 50 | /* Local prototypes */ |
| 51 | static void |
| 52 | acpi_rs_decode_general_flags(union acpi_resource_data *resource, u8 flags); |
| 53 | |
| 54 | static u8 acpi_rs_encode_general_flags(union acpi_resource_data *resource); |
| 55 | |
| 56 | static void |
| 57 | acpi_rs_decode_specific_flags(union acpi_resource_data *resource, u8 flags); |
| 58 | |
| 59 | static u8 acpi_rs_encode_specific_flags(union acpi_resource_data *resource); |
| 60 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 61 | static void |
| 62 | acpi_rs_set_address_common(union aml_resource *aml, |
| 63 | struct acpi_resource *resource); |
| 64 | |
| 65 | static u8 |
| 66 | acpi_rs_get_address_common(struct acpi_resource *resource, |
| 67 | union aml_resource *aml); |
| 68 | |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 69 | /******************************************************************************* |
| 70 | * |
| 71 | * FUNCTION: acpi_rs_decode_general_flags |
| 72 | * |
| 73 | * PARAMETERS: Resource - Address resource data struct |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 74 | * Flags - Raw AML flag byte |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 75 | * |
| 76 | * RETURN: Decoded flag bits in resource struct |
| 77 | * |
| 78 | * DESCRIPTION: Decode a general flag byte to an address resource struct |
| 79 | * |
| 80 | ******************************************************************************/ |
| 81 | |
| 82 | static void |
| 83 | acpi_rs_decode_general_flags(union acpi_resource_data *resource, u8 flags) |
| 84 | { |
| 85 | ACPI_FUNCTION_ENTRY(); |
| 86 | |
| 87 | /* Producer / Consumer - flag bit[0] */ |
| 88 | |
| 89 | resource->address.producer_consumer = (u32) (flags & 0x01); |
| 90 | |
| 91 | /* Decode (_DEC) - flag bit[1] */ |
| 92 | |
| 93 | resource->address.decode = (u32) ((flags >> 1) & 0x01); |
| 94 | |
| 95 | /* Min Address Fixed (_MIF) - flag bit[2] */ |
| 96 | |
| 97 | resource->address.min_address_fixed = (u32) ((flags >> 2) & 0x01); |
| 98 | |
| 99 | /* Max Address Fixed (_MAF) - flag bit[3] */ |
| 100 | |
| 101 | resource->address.max_address_fixed = (u32) ((flags >> 3) & 0x01); |
| 102 | } |
| 103 | |
| 104 | /******************************************************************************* |
| 105 | * |
| 106 | * FUNCTION: acpi_rs_encode_general_flags |
| 107 | * |
| 108 | * PARAMETERS: Resource - Address resource data struct |
| 109 | * |
| 110 | * RETURN: Encoded general flag byte |
| 111 | * |
| 112 | * DESCRIPTION: Construct a general flag byte from an address resource struct |
| 113 | * |
| 114 | ******************************************************************************/ |
| 115 | |
| 116 | static u8 acpi_rs_encode_general_flags(union acpi_resource_data *resource) |
| 117 | { |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 118 | ACPI_FUNCTION_ENTRY(); |
| 119 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 120 | return ((u8) |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 121 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 122 | /* Producer / Consumer - flag bit[0] */ |
| 123 | ((resource->address.producer_consumer & 0x01) | |
| 124 | /* Decode (_DEC) - flag bit[1] */ |
| 125 | ((resource->address.decode & 0x01) << 1) | |
| 126 | /* Min Address Fixed (_MIF) - flag bit[2] */ |
| 127 | ((resource->address.min_address_fixed & 0x01) << 2) | |
| 128 | /* Max Address Fixed (_MAF) - flag bit[3] */ |
| 129 | ((resource->address.max_address_fixed & 0x01) << 3)) |
| 130 | ); |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | /******************************************************************************* |
| 134 | * |
| 135 | * FUNCTION: acpi_rs_decode_specific_flags |
| 136 | * |
| 137 | * PARAMETERS: Resource - Address resource data struct |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 138 | * Flags - Raw AML flag byte |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 139 | * |
| 140 | * RETURN: Decoded flag bits in attribute struct |
| 141 | * |
| 142 | * DESCRIPTION: Decode a type-specific flag byte to an attribute struct. |
| 143 | * Type-specific flags are only defined for the Memory and IO |
| 144 | * resource types. |
| 145 | * |
| 146 | ******************************************************************************/ |
| 147 | |
| 148 | static void |
| 149 | acpi_rs_decode_specific_flags(union acpi_resource_data *resource, u8 flags) |
| 150 | { |
| 151 | ACPI_FUNCTION_ENTRY(); |
| 152 | |
| 153 | if (resource->address.resource_type == ACPI_MEMORY_RANGE) { |
| 154 | /* Write Status (_RW) - flag bit[0] */ |
| 155 | |
| 156 | resource->address.attribute.memory.read_write_attribute = |
| 157 | (u16) (flags & 0x01); |
| 158 | |
| 159 | /* Memory Attributes (_MEM) - flag bits[2:1] */ |
| 160 | |
| 161 | resource->address.attribute.memory.cache_attribute = |
| 162 | (u16) ((flags >> 1) & 0x03); |
| 163 | } else if (resource->address.resource_type == ACPI_IO_RANGE) { |
| 164 | /* Ranges (_RNG) - flag bits[1:0] */ |
| 165 | |
| 166 | resource->address.attribute.io.range_attribute = |
| 167 | (u16) (flags & 0x03); |
| 168 | |
| 169 | /* Translations (_TTP and _TRS) - flag bits[5:4] */ |
| 170 | |
| 171 | resource->address.attribute.io.translation_attribute = |
| 172 | (u16) ((flags >> 4) & 0x03); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | /******************************************************************************* |
| 177 | * |
| 178 | * FUNCTION: acpi_rs_encode_specific_flags |
| 179 | * |
| 180 | * PARAMETERS: Resource - Address resource data struct |
| 181 | * |
| 182 | * RETURN: Encoded type-specific flag byte |
| 183 | * |
| 184 | * DESCRIPTION: Construct a type-specific flag byte from an attribute struct. |
| 185 | * Type-specific flags are only defined for the Memory and IO |
| 186 | * resource types. |
| 187 | * |
| 188 | ******************************************************************************/ |
| 189 | |
| 190 | static u8 acpi_rs_encode_specific_flags(union acpi_resource_data *resource) |
| 191 | { |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 192 | ACPI_FUNCTION_ENTRY(); |
| 193 | |
| 194 | if (resource->address.resource_type == ACPI_MEMORY_RANGE) { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 195 | return ((u8) |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 196 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 197 | /* Write Status (_RW) - flag bit[0] */ |
| 198 | ((resource->address.attribute.memory. |
| 199 | read_write_attribute & 0x01) | |
| 200 | /* Memory Attributes (_MEM) - flag bits[2:1] */ |
| 201 | ((resource->address.attribute.memory. |
| 202 | cache_attribute & 0x03) << 1))); |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 203 | } else if (resource->address.resource_type == ACPI_IO_RANGE) { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 204 | return ((u8) |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 205 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 206 | /* Ranges (_RNG) - flag bits[1:0] */ |
| 207 | ((resource->address.attribute.io. |
| 208 | range_attribute & 0x03) | |
| 209 | /* Translations (_TTP and _TRS) - flag bits[5:4] */ |
| 210 | ((resource->address.attribute.io. |
| 211 | translation_attribute & 0x03) << 4))); |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 212 | } |
| 213 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 214 | return (0); |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 215 | } |
| 216 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | /******************************************************************************* |
| 218 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 219 | * FUNCTION: acpi_rs_set_address_common |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 221 | * PARAMETERS: Aml - Pointer to the AML resource descriptor |
| 222 | * Resource - Pointer to the internal resource struct |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 223 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 224 | * RETURN: None |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 226 | * DESCRIPTION: Convert common flag fields from a resource descriptor to an |
| 227 | * AML descriptor |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | * |
| 229 | ******************************************************************************/ |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 230 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 231 | static void |
| 232 | acpi_rs_set_address_common(union aml_resource *aml, |
| 233 | struct acpi_resource *resource) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 235 | ACPI_FUNCTION_ENTRY(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 237 | /* Set the Resource Type (Memory, Io, bus_number, etc.) */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 238 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 239 | aml->address.resource_type = (u8) resource->data.address.resource_type; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 241 | /* Set the general flags */ |
| 242 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 243 | aml->address.flags = acpi_rs_encode_general_flags(&resource->data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 245 | /* Set the type-specific flags */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 246 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 247 | aml->address.specific_flags = |
| 248 | acpi_rs_encode_specific_flags(&resource->data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | } |
| 250 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | /******************************************************************************* |
| 252 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 253 | * FUNCTION: acpi_rs_get_address_common |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 255 | * PARAMETERS: Resource - Pointer to the internal resource struct |
| 256 | * Aml - Pointer to the AML resource descriptor |
| 257 | * |
| 258 | * RETURN: TRUE if the resource_type field is OK, FALSE otherwise |
| 259 | * |
| 260 | * DESCRIPTION: Convert common flag fields from a raw AML resource descriptor |
| 261 | * to an internal resource descriptor |
| 262 | * |
| 263 | ******************************************************************************/ |
| 264 | |
| 265 | static u8 |
| 266 | acpi_rs_get_address_common(struct acpi_resource *resource, |
| 267 | union aml_resource *aml) |
| 268 | { |
| 269 | ACPI_FUNCTION_ENTRY(); |
| 270 | |
| 271 | /* Validate resource type */ |
| 272 | |
| 273 | if ((aml->address.resource_type > 2) |
| 274 | && (aml->address.resource_type < 0xC0)) { |
| 275 | return (FALSE); |
| 276 | } |
| 277 | |
| 278 | /* Get the Resource Type (Memory, Io, bus_number, etc.) */ |
| 279 | |
| 280 | resource->data.address.resource_type = aml->address.resource_type; |
| 281 | |
| 282 | /* Get the General Flags */ |
| 283 | |
| 284 | acpi_rs_decode_general_flags(&resource->data, aml->address.flags); |
| 285 | |
| 286 | /* Get the Type-Specific Flags */ |
| 287 | |
| 288 | acpi_rs_decode_specific_flags(&resource->data, |
| 289 | aml->address.specific_flags); |
| 290 | return (TRUE); |
| 291 | } |
| 292 | |
| 293 | /******************************************************************************* |
| 294 | * |
| 295 | * FUNCTION: acpi_rs_get_address16 |
| 296 | * |
| 297 | * PARAMETERS: Aml - Pointer to the AML resource descriptor |
| 298 | * aml_resource_length - Length of the resource from the AML header |
| 299 | * Resource - Where the internal resource is returned |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | * |
| 301 | * RETURN: Status |
| 302 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 303 | * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding |
| 304 | * internal resource descriptor, simplifying bitflags and handling |
| 305 | * alignment and endian issues if necessary. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 306 | * |
| 307 | ******************************************************************************/ |
| 308 | |
| 309 | acpi_status |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 310 | acpi_rs_get_address16(union aml_resource * aml, |
| 311 | u16 aml_resource_length, struct acpi_resource * resource) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 312 | { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 313 | ACPI_FUNCTION_TRACE("rs_get_address16"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 314 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 315 | /* Get the Resource Type, general flags, and type-specific flags */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 317 | if (!acpi_rs_get_address_common(resource, aml)) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 318 | return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | } |
| 320 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 321 | /* |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 322 | * Get the following contiguous fields from the AML descriptor: |
| 323 | * Address Granularity |
| 324 | * Address Range Minimum |
| 325 | * Address Range Maximum |
| 326 | * Address Translation Offset |
| 327 | * Address Length |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 328 | */ |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 329 | acpi_rs_move_data(&resource->data.address16.granularity, |
| 330 | &aml->address16.granularity, 5, |
| 331 | ACPI_MOVE_TYPE_16_TO_32); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 332 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 333 | /* Get the optional resource_source (index and string) */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 334 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 335 | resource->length = |
| 336 | ACPI_SIZEOF_RESOURCE(struct acpi_resource_address16) + |
| 337 | acpi_rs_get_resource_source(aml_resource_length, |
| 338 | sizeof(struct aml_resource_address16), |
| 339 | &resource->data.address16. |
| 340 | resource_source, aml, NULL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 341 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 342 | /* Complete the resource header */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 343 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 344 | resource->type = ACPI_RESOURCE_TYPE_ADDRESS16; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 345 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 346 | } |
| 347 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 348 | /******************************************************************************* |
| 349 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 350 | * FUNCTION: acpi_rs_set_address16 |
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 | * PARAMETERS: Resource - Pointer to the resource descriptor |
| 353 | * Aml - Where the AML descriptor is returned |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 354 | * |
| 355 | * RETURN: Status |
| 356 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 357 | * DESCRIPTION: Convert an internal resource descriptor to the corresponding |
| 358 | * external AML resource descriptor. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 359 | * |
| 360 | ******************************************************************************/ |
| 361 | |
| 362 | acpi_status |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 363 | acpi_rs_set_address16(struct acpi_resource *resource, union aml_resource *aml) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 364 | { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 365 | acpi_size descriptor_length; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 366 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 367 | ACPI_FUNCTION_TRACE("rs_set_address16"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 369 | /* Set the Resource Type, General Flags, and Type-Specific Flags */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 371 | acpi_rs_set_address_common(aml, resource); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 372 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 373 | /* |
| 374 | * Set the following contiguous fields in the AML descriptor: |
| 375 | * Address Granularity |
| 376 | * Address Range Minimum |
| 377 | * Address Range Maximum |
| 378 | * Address Translation Offset |
| 379 | * Address Length |
| 380 | */ |
| 381 | acpi_rs_move_data(&aml->address16.granularity, |
| 382 | &resource->data.address16.granularity, 5, |
| 383 | ACPI_MOVE_TYPE_32_TO_16); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 384 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 385 | /* Resource Source Index and Resource Source are optional */ |
| 386 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 387 | descriptor_length = acpi_rs_set_resource_source(aml, |
| 388 | sizeof(struct |
| 389 | aml_resource_address16), |
| 390 | &resource->data. |
| 391 | address16. |
| 392 | resource_source); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 393 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 394 | /* Complete the AML descriptor header */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 395 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 396 | acpi_rs_set_resource_header(ACPI_RESOURCE_NAME_ADDRESS16, |
| 397 | descriptor_length, aml); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 398 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 399 | } |
| 400 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 401 | /******************************************************************************* |
| 402 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 403 | * FUNCTION: acpi_rs_get_address32 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 404 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 405 | * PARAMETERS: Aml - Pointer to the AML resource descriptor |
| 406 | * aml_resource_length - Length of the resource from the AML header |
| 407 | * Resource - Where the internal resource is returned |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 408 | * |
| 409 | * RETURN: Status |
| 410 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 411 | * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding |
| 412 | * internal resource descriptor, simplifying bitflags and handling |
| 413 | * alignment and endian issues if necessary. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 414 | * |
| 415 | ******************************************************************************/ |
| 416 | |
| 417 | acpi_status |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 418 | acpi_rs_get_address32(union aml_resource *aml, |
| 419 | u16 aml_resource_length, struct acpi_resource *resource) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 420 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 421 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 422 | ACPI_FUNCTION_TRACE("rs_get_address32"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 423 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 424 | /* Get the Resource Type, general flags, and type-specific flags */ |
Robert Moore | aff8c27 | 2005-09-02 17:24:17 -0400 | [diff] [blame] | 425 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 426 | if (!acpi_rs_get_address_common(resource, (void *)aml)) { |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 427 | return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 428 | } |
| 429 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 430 | /* |
| 431 | * Get the following contiguous fields from the AML descriptor: |
| 432 | * Address Granularity |
| 433 | * Address Range Minimum |
| 434 | * Address Range Maximum |
| 435 | * Address Translation Offset |
| 436 | * Address Length |
| 437 | */ |
| 438 | acpi_rs_move_data(&resource->data.address32.granularity, |
| 439 | &aml->address32.granularity, 5, |
| 440 | ACPI_MOVE_TYPE_32_TO_32); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 441 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 442 | /* Get the optional resource_source (index and string) */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 443 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 444 | resource->length = |
| 445 | ACPI_SIZEOF_RESOURCE(struct acpi_resource_address32) + |
| 446 | acpi_rs_get_resource_source(aml_resource_length, |
| 447 | sizeof(struct aml_resource_address32), |
| 448 | &resource->data.address32. |
| 449 | resource_source, aml, NULL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 450 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 451 | /* Complete the resource header */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 452 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 453 | resource->type = ACPI_RESOURCE_TYPE_ADDRESS32; |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 454 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 455 | } |
| 456 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 457 | /******************************************************************************* |
| 458 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 459 | * FUNCTION: acpi_rs_set_address32 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 460 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 461 | * PARAMETERS: Resource - Pointer to the resource descriptor |
| 462 | * Aml - Where the AML descriptor is returned |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 463 | * |
| 464 | * RETURN: Status |
| 465 | * |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 466 | * DESCRIPTION: Convert an internal resource descriptor to the corresponding |
| 467 | * external AML resource descriptor. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 468 | * |
| 469 | ******************************************************************************/ |
| 470 | |
| 471 | acpi_status |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 472 | acpi_rs_set_address32(struct acpi_resource *resource, union aml_resource *aml) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 473 | { |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 474 | acpi_size descriptor_length; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 475 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 476 | ACPI_FUNCTION_TRACE("rs_set_address32"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 477 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 478 | /* Set the Resource Type, General Flags, and Type-Specific Flags */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 480 | acpi_rs_set_address_common(aml, resource); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 481 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 482 | /* |
| 483 | * Set the following contiguous fields in the AML descriptor: |
| 484 | * Address Granularity |
| 485 | * Address Range Minimum |
| 486 | * Address Range Maximum |
| 487 | * Address Translation Offset |
| 488 | * Address Length |
| 489 | */ |
| 490 | acpi_rs_move_data(&aml->address32.granularity, |
| 491 | &resource->data.address32.granularity, 5, |
| 492 | ACPI_MOVE_TYPE_32_TO_32); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 493 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 494 | /* Resource Source Index and Resource Source are optional */ |
| 495 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 496 | descriptor_length = acpi_rs_set_resource_source(aml, |
| 497 | sizeof(struct |
| 498 | aml_resource_address32), |
| 499 | &resource->data. |
| 500 | address32. |
| 501 | resource_source); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 502 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 503 | /* Complete the AML descriptor header */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 504 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 505 | acpi_rs_set_resource_header(ACPI_RESOURCE_NAME_ADDRESS32, |
| 506 | descriptor_length, aml); |
| 507 | return_ACPI_STATUS(AE_OK); |
| 508 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 509 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 510 | /******************************************************************************* |
| 511 | * |
| 512 | * FUNCTION: acpi_rs_get_address64 |
| 513 | * |
| 514 | * PARAMETERS: Aml - Pointer to the AML resource descriptor |
| 515 | * aml_resource_length - Length of the resource from the AML header |
| 516 | * Resource - Where the internal resource is returned |
| 517 | * |
| 518 | * RETURN: Status |
| 519 | * |
| 520 | * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding |
| 521 | * internal resource descriptor, simplifying bitflags and handling |
| 522 | * alignment and endian issues if necessary. |
| 523 | * |
| 524 | ******************************************************************************/ |
| 525 | |
| 526 | acpi_status |
| 527 | acpi_rs_get_address64(union aml_resource *aml, |
| 528 | u16 aml_resource_length, struct acpi_resource *resource) |
| 529 | { |
| 530 | ACPI_FUNCTION_TRACE("rs_get_address64"); |
| 531 | |
| 532 | /* Get the Resource Type, general Flags, and type-specific Flags */ |
| 533 | |
| 534 | if (!acpi_rs_get_address_common(resource, aml)) { |
| 535 | return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 536 | } |
| 537 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 538 | /* |
| 539 | * Get the following contiguous fields from the AML descriptor: |
| 540 | * Address Granularity |
| 541 | * Address Range Minimum |
| 542 | * Address Range Maximum |
| 543 | * Address Translation Offset |
| 544 | * Address Length |
| 545 | */ |
| 546 | acpi_rs_move_data(&resource->data.address64.granularity, |
| 547 | &aml->address64.granularity, 5, |
| 548 | ACPI_MOVE_TYPE_64_TO_64); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 549 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 550 | /* Get the optional resource_source (index and string) */ |
| 551 | |
| 552 | resource->length = |
| 553 | ACPI_SIZEOF_RESOURCE(struct acpi_resource_address64) + |
| 554 | acpi_rs_get_resource_source(aml_resource_length, |
| 555 | sizeof(struct aml_resource_address64), |
| 556 | &resource->data.address64. |
| 557 | resource_source, aml, NULL); |
| 558 | |
| 559 | /* Complete the resource header */ |
| 560 | |
| 561 | resource->type = ACPI_RESOURCE_TYPE_ADDRESS64; |
| 562 | return_ACPI_STATUS(AE_OK); |
| 563 | } |
| 564 | |
| 565 | /******************************************************************************* |
| 566 | * |
| 567 | * FUNCTION: acpi_rs_set_address64 |
| 568 | * |
| 569 | * PARAMETERS: Resource - Pointer to the resource descriptor |
| 570 | * Aml - Where the AML descriptor is returned |
| 571 | * |
| 572 | * RETURN: Status |
| 573 | * |
| 574 | * DESCRIPTION: Convert an internal resource descriptor to the corresponding |
| 575 | * external AML resource descriptor. |
| 576 | * |
| 577 | ******************************************************************************/ |
| 578 | |
| 579 | acpi_status |
| 580 | acpi_rs_set_address64(struct acpi_resource *resource, union aml_resource *aml) |
| 581 | { |
| 582 | acpi_size descriptor_length; |
| 583 | |
| 584 | ACPI_FUNCTION_TRACE("rs_set_address64"); |
| 585 | |
| 586 | /* Set the Resource Type, General Flags, and Type-Specific Flags */ |
| 587 | |
| 588 | acpi_rs_set_address_common(aml, resource); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 589 | |
| 590 | /* |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 591 | * Set the following contiguous fields in the AML descriptor: |
| 592 | * Address Granularity |
| 593 | * Address Range Minimum |
| 594 | * Address Range Maximum |
| 595 | * Address Translation Offset |
| 596 | * Address Length |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 597 | */ |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame^] | 598 | acpi_rs_move_data(&aml->address64.granularity, |
| 599 | &resource->data.address64.granularity, 5, |
| 600 | ACPI_MOVE_TYPE_64_TO_64); |
| 601 | |
| 602 | /* Resource Source Index and Resource Source are optional */ |
| 603 | |
| 604 | descriptor_length = acpi_rs_set_resource_source(aml, |
| 605 | sizeof(struct |
| 606 | aml_resource_address64), |
| 607 | &resource->data. |
| 608 | address64. |
| 609 | resource_source); |
| 610 | |
| 611 | /* Complete the AML descriptor header */ |
| 612 | |
| 613 | acpi_rs_set_resource_header(ACPI_RESOURCE_NAME_ADDRESS64, |
| 614 | descriptor_length, aml); |
| 615 | return_ACPI_STATUS(AE_OK); |
| 616 | } |
| 617 | |
| 618 | /******************************************************************************* |
| 619 | * |
| 620 | * FUNCTION: acpi_rs_get_ext_address64 |
| 621 | * |
| 622 | * PARAMETERS: Aml - Pointer to the AML resource descriptor |
| 623 | * aml_resource_length - Length of the resource from the AML header |
| 624 | * Resource - Where the internal resource is returned |
| 625 | * |
| 626 | * RETURN: Status |
| 627 | * |
| 628 | * DESCRIPTION: Convert a raw AML resource descriptor to the corresponding |
| 629 | * internal resource descriptor, simplifying bitflags and handling |
| 630 | * alignment and endian issues if necessary. |
| 631 | * |
| 632 | ******************************************************************************/ |
| 633 | |
| 634 | acpi_status |
| 635 | acpi_rs_get_ext_address64(union aml_resource *aml, |
| 636 | u16 aml_resource_length, |
| 637 | struct acpi_resource *resource) |
| 638 | { |
| 639 | |
| 640 | ACPI_FUNCTION_TRACE("rs_get_ext_address64"); |
| 641 | |
| 642 | /* Get the Resource Type, general flags, and type-specific flags */ |
| 643 | |
| 644 | if (!acpi_rs_get_address_common(resource, aml)) { |
| 645 | return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE); |
| 646 | } |
| 647 | |
| 648 | /* |
| 649 | * Get and validate the Revision ID |
| 650 | * Note: Only one revision ID is currently supported |
| 651 | */ |
| 652 | resource->data.ext_address64.revision_iD = |
| 653 | aml->ext_address64.revision_iD; |
| 654 | if (aml->ext_address64.revision_iD != |
| 655 | AML_RESOURCE_EXTENDED_ADDRESS_REVISION) { |
| 656 | return_ACPI_STATUS(AE_SUPPORT); |
| 657 | } |
| 658 | |
| 659 | /* |
| 660 | * Get the following contiguous fields from the AML descriptor: |
| 661 | * Address Granularity |
| 662 | * Address Range Minimum |
| 663 | * Address Range Maximum |
| 664 | * Address Translation Offset |
| 665 | * Address Length |
| 666 | * Type-Specific Attribute |
| 667 | */ |
| 668 | acpi_rs_move_data(&resource->data.ext_address64.granularity, |
| 669 | &aml->ext_address64.granularity, 6, |
| 670 | ACPI_MOVE_TYPE_64_TO_64); |
| 671 | |
| 672 | /* Complete the resource header */ |
| 673 | |
| 674 | resource->type = ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64; |
| 675 | resource->length = |
| 676 | ACPI_SIZEOF_RESOURCE(struct acpi_resource_extended_address64); |
| 677 | return_ACPI_STATUS(AE_OK); |
| 678 | } |
| 679 | |
| 680 | /******************************************************************************* |
| 681 | * |
| 682 | * FUNCTION: acpi_rs_set_ext_address64 |
| 683 | * |
| 684 | * PARAMETERS: Resource - Pointer to the resource descriptor |
| 685 | * Aml - Where the AML descriptor is returned |
| 686 | * |
| 687 | * RETURN: Status |
| 688 | * |
| 689 | * DESCRIPTION: Convert an internal resource descriptor to the corresponding |
| 690 | * external AML resource descriptor. |
| 691 | * |
| 692 | ******************************************************************************/ |
| 693 | |
| 694 | acpi_status |
| 695 | acpi_rs_set_ext_address64(struct acpi_resource *resource, |
| 696 | union aml_resource *aml) |
| 697 | { |
| 698 | ACPI_FUNCTION_TRACE("rs_set_ext_address64"); |
| 699 | |
| 700 | /* Set the Resource Type, General Flags, and Type-Specific Flags */ |
| 701 | |
| 702 | acpi_rs_set_address_common(aml, resource); |
| 703 | |
| 704 | /* Only one Revision ID is currently supported */ |
| 705 | |
| 706 | aml->ext_address64.revision_iD = AML_RESOURCE_EXTENDED_ADDRESS_REVISION; |
| 707 | aml->ext_address64.reserved = 0; |
| 708 | |
| 709 | /* |
| 710 | * Set the following contiguous fields in the AML descriptor: |
| 711 | * Address Granularity |
| 712 | * Address Range Minimum |
| 713 | * Address Range Maximum |
| 714 | * Address Translation Offset |
| 715 | * Address Length |
| 716 | * Type-Specific Attribute |
| 717 | */ |
| 718 | acpi_rs_move_data(&aml->ext_address64.granularity, |
| 719 | &resource->data.address64.granularity, 6, |
| 720 | ACPI_MOVE_TYPE_64_TO_64); |
| 721 | |
| 722 | /* Complete the AML descriptor header */ |
| 723 | |
| 724 | acpi_rs_set_resource_header(ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64, |
| 725 | sizeof(struct |
| 726 | aml_resource_extended_address64), |
| 727 | aml); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 728 | return_ACPI_STATUS(AE_OK); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 729 | } |