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.
This commit is contained in:
Doug Rabson 2000-10-25 23:36:01 +00:00
parent 75cdadceb4
commit d2041924cd
2 changed files with 6 additions and 3 deletions

View File

@ -66,8 +66,8 @@ memsize()
/* #define XTRA_PAGES 32 */ /* #define XTRA_PAGES 32 */
#define XTRA_PAGES 64 #define XTRA_PAGES 64
static void void
extend_heap() extend_heap(void)
{ {
struct rpb *hwrpb = (struct rpb *)HWRPB_ADDR; struct rpb *hwrpb = (struct rpb *)HWRPB_ADDR;
struct mddt *mddtp; struct mddt *mddtp;
@ -119,7 +119,6 @@ main(void)
* alloc() is usable. The stack is buried inside us, so this is * alloc() is usable. The stack is buried inside us, so this is
* safe. * safe.
*/ */
extend_heap();
setheap((void *)end, (void *)(0x20040000 + XTRA_PAGES * 8192)); setheap((void *)end, (void *)(0x20040000 + XTRA_PAGES * 8192));
#ifdef LOADER #ifdef LOADER

View File

@ -52,6 +52,10 @@ NESTED(start, 1, ENTRY_FRAME, ra, 0, 0)
Lstartgp: Lstartgp:
LDGP(pv) LDGP(pv)
#ifndef BOOT1
CALL(extend_heap)
#endif
lda a0,_edata lda a0,_edata
lda a1,_end lda a1,_end
subq a1,a0,a1 subq a1,a0,a1