aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables/tbrsdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/tables/tbrsdt.c')
-rw-r--r--drivers/acpi/tables/tbrsdt.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c
index 4d308220225d..abcb08c2592a 100644
--- a/drivers/acpi/tables/tbrsdt.c
+++ b/drivers/acpi/tables/tbrsdt.c
@@ -64,7 +64,7 @@ acpi_status acpi_tb_verify_rsdp(struct acpi_pointer *address)
64 acpi_status status; 64 acpi_status status;
65 struct rsdp_descriptor *rsdp; 65 struct rsdp_descriptor *rsdp;
66 66
67 ACPI_FUNCTION_TRACE("tb_verify_rsdp"); 67 ACPI_FUNCTION_TRACE(tb_verify_rsdp);
68 68
69 switch (address->pointer_type) { 69 switch (address->pointer_type) {
70 case ACPI_LOGICAL_POINTER: 70 case ACPI_LOGICAL_POINTER:
@@ -78,7 +78,7 @@ acpi_status acpi_tb_verify_rsdp(struct acpi_pointer *address)
78 */ 78 */
79 status = acpi_os_map_memory(address->pointer.physical, 79 status = acpi_os_map_memory(address->pointer.physical,
80 sizeof(struct rsdp_descriptor), 80 sizeof(struct rsdp_descriptor),
81 (void *)&rsdp); 81 ACPI_CAST_PTR(void, &rsdp));
82 if (ACPI_FAILURE(status)) { 82 if (ACPI_FAILURE(status)) {
83 return_ACPI_STATUS(status); 83 return_ACPI_STATUS(status);
84 } 84 }
@@ -95,15 +95,20 @@ acpi_status acpi_tb_verify_rsdp(struct acpi_pointer *address)
95 goto cleanup; 95 goto cleanup;
96 } 96 }
97 97
98 /* The RSDP supplied is OK */ 98 /* RSDP is ok. Init the table info */
99 99
100 table_info.pointer = ACPI_CAST_PTR(struct acpi_table_header, rsdp); 100 table_info.pointer = ACPI_CAST_PTR(struct acpi_table_header, rsdp);
101 table_info.length = sizeof(struct rsdp_descriptor); 101 table_info.length = sizeof(struct rsdp_descriptor);
102 table_info.allocation = ACPI_MEM_MAPPED; 102
103 if (address->pointer_type == ACPI_PHYSICAL_POINTER) {
104 table_info.allocation = ACPI_MEM_MAPPED;
105 } else {
106 table_info.allocation = ACPI_MEM_NOT_ALLOCATED;
107 }
103 108
104 /* Save the table pointers and allocation info */ 109 /* Save the table pointers and allocation info */
105 110
106 status = acpi_tb_init_table_descriptor(ACPI_TABLE_RSDP, &table_info); 111 status = acpi_tb_init_table_descriptor(ACPI_TABLE_ID_RSDP, &table_info);
107 if (ACPI_FAILURE(status)) { 112 if (ACPI_FAILURE(status)) {
108 goto cleanup; 113 goto cleanup;
109 } 114 }
@@ -174,22 +179,20 @@ void acpi_tb_get_rsdt_address(struct acpi_pointer *out_address)
174 179
175acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr) 180acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr)
176{ 181{
177 int no_match; 182 char *signature;
178 183
179 ACPI_FUNCTION_ENTRY(); 184 ACPI_FUNCTION_ENTRY();
180 185
181 /* 186 /* Search for appropriate signature, RSDT or XSDT */
182 * Search for appropriate signature, RSDT or XSDT 187
183 */
184 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { 188 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
185 no_match = ACPI_STRNCMP((char *)table_ptr, RSDT_SIG, 189 signature = RSDT_SIG;
186 sizeof(RSDT_SIG) - 1);
187 } else { 190 } else {
188 no_match = ACPI_STRNCMP((char *)table_ptr, XSDT_SIG, 191 signature = XSDT_SIG;
189 sizeof(XSDT_SIG) - 1);
190 } 192 }
191 193
192 if (no_match) { 194 if (!ACPI_COMPARE_NAME(table_ptr->signature, signature)) {
195
193 /* Invalid RSDT or XSDT signature */ 196 /* Invalid RSDT or XSDT signature */
194 197
195 ACPI_ERROR((AE_INFO, 198 ACPI_ERROR((AE_INFO,
@@ -198,10 +201,8 @@ acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr)
198 ACPI_DUMP_BUFFER(acpi_gbl_RSDP, 20); 201 ACPI_DUMP_BUFFER(acpi_gbl_RSDP, 20);
199 202
200 ACPI_ERROR((AE_INFO, 203 ACPI_ERROR((AE_INFO,
201 "RSDT/XSDT signature at %X (%p) is invalid", 204 "RSDT/XSDT signature at %X is invalid",
202 acpi_gbl_RSDP->rsdt_physical_address, 205 acpi_gbl_RSDP->rsdt_physical_address));
203 (void *)(acpi_native_uint) acpi_gbl_RSDP->
204 rsdt_physical_address));
205 206
206 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { 207 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
207 ACPI_ERROR((AE_INFO, "Looking for RSDT")); 208 ACPI_ERROR((AE_INFO, "Looking for RSDT"));
@@ -234,13 +235,13 @@ acpi_status acpi_tb_get_table_rsdt(void)
234 acpi_status status; 235 acpi_status status;
235 struct acpi_pointer address; 236 struct acpi_pointer address;
236 237
237 ACPI_FUNCTION_TRACE("tb_get_table_rsdt"); 238 ACPI_FUNCTION_TRACE(tb_get_table_rsdt);
238 239
239 /* Get the RSDT/XSDT via the RSDP */ 240 /* Get the RSDT/XSDT via the RSDP */
240 241
241 acpi_tb_get_rsdt_address(&address); 242 acpi_tb_get_rsdt_address(&address);
242 243
243 table_info.type = ACPI_TABLE_XSDT; 244 table_info.type = ACPI_TABLE_ID_XSDT;
244 status = acpi_tb_get_table(&address, &table_info); 245 status = acpi_tb_get_table(&address, &table_info);
245 if (ACPI_FAILURE(status)) { 246 if (ACPI_FAILURE(status)) {
246 ACPI_EXCEPTION((AE_INFO, status, 247 ACPI_EXCEPTION((AE_INFO, status,
@@ -274,12 +275,13 @@ acpi_status acpi_tb_get_table_rsdt(void)
274 275
275 /* Save the table pointers and allocation info */ 276 /* Save the table pointers and allocation info */
276 277
277 status = acpi_tb_init_table_descriptor(ACPI_TABLE_XSDT, &table_info); 278 status = acpi_tb_init_table_descriptor(ACPI_TABLE_ID_XSDT, &table_info);
278 if (ACPI_FAILURE(status)) { 279 if (ACPI_FAILURE(status)) {
279 return_ACPI_STATUS(status); 280 return_ACPI_STATUS(status);
280 } 281 }
281 282
282 acpi_gbl_XSDT = ACPI_CAST_PTR(XSDT_DESCRIPTOR, table_info.pointer); 283 acpi_gbl_XSDT =
284 ACPI_CAST_PTR(struct xsdt_descriptor, table_info.pointer);
283 285
284 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "XSDT located at %p\n", acpi_gbl_XSDT)); 286 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "XSDT located at %p\n", acpi_gbl_XSDT));
285 return_ACPI_STATUS(status); 287 return_ACPI_STATUS(status);