Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64 Timecounter's tc_get_timecount requires onl...



details:   https://anonhg.NetBSD.org/src/rev/373f7a0301fb
branches:  trunk
changeset: 791861:373f7a0301fb
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Sat Dec 07 11:17:24 2013 +0000

description:
Timecounter's tc_get_timecount requires only 32-bit (u_int), so
omit unnecessary upper 32-bit read from STICK counter.

diffstat:

 sys/arch/sparc64/dev/psycho.c    |  12 ++++++++++--
 sys/arch/sparc64/dev/psychovar.h |   3 ++-
 sys/arch/sparc64/sparc64/clock.c |   6 +++---
 3 files changed, 15 insertions(+), 6 deletions(-)

diffs (77 lines):

diff -r e9f550b95a13 -r 373f7a0301fb sys/arch/sparc64/dev/psycho.c
--- a/sys/arch/sparc64/dev/psycho.c     Sat Dec 07 10:03:28 2013 +0000
+++ b/sys/arch/sparc64/dev/psycho.c     Sat Dec 07 11:17:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: psycho.c,v 1.117 2013/11/08 15:44:26 nakayama Exp $    */
+/*     $NetBSD: psycho.c,v 1.118 2013/12/07 11:17:24 nakayama Exp $    */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.117 2013/11/08 15:44:26 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.118 2013/12/07 11:17:24 nakayama Exp $");
 
 #include "opt_ddb.h"
 
@@ -1574,6 +1574,14 @@
        return stick;
 }
 
+uint32_t
+psycho_getstick32(void)
+{
+
+       return bus_space_read_8(psycho0->sc_bustag, psycho0->sc_bh,
+           STICK_CNT_LOW);
+}
+
 void
 psycho_setstick(long cnt)
 {
diff -r e9f550b95a13 -r 373f7a0301fb sys/arch/sparc64/dev/psychovar.h
--- a/sys/arch/sparc64/dev/psychovar.h  Sat Dec 07 10:03:28 2013 +0000
+++ b/sys/arch/sparc64/dev/psychovar.h  Sat Dec 07 11:17:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: psychovar.h,v 1.20 2013/08/22 09:57:30 nakayama Exp $  */
+/*     $NetBSD: psychovar.h,v 1.21 2013/12/07 11:17:24 nakayama Exp $  */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -139,6 +139,7 @@
 #define psycho_alloc_io_tag(pp) psycho_alloc_bus_tag((pp), PCI_IO_BUS_SPACE)
 
 uint64_t psycho_getstick(void);
+uint32_t psycho_getstick32(void);
 void psycho_setstick(long);
 void psycho_nextstick(long);
 
diff -r e9f550b95a13 -r 373f7a0301fb sys/arch/sparc64/sparc64/clock.c
--- a/sys/arch/sparc64/sparc64/clock.c  Sat Dec 07 10:03:28 2013 +0000
+++ b/sys/arch/sparc64/sparc64/clock.c  Sat Dec 07 11:17:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.113 2013/09/12 12:45:53 martin Exp $ */
+/*     $NetBSD: clock.c,v 1.114 2013/12/07 11:17:25 nakayama Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.113 2013/09/12 12:45:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.114 2013/12/07 11:17:25 nakayama Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -216,7 +216,7 @@
 static u_int
 stick2e_get_timecount(struct timecounter *tc)
 {
-       return psycho_getstick();
+       return psycho_getstick32();
 }
 #endif
 



Home | Main Index | Thread Index | Old Index