summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Murphree <smurph@cvs.openbsd.org>1998-08-22 08:12:43 +0000
committerSteve Murphree <smurph@cvs.openbsd.org>1998-08-22 08:12:43 +0000
commitddb7d152e6d219dba67c0db680b099c420708f8f (patch)
tree700b3f4c2705b97fc86d5d4551bd9cb33d694d4a
parent87c23604fb0b6fa5748345906074855d5a034bb6 (diff)
New libsa.
-rw-r--r--sys/arch/mvme88k/stand/libsa/clock.c36
-rw-r--r--sys/arch/mvme88k/stand/libsa/config.h2
-rw-r--r--sys/arch/mvme88k/stand/libsa/exec_mvme.c1
3 files changed, 11 insertions, 28 deletions
diff --git a/sys/arch/mvme88k/stand/libsa/clock.c b/sys/arch/mvme88k/stand/libsa/clock.c
index 683bd48f849..c9ebce75fa9 100644
--- a/sys/arch/mvme88k/stand/libsa/clock.c
+++ b/sys/arch/mvme88k/stand/libsa/clock.c
@@ -1,8 +1,9 @@
+
#include <sys/types.h>
+#include <machine/prom.h>
-#include "clockreg.h"
-#include "config.h"
-#include "clock.h"
+#include "stand.h"
+#include "libsa.h"
/*
* BCD to decimal and decimal to BCD.
@@ -13,6 +14,8 @@
#define SECDAY (24 * 60 * 60)
#define SECYR (SECDAY * 365)
#define LEAPYEAR(y) (((y) & 3) == 0)
+#define YEAR0 68
+
/*
* This code is defunct after 2068.
@@ -52,28 +55,9 @@ chiptotime(sec, min, hour, day, mon, year)
time_t
getsecs()
{
- extern int cputyp;
- register struct clockreg *cl;
- int sec, min, hour, day, mon, year;
-
- if (cputyp == CPU_147)
- cl = (struct clockreg *) CLOCK_ADDR_147;
- else
- cl = (struct clockreg *) CLOCK_ADDR_16x;
+ struct mvmeprom_time m;
- cl->cl_csr |= CLK_READ; /* enable read (stop time) */
- sec = cl->cl_sec;
- min = cl->cl_min;
- hour = cl->cl_hour;
- day = cl->cl_mday;
- mon = cl->cl_month;
- year = cl->cl_year;
- cl->cl_csr &= ~CLK_READ;/* time wears on */
- return (chiptotime(sec, min, hour, day, mon, year));
-}
-
-int
-getticks()
-{
- return getsecs() * 100;
+ mvmeprom_rtc_rd(&m);
+ return (chiptotime(m.sec_BCD, m.min_BCD, m.hour_BCD, m.day_BCD,
+ m.month_BCD, m.year_BCD));
}
diff --git a/sys/arch/mvme88k/stand/libsa/config.h b/sys/arch/mvme88k/stand/libsa/config.h
index 0aad19e505f..a2b0515adcf 100644
--- a/sys/arch/mvme88k/stand/libsa/config.h
+++ b/sys/arch/mvme88k/stand/libsa/config.h
@@ -1,4 +1,3 @@
-/* $Id: config.h,v 1.1 1997/03/03 19:30:37 rahnds Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -44,6 +43,7 @@
#define CPU_167 0x167
#define CPU_172 0x172
#define CPU_177 0x177
+#define CPU_187 0x187
struct brdid {
u_long eye_catcher;
diff --git a/sys/arch/mvme88k/stand/libsa/exec_mvme.c b/sys/arch/mvme88k/stand/libsa/exec_mvme.c
index 4038238b1bc..19a0ca41405 100644
--- a/sys/arch/mvme88k/stand/libsa/exec_mvme.c
+++ b/sys/arch/mvme88k/stand/libsa/exec_mvme.c
@@ -1,4 +1,3 @@
-/* $NetBSD: exec_sun.c,v 1.5 1996/01/29 23:41:06 gwr Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993