From 6b97e41c971b4d288ef50f21d451001a99cde6d2 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Wed, 2 Dec 2009 17:12:55 +0100 Subject: hdt: Improving ACPI output Impact: Improving ACPI output Improving acpi output --- com32/hdt/hdt-cli-acpi.c | 53 ++++++++++-------------------------------------- com32/hdt/hdt-cli-hdt.c | 4 ++++ com32/hdt/hdt-cli.h | 7 ++++++- 3 files changed, 21 insertions(+), 43 deletions(-) (limited to 'com32/hdt') diff --git a/com32/hdt/hdt-cli-acpi.c b/com32/hdt/hdt-cli-acpi.c index 1a5b0426..b705cbaf 100644 --- a/com32/hdt/hdt-cli-acpi.c +++ b/com32/hdt/hdt-cli-acpi.c @@ -35,14 +35,14 @@ static void show_header_32(uint32_t address, s_acpi_description_header * h) { - more_printf("%-5s (v%03x %-6s %-7s 0x%08x %-4s 0x%08x) @ 0x%016x\n", + more_printf("%-4s v%03x %-6s %-7s 0x%08x %-4s 0x%08x @ 0x%016x\n", h->signature, h->revision, h->oem_id, h->oem_table_id, h->oem_revision, h->creator_id, h->creator_revision, address) } static void show_header(uint32_t address, s_acpi_description_header * h) { - more_printf("%-5s (v%03x %-6s %-7s 0x%08x %-4s 0x%08x) @ 0x%016lx\n", + more_printf("%-4s v%03x %-6s %-7s 0x%08x %-4s 0x%08x @ 0x%016lx\n", h->signature, h->revision, h->oem_id, h->oem_table_id, h->oem_revision, h->creator_id, h->creator_revision, address) } @@ -55,15 +55,14 @@ void main_show_acpi(int argc __unused, char **argv __unused, more_printf("No ACPI Tables detected\n"); return; } -//ACPI: XSDT (v001 DELL PE_SC3 0x00000001 DELL 0x00000001) @ 0x00000000000f222c more_printf - ("Table (rev oem table_id oem_rev creator creator_rev) @ address \n"); + ("ACPI rev oem table_id oem_rev creator creat_rev @ address \n"); more_printf - ("---------------------------------------------------------------------\n"); + ("----|----|------|--------|----------|-------|-----------|--------------------\n"); if (hardware->acpi.rsdp.valid) { s_rsdp *r = &hardware->acpi.rsdp; more_printf - ("RSDP (v%03x %6s ) @ 0x%016llx\n", + ("RSDP v%03x %-6s @ 0x%016llx\n", r->revision, r->oem_id, r->address); } if (hardware->acpi.rsdt.valid) @@ -81,52 +80,22 @@ void main_show_acpi(int argc __unused, char **argv __unused, if (hardware->acpi.dsdt.valid) show_header(hardware->acpi.dsdt.address, &hardware->acpi.dsdt.header); -// more_printf("XSDT (v%3x %6s %7s %08x %4s %08x) @ %08x", -} - -static void show_acpi_modes(int argc __unused, char **argv __unused, - struct s_hardware *hardware) -{ - detect_acpi(hardware); - reset_more_printf(); - if (hardware->is_acpi_valid == false) { - more_printf("No ACPI Tables detected\n"); - return; + for (int i=0;iacpi.ssdt_count;i++) { + if ((hardware->acpi.ssdt[i] != NULL) && (hardware->acpi.ssdt[i]->valid)) + show_header(hardware->acpi.ssdt[i]->address, &hardware->acpi.ssdt[i]->header); } -} - -struct cli_callback_descr list_acpi_show_modules[] = { - { - .name = CLI_MODES, - .exec = show_acpi_modes, - }, - { - .name = NULL, - .exec = NULL, - }, -}; -struct cli_callback_descr list_acpi_commands[] = { - { - .name = NULL, - .exec = NULL, - }, -}; +} struct cli_module_descr acpi_show_modules = { - .modules = list_acpi_show_modules, + .modules = NULL, .default_callback = main_show_acpi, }; -struct cli_module_descr acpi_commands = { - .modules = list_acpi_commands, - .default_callback = NULL, -}; - struct cli_mode_descr acpi_mode = { .mode = ACPI_MODE, .name = CLI_ACPI, - .default_modules = &acpi_commands, + .default_modules = NULL, .show_modules = &acpi_show_modules, .set_modules = NULL, }; diff --git a/com32/hdt/hdt-cli-hdt.c b/com32/hdt/hdt-cli-hdt.c index 71d99a4f..366dfc36 100644 --- a/com32/hdt/hdt-cli-hdt.c +++ b/com32/hdt/hdt-cli-hdt.c @@ -332,6 +332,10 @@ struct cli_callback_descr list_hdt_show_modules[] = { .name = CLI_MEMORY, .exec = show_dmi_memory_modules, }, + { + .name = CLI_ACPI, + .exec = main_show_acpi, + }, { .name = "modes", .exec = main_show_modes, diff --git a/com32/hdt/hdt-cli.h b/com32/hdt/hdt-cli.h index fc7e0003..523f13c0 100644 --- a/com32/hdt/hdt-cli.h +++ b/com32/hdt/hdt-cli.h @@ -86,7 +86,7 @@ typedef enum { DISK_MODE, VPD_MODE, MEMORY_MODE, - ACPI_MODE, + ACPI_MODE } cli_mode_t; #define PROMPT_SIZE 32 @@ -210,4 +210,9 @@ void main_show_vesa(int argc, char **argv, struct s_hardware *hardware); // VPD STUFF void main_show_vpd(int argc __unused, char **argv __unused, struct s_hardware *hardware); + +// ACPI STUFF +void main_show_acpi(int argc __unused, char **argv __unused, + struct s_hardware *hardware); + #endif -- cgit v1.2.1