ACPICA: utilities: add flag to only display data when dumping buffers
ACPICA commit fb18935fcf940c5854a055975c6b9ee31f0e1a5a Link: https://github.com/acpica/acpica/commit/fb18935f Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
1770093c5b
commit
efcf9456c8
@@ -142,10 +142,11 @@ struct acpi_pkg_info {
|
|||||||
|
|
||||||
/* acpi_ut_dump_buffer */
|
/* acpi_ut_dump_buffer */
|
||||||
|
|
||||||
#define DB_BYTE_DISPLAY 1
|
#define DB_BYTE_DISPLAY 0x01
|
||||||
#define DB_WORD_DISPLAY 2
|
#define DB_WORD_DISPLAY 0x02
|
||||||
#define DB_DWORD_DISPLAY 4
|
#define DB_DWORD_DISPLAY 0x04
|
||||||
#define DB_QWORD_DISPLAY 8
|
#define DB_QWORD_DISPLAY 0x08
|
||||||
|
#define DB_DISPLAY_DATA_ONLY 0x10
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* utascii - ASCII utilities
|
* utascii - ASCII utilities
|
||||||
|
@@ -37,7 +37,9 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
|
|||||||
u32 j;
|
u32 j;
|
||||||
u32 temp32;
|
u32 temp32;
|
||||||
u8 buf_char;
|
u8 buf_char;
|
||||||
|
u32 display_data_only = display & DB_DISPLAY_DATA_ONLY;
|
||||||
|
|
||||||
|
display &= ~DB_DISPLAY_DATA_ONLY;
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
acpi_os_printf("Null Buffer Pointer in DumpBuffer!\n");
|
acpi_os_printf("Null Buffer Pointer in DumpBuffer!\n");
|
||||||
return;
|
return;
|
||||||
@@ -53,7 +55,9 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
|
|||||||
|
|
||||||
/* Print current offset */
|
/* Print current offset */
|
||||||
|
|
||||||
acpi_os_printf("%8.4X: ", (base_offset + i));
|
if (!display_data_only) {
|
||||||
|
acpi_os_printf("%8.4X: ", (base_offset + i));
|
||||||
|
}
|
||||||
|
|
||||||
/* Print 16 hex chars */
|
/* Print 16 hex chars */
|
||||||
|
|
||||||
@@ -109,32 +113,34 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
|
|||||||
* Print the ASCII equivalent characters but watch out for the bad
|
* Print the ASCII equivalent characters but watch out for the bad
|
||||||
* unprintable ones (printable chars are 0x20 through 0x7E)
|
* unprintable ones (printable chars are 0x20 through 0x7E)
|
||||||
*/
|
*/
|
||||||
acpi_os_printf(" ");
|
if (!display_data_only) {
|
||||||
for (j = 0; j < 16; j++) {
|
acpi_os_printf(" ");
|
||||||
if (i + j >= count) {
|
for (j = 0; j < 16; j++) {
|
||||||
acpi_os_printf("\n");
|
if (i + j >= count) {
|
||||||
return;
|
acpi_os_printf("\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add comment characters so rest of line is ignored when
|
||||||
|
* compiled
|
||||||
|
*/
|
||||||
|
if (j == 0) {
|
||||||
|
acpi_os_printf("// ");
|
||||||
|
}
|
||||||
|
|
||||||
|
buf_char = buffer[(acpi_size)i + j];
|
||||||
|
if (isprint(buf_char)) {
|
||||||
|
acpi_os_printf("%c", buf_char);
|
||||||
|
} else {
|
||||||
|
acpi_os_printf(".");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Done with that line. */
|
||||||
* Add comment characters so rest of line is ignored when
|
|
||||||
* compiled
|
|
||||||
*/
|
|
||||||
if (j == 0) {
|
|
||||||
acpi_os_printf("// ");
|
|
||||||
}
|
|
||||||
|
|
||||||
buf_char = buffer[(acpi_size)i + j];
|
acpi_os_printf("\n");
|
||||||
if (isprint(buf_char)) {
|
|
||||||
acpi_os_printf("%c", buf_char);
|
|
||||||
} else {
|
|
||||||
acpi_os_printf(".");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Done with that line. */
|
|
||||||
|
|
||||||
acpi_os_printf("\n");
|
|
||||||
i += 16;
|
i += 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user