Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Switch x86 CPU Debug Register types from vaddr_t to...



details:   https://anonhg.NetBSD.org/src/rev/170a46e9eae5
branches:  trunk
changeset: 349517:170a46e9eae5
user:      kamil <kamil%NetBSD.org@localhost>
date:      Tue Dec 13 10:21:33 2016 +0000

description:
Switch x86 CPU Debug Register types from vaddr_t to register_t

This is more opaque and appropriate type, as vaddr_t is meant to be used
for vitual address value. Not all DR on x86 are used to represent virtual
address (DR6 and DR7 are definitely not).

No functional change intended.

Change suggested by <christos>

Sponsored by <The NetBSD Foundation>

diffstat:

 sys/arch/x86/include/cpufunc.h |  26 +++++++++++++-------------
 sys/arch/xen/x86/xenfunc.c     |  28 ++++++++++++++--------------
 2 files changed, 27 insertions(+), 27 deletions(-)

diffs (155 lines):

diff -r 1745c490e11c -r 170a46e9eae5 sys/arch/x86/include/cpufunc.h
--- a/sys/arch/x86/include/cpufunc.h    Tue Dec 13 10:01:44 2016 +0000
+++ b/sys/arch/x86/include/cpufunc.h    Tue Dec 13 10:21:33 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.h,v 1.20 2016/11/27 14:49:21 kamil Exp $       */
+/*     $NetBSD: cpufunc.h,v 1.21 2016/12/13 10:21:33 kamil Exp $       */
 
 /*-
  * Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -69,18 +69,18 @@
 void   tlbflush(void);
 void   tlbflushg(void);
 void   dr0(void *, uint32_t, uint32_t, uint32_t);
-vaddr_t        rdr0(void);
-void   ldr0(vaddr_t);
-vaddr_t        rdr1(void);
-void   ldr1(vaddr_t);
-vaddr_t        rdr2(void);
-void   ldr2(vaddr_t);
-vaddr_t        rdr3(void);
-void   ldr3(vaddr_t);
-vaddr_t        rdr6(void);
-void   ldr6(vaddr_t);
-vaddr_t        rdr7(void);
-void   ldr7(vaddr_t);
+register_t     rdr0(void);
+void           ldr0(register_t);
+register_t     rdr1(void);
+void           ldr1(register_t);
+register_t     rdr2(void);
+void           ldr2(register_t);
+register_t     rdr3(void);
+void           ldr3(register_t);
+register_t     rdr6(void);
+void           ldr6(register_t);
+register_t     rdr7(void);
+void           ldr7(register_t);
 void   wbinvd(void);
 void   breakpoint(void);
 void   x86_hlt(void);
diff -r 1745c490e11c -r 170a46e9eae5 sys/arch/xen/x86/xenfunc.c
--- a/sys/arch/xen/x86/xenfunc.c        Tue Dec 13 10:01:44 2016 +0000
+++ b/sys/arch/xen/x86/xenfunc.c        Tue Dec 13 10:21:33 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xenfunc.c,v 1.14 2016/11/27 14:49:21 kamil Exp $       */
+/*     $NetBSD: xenfunc.c,v 1.15 2016/12/13 10:21:33 kamil Exp $       */
 
 /*
  *
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xenfunc.c,v 1.14 2016/11/27 14:49:21 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenfunc.c,v 1.15 2016/12/13 10:21:33 kamil Exp $");
 
 #include <sys/param.h>
 
@@ -121,7 +121,7 @@
        tlbflush();
 }
 
-vaddr_t
+register_t
 rdr0(void)
 {
 
@@ -129,13 +129,13 @@
 }
 
 void
-ldr0(vaddr_t val)
+ldr0(register_t val)
 {
 
        HYPERVISOR_set_debugreg(0, val);
 }
 
-vaddr_t
+register_t
 rdr1(void)
 {
 
@@ -143,13 +143,13 @@
 }
 
 void
-ldr1(vaddr_t val)
+ldr1(register_t val)
 {
 
        HYPERVISOR_set_debugreg(1, val);
 }
 
-vaddr_t
+register_t
 rdr2(void)
 {
 
@@ -157,13 +157,13 @@
 }
 
 void
-ldr2(vaddr_t val)
+ldr2(register_t val)
 {
 
        HYPERVISOR_set_debugreg(2, val);
 }
 
-vaddr_t
+register_t
 rdr3(void)
 {
 
@@ -171,12 +171,12 @@
 }
 
 void
-ldr3(vaddr_t val)
+ldr3(register_t val)
 {
 
        HYPERVISOR_set_debugreg(3, val);
 }
-vaddr_t
+register_t
 rdr6(void)
 {
 
@@ -184,13 +184,13 @@
 }
 
 void
-ldr6(vaddr_t val)
+ldr6(register_t val)
 {
 
        HYPERVISOR_set_debugreg(6, val);
 }
 
-vaddr_t
+register_t
 rdr7(void)
 {
 
@@ -198,7 +198,7 @@
 }
 
 void
-ldr7(vaddr_t val)
+ldr7(register_t val)
 {
 
        HYPERVISOR_set_debugreg(7, val);



Home | Main Index | Thread Index | Old Index