Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amiga/stand/bootblock/boot Make the -p option work, ...
details: https://anonhg.NetBSD.org/src/rev/85832dc8c8b9
branches: trunk
changeset: 342670:85832dc8c8b9
user: phx <phx%NetBSD.org@localhost>
date: Mon Jan 04 14:10:15 2016 +0000
description:
Make the -p option work, like with loadbsd.
Otherwise the kernel could load into a low-priority 512MB Z3 RAM segment.
diffstat:
sys/arch/amiga/stand/bootblock/boot/amigatypes.h | 4 ++--
sys/arch/amiga/stand/bootblock/boot/main.c | 11 ++++++++---
2 files changed, 10 insertions(+), 5 deletions(-)
diffs (67 lines):
diff -r ec583ca392e2 -r 85832dc8c8b9 sys/arch/amiga/stand/bootblock/boot/amigatypes.h
--- a/sys/arch/amiga/stand/bootblock/boot/amigatypes.h Mon Jan 04 13:57:15 2016 +0000
+++ b/sys/arch/amiga/stand/bootblock/boot/amigatypes.h Mon Jan 04 14:10:15 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amigatypes.h,v 1.7 2008/04/28 20:23:13 martin Exp $ */
+/* $NetBSD: amigatypes.h,v 1.8 2016/01/04 14:10:15 phx Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
struct MemHead {
struct MemHead *next;
u_int8_t Dmy1[ 9- 4];
- u_int8_t Pri;
+ int8_t Pri;
u_int8_t Dmy2[ 14- 10];
u_int16_t Attribs;
u_int32_t First, Lower, Upper, Free;
diff -r ec583ca392e2 -r 85832dc8c8b9 sys/arch/amiga/stand/bootblock/boot/main.c
--- a/sys/arch/amiga/stand/bootblock/boot/main.c Mon Jan 04 13:57:15 2016 +0000
+++ b/sys/arch/amiga/stand/bootblock/boot/main.c Mon Jan 04 14:10:15 2016 +0000
@@ -1,5 +1,5 @@
/*
- * $NetBSD: main.c,v 1.29 2014/03/29 12:49:15 mlelstv Exp $
+ * $NetBSD: main.c,v 1.30 2016/01/04 14:10:15 phx Exp $
*
*
* Copyright (c) 1996,1999 Ignatios Souvatzis
@@ -122,6 +122,7 @@
struct MemHead *mh;
u_int32_t from, size, vfrom, vsize;
int contflag, mapped1to1;
+ int8_t mempri;
int ncd, nseg;
char c;
@@ -200,7 +201,7 @@
(get_number(&path) & 3) << 1;
break;
case 'p': /* Select fastmem by priority */
- p_flag++;
+ p_flag = 1;
break;
case 'q':
boothowto |= AB_QUIET;
@@ -274,6 +275,7 @@
vfrom = mh->Lower & -__PGSZ;
vsize = (mh->Upper & -__PGSZ) - vfrom;
contflag = mapped1to1 = 0;
+ mempri = -128;
do {
size = vsize;
@@ -318,9 +320,12 @@
size += from;
cmemsz = size;
from = 0;
- } else if ((fmemsz < size) && mapped1to1) {
+ } else if (mapped1to1 && ((!p_flag && fmemsz < size) ||
+ (p_flag && (mempri < mh->Pri ||
+ (mempri == mh->Pri && fmemsz < size))))) {
fmem = from;
fmemsz = size;
+ mempri = mh->Pri;
}
memseg[nseg].ms_start = from;
Home |
Main Index |
Thread Index |
Old Index