aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources/rsinfo.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2005-10-21 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2005-12-10 00:22:54 -0500
commit0897831bb54eb36fd9e2a22da7f0f64be1b20d09 (patch)
tree8d77687ce8ebcfb62d6012d2d3c44f6a904b3c15 /drivers/acpi/resources/rsinfo.c
parent50eca3eb89d73d9f0aa070b126c7ee6a616016ab (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 'drivers/acpi/resources/rsinfo.c')
-rw-r--r--drivers/acpi/resources/rsinfo.c115
1 files changed, 57 insertions, 58 deletions
diff --git a/drivers/acpi/resources/rsinfo.c b/drivers/acpi/resources/rsinfo.c
index b31cb33ec565..973fc2834cbb 100644
--- a/drivers/acpi/resources/rsinfo.c
+++ b/drivers/acpi/resources/rsinfo.c
@@ -58,60 +58,60 @@ ACPI_MODULE_NAME("rsinfo")
58 * descriptors are indexed by the acpi_resource_type field. 58 * descriptors are indexed by the acpi_resource_type field.
59 */ 59 */
60/* Dispatch table for resource-to-AML (Set Resource) conversion functions */ 60/* Dispatch table for resource-to-AML (Set Resource) conversion functions */
61ACPI_SET_RESOURCE_HANDLER acpi_gbl_set_resource_dispatch[] = { 61struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[] = {
62 acpi_rs_set_irq, /* 0x00, ACPI_RESOURCE_TYPE_IRQ */ 62 acpi_rs_set_irq, /* 0x00, ACPI_RESOURCE_TYPE_IRQ */
63 acpi_rs_set_dma, /* 0x01, ACPI_RESOURCE_TYPE_DMA */ 63 acpi_rs_convert_dma, /* 0x01, ACPI_RESOURCE_TYPE_DMA */
64 acpi_rs_set_start_dpf, /* 0x02, ACPI_RESOURCE_TYPE_START_DEPENDENT */ 64 acpi_rs_set_start_dpf, /* 0x02, ACPI_RESOURCE_TYPE_START_DEPENDENT */
65 acpi_rs_set_end_dpf, /* 0x03, ACPI_RESOURCE_TYPE_END_DEPENDENT */ 65 acpi_rs_convert_end_dpf, /* 0x03, ACPI_RESOURCE_TYPE_END_DEPENDENT */
66 acpi_rs_set_io, /* 0x04, ACPI_RESOURCE_TYPE_IO */ 66 acpi_rs_convert_io, /* 0x04, ACPI_RESOURCE_TYPE_IO */
67 acpi_rs_set_fixed_io, /* 0x05, ACPI_RESOURCE_TYPE_FIXED_IO */ 67 acpi_rs_convert_fixed_io, /* 0x05, ACPI_RESOURCE_TYPE_FIXED_IO */
68 acpi_rs_set_vendor, /* 0x06, ACPI_RESOURCE_TYPE_VENDOR */ 68 acpi_rs_set_vendor, /* 0x06, ACPI_RESOURCE_TYPE_VENDOR */
69 acpi_rs_set_end_tag, /* 0x07, ACPI_RESOURCE_TYPE_END_TAG */ 69 acpi_rs_convert_end_tag, /* 0x07, ACPI_RESOURCE_TYPE_END_TAG */
70 acpi_rs_set_memory24, /* 0x08, ACPI_RESOURCE_TYPE_MEMORY24 */ 70 acpi_rs_convert_memory24, /* 0x08, ACPI_RESOURCE_TYPE_MEMORY24 */
71 acpi_rs_set_memory32, /* 0x09, ACPI_RESOURCE_TYPE_MEMORY32 */ 71 acpi_rs_convert_memory32, /* 0x09, ACPI_RESOURCE_TYPE_MEMORY32 */
72 acpi_rs_set_fixed_memory32, /* 0x0A, ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */ 72 acpi_rs_convert_fixed_memory32, /* 0x0A, ACPI_RESOURCE_TYPE_FIXED_MEMORY32 */
73 acpi_rs_set_address16, /* 0x0B, ACPI_RESOURCE_TYPE_ADDRESS16 */ 73 acpi_rs_convert_address16, /* 0x0B, ACPI_RESOURCE_TYPE_ADDRESS16 */
74 acpi_rs_set_address32, /* 0x0C, ACPI_RESOURCE_TYPE_ADDRESS32 */ 74 acpi_rs_convert_address32, /* 0x0C, ACPI_RESOURCE_TYPE_ADDRESS32 */
75 acpi_rs_set_address64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */ 75 acpi_rs_convert_address64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */
76 acpi_rs_set_ext_address64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ 76 acpi_rs_convert_ext_address64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
77 acpi_rs_set_ext_irq, /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ 77 acpi_rs_convert_ext_irq, /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
78 acpi_rs_set_generic_reg /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ 78 acpi_rs_convert_generic_reg /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
79}; 79};
80 80
81/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */ 81/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
82 82
83ACPI_GET_RESOURCE_HANDLER acpi_gbl_sm_get_resource_dispatch[] = { 83struct acpi_rsconvert_info *acpi_gbl_sm_get_resource_dispatch[] = {
84 NULL, /* 0x00, Reserved */ 84 NULL, /* 0x00, Reserved */
85 NULL, /* 0x01, Reserved */ 85 NULL, /* 0x01, Reserved */
86 NULL, /* 0x02, Reserved */ 86 NULL, /* 0x02, Reserved */
87 NULL, /* 0x03, Reserved */ 87 NULL, /* 0x03, Reserved */
88 acpi_rs_get_irq, /* 0x04, ACPI_RESOURCE_NAME_IRQ */ 88 acpi_rs_get_irq, /* 0x04, ACPI_RESOURCE_NAME_IRQ */
89 acpi_rs_get_dma, /* 0x05, ACPI_RESOURCE_NAME_DMA */ 89 acpi_rs_convert_dma, /* 0x05, ACPI_RESOURCE_NAME_DMA */
90 acpi_rs_get_start_dpf, /* 0x06, ACPI_RESOURCE_NAME_START_DEPENDENT */ 90 acpi_rs_get_start_dpf, /* 0x06, ACPI_RESOURCE_NAME_START_DEPENDENT */
91 acpi_rs_get_end_dpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */ 91 acpi_rs_convert_end_dpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
92 acpi_rs_get_io, /* 0x08, ACPI_RESOURCE_NAME_IO */ 92 acpi_rs_convert_io, /* 0x08, ACPI_RESOURCE_NAME_IO */
93 acpi_rs_get_fixed_io, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */ 93 acpi_rs_convert_fixed_io, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */
94 NULL, /* 0x0A, Reserved */ 94 NULL, /* 0x0A, Reserved */
95 NULL, /* 0x0B, Reserved */ 95 NULL, /* 0x0B, Reserved */
96 NULL, /* 0x0C, Reserved */ 96 NULL, /* 0x0C, Reserved */
97 NULL, /* 0x0D, Reserved */ 97 NULL, /* 0x0D, Reserved */
98 acpi_rs_get_vendor, /* 0x0E, ACPI_RESOURCE_NAME_VENDOR_SMALL */ 98 acpi_rs_get_vendor_small, /* 0x0E, ACPI_RESOURCE_NAME_VENDOR_SMALL */
99 acpi_rs_get_end_tag /* 0x0F, ACPI_RESOURCE_NAME_END_TAG */ 99 acpi_rs_convert_end_tag /* 0x0F, ACPI_RESOURCE_NAME_END_TAG */
100}; 100};
101 101
102ACPI_GET_RESOURCE_HANDLER acpi_gbl_lg_get_resource_dispatch[] = { 102struct acpi_rsconvert_info *acpi_gbl_lg_get_resource_dispatch[] = {
103 NULL, /* 0x00, Reserved */ 103 NULL, /* 0x00, Reserved */
104 acpi_rs_get_memory24, /* 0x01, ACPI_RESOURCE_NAME_MEMORY24 */ 104 acpi_rs_convert_memory24, /* 0x01, ACPI_RESOURCE_NAME_MEMORY24 */
105 acpi_rs_get_generic_reg, /* 0x02, ACPI_RESOURCE_NAME_GENERIC_REGISTER */ 105 acpi_rs_convert_generic_reg, /* 0x02, ACPI_RESOURCE_NAME_GENERIC_REGISTER */
106 NULL, /* 0x03, Reserved */ 106 NULL, /* 0x03, Reserved */
107 acpi_rs_get_vendor, /* 0x04, ACPI_RESOURCE_NAME_VENDOR_LARGE */ 107 acpi_rs_get_vendor_large, /* 0x04, ACPI_RESOURCE_NAME_VENDOR_LARGE */
108 acpi_rs_get_memory32, /* 0x05, ACPI_RESOURCE_NAME_MEMORY32 */ 108 acpi_rs_convert_memory32, /* 0x05, ACPI_RESOURCE_NAME_MEMORY32 */
109 acpi_rs_get_fixed_memory32, /* 0x06, ACPI_RESOURCE_NAME_FIXED_MEMORY32 */ 109 acpi_rs_convert_fixed_memory32, /* 0x06, ACPI_RESOURCE_NAME_FIXED_MEMORY32 */
110 acpi_rs_get_address32, /* 0x07, ACPI_RESOURCE_NAME_ADDRESS32 */ 110 acpi_rs_convert_address32, /* 0x07, ACPI_RESOURCE_NAME_ADDRESS32 */
111 acpi_rs_get_address16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */ 111 acpi_rs_convert_address16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */
112 acpi_rs_get_ext_irq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */ 112 acpi_rs_convert_ext_irq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */
113 acpi_rs_get_address64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */ 113 acpi_rs_convert_address64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */
114 acpi_rs_get_ext_address64 /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ 114 acpi_rs_convert_ext_address64 /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
115}; 115};
116 116
117#ifdef ACPI_FUTURE_USAGE 117#ifdef ACPI_FUTURE_USAGE
@@ -119,7 +119,7 @@ ACPI_GET_RESOURCE_HANDLER acpi_gbl_lg_get_resource_dispatch[] = {
119 119
120/* Dispatch table for resource dump functions */ 120/* Dispatch table for resource dump functions */
121 121
122ACPI_DUMP_RESOURCE_HANDLER acpi_gbl_dump_resource_dispatch[] = { 122struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[] = {
123 acpi_rs_dump_irq, /* ACPI_RESOURCE_TYPE_IRQ */ 123 acpi_rs_dump_irq, /* ACPI_RESOURCE_TYPE_IRQ */
124 acpi_rs_dump_dma, /* ACPI_RESOURCE_TYPE_DMA */ 124 acpi_rs_dump_dma, /* ACPI_RESOURCE_TYPE_DMA */
125 acpi_rs_dump_start_dpf, /* ACPI_RESOURCE_TYPE_START_DEPENDENT */ 125 acpi_rs_dump_start_dpf, /* ACPI_RESOURCE_TYPE_START_DEPENDENT */
@@ -136,17 +136,17 @@ ACPI_DUMP_RESOURCE_HANDLER acpi_gbl_dump_resource_dispatch[] = {
136 acpi_rs_dump_address64, /* ACPI_RESOURCE_TYPE_ADDRESS64 */ 136 acpi_rs_dump_address64, /* ACPI_RESOURCE_TYPE_ADDRESS64 */
137 acpi_rs_dump_ext_address64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ 137 acpi_rs_dump_ext_address64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
138 acpi_rs_dump_ext_irq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ 138 acpi_rs_dump_ext_irq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
139 acpi_rs_dump_generic_reg /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ 139 acpi_rs_dump_generic_reg, /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
140}; 140};
141
141#endif 142#endif
142#endif /* ACPI_FUTURE_USAGE */ 143#endif /* ACPI_FUTURE_USAGE */
143
144/* 144/*
145 * Base sizes for external AML resource descriptors, indexed by internal type. 145 * Base sizes for external AML resource descriptors, indexed by internal type.
146 * Includes size of the descriptor header (1 byte for small descriptors, 146 * Includes size of the descriptor header (1 byte for small descriptors,
147 * 3 bytes for large descriptors) 147 * 3 bytes for large descriptors)
148 */ 148 */
149u8 acpi_gbl_aml_resource_sizes[] = { 149const u8 acpi_gbl_aml_resource_sizes[] = {
150 sizeof(struct aml_resource_irq), /* ACPI_RESOURCE_TYPE_IRQ (optional Byte 3 always created) */ 150 sizeof(struct aml_resource_irq), /* ACPI_RESOURCE_TYPE_IRQ (optional Byte 3 always created) */
151 sizeof(struct aml_resource_dma), /* ACPI_RESOURCE_TYPE_DMA */ 151 sizeof(struct aml_resource_dma), /* ACPI_RESOURCE_TYPE_DMA */
152 sizeof(struct aml_resource_start_dependent), /* ACPI_RESOURCE_TYPE_START_DEPENDENT (optional Byte 1 always created) */ 152 sizeof(struct aml_resource_start_dependent), /* ACPI_RESOURCE_TYPE_START_DEPENDENT (optional Byte 1 always created) */
@@ -168,8 +168,8 @@ u8 acpi_gbl_aml_resource_sizes[] = {
168 168
169/* Macros used in the tables below */ 169/* Macros used in the tables below */
170 170
171#define ACPI_RLARGE(r) sizeof (r) - sizeof (struct aml_resource_large_header) 171#define ACPI_RLARGE(r) (sizeof (r) - sizeof (struct aml_resource_large_header))
172#define ACPI_RSMALL(r) sizeof (r) - sizeof (struct aml_resource_small_header) 172#define ACPI_RSMALL(r) (sizeof (r) - sizeof (struct aml_resource_small_header))
173 173
174/* 174/*
175 * Base sizes of resource descriptors, both the AML stream resource length 175 * Base sizes of resource descriptors, both the AML stream resource length
@@ -182,47 +182,46 @@ struct acpi_resource_info acpi_gbl_sm_resource_info[] = {
182 {0, 0, 0}, 182 {0, 0, 0},
183 {0, 0, 0}, 183 {0, 0, 0},
184 {2, ACPI_RSMALL(struct aml_resource_irq), 184 {2, ACPI_RSMALL(struct aml_resource_irq),
185 ACPI_SIZEOF_RESOURCE(struct acpi_resource_irq)}, 185 ACPI_RS_SIZE(struct acpi_resource_irq)},
186 {0, ACPI_RSMALL(struct aml_resource_dma), 186 {0, ACPI_RSMALL(struct aml_resource_dma),
187 ACPI_SIZEOF_RESOURCE(struct acpi_resource_dma)}, 187 ACPI_RS_SIZE(struct acpi_resource_dma)},
188 {2, ACPI_RSMALL(struct aml_resource_start_dependent), 188 {2, ACPI_RSMALL(struct aml_resource_start_dependent),
189 ACPI_SIZEOF_RESOURCE(struct acpi_resource_start_dependent)}, 189 ACPI_RS_SIZE(struct acpi_resource_start_dependent)},
190 {0, ACPI_RSMALL(struct aml_resource_end_dependent), 190 {0, ACPI_RSMALL(struct aml_resource_end_dependent), ACPI_RS_SIZE_MIN},
191 ACPI_RESOURCE_LENGTH},
192 {0, ACPI_RSMALL(struct aml_resource_io), 191 {0, ACPI_RSMALL(struct aml_resource_io),
193 ACPI_SIZEOF_RESOURCE(struct acpi_resource_io)}, 192 ACPI_RS_SIZE(struct acpi_resource_io)},
194 {0, ACPI_RSMALL(struct aml_resource_fixed_io), 193 {0, ACPI_RSMALL(struct aml_resource_fixed_io),
195 ACPI_SIZEOF_RESOURCE(struct acpi_resource_fixed_io)}, 194 ACPI_RS_SIZE(struct acpi_resource_fixed_io)},
196 {0, 0, 0}, 195 {0, 0, 0},
197 {0, 0, 0}, 196 {0, 0, 0},
198 {0, 0, 0}, 197 {0, 0, 0},
199 {0, 0, 0}, 198 {0, 0, 0},
200 {1, ACPI_RSMALL(struct aml_resource_vendor_small), 199 {1, ACPI_RSMALL(struct aml_resource_vendor_small),
201 ACPI_SIZEOF_RESOURCE(struct acpi_resource_vendor)}, 200 ACPI_RS_SIZE(struct acpi_resource_vendor)},
202 {0, ACPI_RSMALL(struct aml_resource_end_tag), ACPI_RESOURCE_LENGTH} 201 {0, ACPI_RSMALL(struct aml_resource_end_tag), ACPI_RS_SIZE_MIN}
203}; 202};
204 203
205struct acpi_resource_info acpi_gbl_lg_resource_info[] = { 204struct acpi_resource_info acpi_gbl_lg_resource_info[] = {
206 {0, 0, 0}, 205 {0, 0, 0},
207 {0, ACPI_RLARGE(struct aml_resource_memory24), 206 {0, ACPI_RLARGE(struct aml_resource_memory24),
208 ACPI_SIZEOF_RESOURCE(struct acpi_resource_memory24)}, 207 ACPI_RS_SIZE(struct acpi_resource_memory24)},
209 {0, ACPI_RLARGE(struct aml_resource_generic_register), 208 {0, ACPI_RLARGE(struct aml_resource_generic_register),
210 ACPI_SIZEOF_RESOURCE(struct acpi_resource_generic_register)}, 209 ACPI_RS_SIZE(struct acpi_resource_generic_register)},
211 {0, 0, 0}, 210 {0, 0, 0},
212 {1, ACPI_RLARGE(struct aml_resource_vendor_large), 211 {1, ACPI_RLARGE(struct aml_resource_vendor_large),
213 ACPI_SIZEOF_RESOURCE(struct acpi_resource_vendor)}, 212 ACPI_RS_SIZE(struct acpi_resource_vendor)},
214 {0, ACPI_RLARGE(struct aml_resource_memory32), 213 {0, ACPI_RLARGE(struct aml_resource_memory32),
215 ACPI_SIZEOF_RESOURCE(struct acpi_resource_memory32)}, 214 ACPI_RS_SIZE(struct acpi_resource_memory32)},
216 {0, ACPI_RLARGE(struct aml_resource_fixed_memory32), 215 {0, ACPI_RLARGE(struct aml_resource_fixed_memory32),
217 ACPI_SIZEOF_RESOURCE(struct acpi_resource_fixed_memory32)}, 216 ACPI_RS_SIZE(struct acpi_resource_fixed_memory32)},
218 {1, ACPI_RLARGE(struct aml_resource_address32), 217 {1, ACPI_RLARGE(struct aml_resource_address32),
219 ACPI_SIZEOF_RESOURCE(struct acpi_resource_address32)}, 218 ACPI_RS_SIZE(struct acpi_resource_address32)},
220 {1, ACPI_RLARGE(struct aml_resource_address16), 219 {1, ACPI_RLARGE(struct aml_resource_address16),
221 ACPI_SIZEOF_RESOURCE(struct acpi_resource_address16)}, 220 ACPI_RS_SIZE(struct acpi_resource_address16)},
222 {1, ACPI_RLARGE(struct aml_resource_extended_irq), 221 {1, ACPI_RLARGE(struct aml_resource_extended_irq),
223 ACPI_SIZEOF_RESOURCE(struct acpi_resource_extended_irq)}, 222 ACPI_RS_SIZE(struct acpi_resource_extended_irq)},
224 {1, ACPI_RLARGE(struct aml_resource_address64), 223 {1, ACPI_RLARGE(struct aml_resource_address64),
225 ACPI_SIZEOF_RESOURCE(struct acpi_resource_address64)}, 224 ACPI_RS_SIZE(struct acpi_resource_address64)},
226 {0, ACPI_RLARGE(struct aml_resource_extended_address64), 225 {0, ACPI_RLARGE(struct aml_resource_extended_address64),
227 ACPI_SIZEOF_RESOURCE(struct acpi_resource_extended_address64)} 226 ACPI_RS_SIZE(struct acpi_resource_extended_address64)}
228}; 227};