Author: uwe Date: 2008-03-27 21:46:49 +0100 (Thu, 27 Mar 2008) New Revision: 3191
Modified: trunk/payloads/coreinfo/Makefile trunk/payloads/coreinfo/coreboot_module.c trunk/payloads/coreinfo/coreinfo.c trunk/payloads/coreinfo/pci_module.c Log: Various tiny fixes (trivial):
- Show PCI IDs as 4-digit numbers always.
- Cosmetic changes to make UI look more consistent.
- Drop MODULE_COUNT #define and use ARRAY_SIZE() where needed.
- Small fix to improve build system (create build/ when not there).
Signed-off-by: Uwe Hermann uwe@hermann-uwe.de Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: trunk/payloads/coreinfo/Makefile =================================================================== --- trunk/payloads/coreinfo/Makefile 2008-03-27 19:11:44 UTC (rev 3190) +++ trunk/payloads/coreinfo/Makefile 2008-03-27 20:46:49 UTC (rev 3191) @@ -66,7 +66,7 @@
include $(src)/.config
-all: $(TARGET) +all: prepare $(TARGET)
$(TARGET): $(OBJS) $(Q)printf " LD $(subst $(shell pwd)/,,$(@))\n"
Modified: trunk/payloads/coreinfo/coreboot_module.c =================================================================== --- trunk/payloads/coreinfo/coreboot_module.c 2008-03-27 19:11:44 UTC (rev 3190) +++ trunk/payloads/coreinfo/coreboot_module.c 2008-03-27 20:46:49 UTC (rev 3191) @@ -47,30 +47,30 @@ print_module_title(win, "Coreboot Tables");
if (tables_good) { - mvwprintw(win, row++, 2, "No Coreboot tables were found"); + mvwprintw(win, row++, 1, "No Coreboot tables were found"); return 0; }
- mvwprintw(win, row++, 2, "Vendor: %s", cb_info.vendor); - mvwprintw(win, row++, 2, "Part: %s", cb_info.part); + mvwprintw(win, row++, 1, "Vendor: %s", cb_info.vendor); + mvwprintw(win, row++, 1, "Part: %s", cb_info.part);
- mvwprintw(win, row++, 2, "Version: %s%s", + mvwprintw(win, row++, 1, "Version: %s%s", cb_info.strings[CB_TAG_VERSION - 0x4], cb_info.strings[CB_TAG_EXTRA_VERSION - 0x4]);
- mvwprintw(win, row++, 2, "Built: %s (%s@%s.%s)", + mvwprintw(win, row++, 1, "Built: %s (%s@%s.%s)", cb_info.strings[CB_TAG_BUILD - 0x4], cb_info.strings[CB_TAG_COMPILE_BY - 0x04], cb_info.strings[CB_TAG_COMPILE_HOST - 0x04], cb_info.strings[CB_TAG_COMPILE_DOMAIN - 0x04]);
if (cb_info.serial.tag != 0x0) { - mvwprintw(win, row++, 2, "Serial Port I/O base: 0x%x", + mvwprintw(win, row++, 1, "Serial Port I/O base: 0x%x", cb_info.serial.ioport); }
if (cb_info.console.tag != 0x0) { - mvwprintw(win, row++, 2, "Default Output Console: "); + mvwprintw(win, row++, 1, "Default Output Console: ");
switch (cb_info.console.type) { case CB_TAG_CONSOLE_SERIAL8250: @@ -95,18 +95,18 @@ }
row++; - mvwprintw(win, row++, 2, "-- Memory Map --"); + mvwprintw(win, row++, 1, "-- Memory Map --");
for (i = 0; i < cb_info.mem_count; i++) { switch (cb_info.range[i].type) { case CB_MEM_RAM: - mvwprintw(win, row++, 4, " RAM: "); + mvwprintw(win, row++, 3, " RAM: "); break; case CB_MEM_RESERVED: - mvwprintw(win, row++, 4, "Reserved: "); + mvwprintw(win, row++, 3, "Reserved: "); break; case CB_MEM_TABLE: - mvwprintw(win, row++, 4, " Table: "); + mvwprintw(win, row++, 3, " Table: "); }
wprintw(win, "%16.16llx - %16.16llx",
Modified: trunk/payloads/coreinfo/coreinfo.c =================================================================== --- trunk/payloads/coreinfo/coreinfo.c 2008-03-27 19:11:44 UTC (rev 3190) +++ trunk/payloads/coreinfo/coreinfo.c 2008-03-27 20:46:49 UTC (rev 3191) @@ -26,12 +26,10 @@ extern struct coreinfo_module pci_module; extern struct coreinfo_module coreboot_module;
-#define MODULE_COUNT 3 - -struct coreinfo_module *modules[MODULE_COUNT] = { +struct coreinfo_module *modules[] = { &cpuinfo_module, &pci_module, - &coreboot_module + &coreboot_module, };
static WINDOW *modwin; @@ -61,7 +59,7 @@ for (j = 0; j < SCREEN_X; j++) waddch(stdscr, ' ');
- for (i = 0; i < MODULE_COUNT; i++) + for (i = 0; i < ARRAY_SIZE(modules); i++) ptr += sprintf(ptr, "F%d: %s ", i + 1, modules[i]->name);
mvprintw(23, 0, menu); @@ -127,7 +125,7 @@ if (key >= KEY_F(1) && key <= KEY_F(9)) { unsigned char ch = key - KEY_F(1);
- if (ch < MODULE_COUNT) { + if (ch < ARRAY_SIZE(modules)) { curwin = ch; redraw_module(); continue; @@ -167,7 +165,7 @@
refresh();
- for (i = 0; i < MODULE_COUNT; i++) + for (i = 0; i < ARRAY_SIZE(modules); i++) modules[i]->init();
loop();
Modified: trunk/payloads/coreinfo/pci_module.c =================================================================== --- trunk/payloads/coreinfo/pci_module.c 2008-03-27 19:11:44 UTC (rev 3190) +++ trunk/payloads/coreinfo/pci_module.c 2008-03-27 20:46:49 UTC (rev 3191) @@ -156,7 +156,7 @@ else wattrset(win, COLOR_PAIR(2));
- mvwprintw(win, 2 + i, 1, "%X:%2.2X.%2.2X %X:%X ", + mvwprintw(win, 2 + i, 1, "%X:%2.2X.%2.2X %04X:%04X ", bus, devfn, func, devices[item].id & 0xffff, (devices[item].id >> 16) & 0xffff);