Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hpcmips rearrange struct platform@sysconf.h suitabl...
details: https://anonhg.NetBSD.org/src/rev/31993ef06493
branches: trunk
changeset: 515095:31993ef06493
user: uch <uch%NetBSD.org@localhost>
date: Sun Sep 16 15:45:42 2001 +0000
description:
rearrange struct platform@sysconf.h suitable for hpcmips.
overhaul hpcmips/hpcmips/. no actual changes.
diffstat:
sys/arch/hpcmips/hpcmips/autoconf.c | 45 +--
sys/arch/hpcmips/hpcmips/clock.c | 43 +++-
sys/arch/hpcmips/hpcmips/cpu.c | 39 +---
sys/arch/hpcmips/hpcmips/locore_machdep.S | 34 +-
sys/arch/hpcmips/hpcmips/machdep.c | 310 ++++++-----------------------
sys/arch/hpcmips/hpcmips/machdep.h | 8 +-
sys/arch/hpcmips/hpcmips/mainbus.c | 17 +-
sys/arch/hpcmips/include/autoconf.h | 5 +-
sys/arch/hpcmips/include/intr.h | 3 +-
sys/arch/hpcmips/include/sysconf.h | 28 +--
sys/arch/hpcmips/tx/tx39.c | 44 +---
sys/arch/hpcmips/vr/vr.c | 76 +------
12 files changed, 178 insertions(+), 474 deletions(-)
diffs (truncated from 1135 to 300 lines):
diff -r 5870dc5a2b93 -r 31993ef06493 sys/arch/hpcmips/hpcmips/autoconf.c
--- a/sys/arch/hpcmips/hpcmips/autoconf.c Sun Sep 16 15:08:39 2001 +0000
+++ b/sys/arch/hpcmips/hpcmips/autoconf.c Sun Sep 16 15:45:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.10 2001/09/15 14:08:15 uch Exp $ */
+/* $NetBSD: autoconf.c,v 1.11 2001/09/16 15:45:42 uch Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -43,7 +43,21 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.10 2001/09/15 14:08:15 uch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.11 2001/09/16 15:45:42 uch Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h> /* setroot() */
+
+#include <machine/disklabel.h>
+
+#include <machine/sysconf.h>
+#include <machine/config_hook.h>
+
+#include <hpcmips/hpcmips/machdep.h>
+
+static char __booted_device_name[16];
+static void get_device(char *);
/*
* Setup the system to run on the current machine.
@@ -52,26 +66,6 @@
* devices are determined (from possibilities mentioned in ioconf.c),
* and the drivers are initialized.
*/
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-
-#include <machine/bus.h>
-#include <machine/disklabel.h>
-
-#include <machine/sysconf.h>
-#include <machine/autoconf.h>
-#include <machine/config_hook.h>
-
-int cpuspeed = 7; /* approx # instr per usec. */
-
-struct device *booted_device;
-int booted_partition;
-
-static char booted_device_name[16];
-static void get_device(char *);
-
void
cpu_configure()
{
@@ -86,9 +80,6 @@
if (config_rootfound("mainbus", "mainbus") == NULL)
panic("no mainbus found");
- /* Reset any bus errors due to probing nonexistent devices. */
- (*platform.bus_reset)();
-
/* Configuration is finished, turn on interrupts. */
_splnone(); /* enable all source forcing SOFT_INTs cleared */
}
@@ -97,7 +88,7 @@
cpu_rootconf()
{
- get_device(booted_device_name);
+ get_device(__booted_device_name);
printf("boot device: %s\n",
booted_device ? booted_device->dv_xname : "<unknown>");
@@ -109,7 +100,7 @@
makebootdev(char *cp)
{
- strncpy(booted_device_name, cp, 16);
+ strncpy(__booted_device_name, cp, 16);
}
static void
diff -r 5870dc5a2b93 -r 31993ef06493 sys/arch/hpcmips/hpcmips/clock.c
--- a/sys/arch/hpcmips/hpcmips/clock.c Sun Sep 16 15:08:39 2001 +0000
+++ b/sys/arch/hpcmips/hpcmips/clock.c Sun Sep 16 15:45:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.13 2001/09/15 14:08:15 uch Exp $ */
+/* $NetBSD: clock.c,v 1.14 2001/09/16 15:45:42 uch Exp $ */
/*-
* Copyright (c) 1999 Shin Takemura, All rights reserved.
@@ -74,8 +74,7 @@
#include "opt_tx39xx.h"
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.13 2001/09/15 14:08:15 uch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.14 2001/09/16 15:45:42 uch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -286,3 +285,41 @@
(*clockfns->cf_set)(clockdev, &ct);
}
+
+/*
+ * Return the best possible estimate of the time in the timeval to
+ * which tvp points. We guarantee that the time will be greater than
+ * the value obtained by a previous call.
+ */
+void
+microtime(struct timeval *tvp)
+{
+ int s = splclock();
+ static struct timeval lasttime;
+
+ *tvp = time;
+
+ if (tvp->tv_usec >= 1000000) {
+ tvp->tv_usec -= 1000000;
+ tvp->tv_sec++;
+ }
+
+ if (tvp->tv_sec == lasttime.tv_sec &&
+ tvp->tv_usec <= lasttime.tv_usec &&
+ (tvp->tv_usec = lasttime.tv_usec + 1) >= 1000000) {
+ tvp->tv_sec++;
+ tvp->tv_usec -= 1000000;
+ }
+ lasttime = *tvp;
+ splx(s);
+}
+
+/*
+ * Wait "n" microseconds.
+ */
+void
+delay(int n)
+{
+
+ DELAY(n);
+}
diff -r 5870dc5a2b93 -r 31993ef06493 sys/arch/hpcmips/hpcmips/cpu.c
--- a/sys/arch/hpcmips/hpcmips/cpu.c Sun Sep 16 15:08:39 2001 +0000
+++ b/sys/arch/hpcmips/hpcmips/cpu.c Sun Sep 16 15:45:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.9 2001/09/15 14:08:15 uch Exp $ */
+/* $NetBSD: cpu.c,v 1.10 2001/09/16 15:45:43 uch Exp $ */
/*-
* Copyright (c) 1999 Shin Takemura, All rights reserved.
* Copyright (c) 1999-2001 SATO Kazumi, All rights reserved.
@@ -55,16 +55,12 @@
* rights to redistribute these changes.
*/
-#include "opt_vr41xx.h"
-#include "opt_tx39xx.h"
-
#include <sys/param.h>
#include <sys/systm.h>
+#include <machine/sysconf.h>
#include <machine/bus.h>
#include <machine/autoconf.h>
-#include <machine/platid.h>
-#include <machine/platid_mask.h>
/* Definition of the driver for autoconfig. */
static int cpumatch(struct device *, struct cfdata *, void *);
@@ -76,21 +72,13 @@
extern struct cfdriver cpu_cd;
-extern void cpu_identify(void);
-extern void vr_idle(void);
-
-
static int
cpumatch(struct device *parent, struct cfdata *cf, void *aux)
{
struct mainbus_attach_args *ma = aux;
-
/* make sure that we're looking for a CPU. */
- if (strcmp(ma->ma_name, cpu_cd.cd_name) != 0) {
- return (0);
- }
- return (1);
+ return (strcmp(ma->ma_name, cpu_cd.cd_name) != 0 ? 0 : 1);
}
static void
@@ -101,22 +89,7 @@
cpu_identify();
-#ifdef VR41XX
-#ifdef TX39XX
- if (platid_match(&platid, &platid_mask_CPU_MIPS_VR_41XX))
-#endif /* TX39XX */
- {
- printf("cpu0: install VR specific idle routine\n");
- CPU_IDLE = (long *)vr_idle;
- }
-#endif
-#ifdef TX39XX
-#ifdef VR41XX
- if (platid_match(&platid, &platid_mask_CPU_MIPS_TX_3900)
- || platid_match(&platid, &platid_mask_CPU_MIPS_TX_3920))
-#endif /* VR41XX */
- {
- ; /* XXXX: currenty not implemented */
- }
-#endif
+ /* install CPU specific idle routine if any. */
+ if (platform.cpu_idle != NULL)
+ CPU_IDLE = (long *)platform.cpu_idle;
}
diff -r 5870dc5a2b93 -r 31993ef06493 sys/arch/hpcmips/hpcmips/locore_machdep.S
--- a/sys/arch/hpcmips/hpcmips/locore_machdep.S Sun Sep 16 15:08:39 2001 +0000
+++ b/sys/arch/hpcmips/hpcmips/locore_machdep.S Sun Sep 16 15:45:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore_machdep.S,v 1.2 2000/05/22 07:40:41 uch Exp $ */
+/* $NetBSD: locore_machdep.S,v 1.3 2001/09/16 15:45:43 uch Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -81,23 +81,23 @@
_C_LABEL(intrnames):
.asciiz "softclock"
.asciiz "softnet"
- .asciiz "serial0"
- .asciiz "serial1"
- .asciiz "serial2"
- .asciiz "ether"
- .asciiz "scsi"
- .asciiz "memory"
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
.asciiz "clock"
- .asciiz "fpu"
- .asciiz "tcslot0"
- .asciiz "tcslot1"
- .asciiz "tcslot2"
- .asciiz "dtop"
- .asciiz "isdn"
- .asciiz "floppy"
- .asciiz "stray"
- .asciiz "nmi"
- .asciiz "lostclock"
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
+ .asciiz ""
_C_LABEL(eintrnames):
.align 2
_C_LABEL(intrcnt):
diff -r 5870dc5a2b93 -r 31993ef06493 sys/arch/hpcmips/hpcmips/machdep.c
--- a/sys/arch/hpcmips/hpcmips/machdep.c Sun Sep 16 15:08:39 2001 +0000
+++ b/sys/arch/hpcmips/hpcmips/machdep.c Sun Sep 16 15:45:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.61 2001/09/15 19:51:38 uch Exp $ */
+/* $NetBSD: machdep.c,v 1.62 2001/09/16 15:45:43 uch Exp $ */
/*-
* Copyright (c) 1999 Shin Takemura, All rights reserved.
@@ -72,7 +72,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.61 2001/09/15 19:51:38 uch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.62 2001/09/16 15:45:43 uch Exp $");
/* from: Utah Hdr: machdep.c 1.63 91/04/24 */
#include "opt_vr41xx.h"
@@ -105,8 +105,8 @@
#include <machine/bootinfo.h>
#include <machine/platid.h>
#include <machine/platid_mask.h>
-#include <machine/bus.h>
-#include <machine/autoconf.h>
+
+#include <hpcmips/hpcmips/machdep.h>
Home |
Main Index |
Thread Index |
Old Index