Smaller fixes to allow using -Wall (trivial).
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@3181 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
6a441bfb46
commit
35845a2acb
|
@ -25,7 +25,7 @@ INCLUDES += -I$(shell $(CC) $(CROSS_CFLAGS) -print-search-dirs | head -n 1 | cut
|
||||||
|
|
||||||
LIBPAYLOAD = ../libpayload/libpayload.a
|
LIBPAYLOAD = ../libpayload/libpayload.a
|
||||||
LIBGCC := $(shell $(CC) $(CROSS_CFLAGS) -print-libgcc-file-name)
|
LIBGCC := $(shell $(CC) $(CROSS_CFLAGS) -print-libgcc-file-name)
|
||||||
CFLAGS := -Werror -Os -fno-stack-protector -nostdinc $(INCLUDES)
|
CFLAGS := -Wall -Werror -Os -fno-stack-protector -nostdinc $(INCLUDES)
|
||||||
|
|
||||||
MODULES = cpuinfo_module.o cpuid.o pci_module.o coreboot_module.o
|
MODULES = cpuinfo_module.o cpuid.o pci_module.o coreboot_module.o
|
||||||
OBJECTS = coreinfo.o
|
OBJECTS = coreinfo.o
|
||||||
|
|
|
@ -114,6 +114,8 @@ int coreboot_module_redraw(WINDOW *win)
|
||||||
UNPACK_CB64(cb_info.range[i].start) +
|
UNPACK_CB64(cb_info.range[i].start) +
|
||||||
UNPACK_CB64(cb_info.range[i].size) - 1);
|
UNPACK_CB64(cb_info.range[i].size) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parse_memory(unsigned char *ptr)
|
static void parse_memory(unsigned char *ptr)
|
||||||
|
@ -139,8 +141,8 @@ static void parse_mainboard(unsigned char *ptr)
|
||||||
{
|
{
|
||||||
struct cb_mainboard *mb = (struct cb_mainboard *)ptr;
|
struct cb_mainboard *mb = (struct cb_mainboard *)ptr;
|
||||||
|
|
||||||
strncpy(cb_info.vendor, MB_VENDOR_STRING(mb), 31);
|
strncpy(cb_info.vendor, (const char *)MB_VENDOR_STRING(mb), 31);
|
||||||
strncpy(cb_info.part, MB_PART_STRING(mb), 31);
|
strncpy(cb_info.part, (const char *)MB_PART_STRING(mb), 31);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parse_strings(unsigned char *ptr)
|
static void parse_strings(unsigned char *ptr)
|
||||||
|
@ -148,7 +150,7 @@ static void parse_strings(unsigned char *ptr)
|
||||||
struct cb_string *string = (struct cb_string *)ptr;
|
struct cb_string *string = (struct cb_string *)ptr;
|
||||||
int index = string->tag - CB_TAG_VERSION;
|
int index = string->tag - CB_TAG_VERSION;
|
||||||
|
|
||||||
strncpy(cb_info.strings[index], string->string, 63);
|
strncpy(cb_info.strings[index], (const char *)string->string, 63);
|
||||||
cb_info.strings[index][63] = 0;
|
cb_info.strings[index][63] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +175,7 @@ static int parse_header(void *addr, int len)
|
||||||
for (i = 0; i < len; i += 16, ptr += 16) {
|
for (i = 0; i < len; i += 16, ptr += 16) {
|
||||||
header = (struct cb_header *)ptr;
|
header = (struct cb_header *)ptr;
|
||||||
|
|
||||||
if (!strncmp(header->signature, "LBIO", 4))
|
if (!strncmp((const char *)header->signature, "LBIO", 4))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ void print_module_title(WINDOW *win, const char *title)
|
||||||
|
|
||||||
void print_menu(void)
|
void print_menu(void)
|
||||||
{
|
{
|
||||||
int i, j, len;
|
int i, j;
|
||||||
char menu[80];
|
char menu[80];
|
||||||
char *ptr = menu;
|
char *ptr = menu;
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ static void redraw_module(void)
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
int loop(void)
|
void loop(void)
|
||||||
{
|
{
|
||||||
int key;
|
int key;
|
||||||
|
|
||||||
|
@ -168,4 +168,6 @@ int main(void)
|
||||||
modules[i]->init();
|
modules[i]->init();
|
||||||
|
|
||||||
loop();
|
loop();
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,6 @@ static unsigned int cpu_khz;
|
||||||
|
|
||||||
void decode_flags(WINDOW *win, unsigned long reg, const char **flags, int *row)
|
void decode_flags(WINDOW *win, unsigned long reg, const char **flags, int *row)
|
||||||
{
|
{
|
||||||
int index = 0;
|
|
||||||
int i;
|
int i;
|
||||||
int lrow = *row;
|
int lrow = *row;
|
||||||
|
|
||||||
|
@ -117,7 +116,6 @@ void decode_flags(WINDOW *win, unsigned long reg, const char **flags, int *row)
|
||||||
static void get_features(WINDOW *win, int *row)
|
static void get_features(WINDOW *win, int *row)
|
||||||
{
|
{
|
||||||
unsigned long eax, ebx, ecx, edx;
|
unsigned long eax, ebx, ecx, edx;
|
||||||
int index = 0;
|
|
||||||
int lrow = *row;
|
int lrow = *row;
|
||||||
|
|
||||||
wmove(win, lrow++, 1);
|
wmove(win, lrow++, 1);
|
||||||
|
@ -152,7 +150,7 @@ static void get_features(WINDOW *win, int *row)
|
||||||
|
|
||||||
static void do_name(WINDOW *win, int row)
|
static void do_name(WINDOW *win, int row)
|
||||||
{
|
{
|
||||||
char str[80], name[49], *p;
|
char name[49], *p;
|
||||||
unsigned long eax, ebx, ecx, edx;
|
unsigned long eax, ebx, ecx, edx;
|
||||||
int i, t;
|
int i, t;
|
||||||
|
|
||||||
|
@ -177,11 +175,11 @@ static void do_name(WINDOW *win, int row)
|
||||||
mvwprintw(win, row, 1, "Processor: %s", name);
|
mvwprintw(win, row, 1, "Processor: %s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
int cpuinfo_module_redraw(WINDOW * win)
|
int cpuinfo_module_redraw(WINDOW *win)
|
||||||
{
|
{
|
||||||
unsigned long eax, ebx, ecx, edx;
|
unsigned long eax, ebx, ecx, edx;
|
||||||
unsigned int brand;
|
unsigned int brand;
|
||||||
char str[80], *vstr;
|
char *vstr;
|
||||||
int row = 2;
|
int row = 2;
|
||||||
|
|
||||||
print_module_title(win, "CPU Information");
|
print_module_title(win, "CPU Information");
|
||||||
|
@ -210,6 +208,10 @@ int cpuinfo_module_redraw(WINDOW * win)
|
||||||
break;
|
break;
|
||||||
case VENDOR_SIS:
|
case VENDOR_SIS:
|
||||||
vstr = "SiS";
|
vstr = "SiS";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
vstr = "Unknown";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mvwprintw(win, row++, 1, "Vendor: %s", vstr);
|
mvwprintw(win, row++, 1, "Vendor: %s", vstr);
|
||||||
|
@ -238,6 +240,8 @@ int cpuinfo_module_redraw(WINDOW * win)
|
||||||
|
|
||||||
row++;
|
row++;
|
||||||
get_features(win, &row);
|
get_features(win, &row);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int getticks(void)
|
unsigned int getticks(void)
|
||||||
|
@ -255,6 +259,7 @@ unsigned int getticks(void)
|
||||||
int cpuinfo_module_init(void)
|
int cpuinfo_module_init(void)
|
||||||
{
|
{
|
||||||
cpu_khz = getticks();
|
cpu_khz = getticks();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct coreinfo_module cpuinfo_module = {
|
struct coreinfo_module cpuinfo_module = {
|
||||||
|
|
|
@ -106,7 +106,7 @@ static void pci_read_byte(unsigned int bus, unsigned int devfn,
|
||||||
*val = inb(0xcfc + (reg & 3));
|
*val = inb(0xcfc + (reg & 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int show_config_space(WINDOW *win, int row, int col, int index)
|
static void show_config_space(WINDOW *win, int row, int col, int index)
|
||||||
{
|
{
|
||||||
unsigned char cspace[64];
|
unsigned char cspace[64];
|
||||||
int bus, devfn;
|
int bus, devfn;
|
||||||
|
@ -116,7 +116,7 @@ static int show_config_space(WINDOW *win, int row, int col, int index)
|
||||||
devfn = devices[index].device & 0xff;
|
devfn = devices[index].device & 0xff;
|
||||||
|
|
||||||
for (i = 0; i < 64; i += 4)
|
for (i = 0; i < 64; i += 4)
|
||||||
pci_read_dword(bus, devfn, i, ((int *)&cspace[i]));
|
pci_read_dword(bus, devfn, i, ((unsigned int *)&cspace[i]));
|
||||||
|
|
||||||
for (y = 0; y < 4; y++) {
|
for (y = 0; y < 4; y++) {
|
||||||
for (x = 0; x < 16; x++)
|
for (x = 0; x < 16; x++)
|
||||||
|
@ -272,11 +272,7 @@ int pci_module_handle(int key)
|
||||||
|
|
||||||
int pci_module_init(void)
|
int pci_module_init(void)
|
||||||
{
|
{
|
||||||
unsigned int val;
|
|
||||||
int bus = 0;
|
|
||||||
|
|
||||||
pci_scan_bus(0);
|
pci_scan_bus(0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue