Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/acorn32/stand Claim maximum available memory during...



details:   https://anonhg.NetBSD.org/src/rev/2d3fb2fc39c1
branches:  trunk
changeset: 566737:2d3fb2fc39c1
user:      gavan <gavan%NetBSD.org@localhost>
date:      Tue May 18 23:29:30 2004 +0000

description:
Claim maximum available memory during boot32 startup. This removes
the need to explicitly set the WIMP slot size before running the bootloader.

Conditional on BOOT_MAXIMISE_MEMORY, so as not to interfere with potential
future uses of libriscos.

Also remove references to increasing WIMP slot size, as this is now
meaningless.

diffstat:

 sys/arch/acorn32/stand/boot32/Makefile   |   4 +++-
 sys/arch/acorn32/stand/boot32/boot32.c   |  10 +++++-----
 sys/arch/acorn32/stand/lib/riscoscalls.h |   5 ++++-
 sys/arch/acorn32/stand/lib/srt0.S        |  12 ++++++++++--
 4 files changed, 22 insertions(+), 9 deletions(-)

diffs (106 lines):

diff -r 9d3ff37e4519 -r 2d3fb2fc39c1 sys/arch/acorn32/stand/boot32/Makefile
--- a/sys/arch/acorn32/stand/boot32/Makefile    Tue May 18 22:14:35 2004 +0000
+++ b/sys/arch/acorn32/stand/boot32/Makefile    Tue May 18 23:29:30 2004 +0000
@@ -1,10 +1,12 @@
-#      $NetBSD: Makefile,v 1.2 2003/10/26 07:25:35 lukem Exp $
+#      $NetBSD: Makefile,v 1.3 2004/05/18 23:29:30 gavan Exp $
 
 PROG=          boot32
 PROGSOURCE=    rmheader.S rmvers.c srt0.S boot32.c start.S
 NEWVERSWHAT=   "RISC OS Boot"
 RISCOSTYPE=    ffa
 
+CPPFLAGS+=     -DBOOT_MAXIMISE_MEMORY
+
 rmvers.c: ${.CURDIR}/version
        ${HOST_SH} ${.CURDIR}/../lib/newvers_rm.sh ${.CURDIR}/version "NetBSD Boot"
 .PHONY: rmvers.c
diff -r 9d3ff37e4519 -r 2d3fb2fc39c1 sys/arch/acorn32/stand/boot32/boot32.c
--- a/sys/arch/acorn32/stand/boot32/boot32.c    Tue May 18 22:14:35 2004 +0000
+++ b/sys/arch/acorn32/stand/boot32/boot32.c    Tue May 18 23:29:30 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot32.c,v 1.16 2003/07/20 07:08:45 reinoud Exp $      */
+/*     $NetBSD: boot32.c,v 1.17 2004/05/18 23:29:30 gavan Exp $        */
 
 /*-
  * Copyright (c) 2002 Reinoud Zandijk
@@ -162,7 +162,7 @@
        /* reserve some space for heap etc... 512 might be bigish though */
        memory_image_size = (int) HIMEM - 512*1024;
        if (memory_image_size <= 256*1024)
-               panic("I need more memory to boot up; increase Wimp slot");
+               panic("Insufficient memory");
 
        memory_image = alloc(memory_image_size);
        if (!memory_image)
@@ -540,9 +540,9 @@
        };
        printf("\n\n");
        if (first_mapped_PODRAM_page_index < 0) {
-               if (PODRAM_addr[0]) panic("Found no (S)DRAM mapped in the bootloader ... increase Wimpslot!");
+               if (PODRAM_addr[0]) panic("Found no (S)DRAM mapped in the bootloader");
        };
-       if (first_mapped_DRAM_page_index < 0) panic("No DRAM  mapped in the bootloader ... increase Wimpslot!");
+       if (first_mapped_DRAM_page_index < 0) panic("No DRAM mapped in the bootloader");
 }
 
 
@@ -875,7 +875,7 @@
 
        /* get a page for a fragment */
        page = free_relocation_page;
-       if (free_relocation_page->pagenumber < 0) panic("\n\nOut of pages; increase Wimpslot and try again");
+       if (free_relocation_page->pagenumber < 0) panic("\n\nOut of pages");
        reloc_entries++;
        if (reloc_entries >= MAX_RELOCPAGES) panic("\n\nToo many relocations! What are you loading ??");
 
diff -r 9d3ff37e4519 -r 2d3fb2fc39c1 sys/arch/acorn32/stand/lib/riscoscalls.h
--- a/sys/arch/acorn32/stand/lib/riscoscalls.h  Tue May 18 22:14:35 2004 +0000
+++ b/sys/arch/acorn32/stand/lib/riscoscalls.h  Tue May 18 23:29:30 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: riscoscalls.h,v 1.2 2003/11/23 15:24:20 bjh21 Exp $    */
+/*     $NetBSD: riscoscalls.h,v 1.3 2004/05/18 23:29:30 gavan Exp $    */
 
 /*-
  * Copyright (c) 2001 Ben Harris
@@ -82,6 +82,9 @@
 #define Cache_Control          0x000280
 #define XCache_Control         0x020280
 
+#define Wimp_SlotSize          0x0400ec
+#define XWimp_SlotSize         0x0600ec
+
 #ifndef __ASSEMBLER__
 typedef struct os_error {
        u_int32_t errnum;
diff -r 9d3ff37e4519 -r 2d3fb2fc39c1 sys/arch/acorn32/stand/lib/srt0.S
--- a/sys/arch/acorn32/stand/lib/srt0.S Tue May 18 22:14:35 2004 +0000
+++ b/sys/arch/acorn32/stand/lib/srt0.S Tue May 18 23:29:30 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: srt0.S,v 1.1 2002/12/28 23:57:39 reinoud Exp $ */
+/*     $NetBSD: srt0.S,v 1.2 2004/05/18 23:29:30 gavan Exp $   */
 
 /*-
  * Copyright (c) 2001 Ben Harris
@@ -38,12 +38,20 @@
 #include <riscoscalls.h>
 
 ENTRY(_start)
+#ifdef BOOT_MAXIMISE_MEMORY
+       mvn     r0, #0
+       mvn     r1, #0
+       swi     Wimp_SlotSize
+       add     r0, r0, r2
+       mvn     r1, #0
+       swi     Wimp_SlotSize
+#endif
        swi     OS_GetEnv
        ldr     r6, Lhimem
        str     r1, [r6]
        mov     sp, r1
        mov     fp, #0
-       bl      __start
+       b       __start
 
 Lhimem:
        .word   HIMEM



Home | Main Index | Thread Index | Old Index