Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Forgot to commit a change in i386/cpufunc.S; add rd...



details:   https://anonhg.NetBSD.org/src/rev/97f332e0b430
branches:  trunk
changeset: 324231:97f332e0b430
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Jul 21 16:21:27 2018 +0000

description:
Forgot to commit a change in i386/cpufunc.S; add rdtsc(), so that it can be
used in cpu_rng. Restore the cpu_rng code back to how it was in my initial
commit.

diffstat:

 sys/arch/i386/i386/cpufunc.S |  9 +++++++--
 sys/arch/x86/x86/cpu_rng.c   |  8 +-------
 2 files changed, 8 insertions(+), 9 deletions(-)

diffs (60 lines):

diff -r 221b5ed224c3 -r 97f332e0b430 sys/arch/i386/i386/cpufunc.S
--- a/sys/arch/i386/i386/cpufunc.S      Sat Jul 21 14:46:41 2018 +0000
+++ b/sys/arch/i386/i386/cpufunc.S      Sat Jul 21 16:21:27 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.S,v 1.22 2018/07/14 14:29:40 maxv Exp $        */
+/*     $NetBSD: cpufunc.S,v 1.23 2018/07/21 16:21:27 maxv Exp $        */
 
 /*-
  * Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #include <sys/errno.h>
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.22 2018/07/14 14:29:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.23 2018/07/21 16:21:27 maxv Exp $");
 
 #include "opt_xen.h"
 
@@ -209,6 +209,11 @@
        ret
 END(rdpmc)
 
+ENTRY(rdtsc)
+       rdtsc
+       ret
+END(rdtsc)
+
 ENTRY(breakpoint)
        pushl   %ebp
        movl    %esp, %ebp
diff -r 221b5ed224c3 -r 97f332e0b430 sys/arch/x86/x86/cpu_rng.c
--- a/sys/arch/x86/x86/cpu_rng.c        Sat Jul 21 14:46:41 2018 +0000
+++ b/sys/arch/x86/x86/cpu_rng.c        Sat Jul 21 16:21:27 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_rng.c,v 1.7 2018/07/21 14:46:41 kre Exp $ */
+/* $NetBSD: cpu_rng.c,v 1.8 2018/07/21 16:21:27 maxv Exp $ */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -35,8 +35,6 @@
  * comments from Henric Jungheim on the tech%openbsd.org@localhost mailing list.
  */
 
-#include "opt_xen.h"
-
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/cpu.h>
@@ -237,11 +235,7 @@
                }
                SHA512_Update(&ctx, (uint8_t *)buf, i * sizeof(cpu_rng_t));
        }
-#ifndef XEN
        val = rdtsc();
-#else
-       val = 0;                /* XXX */
-#endif
        SHA512_Update(&ctx, (uint8_t *)&val, sizeof(val));
 
        SHA512_Final(digest, &ctx);



Home | Main Index | Thread Index | Old Index