patch-2.4.19 linux-2.4.19/arch/ppc/boot/common/ofcommon.c

Next file: linux-2.4.19/arch/ppc/boot/common/relocate.S
Previous file: linux-2.4.19/arch/ppc/boot/common/ns16550.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/arch/ppc/boot/common/ofcommon.c linux-2.4.19/arch/ppc/boot/common/ofcommon.c
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.ofcommon.c 1.1 07/27/01 20:24:18 trini
+ * BK Id: SCCS/s.ofcommon.c 1.2 01/11/02 10:46:07 trini
  *
  * Copyright (C) Paul Mackerras 1997.
  *
@@ -14,6 +14,9 @@
 #include <asm/bootinfo.h>
 #include <asm/page.h>
 
+/* Information from the linker */
+extern char __sysmap_begin, __sysmap_end;
+
 extern int strcmp(const char *s1, const char *s2);
 extern char *avail_ram, *avail_high;
 extern char *end_avail;
@@ -126,15 +129,22 @@
     inflateEnd(&s);
 }
 
-/* Make a bi_rec in OF.  We need to be passed a name for BI_BOOTLOADER_ID, 
+/* Make a bi_rec in OF.  We need to be passed a name for BI_BOOTLOADER_ID,
  * a machine type for BI_MACHTYPE, and the location where the end of the
  * bootloader is (PROG_START + PROG_SIZE)
  */
 void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
 		unsigned long progend)
 {
+	unsigned long sysmap_size;
 	struct bi_record *rec;
 
+	/* FIgure out the size of a possible System.map we're going to
+	 * pass along.
+	 * */
+	sysmap_size = (unsigned long)(&__sysmap_end) -
+		(unsigned long)(&__sysmap_begin);
+
 	/* leave a 1MB gap then align to the next 1MB boundary */
 	addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
 	/* oldworld machine seem very unhappy about this. -- Tom */
@@ -150,21 +160,22 @@
 	sprintf( (char *)rec->data, name);
 	rec->size = sizeof(struct bi_record) + strlen(name) + 1;
 	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-	    
+
 	rec->tag = BI_MACHTYPE;
 	rec->data[0] = mach;
 	rec->data[1] = 1;
 	rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
 	rec = (struct bi_record *)((unsigned long)rec + rec->size);
 
-#ifdef SYSMAP_OFFSET
-	rec->tag = BI_SYSMAP;
-	rec->data[0] = SYSMAP_OFFSET;
-	rec->data[1] = SYSMAP_SIZE;
-	rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
-	rec = (struct bi_record *)((unsigned long)rec + rec->size);
-#endif /* SYSMAP_OFFSET */
-	
+	if (sysmap_size) {
+		rec->tag = BI_SYSMAP;
+		rec->data[0] = (unsigned long)(&__sysmap_begin);
+		rec->data[1] = sysmap_size;
+		rec->size = sizeof(struct bi_record) + 2 *
+			sizeof(unsigned long);
+		rec = (struct bi_record *)((unsigned long)rec + rec->size);
+	}
+
 	rec->tag = BI_LAST;
 	rec->size = sizeof(struct bi_record);
 	rec = (struct bi_record *)((unsigned long)rec + rec->size);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)