Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-2-0]: src/sys/arch/acorn32/stand/lib Pull up revision 1.3 (reques...
details: https://anonhg.NetBSD.org/src/rev/7ff8e1f5feff
branches: netbsd-2-0
changeset: 561434:7ff8e1f5feff
user: tron <tron%NetBSD.org@localhost>
date: Thu Jun 17 08:39:10 2004 +0000
description:
Pull up revision 1.3 (requested by abs in ticket #497):
Add BOOT_LEAVE_MEMORY (desired memory left unused) and BOOT_MIN_AVAIL_MEMORY
(minimum desired free memory), default them to 5M and 10M respectively.
On a machine with more than (BOOT_LEAVE_MEMORY + BOOT_MIN_AVAIL_MEMORY) free
BOOT_LEAVE_MEMORY will be left unused.
Allows a kernel to be booted from SparkFS on a machine with more than 15M
of free memory (SparkFS needs to be able to allocate memory for the
uncompressed kernel)
diffstat:
sys/arch/acorn32/stand/lib/srt0.S | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diffs (44 lines):
diff -r 54f565885317 -r 7ff8e1f5feff sys/arch/acorn32/stand/lib/srt0.S
--- a/sys/arch/acorn32/stand/lib/srt0.S Thu Jun 17 08:37:46 2004 +0000
+++ b/sys/arch/acorn32/stand/lib/srt0.S Thu Jun 17 08:39:10 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: srt0.S,v 1.1.6.1 2004/05/22 17:00:30 he Exp $ */
+/* $NetBSD: srt0.S,v 1.1.6.2 2004/06/17 08:39:10 tron Exp $ */
/*-
* Copyright (c) 2001 Ben Harris
@@ -33,6 +33,23 @@
* (see srt1.c)
*/
+/* Minimum desired free memory */
+
+#ifndef BOOT_MIN_AVAIL_MEMORY
+#define BOOT_MIN_AVAIL_MEMORY 10 * 1024 * 1024
+#endif
+
+/* If enough above BOOT_MIN_AVAIL_MEMORY, leave BOOT_LEAVE_MEMORY unused */
+/* Avoids sparkfs failing on memory if we try to read a kernel from it */
+
+#ifndef BOOT_LEAVE_MEMORY
+#define BOOT_LEAVE_MEMORY 5 * 1024 * 1024
+#endif
+
+/*
+ * Both BOOT_LEAVE_MEMORY and BOOT_MIN_AVAIL_MEMORY + BOOT_LEAVE_MEMORY
+ * must fit into an immediate ATM constant - 8 bits with arbitrary rotation
+ */
#include <machine/asm.h>
#include <riscoscalls.h>
@@ -43,6 +60,10 @@
mvn r1, #0
swi Wimp_SlotSize
add r0, r0, r2
+#if (BOOT_LEAVE_MEMORY > 0)
+ cmp r0, #BOOT_MIN_AVAIL_MEMORY + BOOT_LEAVE_MEMORY
+ subhi r0, r0, #BOOT_LEAVE_MEMORY
+#endif
mvn r1, #0
swi Wimp_SlotSize
#endif
Home |
Main Index |
Thread Index |
Old Index