summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mips64/dev/clockvar.h64
-rw-r--r--sys/arch/mips64/mips64/clock.c4
-rw-r--r--sys/arch/mips64/mips64/mips64_machdep.c63
3 files changed, 2 insertions, 129 deletions
diff --git a/sys/arch/mips64/dev/clockvar.h b/sys/arch/mips64/dev/clockvar.h
deleted file mode 100644
index dcfc0be64c0..00000000000
--- a/sys/arch/mips64/dev/clockvar.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* $OpenBSD: clockvar.h,v 1.5 2008/04/07 22:36:24 miod Exp $ */
-
-/*
- * Copyright (c) 1994, 1995 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- * Adopted for r4400: Per Fogelstrom
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-/*
- * Definitions for "cpu-independent" clock handling.
- */
-
-/*
- * tod_time structure:
- *
- * structure passed to TOD clocks when setting them. broken out this
- * way, so that the time_t -> field conversion can be shared.
- */
-struct tod_time {
- int year; /* year 1900.... */
- int mon; /* month (1 - 12) */
- int day; /* day (1 - 31) */
- int hour; /* hour (0 - 23) */
- int min; /* minute (0 - 59) */
- int sec; /* second (0 - 59) */
- int dow; /* day of week (0 - 6; 0 = Sunday) */
-};
-
-/*
- * tod_desc structure:
- *
- * provides tod-specific functions to do necessary operations.
- */
-
-struct tod_desc {
- void *tod_cookie;
- void (*tod_get)(void *, time_t, struct tod_time *);
- void (*tod_set)(void *, struct tod_time *);
- int tod_valid;
-};
-
-extern struct tod_desc sys_tod;
diff --git a/sys/arch/mips64/mips64/clock.c b/sys/arch/mips64/mips64/clock.c
index 063aaa0c29c..5fbc090ba28 100644
--- a/sys/arch/mips64/mips64/clock.c
+++ b/sys/arch/mips64/mips64/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.41 2016/03/06 19:42:27 mpi Exp $ */
+/* $OpenBSD: clock.c,v 1.42 2020/06/30 14:56:10 visa Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -44,8 +44,6 @@
#include <machine/cpu.h>
#include <mips64/mips_cpu.h>
-#include <mips64/dev/clockvar.h>
-
static struct evcount cp0_clock_count;
static int cp0_clock_irq = 5;
diff --git a/sys/arch/mips64/mips64/mips64_machdep.c b/sys/arch/mips64/mips64/mips64_machdep.c
index d4a42ed5acc..2657f9e8ae1 100644
--- a/sys/arch/mips64/mips64/mips64_machdep.c
+++ b/sys/arch/mips64/mips64/mips64_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mips64_machdep.c,v 1.30 2020/05/16 14:44:45 kettenis Exp $ */
+/* $OpenBSD: mips64_machdep.c,v 1.31 2020/06/30 14:56:10 visa Exp $ */
/*
* Copyright (c) 2009, 2010, 2012 Miodrag Vallat.
@@ -57,7 +57,6 @@
#include <uvm/uvm_extern.h>
-#include <mips64/dev/clockvar.h>
#include <dev/clock_subr.h>
/*
@@ -238,62 +237,9 @@ tlb_asid_wrap(struct cpu_info *ci)
* Mips machine independent clock routines.
*/
-struct tod_desc sys_tod;
void (*md_startclock)(struct cpu_info *);
extern todr_chip_handle_t todr_handle;
-struct todr_chip_handle rtc_todr;
-
-int
-rtc_gettime(struct todr_chip_handle *handle, struct timeval *tv)
-{
- struct tod_desc *cd = &sys_tod;
- struct clock_ymdhms dt;
- struct tod_time c;
-
- KASSERT(cd->tod_get);
-
- /*
- * Read RTC chip registers NOTE: Read routines are responsible
- * for sanity checking clock. Dates after 19991231 should be
- * returned as year >= 100.
- */
- (*cd->tod_get)(cd->tod_cookie, tv->tv_sec, &c);
-
- dt.dt_sec = c.sec;
- dt.dt_min = c.min;
- dt.dt_hour = c.hour;
- dt.dt_day = c.day;
- dt.dt_mon = c.mon;
- dt.dt_year = c.year + 1900;
-
- tv->tv_sec = clock_ymdhms_to_secs(&dt);
- tv->tv_usec = 0;
- return 0;
-}
-
-int
-rtc_settime(struct todr_chip_handle *handle, struct timeval *tv)
-{
- struct tod_desc *cd = &sys_tod;
- struct clock_ymdhms dt;
- struct tod_time c;
-
- KASSERT(cd->tod_set);
-
- clock_secs_to_ymdhms(tv->tv_sec, &dt);
-
- c.sec = dt.dt_sec;
- c.min = dt.dt_min;
- c.hour = dt.dt_hour;
- c.day = dt.dt_day;
- c.mon = dt.dt_mon;
- c.year = dt.dt_year - 1900;
- c.dow = dt.dt_wday + 1;
-
- (*cd->tod_set)(cd->tod_cookie, &c);
- return 0;
-}
/*
* Wait "n" microseconds.
@@ -380,13 +326,6 @@ void
cpu_initclocks()
{
struct cpu_info *ci = curcpu();
- struct tod_desc *cd = &sys_tod;
-
- if (todr_handle == NULL && cd->tod_get) {
- rtc_todr.todr_gettime = rtc_gettime;
- rtc_todr.todr_settime = rtc_settime;
- todr_handle = &rtc_todr;
- }
profhz = hz;