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>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3191 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Uwe Hermann 2008-03-27 20:46:49 +00:00
parent 408c4e1784
commit a0c0093a09
4 changed files with 18 additions and 20 deletions

View File

@ -66,7 +66,7 @@ else
include $(src)/.config include $(src)/.config
all: $(TARGET) all: prepare $(TARGET)
$(TARGET): $(OBJS) $(TARGET): $(OBJS)
$(Q)printf " LD $(subst $(shell pwd)/,,$(@))\n" $(Q)printf " LD $(subst $(shell pwd)/,,$(@))\n"

View File

@ -47,30 +47,30 @@ int coreboot_module_redraw(WINDOW *win)
print_module_title(win, "Coreboot Tables"); print_module_title(win, "Coreboot Tables");
if (tables_good) { if (tables_good) {
mvwprintw(win, row++, 2, "No Coreboot tables were found"); mvwprintw(win, row++, 1, "No Coreboot tables were found");
return 0; return 0;
} }
mvwprintw(win, row++, 2, "Vendor: %s", cb_info.vendor); mvwprintw(win, row++, 1, "Vendor: %s", cb_info.vendor);
mvwprintw(win, row++, 2, "Part: %s", cb_info.part); 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_VERSION - 0x4],
cb_info.strings[CB_TAG_EXTRA_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_BUILD - 0x4],
cb_info.strings[CB_TAG_COMPILE_BY - 0x04], cb_info.strings[CB_TAG_COMPILE_BY - 0x04],
cb_info.strings[CB_TAG_COMPILE_HOST - 0x04], cb_info.strings[CB_TAG_COMPILE_HOST - 0x04],
cb_info.strings[CB_TAG_COMPILE_DOMAIN - 0x04]); cb_info.strings[CB_TAG_COMPILE_DOMAIN - 0x04]);
if (cb_info.serial.tag != 0x0) { 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); cb_info.serial.ioport);
} }
if (cb_info.console.tag != 0x0) { 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) { switch (cb_info.console.type) {
case CB_TAG_CONSOLE_SERIAL8250: case CB_TAG_CONSOLE_SERIAL8250:
@ -95,18 +95,18 @@ int coreboot_module_redraw(WINDOW *win)
} }
row++; row++;
mvwprintw(win, row++, 2, "-- Memory Map --"); mvwprintw(win, row++, 1, "-- Memory Map --");
for (i = 0; i < cb_info.mem_count; i++) { for (i = 0; i < cb_info.mem_count; i++) {
switch (cb_info.range[i].type) { switch (cb_info.range[i].type) {
case CB_MEM_RAM: case CB_MEM_RAM:
mvwprintw(win, row++, 4, " RAM: "); mvwprintw(win, row++, 3, " RAM: ");
break; break;
case CB_MEM_RESERVED: case CB_MEM_RESERVED:
mvwprintw(win, row++, 4, "Reserved: "); mvwprintw(win, row++, 3, "Reserved: ");
break; break;
case CB_MEM_TABLE: case CB_MEM_TABLE:
mvwprintw(win, row++, 4, " Table: "); mvwprintw(win, row++, 3, " Table: ");
} }
wprintw(win, "%16.16llx - %16.16llx", wprintw(win, "%16.16llx - %16.16llx",

View File

@ -26,12 +26,10 @@ extern struct coreinfo_module cpuinfo_module;
extern struct coreinfo_module pci_module; extern struct coreinfo_module pci_module;
extern struct coreinfo_module coreboot_module; extern struct coreinfo_module coreboot_module;
#define MODULE_COUNT 3 struct coreinfo_module *modules[] = {
struct coreinfo_module *modules[MODULE_COUNT] = {
&cpuinfo_module, &cpuinfo_module,
&pci_module, &pci_module,
&coreboot_module &coreboot_module,
}; };
static WINDOW *modwin; static WINDOW *modwin;
@ -61,7 +59,7 @@ static void print_menu(void)
for (j = 0; j < SCREEN_X; j++) for (j = 0; j < SCREEN_X; j++)
waddch(stdscr, ' '); 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); ptr += sprintf(ptr, "F%d: %s ", i + 1, modules[i]->name);
mvprintw(23, 0, menu); mvprintw(23, 0, menu);
@ -127,7 +125,7 @@ static void loop(void)
if (key >= KEY_F(1) && key <= KEY_F(9)) { if (key >= KEY_F(1) && key <= KEY_F(9)) {
unsigned char ch = key - KEY_F(1); unsigned char ch = key - KEY_F(1);
if (ch < MODULE_COUNT) { if (ch < ARRAY_SIZE(modules)) {
curwin = ch; curwin = ch;
redraw_module(); redraw_module();
continue; continue;
@ -167,7 +165,7 @@ int main(void)
refresh(); refresh();
for (i = 0; i < MODULE_COUNT; i++) for (i = 0; i < ARRAY_SIZE(modules); i++)
modules[i]->init(); modules[i]->init();
loop(); loop();

View File

@ -156,7 +156,7 @@ static int pci_module_redraw(WINDOW *win)
else else
wattrset(win, COLOR_PAIR(2)); 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, bus, devfn, func,
devices[item].id & 0xffff, devices[item].id & 0xffff,
(devices[item].id >> 16) & 0xffff); (devices[item].id >> 16) & 0xffff);