Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hppa Don't rely on global APIs from internal.



details:   https://anonhg.NetBSD.org/src/rev/83ce9f506051
branches:  trunk
changeset: 758717:83ce9f506051
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Sun Nov 14 03:16:03 2010 +0000

description:
Don't rely on global APIs from internal.

diffstat:

 sys/arch/hppa/hppa/pmap.c       |   5 +++--
 sys/arch/hppa/include/mutex.h   |  25 +++++++++++++------------
 sys/arch/hppa/include/vmparam.h |   6 ++++--
 3 files changed, 20 insertions(+), 16 deletions(-)

diffs (160 lines):

diff -r fed94a1c1990 -r 83ce9f506051 sys/arch/hppa/hppa/pmap.c
--- a/sys/arch/hppa/hppa/pmap.c Sun Nov 14 00:38:56 2010 +0000
+++ b/sys/arch/hppa/hppa/pmap.c Sun Nov 14 03:16:03 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.78 2010/11/12 07:59:26 uebayasi Exp $       */
+/*     $NetBSD: pmap.c,v 1.79 2010/11/14 03:16:03 uebayasi Exp $       */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.78 2010/11/12 07:59:26 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.79 2010/11/14 03:16:03 uebayasi Exp $");
 
 #include "opt_cputype.h"
 
@@ -73,6 +73,7 @@
 #include <sys/systm.h>
 #include <sys/malloc.h>
 #include <sys/proc.h>
+#include <sys/mutex.h>
 
 #include <uvm/uvm.h>
 
diff -r fed94a1c1990 -r 83ce9f506051 sys/arch/hppa/include/mutex.h
--- a/sys/arch/hppa/include/mutex.h     Sun Nov 14 00:38:56 2010 +0000
+++ b/sys/arch/hppa/include/mutex.h     Sun Nov 14 03:16:03 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.9 2008/04/28 20:23:23 martin Exp $ */
+/*     $NetBSD: mutex.h,v 1.10 2010/11/14 03:16:04 uebayasi Exp $      */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -42,6 +42,7 @@
 
 #ifndef __ASSEMBLER__
 
+#include <machine/intr.h>
 #include <machine/lock.h>
 
 struct kmutex {
@@ -97,7 +98,7 @@
 }
 
 static inline int
-MUTEX_SET_WAITERS(kmutex_t *mtx, uintptr_t owner)
+MUTEX_SET_WAITERS(struct kmutex *mtx, uintptr_t owner)
 {
        mb_write();
        mtx->mtx_waiters = 1;
@@ -106,13 +107,13 @@
 }
 
 static inline int
-MUTEX_HAS_WAITERS(volatile kmutex_t *mtx)
+MUTEX_HAS_WAITERS(volatile struct kmutex *mtx)
 {
        return mtx->mtx_waiters != 0;
 }
 
 static inline void
-MUTEX_INITIALIZE_SPIN(kmutex_t *mtx, bool dodebug, int ipl)
+MUTEX_INITIALIZE_SPIN(struct kmutex *mtx, bool dodebug, int ipl)
 {
        mtx->mtx_ipl = makeiplcookie(ipl);
        mtx->mtx_dodebug = dodebug;
@@ -121,7 +122,7 @@
 }
 
 static inline void
-MUTEX_INITIALIZE_ADAPTIVE(kmutex_t *mtx, bool dodebug)
+MUTEX_INITIALIZE_ADAPTIVE(struct kmutex *mtx, bool dodebug)
 {
        mtx->mtx_dodebug = dodebug;
        mtx->mtx_owner = MUTEX_ADAPTIVE_UNOWNED;
@@ -129,32 +130,32 @@
 }
 
 static inline void
-MUTEX_DESTROY(kmutex_t *mtx)
+MUTEX_DESTROY(struct kmutex *mtx)
 {
        mtx->mtx_owner = 0xffffffff;
 }
 
 static inline bool
-MUTEX_DEBUG_P(kmutex_t *mtx)
+MUTEX_DEBUG_P(struct kmutex *mtx)
 {
        return mtx->mtx_dodebug != 0;
 }
 
 static inline int
-MUTEX_SPIN_P(volatile kmutex_t *mtx)
+MUTEX_SPIN_P(volatile struct kmutex *mtx)
 {
        return mtx->mtx_owner == MUTEX_SPIN_FLAG;
 }
 
 static inline int
-MUTEX_ADAPTIVE_P(volatile kmutex_t *mtx)
+MUTEX_ADAPTIVE_P(volatile struct kmutex *mtx)
 {
        return mtx->mtx_owner != MUTEX_SPIN_FLAG;
 }
 
 /* Acquire an adaptive mutex */
 static inline int
-MUTEX_ACQUIRE(kmutex_t *mtx, uintptr_t curthread)
+MUTEX_ACQUIRE(struct kmutex *mtx, uintptr_t curthread)
 {
        if (!__cpu_simple_lock_try(&mtx->mtx_lock))
                return 0;
@@ -164,7 +165,7 @@
 
 /* Release an adaptive mutex */
 static inline void
-MUTEX_RELEASE(kmutex_t *mtx)
+MUTEX_RELEASE(struct kmutex *mtx)
 {
        mtx->mtx_owner = MUTEX_ADAPTIVE_UNOWNED;
        __cpu_simple_unlock(&mtx->mtx_lock);
@@ -172,7 +173,7 @@
 }
 
 static inline void
-MUTEX_CLEAR_WAITERS(kmutex_t *mtx)
+MUTEX_CLEAR_WAITERS(struct kmutex *mtx)
 {
        mtx->mtx_waiters = 0;
 }
diff -r fed94a1c1990 -r 83ce9f506051 sys/arch/hppa/include/vmparam.h
--- a/sys/arch/hppa/include/vmparam.h   Sun Nov 14 00:38:56 2010 +0000
+++ b/sys/arch/hppa/include/vmparam.h   Sun Nov 14 03:16:03 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmparam.h,v 1.16 2010/11/06 15:42:45 uebayasi Exp $    */
+/*     $NetBSD: vmparam.h,v 1.17 2010/11/14 03:16:04 uebayasi Exp $    */
 
 /*     $OpenBSD: vmparam.h,v 1.33 2006/06/04 17:21:24 miod Exp $       */
 
@@ -28,6 +28,8 @@
 #ifndef _HPPA_VMPARAM_H_
 #define _HPPA_VMPARAM_H_
 
+#include <machine/mutex.h>
+
 /*
  * Machine dependent constants for HP PA
  */
@@ -105,7 +107,7 @@
 struct pv_entry;
 
 struct vm_page_md {
-       kmutex_t        pvh_lock;       /* locks every pv on this list */
+       struct kmutex   pvh_lock;       /* locks every pv on this list */
        struct pv_entry *pvh_list;      /* head of list (locked by pvh_lock) */
        u_int           pvh_attrs;      /* to preserve ref/mod */
        int             pvh_aliases;    /* alias counting */



Home | Main Index | Thread Index | Old Index