Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Apr 2013 19:26:48 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 227393 for review
Message-ID:  <201304041926.r34JQmpU085678@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@227393?ac=10

Change 227393 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/04/04 19:25:54

	Initialise the /boot/loader heap (allowing FICL to be less
	FICL), and implement the architecture-specific switch used
	by the loader->kernel metadata code.  One remaining function
	to implement here, however.

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/Makefile#2 edit
.. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/loader/Makefile#4 edit
.. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/loader/arch.c#1 add
.. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/loader/linker.cfg#3 edit
.. //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/loader/main.c#3 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/sys/boot/mips/Makefile#2 (text+ko) ====

@@ -1,3 +1,5 @@
 # $FreeBSD$
 
+SUBDIR=	beri
+
 .include <bsd.subdir.mk>

==== //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/loader/Makefile#4 (text+ko) ====

@@ -8,7 +8,7 @@
 INSTALLFLAGS=	-b
 
 # Architecture-specific loader code
-SRCS=		start.S main.c exec.c metadata.c vers.c
+SRCS=		start.S main.c exec.c metadata.c vers.c arch.c
 SRCS+=		beri_console.c altera_jtag_uart.c beri_disk.c cfi.c
 
 LOADER_DISK_SUPPORT?=	yes

==== //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/loader/linker.cfg#3 (text+ko) ====

@@ -49,6 +49,12 @@
 __loader_base__ = 0x20000;
 __loader_base_vaddr__ = __mips64_xkphys_cached__ + __loader_base__;
 
+/*
+ * Highest address the loader is allowed to use below the kernel.
+ */
+__loader_end__ = 0x100000;
+__loader_end_vaddr__ = __mips64_xkphys_cached__ + __loader_end__;
+
 OUTPUT_FORMAT("elf64-tradbigmips");
 OUTPUT_ARCH(mips)
 ENTRY(start)
@@ -73,4 +79,8 @@
 	__boot_loader_len__ = . - __loader_base_vaddr__;
 	__bss_start = ADDR(.bss);
 	__bss_end = ALIGN(__bss_start + SIZEOF(.bss), 0x8);
+
+	__heap_base = .;
+	__heap_top = __loader_end_vaddr__;
+	__heap_len = __heap_top - __heap_base;
 }

==== //depot/projects/ctsrd/beribsd/src/sys/boot/mips/beri/loader/main.c#3 (text+ko) ====

@@ -67,6 +67,9 @@
 	NULL
 };
 
+extern void	*__heap_base;
+extern void	*__heap_top;
+
 static int
 __elfN(exec)(struct preloaded_file *fp)
 {
@@ -92,6 +95,8 @@
 	boot2_envv = envv;
 	boot2_bootinfop = bootinfop;
 
+	setheap((void *)&__heap_base, (void *)&__heap_top);
+
 	/*
 	 * Probe for a console.
 	 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304041926.r34JQmpU085678>