From d2041924cd63a7adec86f3d09a869dcd402e0d40 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Wed, 25 Oct 2000 23:36:01 +0000 Subject: [PATCH] Move the call to extend_heap() from main to start so that if our BSS expands beyond the limit we will extend the address space before trying to zero the BSS. This should give us plenty of headroom for modest expansion of the loader. --- sys/boot/alpha/common/main.c | 5 ++--- sys/boot/alpha/libalpha/start.S | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/boot/alpha/common/main.c b/sys/boot/alpha/common/main.c index 778ce82ba44..8b5fcffac18 100644 --- a/sys/boot/alpha/common/main.c +++ b/sys/boot/alpha/common/main.c @@ -66,8 +66,8 @@ memsize() /* #define XTRA_PAGES 32 */ #define XTRA_PAGES 64 -static void -extend_heap() +void +extend_heap(void) { struct rpb *hwrpb = (struct rpb *)HWRPB_ADDR; struct mddt *mddtp; @@ -119,7 +119,6 @@ main(void) * alloc() is usable. The stack is buried inside us, so this is * safe. */ - extend_heap(); setheap((void *)end, (void *)(0x20040000 + XTRA_PAGES * 8192)); #ifdef LOADER diff --git a/sys/boot/alpha/libalpha/start.S b/sys/boot/alpha/libalpha/start.S index 1830baf82e4..6cf30a32aa5 100644 --- a/sys/boot/alpha/libalpha/start.S +++ b/sys/boot/alpha/libalpha/start.S @@ -52,6 +52,10 @@ NESTED(start, 1, ENTRY_FRAME, ra, 0, 0) Lstartgp: LDGP(pv) +#ifndef BOOT1 + CALL(extend_heap) +#endif + lda a0,_edata lda a1,_end subq a1,a0,a1