diff mbox

[02/14] Remove birecs code

Message ID 20100709050341.537772607@samba.org
State Not Applicable
Headers show

Commit Message

Anton Blanchard July 9, 2010, 5:03 a.m. UTC
The birecs code is deprecated and writes garbage into kernel images.
I had a painful time rediscovering this bug in mainline :) Remove it.

Signed-off-by: Anton Blanchard <anton@samba.org>
---
diff mbox

Patch

Index: yaboot/second/yaboot.c
===================================================================
--- yaboot.orig/second/yaboot.c	2010-07-08 14:04:39.000000000 +1000
+++ yaboot/second/yaboot.c	2010-07-08 14:05:55.000000000 +1000
@@ -1021,7 +1021,6 @@  yaboot_text_ui(void)
      void		*initrd_base;
      unsigned long	initrd_size;
      kernel_entry_t      kernel_entry;
-     struct bi_record*	birec;
      char*               loc=NULL;
      loadinfo_t          loadinfo;
      void                *initrd_more,*initrd_want;
@@ -1162,43 +1161,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);
-
-	       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;