Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sh5/sh5 - Remove the version of delay() which used ...
details: https://anonhg.NetBSD.org/src/rev/1097594abadf
branches: trunk
changeset: 536175:1097594abadf
user: scw <scw%NetBSD.org@localhost>
date: Tue Sep 10 11:59:50 2002 +0000
description:
- Remove the version of delay() which used the cycle counter register.
There were some problems related to wrap-around which lead to
delaying much longer than requested.
- Cacheops additions.
diffstat:
sys/arch/sh5/sh5/sh5_machdep.c | 40 ++++++++++------------------------------
1 files changed, 10 insertions(+), 30 deletions(-)
diffs (55 lines):
diff -r 893235c9d26d -r 1097594abadf sys/arch/sh5/sh5/sh5_machdep.c
--- a/sys/arch/sh5/sh5/sh5_machdep.c Tue Sep 10 11:56:32 2002 +0000
+++ b/sys/arch/sh5/sh5/sh5_machdep.c Tue Sep 10 11:59:50 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sh5_machdep.c,v 1.1 2002/07/05 13:32:06 scw Exp $ */
+/* $NetBSD: sh5_machdep.c,v 1.2 2002/09/10 11:59:50 scw Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@@ -58,36 +58,16 @@
*/
u_int _sh5_ctc_ticks_per_us;
-void (*__cpu_cache_purge)(vaddr_t, vsize_t);
-void (*__cpu_cache_invalidate)(vaddr_t, vsize_t);
-
-void
-delay(u_int microseconds)
-{
- register_t ctcreg;
- u_int ctc;
-
- if (microseconds == 0)
- return;
-
- __asm __volatile("getcon ctc, %0" : "=r"(ctcreg));
+/*
+ * This is used to calibrate the delay() loop in locore_subr.S
+ */
+u_int _sh5_delay_constant;
- /*
- * XXX: Assumes CTC is 32-bits wide.
- */
- ctc = (u_int)ctcreg - (microseconds * _sh5_ctc_ticks_per_us);
-
- if (ctc > (u_int)ctcreg) {
- /* Counter will wrap-around while we're waiting... */
- do {
- __asm __volatile("getcon ctc, %0" : "=r"(ctcreg));
- } while (ctc >= (u_int)ctcreg);
- } else {
- do {
- __asm __volatile("getcon ctc, %0" : "=r"(ctcreg));
- } while (ctc <= (u_int)ctcreg);
- }
-}
+void (*__cpu_cache_dpurge)(vaddr_t, vsize_t);
+void (*__cpu_cache_dpurge_iinv)(vaddr_t, vsize_t);
+void (*__cpu_cache_dinv)(vaddr_t, vsize_t);
+void (*__cpu_cache_dinv_iinv)(vaddr_t, vsize_t);
+void (*__cpu_cache_iinv)(vaddr_t, vsize_t);
/*
* These variables are needed by /sbin/savecore
Home |
Main Index |
Thread Index |
Old Index