diff options
| author | Bob Moore <robert.moore@intel.com> | 2005-10-21 00:00:00 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2005-12-10 00:22:54 -0500 |
| commit | 0897831bb54eb36fd9e2a22da7f0f64be1b20d09 (patch) | |
| tree | 8d77687ce8ebcfb62d6012d2d3c44f6a904b3c15 /include/acpi | |
| parent | 50eca3eb89d73d9f0aa070b126c7ee6a616016ab (diff) | |
[ACPI] ACPICA 20051021
Implemented support for the EM64T and other x86_64
processors. This essentially entails recognizing
that these processors support non-aligned memory
transfers. Previously, all 64-bit processors were assumed
to lack hardware support for non-aligned transfers.
Completed conversion of the Resource Manager to nearly
full table-driven operation. Specifically, the resource
conversion code (convert AML to internal format and the
reverse) and the debug code to dump internal resource
descriptors are fully table-driven, reducing code and data
size and improving maintainability.
The OSL interfaces for Acquire and Release Lock now use a
64-bit flag word on 64-bit processors instead of a fixed
32-bit word. (Alexey Starikovskiy)
Implemented support within the resource conversion code
for the Type-Specific byte within the various ACPI 3.0
*WordSpace macros.
Fixed some issues within the resource conversion code for
the type-specific flags for both Memory and I/O address
resource descriptors. For Memory, implemented support
for the MTP and TTP flags. For I/O, split the TRS and TTP
flags into two separate fields.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi')
| -rw-r--r-- | include/acpi/acconfig.h | 2 | ||||
| -rw-r--r-- | include/acpi/acdisasm.h | 17 | ||||
| -rw-r--r-- | include/acpi/acmacros.h | 6 | ||||
| -rw-r--r-- | include/acpi/acpiosxf.h | 4 | ||||
| -rw-r--r-- | include/acpi/acresrc.h | 401 | ||||
| -rw-r--r-- | include/acpi/actypes.h | 183 | ||||
| -rw-r--r-- | include/acpi/acutils.h | 7 | ||||
| -rw-r--r-- | include/acpi/amlresrc.h | 14 | ||||
| -rw-r--r-- | include/acpi/platform/acenv.h | 11 |
9 files changed, 323 insertions, 322 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index cb59b018c84c..7676afec09a2 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
| @@ -63,7 +63,7 @@ | |||
| 63 | 63 | ||
| 64 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 64 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
| 65 | 65 | ||
| 66 | #define ACPI_CA_VERSION 0x20050930 | 66 | #define ACPI_CA_VERSION 0x20051021 |
| 67 | 67 | ||
| 68 | /* | 68 | /* |
| 69 | * OS name, used for the _OS object. The _OS object is essentially obsolete, | 69 | * OS name, used for the _OS object. The _OS object is essentially obsolete, |
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index b2921b869bb4..99250ee1b9d1 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h | |||
| @@ -60,6 +60,7 @@ extern struct acpi_external_list *acpi_gbl_external_list; | |||
| 60 | extern const char *acpi_gbl_io_decode[2]; | 60 | extern const char *acpi_gbl_io_decode[2]; |
| 61 | extern const char *acpi_gbl_word_decode[4]; | 61 | extern const char *acpi_gbl_word_decode[4]; |
| 62 | extern const char *acpi_gbl_consume_decode[2]; | 62 | extern const char *acpi_gbl_consume_decode[2]; |
| 63 | extern const char *acpi_gbl_config_decode[4]; | ||
| 63 | extern const char *acpi_gbl_min_decode[2]; | 64 | extern const char *acpi_gbl_min_decode[2]; |
| 64 | extern const char *acpi_gbl_max_decode[2]; | 65 | extern const char *acpi_gbl_max_decode[2]; |
| 65 | extern const char *acpi_gbl_DECdecode[2]; | 66 | extern const char *acpi_gbl_DECdecode[2]; |
| @@ -171,11 +172,19 @@ u8 acpi_dm_is_string_buffer(union acpi_parse_object *op); | |||
| 171 | /* | 172 | /* |
| 172 | * dmresrc | 173 | * dmresrc |
| 173 | */ | 174 | */ |
| 175 | void acpi_dm_dump_integer8(u8 value, char *name); | ||
| 176 | |||
| 177 | void acpi_dm_dump_integer16(u16 value, char *name); | ||
| 178 | |||
| 179 | void acpi_dm_dump_integer32(u32 value, char *name); | ||
| 180 | |||
| 181 | void acpi_dm_dump_integer64(u64 value, char *name); | ||
| 182 | |||
| 174 | void | 183 | void |
| 175 | acpi_dm_resource_descriptor(struct acpi_op_walk_info *info, | 184 | acpi_dm_resource_template(struct acpi_op_walk_info *info, |
| 176 | u8 * byte_data, u32 byte_count); | 185 | u8 * byte_data, u32 byte_count); |
| 177 | 186 | ||
| 178 | u8 acpi_dm_is_resource_descriptor(union acpi_parse_object *op); | 187 | u8 acpi_dm_is_resource_template(union acpi_parse_object *op); |
| 179 | 188 | ||
| 180 | void acpi_dm_indent(u32 level); | 189 | void acpi_dm_indent(u32 level); |
| 181 | 190 | ||
| @@ -223,6 +232,8 @@ void | |||
| 223 | acpi_dm_vendor_large_descriptor(union aml_resource *resource, | 232 | acpi_dm_vendor_large_descriptor(union aml_resource *resource, |
| 224 | u32 length, u32 level); | 233 | u32 length, u32 level); |
| 225 | 234 | ||
| 235 | void acpi_dm_vendor_common(char *name, u8 * byte_data, u32 length, u32 level); | ||
| 236 | |||
| 226 | /* | 237 | /* |
| 227 | * dmresrcs | 238 | * dmresrcs |
| 228 | */ | 239 | */ |
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 258cfe5e2aac..e42222c3d34c 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
| @@ -202,7 +202,7 @@ | |||
| 202 | 202 | ||
| 203 | #define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset) | 203 | #define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset) |
| 204 | 204 | ||
| 205 | #ifdef ACPI_MISALIGNED_TRANSFERS | 205 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED |
| 206 | 206 | ||
| 207 | /* The hardware supports unaligned transfers, just do the little-endian move */ | 207 | /* The hardware supports unaligned transfers, just do the little-endian move */ |
| 208 | 208 | ||
| @@ -563,11 +563,11 @@ | |||
| 563 | return (_s); }) | 563 | return (_s); }) |
| 564 | #define return_UINT8(s) ACPI_DO_WHILE0 ({ \ | 564 | #define return_UINT8(s) ACPI_DO_WHILE0 ({ \ |
| 565 | register u8 _s = (u8) (s); \ | 565 | register u8 _s = (u8) (s); \ |
| 566 | acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ | 566 | acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \ |
| 567 | return (_s); }) | 567 | return (_s); }) |
| 568 | #define return_UINT32(s) ACPI_DO_WHILE0 ({ \ | 568 | #define return_UINT32(s) ACPI_DO_WHILE0 ({ \ |
| 569 | register u32 _s = (u32) (s); \ | 569 | register u32 _s = (u32) (s); \ |
| 570 | acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ | 570 | acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \ |
| 571 | return (_s); }) | 571 | return (_s); }) |
| 572 | #else /* Use original less-safe macros */ | 572 | #else /* Use original less-safe macros */ |
| 573 | 573 | ||
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 98e0b8cd14ed..58473f60755f 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
| @@ -108,9 +108,9 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle); | |||
| 108 | 108 | ||
| 109 | void acpi_os_delete_lock(acpi_handle handle); | 109 | void acpi_os_delete_lock(acpi_handle handle); |
| 110 | 110 | ||
| 111 | unsigned long acpi_os_acquire_lock(acpi_handle handle); | 111 | acpi_native_uint acpi_os_acquire_lock(acpi_handle handle); |
| 112 | 112 | ||
| 113 | void acpi_os_release_lock(acpi_handle handle, unsigned long flags); | 113 | void acpi_os_release_lock(acpi_handle handle, acpi_native_uint flags); |
| 114 | 114 | ||
| 115 | /* | 115 | /* |
| 116 | * Memory allocation and mapping | 116 | * Memory allocation and mapping |
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index b66994e9e4ee..25cff0d5ba58 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h | |||
| @@ -49,48 +49,132 @@ | |||
| 49 | #include "amlresrc.h" | 49 | #include "amlresrc.h" |
| 50 | 50 | ||
| 51 | /* | 51 | /* |
| 52 | * If possible, pack the following structures to byte alignment, since we | ||
| 53 | * don't care about performance for debug output | ||
| 54 | */ | ||
| 55 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | ||
| 56 | #pragma pack(1) | ||
| 57 | #endif | ||
| 58 | |||
| 59 | /* | ||
| 60 | * Individual entry for the resource conversion tables | ||
| 61 | */ | ||
| 62 | typedef const struct acpi_rsconvert_info { | ||
| 63 | u8 opcode; | ||
| 64 | u8 resource_offset; | ||
| 65 | u8 aml_offset; | ||
| 66 | u8 value; | ||
| 67 | |||
| 68 | } acpi_rsconvert_info; | ||
| 69 | |||
| 70 | /* Resource conversion opcodes */ | ||
| 71 | |||
| 72 | #define ACPI_RSC_INITGET 0 | ||
| 73 | #define ACPI_RSC_INITSET 1 | ||
| 74 | #define ACPI_RSC_FLAGINIT 2 | ||
| 75 | #define ACPI_RSC_1BITFLAG 3 | ||
| 76 | #define ACPI_RSC_2BITFLAG 4 | ||
| 77 | #define ACPI_RSC_COUNT 5 | ||
| 78 | #define ACPI_RSC_COUNT16 6 | ||
| 79 | #define ACPI_RSC_LENGTH 7 | ||
| 80 | #define ACPI_RSC_MOVE8 8 | ||
| 81 | #define ACPI_RSC_MOVE16 9 | ||
| 82 | #define ACPI_RSC_MOVE32 10 | ||
| 83 | #define ACPI_RSC_MOVE64 11 | ||
| 84 | #define ACPI_RSC_SET8 12 | ||
| 85 | #define ACPI_RSC_DATA8 13 | ||
| 86 | #define ACPI_RSC_ADDRESS 14 | ||
| 87 | #define ACPI_RSC_SOURCE 15 | ||
| 88 | #define ACPI_RSC_SOURCEX 16 | ||
| 89 | #define ACPI_RSC_BITMASK 17 | ||
| 90 | #define ACPI_RSC_BITMASK16 18 | ||
| 91 | #define ACPI_RSC_EXIT_NE 19 | ||
| 92 | #define ACPI_RSC_EXIT_LE 20 | ||
| 93 | |||
| 94 | /* Resource Conversion sub-opcodes */ | ||
| 95 | |||
| 96 | #define ACPI_RSC_COMPARE_AML_LENGTH 0 | ||
| 97 | #define ACPI_RSC_COMPARE_VALUE 1 | ||
| 98 | |||
| 99 | #define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (struct acpi_rsconvert_info)) | ||
| 100 | |||
| 101 | #define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f) | ||
| 102 | #define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f) | ||
| 103 | |||
| 104 | /* | ||
| 52 | * Resource dispatch and info tables | 105 | * Resource dispatch and info tables |
| 53 | */ | 106 | */ |
| 54 | struct acpi_resource_info { | 107 | typedef const struct acpi_resource_info { |
| 55 | u8 length_type; | 108 | u8 length_type; |
| 56 | u8 minimum_aml_resource_length; | 109 | u8 minimum_aml_resource_length; |
| 57 | u8 minimum_internal_struct_length; | 110 | u8 minimum_internal_struct_length; |
| 58 | }; | 111 | |
| 112 | } acpi_resource_info; | ||
| 59 | 113 | ||
| 60 | /* Types for length_type above */ | 114 | /* Types for length_type above */ |
| 61 | 115 | ||
| 62 | #define ACPI_FIXED_LENGTH 0 | 116 | #define ACPI_FIXED_LENGTH 0 |
| 63 | #define ACPI_VARIABLE_LENGTH 1 | 117 | #define ACPI_VARIABLE_LENGTH 1 |
| 64 | #define ACPI_SMALL_VARIABLE_LENGTH 2 | 118 | #define ACPI_SMALL_VARIABLE_LENGTH 2 |
| 119 | |||
| 120 | typedef const struct acpi_rsdump_info { | ||
| 121 | u8 opcode; | ||
| 122 | u8 offset; | ||
| 123 | char *name; | ||
| 124 | const void *pointer; | ||
| 65 | 125 | ||
| 66 | /* Handlers */ | 126 | } acpi_rsdump_info; |
| 67 | 127 | ||
| 68 | typedef acpi_status(*ACPI_SET_RESOURCE_HANDLER) (struct acpi_resource * | 128 | /* Values for the Opcode field above */ |
| 69 | resource, | ||
| 70 | union aml_resource * aml); | ||
| 71 | 129 | ||
| 72 | typedef acpi_status(*ACPI_GET_RESOURCE_HANDLER) (union aml_resource * aml, | 130 | #define ACPI_RSD_TITLE 0 |
| 73 | u16 aml_resource_length, | 131 | #define ACPI_RSD_LITERAL 1 |
| 74 | struct acpi_resource * | 132 | #define ACPI_RSD_STRING 2 |
| 75 | resource); | 133 | #define ACPI_RSD_UINT8 3 |
| 134 | #define ACPI_RSD_UINT16 4 | ||
| 135 | #define ACPI_RSD_UINT32 5 | ||
| 136 | #define ACPI_RSD_UINT64 6 | ||
| 137 | #define ACPI_RSD_1BITFLAG 7 | ||
| 138 | #define ACPI_RSD_2BITFLAG 8 | ||
| 139 | #define ACPI_RSD_SHORTLIST 9 | ||
| 140 | #define ACPI_RSD_LONGLIST 10 | ||
| 141 | #define ACPI_RSD_DWORDLIST 11 | ||
| 142 | #define ACPI_RSD_ADDRESS 12 | ||
| 143 | #define ACPI_RSD_SOURCE 13 | ||
| 76 | 144 | ||
| 77 | typedef void (*ACPI_DUMP_RESOURCE_HANDLER) (union acpi_resource_data * data); | 145 | /* restore default alignment */ |
| 78 | 146 | ||
| 79 | /* Tables indexed by internal resource type */ | 147 | #pragma pack() |
| 80 | 148 | ||
| 81 | extern u8 acpi_gbl_aml_resource_sizes[]; | 149 | /* Resource tables indexed by internal resource type */ |
| 82 | extern ACPI_SET_RESOURCE_HANDLER acpi_gbl_set_resource_dispatch[]; | ||
| 83 | extern ACPI_DUMP_RESOURCE_HANDLER acpi_gbl_dump_resource_dispatch[]; | ||
| 84 | 150 | ||
| 85 | /* Tables indexed by raw AML resource descriptor type */ | 151 | extern const u8 acpi_gbl_aml_resource_sizes[]; |
| 152 | extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[]; | ||
| 153 | |||
| 154 | /* Resource tables indexed by raw AML resource descriptor type */ | ||
| 86 | 155 | ||
| 87 | extern struct acpi_resource_info acpi_gbl_sm_resource_info[]; | 156 | extern struct acpi_resource_info acpi_gbl_sm_resource_info[]; |
| 88 | extern struct acpi_resource_info acpi_gbl_lg_resource_info[]; | 157 | extern struct acpi_resource_info acpi_gbl_lg_resource_info[]; |
| 89 | extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_sm_get_resource_dispatch[]; | 158 | extern struct acpi_rsconvert_info *acpi_gbl_sm_get_resource_dispatch[]; |
| 90 | extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_lg_get_resource_dispatch[]; | 159 | extern struct acpi_rsconvert_info *acpi_gbl_lg_get_resource_dispatch[]; |
| 160 | |||
| 161 | /* | ||
| 162 | * rscreate | ||
| 163 | */ | ||
| 164 | acpi_status | ||
| 165 | acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, | ||
| 166 | struct acpi_buffer *output_buffer); | ||
| 167 | |||
| 168 | acpi_status | ||
| 169 | acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, | ||
| 170 | struct acpi_buffer *output_buffer); | ||
| 171 | |||
| 172 | acpi_status | ||
| 173 | acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | ||
| 174 | struct acpi_buffer *output_buffer); | ||
| 91 | 175 | ||
| 92 | /* | 176 | /* |
| 93 | * Function prototypes called from Acpi* APIs | 177 | * rsutils |
| 94 | */ | 178 | */ |
| 95 | acpi_status | 179 | acpi_status |
| 96 | acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 180 | acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); |
| @@ -110,27 +194,6 @@ acpi_rs_get_method_data(acpi_handle handle, | |||
| 110 | acpi_status | 194 | acpi_status |
| 111 | acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 195 | acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); |
| 112 | 196 | ||
| 113 | acpi_status | ||
| 114 | acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, | ||
| 115 | struct acpi_buffer *output_buffer); | ||
| 116 | |||
| 117 | acpi_status | ||
| 118 | acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, | ||
| 119 | struct acpi_buffer *output_buffer); | ||
| 120 | |||
| 121 | acpi_status | ||
| 122 | acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | ||
| 123 | struct acpi_buffer *output_buffer); | ||
| 124 | |||
| 125 | /* | ||
| 126 | * rsdump | ||
| 127 | */ | ||
| 128 | #ifdef ACPI_FUTURE_USAGE | ||
| 129 | void acpi_rs_dump_resource_list(struct acpi_resource *resource); | ||
| 130 | |||
| 131 | void acpi_rs_dump_irq_list(u8 * route_table); | ||
| 132 | #endif /* ACPI_FUTURE_USAGE */ | ||
| 133 | |||
| 134 | /* | 197 | /* |
| 135 | * rscalc | 198 | * rscalc |
| 136 | */ | 199 | */ |
| @@ -155,144 +218,28 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, | |||
| 155 | acpi_size aml_size_needed, u8 * output_buffer); | 218 | acpi_size aml_size_needed, u8 * output_buffer); |
| 156 | 219 | ||
| 157 | /* | 220 | /* |
| 158 | * rsio | ||
| 159 | */ | ||
| 160 | acpi_status | ||
| 161 | acpi_rs_get_io(union aml_resource *aml, | ||
| 162 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 163 | |||
| 164 | acpi_status | ||
| 165 | acpi_rs_set_io(struct acpi_resource *resource, union aml_resource *aml); | ||
| 166 | |||
| 167 | acpi_status | ||
| 168 | acpi_rs_get_fixed_io(union aml_resource *aml, | ||
| 169 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 170 | |||
| 171 | acpi_status | ||
| 172 | acpi_rs_set_fixed_io(struct acpi_resource *resource, union aml_resource *aml); | ||
| 173 | |||
| 174 | acpi_status | ||
| 175 | acpi_rs_get_dma(union aml_resource *aml, | ||
| 176 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 177 | |||
| 178 | acpi_status | ||
| 179 | acpi_rs_set_dma(struct acpi_resource *resource, union aml_resource *aml); | ||
| 180 | |||
| 181 | /* | ||
| 182 | * rsirq | ||
| 183 | */ | ||
| 184 | acpi_status | ||
| 185 | acpi_rs_get_irq(union aml_resource *aml, | ||
| 186 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 187 | |||
| 188 | acpi_status | ||
| 189 | acpi_rs_set_irq(struct acpi_resource *resource, union aml_resource *aml); | ||
| 190 | |||
| 191 | acpi_status | ||
| 192 | acpi_rs_get_ext_irq(union aml_resource *aml, | ||
| 193 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 194 | |||
| 195 | acpi_status | ||
| 196 | acpi_rs_set_ext_irq(struct acpi_resource *resource, union aml_resource *aml); | ||
| 197 | |||
| 198 | /* | ||
| 199 | * rsaddr | 221 | * rsaddr |
| 200 | */ | 222 | */ |
| 201 | acpi_status | 223 | void |
| 202 | acpi_rs_get_address16(union aml_resource *aml, | 224 | acpi_rs_set_address_common(union aml_resource *aml, |
| 203 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 204 | |||
| 205 | acpi_status | ||
| 206 | acpi_rs_set_address16(struct acpi_resource *resource, union aml_resource *aml); | ||
| 207 | |||
| 208 | acpi_status | ||
| 209 | acpi_rs_get_address32(union aml_resource *aml, | ||
| 210 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 211 | |||
| 212 | acpi_status | ||
| 213 | acpi_rs_set_address32(struct acpi_resource *resource, union aml_resource *aml); | ||
| 214 | |||
| 215 | acpi_status | ||
| 216 | acpi_rs_get_address64(union aml_resource *aml, | ||
| 217 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 218 | |||
| 219 | acpi_status | ||
| 220 | acpi_rs_set_address64(struct acpi_resource *resource, union aml_resource *aml); | ||
| 221 | |||
| 222 | acpi_status | ||
| 223 | acpi_rs_get_ext_address64(union aml_resource *aml, | ||
| 224 | u16 aml_resource_length, | ||
| 225 | struct acpi_resource *resource); | ||
| 226 | |||
| 227 | acpi_status | ||
| 228 | acpi_rs_set_ext_address64(struct acpi_resource *resource, | ||
| 229 | union aml_resource *aml); | ||
| 230 | |||
| 231 | /* | ||
| 232 | * rsmemory | ||
| 233 | */ | ||
| 234 | acpi_status | ||
| 235 | acpi_rs_get_memory24(union aml_resource *aml, | ||
| 236 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 237 | |||
| 238 | acpi_status | ||
| 239 | acpi_rs_set_memory24(struct acpi_resource *resource, union aml_resource *aml); | ||
| 240 | |||
| 241 | acpi_status | ||
| 242 | acpi_rs_get_memory32(union aml_resource *aml, | ||
| 243 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 244 | |||
| 245 | acpi_status | ||
| 246 | acpi_rs_set_memory32(struct acpi_resource *resource, union aml_resource *aml); | ||
| 247 | |||
| 248 | acpi_status | ||
| 249 | acpi_rs_get_fixed_memory32(union aml_resource *aml, | ||
| 250 | u16 aml_resource_length, | ||
| 251 | struct acpi_resource *resource); | 225 | struct acpi_resource *resource); |
| 252 | 226 | ||
| 253 | acpi_status | 227 | u8 |
| 254 | acpi_rs_set_fixed_memory32(struct acpi_resource *resource, | 228 | acpi_rs_get_address_common(struct acpi_resource *resource, |
| 255 | union aml_resource *aml); | 229 | union aml_resource *aml); |
| 256 | 230 | ||
| 257 | /* | 231 | /* |
| 258 | * rsmisc | 232 | * rsmisc |
| 259 | */ | 233 | */ |
| 260 | acpi_status | 234 | acpi_status |
| 261 | acpi_rs_get_generic_reg(union aml_resource *aml, | 235 | acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, |
| 262 | u16 aml_resource_length, | 236 | union aml_resource *aml, |
| 263 | struct acpi_resource *resource); | 237 | struct acpi_rsconvert_info *info); |
| 264 | |||
| 265 | acpi_status | ||
| 266 | acpi_rs_set_generic_reg(struct acpi_resource *resource, | ||
| 267 | union aml_resource *aml); | ||
| 268 | |||
| 269 | acpi_status | ||
| 270 | acpi_rs_get_vendor(union aml_resource *aml, | ||
| 271 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 272 | |||
| 273 | acpi_status | ||
| 274 | acpi_rs_set_vendor(struct acpi_resource *resource, union aml_resource *aml); | ||
| 275 | |||
| 276 | acpi_status | ||
| 277 | acpi_rs_get_start_dpf(union aml_resource *aml, | ||
| 278 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 279 | |||
| 280 | acpi_status | ||
| 281 | acpi_rs_set_start_dpf(struct acpi_resource *resource, union aml_resource *aml); | ||
| 282 | |||
| 283 | acpi_status | ||
| 284 | acpi_rs_get_end_dpf(union aml_resource *aml, | ||
| 285 | u16 aml_resource_length, struct acpi_resource *resource); | ||
| 286 | |||
| 287 | acpi_status | ||
| 288 | acpi_rs_set_end_dpf(struct acpi_resource *resource, union aml_resource *aml); | ||
| 289 | 238 | ||
| 290 | acpi_status | 239 | acpi_status |
| 291 | acpi_rs_get_end_tag(union aml_resource *aml, | 240 | acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, |
| 292 | u16 aml_resource_length, struct acpi_resource *resource); | 241 | union aml_resource *aml, |
| 293 | 242 | struct acpi_rsconvert_info *info); | |
| 294 | acpi_status | ||
| 295 | acpi_rs_set_end_tag(struct acpi_resource *resource, union aml_resource *aml); | ||
| 296 | 243 | ||
| 297 | /* | 244 | /* |
| 298 | * rsutils | 245 | * rsutils |
| @@ -301,74 +248,94 @@ void | |||
| 301 | acpi_rs_move_data(void *destination, | 248 | acpi_rs_move_data(void *destination, |
| 302 | void *source, u16 item_count, u8 move_type); | 249 | void *source, u16 item_count, u8 move_type); |
| 303 | 250 | ||
| 304 | /* Types used in move_type above */ | 251 | u8 acpi_rs_decode_bitmask(u16 mask, u8 * list); |
| 305 | 252 | ||
| 306 | #define ACPI_MOVE_TYPE_16_TO_32 0 | 253 | u16 acpi_rs_encode_bitmask(u8 * list, u8 count); |
| 307 | #define ACPI_MOVE_TYPE_32_TO_16 1 | ||
| 308 | #define ACPI_MOVE_TYPE_32_TO_32 2 | ||
| 309 | #define ACPI_MOVE_TYPE_64_TO_64 3 | ||
| 310 | 254 | ||
| 311 | u16 | 255 | acpi_rs_length |
| 312 | acpi_rs_get_resource_source(u16 resource_length, | 256 | acpi_rs_get_resource_source(acpi_rs_length resource_length, |
| 313 | acpi_size minimum_length, | 257 | acpi_rs_length minimum_length, |
| 314 | struct acpi_resource_source *resource_source, | 258 | struct acpi_resource_source *resource_source, |
| 315 | union aml_resource *aml, char *string_ptr); | 259 | union aml_resource *aml, char *string_ptr); |
| 316 | 260 | ||
| 317 | acpi_size | 261 | acpi_rsdesc_size |
| 318 | acpi_rs_set_resource_source(union aml_resource *aml, | 262 | acpi_rs_set_resource_source(union aml_resource *aml, |
| 319 | acpi_size minimum_length, | 263 | acpi_rs_length minimum_length, |
| 320 | struct acpi_resource_source *resource_source); | 264 | struct acpi_resource_source *resource_source); |
| 321 | 265 | ||
| 322 | u8 acpi_rs_get_resource_type(u8 resource_start_byte); | ||
| 323 | |||
| 324 | u32 acpi_rs_get_descriptor_length(union aml_resource *aml); | ||
| 325 | |||
| 326 | u16 acpi_rs_get_resource_length(union aml_resource *aml); | ||
| 327 | |||
| 328 | void | 266 | void |
| 329 | acpi_rs_set_resource_header(u8 descriptor_type, | 267 | acpi_rs_set_resource_header(u8 descriptor_type, |
| 330 | acpi_size total_length, union aml_resource *aml); | 268 | acpi_rsdesc_size total_length, |
| 269 | union aml_resource *aml); | ||
| 270 | |||
| 271 | void | ||
| 272 | acpi_rs_set_resource_length(acpi_rsdesc_size total_length, | ||
| 273 | union aml_resource *aml); | ||
| 331 | 274 | ||
| 332 | struct acpi_resource_info *acpi_rs_get_resource_info(u8 resource_type); | 275 | struct acpi_resource_info *acpi_rs_get_resource_info(u8 resource_type); |
| 333 | 276 | ||
| 334 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | ||
| 335 | /* | 277 | /* |
| 336 | * rsdump | 278 | * rsdump |
| 337 | */ | 279 | */ |
| 338 | void acpi_rs_dump_irq(union acpi_resource_data *resource); | 280 | void acpi_rs_dump_resource_list(struct acpi_resource *resource); |
| 339 | |||
| 340 | void acpi_rs_dump_address16(union acpi_resource_data *resource); | ||
| 341 | |||
| 342 | void acpi_rs_dump_address32(union acpi_resource_data *resource); | ||
| 343 | |||
| 344 | void acpi_rs_dump_address64(union acpi_resource_data *resource); | ||
| 345 | |||
| 346 | void acpi_rs_dump_ext_address64(union acpi_resource_data *resource); | ||
| 347 | |||
| 348 | void acpi_rs_dump_dma(union acpi_resource_data *resource); | ||
| 349 | |||
| 350 | void acpi_rs_dump_io(union acpi_resource_data *resource); | ||
| 351 | |||
| 352 | void acpi_rs_dump_ext_irq(union acpi_resource_data *resource); | ||
| 353 | |||
| 354 | void acpi_rs_dump_fixed_io(union acpi_resource_data *resource); | ||
| 355 | |||
| 356 | void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource); | ||
| 357 | |||
| 358 | void acpi_rs_dump_memory24(union acpi_resource_data *resource); | ||
| 359 | |||
| 360 | void acpi_rs_dump_memory32(union acpi_resource_data *resource); | ||
| 361 | |||
| 362 | void acpi_rs_dump_start_dpf(union acpi_resource_data *resource); | ||
| 363 | |||
| 364 | void acpi_rs_dump_vendor(union acpi_resource_data *resource); | ||
| 365 | 281 | ||
| 366 | void acpi_rs_dump_generic_reg(union acpi_resource_data *resource); | 282 | void acpi_rs_dump_irq_list(u8 * route_table); |
| 367 | 283 | ||
| 368 | void acpi_rs_dump_end_dpf(union acpi_resource_data *resource); | 284 | /* |
| 285 | * Resource conversion tables | ||
| 286 | */ | ||
| 287 | extern struct acpi_rsconvert_info acpi_rs_convert_dma[]; | ||
| 288 | extern struct acpi_rsconvert_info acpi_rs_convert_end_dpf[]; | ||
| 289 | extern struct acpi_rsconvert_info acpi_rs_convert_io[]; | ||
| 290 | extern struct acpi_rsconvert_info acpi_rs_convert_fixed_io[]; | ||
| 291 | extern struct acpi_rsconvert_info acpi_rs_convert_end_tag[]; | ||
| 292 | extern struct acpi_rsconvert_info acpi_rs_convert_memory24[]; | ||
| 293 | extern struct acpi_rsconvert_info acpi_rs_convert_generic_reg[]; | ||
| 294 | extern struct acpi_rsconvert_info acpi_rs_convert_memory32[]; | ||
| 295 | extern struct acpi_rsconvert_info acpi_rs_convert_fixed_memory32[]; | ||
| 296 | extern struct acpi_rsconvert_info acpi_rs_convert_address32[]; | ||
| 297 | extern struct acpi_rsconvert_info acpi_rs_convert_address16[]; | ||
| 298 | extern struct acpi_rsconvert_info acpi_rs_convert_ext_irq[]; | ||
| 299 | extern struct acpi_rsconvert_info acpi_rs_convert_address64[]; | ||
| 300 | extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[]; | ||
| 301 | |||
| 302 | /* These resources require separate get/set tables */ | ||
| 303 | |||
| 304 | extern struct acpi_rsconvert_info acpi_rs_get_irq[]; | ||
| 305 | extern struct acpi_rsconvert_info acpi_rs_get_start_dpf[]; | ||
| 306 | extern struct acpi_rsconvert_info acpi_rs_get_vendor_small[]; | ||
| 307 | extern struct acpi_rsconvert_info acpi_rs_get_vendor_large[]; | ||
| 308 | |||
| 309 | extern struct acpi_rsconvert_info acpi_rs_set_irq[]; | ||
| 310 | extern struct acpi_rsconvert_info acpi_rs_set_start_dpf[]; | ||
| 311 | extern struct acpi_rsconvert_info acpi_rs_set_vendor[]; | ||
| 369 | 312 | ||
| 370 | void acpi_rs_dump_end_tag(union acpi_resource_data *resource); | 313 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
| 314 | /* | ||
| 315 | * rsinfo | ||
| 316 | */ | ||
| 317 | extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[]; | ||
| 371 | 318 | ||
| 319 | /* | ||
| 320 | * rsdump | ||
| 321 | */ | ||
| 322 | extern struct acpi_rsdump_info acpi_rs_dump_irq[]; | ||
| 323 | extern struct acpi_rsdump_info acpi_rs_dump_dma[]; | ||
| 324 | extern struct acpi_rsdump_info acpi_rs_dump_start_dpf[]; | ||
| 325 | extern struct acpi_rsdump_info acpi_rs_dump_end_dpf[]; | ||
| 326 | extern struct acpi_rsdump_info acpi_rs_dump_io[]; | ||
| 327 | extern struct acpi_rsdump_info acpi_rs_dump_fixed_io[]; | ||
| 328 | extern struct acpi_rsdump_info acpi_rs_dump_vendor[]; | ||
| 329 | extern struct acpi_rsdump_info acpi_rs_dump_end_tag[]; | ||
| 330 | extern struct acpi_rsdump_info acpi_rs_dump_memory24[]; | ||
| 331 | extern struct acpi_rsdump_info acpi_rs_dump_memory32[]; | ||
| 332 | extern struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[]; | ||
| 333 | extern struct acpi_rsdump_info acpi_rs_dump_address16[]; | ||
| 334 | extern struct acpi_rsdump_info acpi_rs_dump_address32[]; | ||
| 335 | extern struct acpi_rsdump_info acpi_rs_dump_address64[]; | ||
| 336 | extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[]; | ||
| 337 | extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[]; | ||
| 338 | extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[]; | ||
| 372 | #endif | 339 | #endif |
| 373 | 340 | ||
| 374 | #endif /* __ACRESRC_H__ */ | 341 | #endif /* __ACRESRC_H__ */ |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 43f7c509317a..29b887017b18 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
| @@ -83,10 +83,11 @@ typedef COMPILER_DEPENDENT_UINT64 u64; | |||
| 83 | * UINT32 32-bit (4 byte) unsigned value | 83 | * UINT32 32-bit (4 byte) unsigned value |
| 84 | * INT64 64-bit (8 byte) signed value | 84 | * INT64 64-bit (8 byte) signed value |
| 85 | * UINT64 64-bit (8 byte) unsigned value | 85 | * UINT64 64-bit (8 byte) unsigned value |
| 86 | * ACPI_NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value | 86 | * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on x86_64/IA-64 unsigned value |
| 87 | * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value | ||
| 88 | */ | 87 | */ |
| 89 | 88 | ||
| 89 | typedef unsigned long acpi_native_uint; | ||
| 90 | |||
| 90 | #ifndef ACPI_MACHINE_WIDTH | 91 | #ifndef ACPI_MACHINE_WIDTH |
| 91 | #error ACPI_MACHINE_WIDTH not defined | 92 | #error ACPI_MACHINE_WIDTH not defined |
| 92 | #endif | 93 | #endif |
| @@ -108,9 +109,6 @@ typedef COMPILER_DEPENDENT_UINT64 UINT64; | |||
| 108 | 109 | ||
| 109 | /*! [End] no source code translation !*/ | 110 | /*! [End] no source code translation !*/ |
| 110 | 111 | ||
| 111 | typedef s64 acpi_native_int; | ||
| 112 | typedef u64 acpi_native_uint; | ||
| 113 | |||
| 114 | typedef u64 acpi_table_ptr; | 112 | typedef u64 acpi_table_ptr; |
| 115 | typedef u64 acpi_io_address; | 113 | typedef u64 acpi_io_address; |
| 116 | typedef u64 acpi_physical_address; | 114 | typedef u64 acpi_physical_address; |
| @@ -121,9 +119,22 @@ typedef u64 acpi_size; | |||
| 121 | #define ACPI_MAX_PTR ACPI_UINT64_MAX | 119 | #define ACPI_MAX_PTR ACPI_UINT64_MAX |
| 122 | #define ACPI_SIZE_MAX ACPI_UINT64_MAX | 120 | #define ACPI_SIZE_MAX ACPI_UINT64_MAX |
| 123 | 121 | ||
| 122 | /* | ||
| 123 | * In the case of the Itanium Processor Family (IPF), the hardware does not | ||
| 124 | * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag | ||
| 125 | * to indicate that special precautions must be taken to avoid alignment faults. | ||
| 126 | * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) | ||
| 127 | * | ||
| 128 | * Note: Em64_t and other X86-64 processors do support misaligned transfers, | ||
| 129 | * so there is no need to define this flag. | ||
| 130 | */ | ||
| 131 | #if defined (__IA64__) || defined (__ia64__) | ||
| 132 | #define ACPI_MISALIGNMENT_NOT_SUPPORTED | ||
| 133 | #endif | ||
| 134 | |||
| 124 | #elif ACPI_MACHINE_WIDTH == 16 | 135 | #elif ACPI_MACHINE_WIDTH == 16 |
| 125 | 136 | ||
| 126 | /*! [Begin] no source code translation (keep the typedefs) */ | 137 | /*! [Begin] no source code translation (keep the typedefs as-is) */ |
| 127 | 138 | ||
| 128 | /* | 139 | /* |
| 129 | * 16-bit type definitions | 140 | * 16-bit type definitions |
| @@ -142,16 +153,12 @@ struct { | |||
| 142 | 153 | ||
| 143 | /*! [End] no source code translation !*/ | 154 | /*! [End] no source code translation !*/ |
| 144 | 155 | ||
| 145 | typedef u16 acpi_native_uint; | ||
| 146 | typedef s16 acpi_native_int; | ||
| 147 | |||
| 148 | typedef u32 acpi_table_ptr; | 156 | typedef u32 acpi_table_ptr; |
| 149 | typedef u32 acpi_io_address; | 157 | typedef u32 acpi_io_address; |
| 150 | typedef char *acpi_physical_address; | 158 | typedef char *acpi_physical_address; |
| 151 | typedef u16 acpi_size; | 159 | typedef u16 acpi_size; |
| 152 | 160 | ||
| 153 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 | 161 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 |
| 154 | #define ACPI_MISALIGNED_TRANSFERS | ||
| 155 | #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ | 162 | #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ |
| 156 | #define ACPI_MAX_PTR ACPI_UINT16_MAX | 163 | #define ACPI_MAX_PTR ACPI_UINT16_MAX |
| 157 | #define ACPI_SIZE_MAX ACPI_UINT16_MAX | 164 | #define ACPI_SIZE_MAX ACPI_UINT16_MAX |
| @@ -179,16 +186,12 @@ typedef COMPILER_DEPENDENT_UINT64 UINT64; | |||
| 179 | 186 | ||
| 180 | /*! [End] no source code translation !*/ | 187 | /*! [End] no source code translation !*/ |
| 181 | 188 | ||
| 182 | typedef s32 acpi_native_int; | ||
| 183 | typedef u32 acpi_native_uint; | ||
| 184 | |||
| 185 | typedef u64 acpi_table_ptr; | 189 | typedef u64 acpi_table_ptr; |
| 186 | typedef u32 acpi_io_address; | 190 | typedef u32 acpi_io_address; |
| 187 | typedef u64 acpi_physical_address; | 191 | typedef u64 acpi_physical_address; |
| 188 | typedef u32 acpi_size; | 192 | typedef u32 acpi_size; |
| 189 | 193 | ||
| 190 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 | 194 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 |
| 191 | #define ACPI_MISALIGNED_TRANSFERS | ||
| 192 | #define ACPI_MAX_PTR ACPI_UINT32_MAX | 195 | #define ACPI_MAX_PTR ACPI_UINT32_MAX |
| 193 | #define ACPI_SIZE_MAX ACPI_UINT32_MAX | 196 | #define ACPI_SIZE_MAX ACPI_UINT32_MAX |
| 194 | 197 | ||
| @@ -895,6 +898,8 @@ struct acpi_mem_space_context { | |||
| 895 | /* | 898 | /* |
| 896 | * Definitions for Resource Attributes | 899 | * Definitions for Resource Attributes |
| 897 | */ | 900 | */ |
| 901 | typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ | ||
| 902 | typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (64_k-1)+3 */ | ||
| 898 | 903 | ||
| 899 | /* | 904 | /* |
| 900 | * Memory Attributes | 905 | * Memory Attributes |
| @@ -927,8 +932,8 @@ struct acpi_mem_space_context { | |||
| 927 | /* | 932 | /* |
| 928 | * IRQ Attributes | 933 | * IRQ Attributes |
| 929 | */ | 934 | */ |
| 930 | #define ACPI_EDGE_SENSITIVE (u8) 0x00 | 935 | #define ACPI_LEVEL_SENSITIVE (u8) 0x00 |
| 931 | #define ACPI_LEVEL_SENSITIVE (u8) 0x01 | 936 | #define ACPI_EDGE_SENSITIVE (u8) 0x01 |
| 932 | 937 | ||
| 933 | #define ACPI_ACTIVE_HIGH (u8) 0x00 | 938 | #define ACPI_ACTIVE_HIGH (u8) 0x00 |
| 934 | #define ACPI_ACTIVE_LOW (u8) 0x01 | 939 | #define ACPI_ACTIVE_LOW (u8) 0x01 |
| @@ -975,27 +980,34 @@ struct acpi_mem_space_context { | |||
| 975 | #define ACPI_CONSUMER (u8) 0x01 | 980 | #define ACPI_CONSUMER (u8) 0x01 |
| 976 | 981 | ||
| 977 | /* | 982 | /* |
| 983 | * If possible, pack the following structures to byte alignment | ||
| 984 | */ | ||
| 985 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | ||
| 986 | #pragma pack(1) | ||
| 987 | #endif | ||
| 988 | |||
| 989 | /* | ||
| 978 | * Structures used to describe device resources | 990 | * Structures used to describe device resources |
| 979 | */ | 991 | */ |
| 980 | struct acpi_resource_irq { | 992 | struct acpi_resource_irq { |
| 981 | u32 triggering; | 993 | u8 triggering; |
| 982 | u32 polarity; | 994 | u8 polarity; |
| 983 | u32 sharable; | 995 | u8 sharable; |
| 984 | u32 interrupt_count; | 996 | u8 interrupt_count; |
| 985 | u32 interrupts[1]; | 997 | u8 interrupts[1]; |
| 986 | }; | 998 | }; |
| 987 | 999 | ||
| 988 | struct acpi_resource_dma { | 1000 | struct acpi_resource_dma { |
| 989 | u32 type; | 1001 | u8 type; |
| 990 | u32 bus_master; | 1002 | u8 bus_master; |
| 991 | u32 transfer; | 1003 | u8 transfer; |
| 992 | u32 channel_count; | 1004 | u8 channel_count; |
| 993 | u32 channels[1]; | 1005 | u8 channels[1]; |
| 994 | }; | 1006 | }; |
| 995 | 1007 | ||
| 996 | struct acpi_resource_start_dependent { | 1008 | struct acpi_resource_start_dependent { |
| 997 | u32 compatibility_priority; | 1009 | u8 compatibility_priority; |
| 998 | u32 performance_robustness; | 1010 | u8 performance_robustness; |
| 999 | }; | 1011 | }; |
| 1000 | 1012 | ||
| 1001 | /* | 1013 | /* |
| @@ -1004,20 +1016,20 @@ struct acpi_resource_start_dependent { | |||
| 1004 | */ | 1016 | */ |
| 1005 | 1017 | ||
| 1006 | struct acpi_resource_io { | 1018 | struct acpi_resource_io { |
| 1007 | u32 io_decode; | 1019 | u8 io_decode; |
| 1008 | u32 minimum; | 1020 | u8 alignment; |
| 1009 | u32 maximum; | 1021 | u8 address_length; |
| 1010 | u32 alignment; | 1022 | u16 minimum; |
| 1011 | u32 address_length; | 1023 | u16 maximum; |
| 1012 | }; | 1024 | }; |
| 1013 | 1025 | ||
| 1014 | struct acpi_resource_fixed_io { | 1026 | struct acpi_resource_fixed_io { |
| 1015 | u32 address; | 1027 | u16 address; |
| 1016 | u32 address_length; | 1028 | u8 address_length; |
| 1017 | }; | 1029 | }; |
| 1018 | 1030 | ||
| 1019 | struct acpi_resource_vendor { | 1031 | struct acpi_resource_vendor { |
| 1020 | u32 byte_length; | 1032 | u16 byte_length; |
| 1021 | u8 byte_data[1]; | 1033 | u8 byte_data[1]; |
| 1022 | }; | 1034 | }; |
| 1023 | 1035 | ||
| @@ -1026,15 +1038,15 @@ struct acpi_resource_end_tag { | |||
| 1026 | }; | 1038 | }; |
| 1027 | 1039 | ||
| 1028 | struct acpi_resource_memory24 { | 1040 | struct acpi_resource_memory24 { |
| 1029 | u32 read_write_attribute; | 1041 | u8 write_protect; |
| 1030 | u32 minimum; | 1042 | u16 minimum; |
| 1031 | u32 maximum; | 1043 | u16 maximum; |
| 1032 | u32 alignment; | 1044 | u16 alignment; |
| 1033 | u32 address_length; | 1045 | u16 address_length; |
| 1034 | }; | 1046 | }; |
| 1035 | 1047 | ||
| 1036 | struct acpi_resource_memory32 { | 1048 | struct acpi_resource_memory32 { |
| 1037 | u32 read_write_attribute; | 1049 | u8 write_protect; |
| 1038 | u32 minimum; | 1050 | u32 minimum; |
| 1039 | u32 maximum; | 1051 | u32 maximum; |
| 1040 | u32 alignment; | 1052 | u32 alignment; |
| @@ -1042,57 +1054,59 @@ struct acpi_resource_memory32 { | |||
| 1042 | }; | 1054 | }; |
| 1043 | 1055 | ||
| 1044 | struct acpi_resource_fixed_memory32 { | 1056 | struct acpi_resource_fixed_memory32 { |
| 1045 | u32 read_write_attribute; | 1057 | u8 write_protect; |
| 1046 | u32 address; | 1058 | u32 address; |
| 1047 | u32 address_length; | 1059 | u32 address_length; |
| 1048 | }; | 1060 | }; |
| 1049 | 1061 | ||
| 1050 | struct acpi_memory_attribute { | 1062 | struct acpi_memory_attribute { |
| 1051 | u16 cache_attribute; | 1063 | u8 write_protect; |
| 1052 | u16 read_write_attribute; | 1064 | u8 caching; |
| 1065 | u8 range_type; | ||
| 1066 | u8 translation; | ||
| 1053 | }; | 1067 | }; |
| 1054 | 1068 | ||
| 1055 | struct acpi_io_attribute { | 1069 | struct acpi_io_attribute { |
| 1056 | u16 range_attribute; | 1070 | u8 range_type; |
| 1057 | u16 translation_attribute; | 1071 | u8 translation; |
| 1058 | }; | 1072 | u8 translation_type; |
| 1059 | 1073 | u8 reserved1; | |
| 1060 | struct acpi_bus_attribute { | ||
| 1061 | u16 reserved1; | ||
| 1062 | u16 reserved2; | ||
| 1063 | }; | 1074 | }; |
| 1064 | 1075 | ||
| 1065 | union acpi_resource_attribute { | 1076 | union acpi_resource_attribute { |
| 1066 | struct acpi_memory_attribute memory; | 1077 | struct acpi_memory_attribute mem; |
| 1067 | struct acpi_io_attribute io; | 1078 | struct acpi_io_attribute io; |
| 1068 | struct acpi_bus_attribute bus; | 1079 | |
| 1080 | /* Used for the *word_space macros */ | ||
| 1081 | |||
| 1082 | u8 type_specific; | ||
| 1069 | }; | 1083 | }; |
| 1070 | 1084 | ||
| 1071 | struct acpi_resource_source { | 1085 | struct acpi_resource_source { |
| 1072 | u32 index; | 1086 | u8 index; |
| 1073 | u32 string_length; | 1087 | u16 string_length; |
| 1074 | char *string_ptr; | 1088 | char *string_ptr; |
| 1075 | }; | 1089 | }; |
| 1076 | 1090 | ||
| 1077 | /* Fields common to all address descriptors, 16/32/64 bit */ | 1091 | /* Fields common to all address descriptors, 16/32/64 bit */ |
| 1078 | 1092 | ||
| 1079 | #define ACPI_RESOURCE_ADDRESS_COMMON \ | 1093 | #define ACPI_RESOURCE_ADDRESS_COMMON \ |
| 1080 | u32 resource_type; \ | 1094 | u8 resource_type; \ |
| 1081 | u32 producer_consumer; \ | 1095 | u8 producer_consumer; \ |
| 1082 | u32 decode; \ | 1096 | u8 decode; \ |
| 1083 | u32 min_address_fixed; \ | 1097 | u8 min_address_fixed; \ |
| 1084 | u32 max_address_fixed; \ | 1098 | u8 max_address_fixed; \ |
| 1085 | union acpi_resource_attribute attribute; | 1099 | union acpi_resource_attribute info; |
| 1086 | 1100 | ||
| 1087 | struct acpi_resource_address { | 1101 | struct acpi_resource_address { |
| 1088 | ACPI_RESOURCE_ADDRESS_COMMON}; | 1102 | ACPI_RESOURCE_ADDRESS_COMMON}; |
| 1089 | 1103 | ||
| 1090 | struct acpi_resource_address16 { | 1104 | struct acpi_resource_address16 { |
| 1091 | ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; | 1105 | ACPI_RESOURCE_ADDRESS_COMMON u16 granularity; |
| 1092 | u32 minimum; | 1106 | u16 minimum; |
| 1093 | u32 maximum; | 1107 | u16 maximum; |
| 1094 | u32 translation_offset; | 1108 | u16 translation_offset; |
| 1095 | u32 address_length; | 1109 | u16 address_length; |
| 1096 | struct acpi_resource_source resource_source; | 1110 | struct acpi_resource_source resource_source; |
| 1097 | }; | 1111 | }; |
| 1098 | 1112 | ||
| @@ -1115,30 +1129,30 @@ struct acpi_resource_address64 { | |||
| 1115 | }; | 1129 | }; |
| 1116 | 1130 | ||
| 1117 | struct acpi_resource_extended_address64 { | 1131 | struct acpi_resource_extended_address64 { |
| 1118 | ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; | 1132 | ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD; |
| 1133 | u64 granularity; | ||
| 1119 | u64 minimum; | 1134 | u64 minimum; |
| 1120 | u64 maximum; | 1135 | u64 maximum; |
| 1121 | u64 translation_offset; | 1136 | u64 translation_offset; |
| 1122 | u64 address_length; | 1137 | u64 address_length; |
| 1123 | u64 type_specific_attributes; | 1138 | u64 type_specific; |
| 1124 | u8 revision_iD; | ||
| 1125 | }; | 1139 | }; |
| 1126 | 1140 | ||
| 1127 | struct acpi_resource_extended_irq { | 1141 | struct acpi_resource_extended_irq { |
| 1128 | u32 producer_consumer; | 1142 | u8 producer_consumer; |
| 1129 | u32 triggering; | 1143 | u8 triggering; |
| 1130 | u32 polarity; | 1144 | u8 polarity; |
| 1131 | u32 sharable; | 1145 | u8 sharable; |
| 1132 | u32 interrupt_count; | 1146 | u8 interrupt_count; |
| 1133 | struct acpi_resource_source resource_source; | 1147 | struct acpi_resource_source resource_source; |
| 1134 | u32 interrupts[1]; | 1148 | u32 interrupts[1]; |
| 1135 | }; | 1149 | }; |
| 1136 | 1150 | ||
| 1137 | struct acpi_resource_generic_register { | 1151 | struct acpi_resource_generic_register { |
| 1138 | u32 space_id; | 1152 | u8 space_id; |
| 1139 | u32 bit_width; | 1153 | u8 bit_width; |
| 1140 | u32 bit_offset; | 1154 | u8 bit_offset; |
| 1141 | u32 access_size; | 1155 | u8 access_size; |
| 1142 | u64 address; | 1156 | u64 address; |
| 1143 | }; | 1157 | }; |
| 1144 | 1158 | ||
| @@ -1192,14 +1206,17 @@ struct acpi_resource { | |||
| 1192 | union acpi_resource_data data; | 1206 | union acpi_resource_data data; |
| 1193 | }; | 1207 | }; |
| 1194 | 1208 | ||
| 1195 | #define ACPI_RESOURCE_LENGTH 12 | 1209 | /* restore default alignment */ |
| 1196 | #define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ | 1210 | |
| 1211 | #pragma pack() | ||
| 1197 | 1212 | ||
| 1198 | #define ACPI_SIZEOF_RESOURCE(type) (u32) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) | 1213 | #define ACPI_RS_SIZE_MIN 12 |
| 1214 | #define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */ | ||
| 1215 | #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) | ||
| 1199 | 1216 | ||
| 1200 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) | 1217 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) |
| 1201 | 1218 | ||
| 1202 | #ifdef ACPI_MISALIGNED_TRANSFERS | 1219 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED |
| 1203 | #define ACPI_ALIGN_RESOURCE_SIZE(length) (length) | 1220 | #define ACPI_ALIGN_RESOURCE_SIZE(length) (length) |
| 1204 | #else | 1221 | #else |
| 1205 | #define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length) | 1222 | #define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length) |
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index c1086452696e..7386eb81bd2a 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h | |||
| @@ -159,7 +159,6 @@ extern const u8 _acpi_ctype[]; | |||
| 159 | #define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) | 159 | #define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) |
| 160 | #define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) | 160 | #define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) |
| 161 | #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) | 161 | #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) |
| 162 | #define ACPI_IS_ASCII(c) ((c) < 0x80) | ||
| 163 | 162 | ||
| 164 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | 163 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
| 165 | 164 | ||
| @@ -419,6 +418,12 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); | |||
| 419 | 418 | ||
| 420 | #define ACPI_ANY_BASE 0 | 419 | #define ACPI_ANY_BASE 0 |
| 421 | 420 | ||
| 421 | u32 acpi_ut_get_descriptor_length(void *aml); | ||
| 422 | |||
| 423 | u16 acpi_ut_get_resource_length(void *aml); | ||
| 424 | |||
| 425 | u8 acpi_ut_get_resource_type(void *aml); | ||
| 426 | |||
| 422 | u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); | 427 | u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); |
| 423 | 428 | ||
| 424 | u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); | 429 | u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); |
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index 103aff07db18..3112be527731 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h | |||
| @@ -134,7 +134,7 @@ struct aml_resource_end_dependent { | |||
| 134 | AML_RESOURCE_SMALL_HEADER_COMMON}; | 134 | AML_RESOURCE_SMALL_HEADER_COMMON}; |
| 135 | 135 | ||
| 136 | struct aml_resource_io { | 136 | struct aml_resource_io { |
| 137 | AML_RESOURCE_SMALL_HEADER_COMMON u8 information; | 137 | AML_RESOURCE_SMALL_HEADER_COMMON u8 flags; |
| 138 | u16 minimum; | 138 | u16 minimum; |
| 139 | u16 maximum; | 139 | u16 maximum; |
| 140 | u8 alignment; | 140 | u8 alignment; |
| @@ -164,7 +164,7 @@ struct aml_resource_large_header { | |||
| 164 | AML_RESOURCE_LARGE_HEADER_COMMON}; | 164 | AML_RESOURCE_LARGE_HEADER_COMMON}; |
| 165 | 165 | ||
| 166 | struct aml_resource_memory24 { | 166 | struct aml_resource_memory24 { |
| 167 | AML_RESOURCE_LARGE_HEADER_COMMON u8 information; | 167 | AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; |
| 168 | u16 minimum; | 168 | u16 minimum; |
| 169 | u16 maximum; | 169 | u16 maximum; |
| 170 | u16 alignment; | 170 | u16 alignment; |
| @@ -175,7 +175,7 @@ struct aml_resource_vendor_large { | |||
| 175 | AML_RESOURCE_LARGE_HEADER_COMMON}; | 175 | AML_RESOURCE_LARGE_HEADER_COMMON}; |
| 176 | 176 | ||
| 177 | struct aml_resource_memory32 { | 177 | struct aml_resource_memory32 { |
| 178 | AML_RESOURCE_LARGE_HEADER_COMMON u8 information; | 178 | AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; |
| 179 | u32 minimum; | 179 | u32 minimum; |
| 180 | u32 maximum; | 180 | u32 maximum; |
| 181 | u32 alignment; | 181 | u32 alignment; |
| @@ -183,7 +183,7 @@ struct aml_resource_memory32 { | |||
| 183 | }; | 183 | }; |
| 184 | 184 | ||
| 185 | struct aml_resource_fixed_memory32 { | 185 | struct aml_resource_fixed_memory32 { |
| 186 | AML_RESOURCE_LARGE_HEADER_COMMON u8 information; | 186 | AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; |
| 187 | u32 address; | 187 | u32 address; |
| 188 | u32 address_length; | 188 | u32 address_length; |
| 189 | }; | 189 | }; |
| @@ -205,7 +205,7 @@ struct aml_resource_extended_address64 { | |||
| 205 | u64 maximum; | 205 | u64 maximum; |
| 206 | u64 translation_offset; | 206 | u64 translation_offset; |
| 207 | u64 address_length; | 207 | u64 address_length; |
| 208 | u64 type_specific_attributes; | 208 | u64 type_specific; |
| 209 | }; | 209 | }; |
| 210 | 210 | ||
| 211 | #define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */ | 211 | #define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */ |
| @@ -239,8 +239,8 @@ struct aml_resource_address16 { | |||
| 239 | 239 | ||
| 240 | struct aml_resource_extended_irq { | 240 | struct aml_resource_extended_irq { |
| 241 | AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; | 241 | AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; |
| 242 | u8 table_length; | 242 | u8 interrupt_count; |
| 243 | u32 interrupt_number[1]; | 243 | u32 interrupts[1]; |
| 244 | /* res_source_index, res_source optional fields follow */ | 244 | /* res_source_index, res_source optional fields follow */ |
| 245 | }; | 245 | }; |
| 246 | 246 | ||
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 08539125696a..53aa997f05fc 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
| @@ -206,6 +206,8 @@ | |||
| 206 | * | 206 | * |
| 207 | *****************************************************************************/ | 207 | *****************************************************************************/ |
| 208 | 208 | ||
| 209 | #define ACPI_IS_ASCII(c) ((c) < 0x80) | ||
| 210 | |||
| 209 | #ifdef ACPI_USE_SYSTEM_CLIBRARY | 211 | #ifdef ACPI_USE_SYSTEM_CLIBRARY |
| 210 | /* | 212 | /* |
| 211 | * Use the standard C library headers. | 213 | * Use the standard C library headers. |
| @@ -235,7 +237,7 @@ | |||
| 235 | #define ACPI_STRCAT(d,s) (void) strcat((d), (s)) | 237 | #define ACPI_STRCAT(d,s) (void) strcat((d), (s)) |
| 236 | #define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n)) | 238 | #define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n)) |
| 237 | #define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n)) | 239 | #define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n)) |
| 238 | #define ACPI_MEMCMP(s1,s2,n) memcmp((s1), (s2), (acpi_size)(n)) | 240 | #define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n)) |
| 239 | #define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) | 241 | #define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) |
| 240 | #define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) | 242 | #define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) |
| 241 | 243 | ||
| @@ -247,7 +249,6 @@ | |||
| 247 | #define ACPI_IS_UPPER(i) isupper((int) (i)) | 249 | #define ACPI_IS_UPPER(i) isupper((int) (i)) |
| 248 | #define ACPI_IS_PRINT(i) isprint((int) (i)) | 250 | #define ACPI_IS_PRINT(i) isprint((int) (i)) |
| 249 | #define ACPI_IS_ALPHA(i) isalpha((int) (i)) | 251 | #define ACPI_IS_ALPHA(i) isalpha((int) (i)) |
| 250 | #define ACPI_IS_ASCII(i) isascii((int) (i)) | ||
| 251 | 252 | ||
| 252 | #else | 253 | #else |
| 253 | 254 | ||
| @@ -274,8 +275,8 @@ typedef char *va_list; | |||
| 274 | /* | 275 | /* |
| 275 | * Storage alignment properties | 276 | * Storage alignment properties |
| 276 | */ | 277 | */ |
| 277 | #define _AUPBND (sizeof (acpi_native_int) - 1) | 278 | #define _AUPBND (sizeof (acpi_native_uint) - 1) |
| 278 | #define _ADNBND (sizeof (acpi_native_int) - 1) | 279 | #define _ADNBND (sizeof (acpi_native_uint) - 1) |
| 279 | 280 | ||
| 280 | /* | 281 | /* |
| 281 | * Variable argument list macro definitions | 282 | * Variable argument list macro definitions |
| @@ -297,7 +298,7 @@ typedef char *va_list; | |||
| 297 | #define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s)) | 298 | #define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s)) |
| 298 | #define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n)) | 299 | #define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n)) |
| 299 | #define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n)) | 300 | #define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n)) |
| 300 | #define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((s1), (s2), (acpi_size)(n)) | 301 | #define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n)) |
| 301 | #define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n)) | 302 | #define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n)) |
| 302 | #define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n)) | 303 | #define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n)) |
| 303 | #define ACPI_TOUPPER acpi_ut_to_upper | 304 | #define ACPI_TOUPPER acpi_ut_to_upper |
