Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/algor Add MEMSIZE and ETHADDR options, so that they...
details: https://anonhg.NetBSD.org/src/rev/424f10897e5d
branches: trunk
changeset: 511217:424f10897e5d
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu Jun 14 16:14:37 2001 +0000
description:
Add MEMSIZE and ETHADDR options, so that they can be set in
the kernel config file, in case you have a buggy PMON which
doesn't provide the environment variables to the kernel.
diffstat:
sys/arch/algor/algor/machdep.c | 30 ++++++++++++++++++++++--------
sys/arch/algor/conf/files.algor | 6 +++++-
2 files changed, 27 insertions(+), 9 deletions(-)
diffs (83 lines):
diff -r dfabef63ff3c -r 424f10897e5d sys/arch/algor/algor/machdep.c
--- a/sys/arch/algor/algor/machdep.c Thu Jun 14 15:54:18 2001 +0000
+++ b/sys/arch/algor/algor/machdep.c Thu Jun 14 16:14:37 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.8 2001/06/14 15:29:23 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.9 2001/06/14 16:14:37 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -85,6 +85,9 @@
#include "opt_ddb.h"
#include "opt_kgdb.h"
+#include "opt_memsize.h"
+#include "opt_ethaddr.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -322,7 +325,12 @@
/*
* Get the Ethernet address of the on-board Ethernet.
*/
- if ((cp = pmon_getenv("ethaddr")) != NULL) {
+#if defined(ETHADDR)
+ cp = ETHADDR;
+#else
+ cp = pmon_getenv("ethaddr");
+#endif
+ if (cp != NULL) {
for (i = 0; i < ETHER_ADDR_LEN; i++) {
algor_ethaddr[i] = strtoul(cp, &cp0, 16);
cp = cp0 + 1;
@@ -385,17 +393,23 @@
* Note: Reserve the first page! That's where the trap
* vectors are located.
*/
- mem_clusters[mem_cluster_cnt].start = NBPG;
- if ((cp = pmon_getenv("memsize")) != NULL) {
+#if defined(MEMSIZE)
+ size = MEMSIZE * 1024 * 1024;
+#else
+ if ((cp = pmon_getenv("memsize")) != NULL)
size = strtoul(cp, NULL, 10) * 1024 * 1024;
- mem_clusters[mem_cluster_cnt].size =
- size - mem_clusters[mem_cluster_cnt].start;
- mem_cluster_cnt++;
- } else {
+ else {
printf("FATAL: `memsize' PMON variable not set. Set it to\n");
printf(" the amount of memory (in MB) and try again.\n");
+ printf(" Or, build a kernel with the `MEMSIZE' "
+ "option.\n");
panic("algor_init");
}
+#endif /* MEMSIZE */
+ mem_clusters[mem_cluster_cnt].start = NBPG;
+ mem_clusters[mem_cluster_cnt].size =
+ size - mem_clusters[mem_cluster_cnt].start;
+ mem_cluster_cnt++;
/*
* Copy the exception-dispatch code down to the exception vector.
diff -r dfabef63ff3c -r 424f10897e5d sys/arch/algor/conf/files.algor
--- a/sys/arch/algor/conf/files.algor Thu Jun 14 15:54:18 2001 +0000
+++ b/sys/arch/algor/conf/files.algor Thu Jun 14 16:14:37 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.algor,v 1.3 2001/06/10 08:45:09 thorpej Exp $
+# $NetBSD: files.algor,v 1.4 2001/06/14 16:14:37 thorpej Exp $
# Algorithmics evaluation board specific configuration info.
@@ -12,6 +12,10 @@
defopt ALGOR_P5064 # Algorithmics P-5064
defopt ALGOR_P6032 # Algorithmics P-6032
+# Various items that a buggy PMON might not provide us.
+defopt MEMSIZE
+defopt ETHADDR
+
# Platform support files
file arch/algor/algor/algor_p4032_bus_io.c algor_p4032
file arch/algor/algor/algor_p4032_bus_locio.c algor_p4032
Home |
Main Index |
Thread Index |
Old Index