|
@@ -69,17 +69,16 @@ u8 ap_is_valid_header(struct acpi_table_header *table)
|
|
|
/* Make sure signature is all ASCII and a valid ACPI name */
|
|
|
|
|
|
if (!acpi_ut_valid_acpi_name(table->signature)) {
|
|
|
- fprintf(stderr,
|
|
|
- "Table signature (0x%8.8X) is invalid\n",
|
|
|
- *(u32 *)table->signature);
|
|
|
+ acpi_log_error("Table signature (0x%8.8X) is invalid\n",
|
|
|
+ *(u32 *)table->signature);
|
|
|
return (FALSE);
|
|
|
}
|
|
|
|
|
|
/* Check for minimum table length */
|
|
|
|
|
|
if (table->length < sizeof(struct acpi_table_header)) {
|
|
|
- fprintf(stderr, "Table length (0x%8.8X) is invalid\n",
|
|
|
- table->length);
|
|
|
+ acpi_log_error("Table length (0x%8.8X) is invalid\n",
|
|
|
+ table->length);
|
|
|
return (FALSE);
|
|
|
}
|
|
|
}
|
|
@@ -116,8 +115,8 @@ u8 ap_is_valid_checksum(struct acpi_table_header *table)
|
|
|
}
|
|
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
- fprintf(stderr, "%4.4s: Warning: wrong checksum in table\n",
|
|
|
- table->signature);
|
|
|
+ acpi_log_error("%4.4s: Warning: wrong checksum in table\n",
|
|
|
+ table->signature);
|
|
|
}
|
|
|
|
|
|
return (AE_OK);
|
|
@@ -196,12 +195,12 @@ ap_dump_table_buffer(struct acpi_table_header *table,
|
|
|
* Note: simplest to just always emit a 64-bit address. acpi_xtract
|
|
|
* utility can handle this.
|
|
|
*/
|
|
|
- printf("%4.4s @ 0x%8.8X%8.8X\n", table->signature,
|
|
|
- ACPI_FORMAT_UINT64(address));
|
|
|
+ acpi_os_printf("%4.4s @ 0x%8.8X%8.8X\n", table->signature,
|
|
|
+ ACPI_FORMAT_UINT64(address));
|
|
|
|
|
|
acpi_ut_dump_buffer(ACPI_CAST_PTR(u8, table), table_length,
|
|
|
DB_BYTE_DISPLAY, 0);
|
|
|
- printf("\n");
|
|
|
+ acpi_os_printf("\n");
|
|
|
return (0);
|
|
|
}
|
|
|
|
|
@@ -239,14 +238,14 @@ int ap_dump_all_tables(void)
|
|
|
if (status == AE_LIMIT) {
|
|
|
return (0);
|
|
|
} else if (i == 0) {
|
|
|
- fprintf(stderr,
|
|
|
- "Could not get ACPI tables, %s\n",
|
|
|
- acpi_format_exception(status));
|
|
|
+ acpi_log_error
|
|
|
+ ("Could not get ACPI tables, %s\n",
|
|
|
+ acpi_format_exception(status));
|
|
|
return (-1);
|
|
|
} else {
|
|
|
- fprintf(stderr,
|
|
|
- "Could not get ACPI table at index %u, %s\n",
|
|
|
- i, acpi_format_exception(status));
|
|
|
+ acpi_log_error
|
|
|
+ ("Could not get ACPI table at index %u, %s\n",
|
|
|
+ i, acpi_format_exception(status));
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
@@ -288,17 +287,17 @@ int ap_dump_table_by_address(char *ascii_address)
|
|
|
|
|
|
status = acpi_ut_strtoul64(ascii_address, 0, &long_address);
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
- fprintf(stderr, "%s: Could not convert to a physical address\n",
|
|
|
- ascii_address);
|
|
|
+ acpi_log_error("%s: Could not convert to a physical address\n",
|
|
|
+ ascii_address);
|
|
|
return (-1);
|
|
|
}
|
|
|
|
|
|
address = (acpi_physical_address) long_address;
|
|
|
status = acpi_os_get_table_by_address(address, &table);
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
- fprintf(stderr, "Could not get table at 0x%8.8X%8.8X, %s\n",
|
|
|
- ACPI_FORMAT_UINT64(address),
|
|
|
- acpi_format_exception(status));
|
|
|
+ acpi_log_error("Could not get table at 0x%8.8X%8.8X, %s\n",
|
|
|
+ ACPI_FORMAT_UINT64(address),
|
|
|
+ acpi_format_exception(status));
|
|
|
return (-1);
|
|
|
}
|
|
|
|
|
@@ -330,9 +329,9 @@ int ap_dump_table_by_name(char *signature)
|
|
|
int table_status;
|
|
|
|
|
|
if (ACPI_STRLEN(signature) != ACPI_NAME_SIZE) {
|
|
|
- fprintf(stderr,
|
|
|
- "Invalid table signature [%s]: must be exactly 4 characters\n",
|
|
|
- signature);
|
|
|
+ acpi_log_error
|
|
|
+ ("Invalid table signature [%s]: must be exactly 4 characters\n",
|
|
|
+ signature);
|
|
|
return (-1);
|
|
|
}
|
|
|
|
|
@@ -362,9 +361,9 @@ int ap_dump_table_by_name(char *signature)
|
|
|
return (0);
|
|
|
}
|
|
|
|
|
|
- fprintf(stderr,
|
|
|
- "Could not get ACPI table with signature [%s], %s\n",
|
|
|
- local_signature, acpi_format_exception(status));
|
|
|
+ acpi_log_error
|
|
|
+ ("Could not get ACPI table with signature [%s], %s\n",
|
|
|
+ local_signature, acpi_format_exception(status));
|
|
|
return (-1);
|
|
|
}
|
|
|
|
|
@@ -409,16 +408,16 @@ int ap_dump_table_from_file(char *pathname)
|
|
|
/* File must be at least as long as the table length */
|
|
|
|
|
|
if (table->length > file_size) {
|
|
|
- fprintf(stderr,
|
|
|
- "Table length (0x%X) is too large for input file (0x%X) %s\n",
|
|
|
- table->length, file_size, pathname);
|
|
|
+ acpi_log_error
|
|
|
+ ("Table length (0x%X) is too large for input file (0x%X) %s\n",
|
|
|
+ table->length, file_size, pathname);
|
|
|
goto exit;
|
|
|
}
|
|
|
|
|
|
if (gbl_verbose_mode) {
|
|
|
- fprintf(stderr,
|
|
|
- "Input file: %s contains table [%4.4s], 0x%X (%u) bytes\n",
|
|
|
- pathname, table->signature, file_size, file_size);
|
|
|
+ acpi_log_error
|
|
|
+ ("Input file: %s contains table [%4.4s], 0x%X (%u) bytes\n",
|
|
|
+ pathname, table->signature, file_size, file_size);
|
|
|
}
|
|
|
|
|
|
table_status = ap_dump_table_buffer(table, 0, 0);
|