From: Tony Breeds Date: Fri, 2 Oct 2009 05:55:33 +0000 (+1000) Subject: Remove Bootinfo (BIRECS). X-Git-Tag: yaboot-1.3.15~1 X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=commitdiff_plain;h=fac08a190a9d932020b6f9275783aba2bd0902c4 Remove Bootinfo (BIRECS). The are not used and can scribble on kernel memory. Signed-off-by: Tony Breeds --- diff --git a/include/bootinfo.h b/include/bootinfo.h index 7602e48..3a02c90 100644 --- a/include/bootinfo.h +++ b/include/bootinfo.h @@ -36,20 +36,6 @@ #define _MACH_walnut 0x00001000 /* IBM "Walnut" 405GP eval. board */ #define _MACH_bplan 0x00002000 /* Pegasos/Efika, broken partition #s */ -struct bi_record { - unsigned long tag; /* tag ID */ - unsigned long size; /* size of record (in bytes) */ - unsigned long data[0]; /* data */ -}; - -#define BI_FIRST 0x1010 /* first record - marker */ -#define BI_LAST 0x1011 /* last record - marker */ -#define BI_CMD_LINE 0x1012 -#define BI_BOOTLOADER_ID 0x1013 -#define BI_INITRD 0x1014 -#define BI_SYSMAP 0x1015 -#define BI_MACHTYPE 0x1016 - #endif /* _PPC_BOOTINFO_H */ extern int _machine; diff --git a/second/yaboot.c b/second/yaboot.c index 3db7b4f..e91b6c7 100644 --- a/second/yaboot.c +++ b/second/yaboot.c @@ -1047,7 +1047,6 @@ yaboot_text_ui(void) void *sysmap_base; unsigned long sysmap_size; kernel_entry_t kernel_entry; - struct bi_record* birec; char* loc=NULL; loadinfo_t loadinfo; void *initrd_more,*initrd_want; @@ -1239,50 +1238,6 @@ yaboot_text_ui(void) flush_icache_range ((long)loadinfo.base, (long)loadinfo.base+loadinfo.memsize); DEBUG_F(" done\n"); - if (flat_vmlinux) { - /* - * Fill new boot infos (only if booting a vmlinux). - * - * The birec is low on memory, probably inside the malloc pool, - * so we don't write it earlier. At this point, we should not - * use anything coming from the malloc pool. - */ - birec = (struct bi_record *)_ALIGN(loadinfo.filesize+(1<<20)-1,(1<<20)); - - /* We make sure it's mapped. We map only 64k for now, it's - * plenty enough we don't claim since this precise memory - * range may already be claimed by the malloc pool. - */ - prom_map (birec, birec, 0x10000); - DEBUG_F("birec at %p\n", birec); - DEBUG_SLEEP; - - birec->tag = BI_FIRST; - birec->size = sizeof(struct bi_record); - birec = (struct bi_record *)((ulong)birec + birec->size); - - birec->tag = BI_BOOTLOADER_ID; - sprintf( (char *)birec->data, "yaboot"); - birec->size = sizeof(struct bi_record) + strlen("yaboot") + 1; - birec = (struct bi_record *)((ulong)birec + birec->size); - - birec->tag = BI_MACHTYPE; - birec->data[0] = _machine; - birec->size = sizeof(struct bi_record) + sizeof(ulong); - birec = (struct bi_record *)((ulong)birec + birec->size); - - if (sysmap_base) { - birec->tag = BI_SYSMAP; - birec->data[0] = (ulong)sysmap_base; - birec->data[1] = sysmap_size; - birec->size = sizeof(struct bi_record) + sizeof(ulong)*2; - birec = (struct bi_record *)((ulong)birec + birec->size); - } - birec->tag = BI_LAST; - birec->size = sizeof(struct bi_record); - birec = (struct bi_record *)((ulong)birec + birec->size); - } - /* compute the kernel's entry point. */ kernel_entry = loadinfo.base + loadinfo.entry - loadinfo.load_loc; @@ -1520,8 +1475,7 @@ load_elf64(struct boot_file_t *file, loadinfo_t *loadinfo) goto bail; } - /* leave some room (1Mb) for boot infos */ - loadinfo->memsize = _ALIGN(loadinfo->memsize,(1<<20)) + 0x100000; + loadinfo->memsize = _ALIGN(loadinfo->memsize,(1<<20)); /* Claim OF memory */ DEBUG_F("Before prom_claim, mem_sz: 0x%08lx\n", loadinfo->memsize);