mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
* fix typos in device_util.c
* drop double error in malloc.c * add extra CFLAGS to reduce code size by 10% * add more build time defines and use them in the LB table. The LB_TAG_COMPILE_TIME is a partly duplicate of LB_TAG_BUILD, as LB_TAG_BUILD contains both date and time. I left this in for compatibility reasons. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@268 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
bec074295e
commit
8a8f3f4836
4 changed files with 22 additions and 21 deletions
8
Makefile
8
Makefile
|
@ -38,7 +38,8 @@ MAKEFLAGS += --no-print-directory
|
|||
CC := gcc
|
||||
CFLAGS := -Os -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||
-Werror-implicit-function-declaration -Wstrict-aliasing \
|
||||
-fno-common -ffreestanding -fno-builtin
|
||||
-fno-common -ffreestanding -fno-builtin -fomit-frame-pointer \
|
||||
-mpreferred-stack-boundary=2 -mregparm=3 -pipe
|
||||
|
||||
HOSTCC := gcc
|
||||
HOSTCXX := g++
|
||||
|
@ -126,6 +127,11 @@ prepare2:
|
|||
$(Q)printf "#define LINUXBIOS_COMPILER \"$(shell LANG= $(CC) --version | head -n1)\"\n" >> $(obj)/build.h
|
||||
$(Q)printf "#define LINUXBIOS_ASSEMBLER \"$(shell LANG= $(AS) --version | head -n1)\"\n" >> $(obj)/build.h
|
||||
$(Q)printf "#define LINUXBIOS_LINKER \"$(shell LANG= $(LD) --version | head -n1)\"\n" >> $(obj)/build.h
|
||||
$(Q)printf "#define LINUXBIOS_COMPILE_TIME \"`LANG= date +%T`\"\n" >> $(obj)/build.h
|
||||
$(Q)printf "#define LINUXBIOS_COMPILE_BY \"$(shell whoami)\"\n" >> $(obj)/build.h
|
||||
$(Q)printf "#define LINUXBIOS_COMPILE_HOST \"$(shell hostname)\"\n" >> $(obj)/build.h
|
||||
$(Q)printf "#define LINUXBIOS_COMPILE_DOMAIN \"$(shell dnsdomainname)\"\n" >> $(obj)/build.h
|
||||
|
||||
|
||||
clean:
|
||||
$(Q)printf " CLEAN $(subst $(shell pwd)/,,$(obj))\n"
|
||||
|
|
|
@ -144,24 +144,20 @@ struct cmos_checksum *lb_cmos_checksum(struct lb_header *header)
|
|||
|
||||
void lb_strings(struct lb_header *header)
|
||||
{
|
||||
#warning "Fill in the strings in lb_strings -- needs Makefile changes"
|
||||
static const struct {
|
||||
u32 tag;
|
||||
const u8 *string;
|
||||
} strings[] = {
|
||||
{ LB_TAG_VERSION, (u8 *) "3 -- FIXME", },
|
||||
/*
|
||||
{ LB_TAG_VERSION, linuxbios_version, },
|
||||
{ LB_TAG_EXTRA_VERSION, linuxbios_extra_version, },
|
||||
{ LB_TAG_BUILD, linuxbios_build, },
|
||||
{ LB_TAG_COMPILE_TIME, linuxbios_compile_time, },
|
||||
{ LB_TAG_COMPILE_BY, linuxbios_compile_by, },
|
||||
{ LB_TAG_COMPILE_HOST, linuxbios_compile_host, },
|
||||
{ LB_TAG_COMPILE_DOMAIN, linuxbios_compile_domain, },
|
||||
{ LB_TAG_COMPILER, linuxbios_compiler, },
|
||||
{ LB_TAG_LINKER, linuxbios_linker, },
|
||||
{ LB_TAG_ASSEMBLER, linuxbios_assembler, },
|
||||
*/
|
||||
{ LB_TAG_VERSION, (const u8 *)LINUXBIOS_VERSION, },
|
||||
{ LB_TAG_EXTRA_VERSION, (const u8 *)LINUXBIOS_EXTRA_VERSION, },
|
||||
{ LB_TAG_BUILD, (const u8 *)LINUXBIOS_BUILD, },
|
||||
{ LB_TAG_COMPILE_TIME, (const u8 *)LINUXBIOS_COMPILE_TIME, }, // duplicate?
|
||||
{ LB_TAG_COMPILE_BY, (const u8 *)LINUXBIOS_COMPILE_BY, },
|
||||
{ LB_TAG_COMPILE_HOST, (const u8 *)LINUXBIOS_COMPILE_HOST, },
|
||||
{ LB_TAG_COMPILE_DOMAIN, (const u8 *)LINUXBIOS_COMPILE_DOMAIN, },
|
||||
{ LB_TAG_COMPILER, (const u8 *)LINUXBIOS_COMPILER, },
|
||||
{ LB_TAG_LINKER, (const u8 *)LINUXBIOS_LINKER, },
|
||||
{ LB_TAG_ASSEMBLER, (const u8 *)LINUXBIOS_ASSEMBLER, },
|
||||
};
|
||||
unsigned int i;
|
||||
for(i = 0; i < sizeof(strings)/sizeof(strings[0]); i++) {
|
||||
|
@ -244,7 +240,8 @@ static void lb_cleanup_memory_ranges(struct lb_memory *mem)
|
|||
entries = (mem->size - sizeof(*mem))/sizeof(mem->map[0]);
|
||||
printk(BIOS_INFO, "%s: # entries %d\n", __func__, entries);
|
||||
for(i = 0; i < entries; i++)
|
||||
printk(BIOS_INFO, " #%d: base 0x%x size 0x%x\n", i, (u32)mem->map[i].start.lo, mem->map[i].size.lo);
|
||||
printk(BIOS_INFO, " #%d: base 0x%x size 0x%x\n",
|
||||
i, (u32)mem->map[i].start.lo, mem->map[i].size.lo);
|
||||
|
||||
/* Sort the lb memory ranges */
|
||||
for(i = 0; i < entries; i++) {
|
||||
|
@ -375,8 +372,7 @@ static struct lb_memory *build_lb_mem(struct lb_header *head)
|
|||
mem_ranges = mem;
|
||||
|
||||
/* Build the raw table of memory */
|
||||
search_global_resources(
|
||||
IORESOURCE_MEM | IORESOURCE_CACHEABLE, IORESOURCE_MEM | IORESOURCE_CACHEABLE,
|
||||
search_global_resources( IORESOURCE_MEM | IORESOURCE_CACHEABLE, IORESOURCE_MEM | IORESOURCE_CACHEABLE,
|
||||
build_lb_mem_range, mem);
|
||||
lb_cleanup_memory_ranges(mem);
|
||||
return mem;
|
||||
|
|
|
@ -297,7 +297,7 @@ int path_eq(struct device_path *path1, struct device_path *path2)
|
|||
equal = (path1->u.cpu_bus.id == path2->u.cpu_bus.id);
|
||||
break;
|
||||
default:
|
||||
printk(BIOS_ERR, "Uknown device type: %d\n", path1->type);
|
||||
printk(BIOS_ERR, "Unknown device type: %d\n", path1->type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ int id_eq(struct device_id *path1, struct device_id *path2)
|
|||
equal = (path1->u.cpu_bus.vendor == path2->u.cpu_bus.vendor) && (path1->u.cpu_bus.device == path2->u.cpu_bus.device);
|
||||
break;
|
||||
default:
|
||||
printk(BIOS_ERR, "Uknown device type: %d\n", path1->type);
|
||||
printk(BIOS_ERR, "Unknown device type: %d\n", path1->type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@ void *malloc(size_t size)
|
|||
free_mem_ptr);
|
||||
|
||||
if (size > freebytes) {
|
||||
printk(BIOS_ERR, "OUT OF MEMORY for alloc of %d bytes\n", size);
|
||||
die("OUT OF MEMORY\n");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue