Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm Protect prototypes, certain macros, and inlines from...



details:   https://anonhg.NetBSD.org/src/rev/cd5eb27370f8
branches:  trunk
changeset: 473912:cd5eb27370f8
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Jun 21 17:25:11 1999 +0000

description:
Protect prototypes, certain macros, and inlines from userland.

diffstat:

 sys/uvm/uvm.h         |  19 +++++++++----------
 sys/uvm/uvm_amap.h    |   8 +++++++-
 sys/uvm/uvm_anon.h    |   6 +++++-
 sys/uvm/uvm_aobj.h    |   6 +++++-
 sys/uvm/uvm_ddb.h     |  11 ++++++++---
 sys/uvm/uvm_device.h  |   6 +++++-
 sys/uvm/uvm_extern.h  |  10 ++++++++--
 sys/uvm/uvm_fault.h   |   6 +++++-
 sys/uvm/uvm_glue.h    |   6 +++++-
 sys/uvm/uvm_km.h      |   6 +++++-
 sys/uvm/uvm_loan.h    |   6 +++++-
 sys/uvm/uvm_map.h     |   6 +++++-
 sys/uvm/uvm_page.h    |   6 +++++-
 sys/uvm/uvm_pager.h   |   5 ++++-
 sys/uvm/uvm_pdaemon.h |   6 +++++-
 sys/uvm/uvm_stat.h    |   9 ++++++++-
 sys/uvm/uvm_swap.h    |   6 +++++-
 sys/uvm/uvm_vnode.h   |   5 ++++-
 18 files changed, 103 insertions(+), 30 deletions(-)

diffs (truncated from 543 to 300 lines):

diff -r dbaf6e49516e -r cd5eb27370f8 sys/uvm/uvm.h
--- a/sys/uvm/uvm.h     Mon Jun 21 16:23:00 1999 +0000
+++ b/sys/uvm/uvm.h     Mon Jun 21 17:25:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm.h,v 1.15 1999/03/26 17:34:15 chs Exp $     */
+/*     $NetBSD: uvm.h,v 1.16 1999/06/21 17:25:11 thorpej Exp $ */
 
 /*
  *
@@ -121,8 +121,10 @@
  * historys
  */
 
+#ifdef _KERNEL
 UVMHIST_DECL(maphist);
 UVMHIST_DECL(pdhist);
+#endif /* _KERNEL */
 
 /*
  * vm_map_entry etype bits:
@@ -142,35 +144,30 @@
  * macros
  */
 
+#ifdef _KERNEL
+
 /*
  * UVM_UNLOCK_AND_WAIT: atomic unlock+wait... front end for the 
  * (poorly named) thread_sleep_msg function.
  */
 
 #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
-
 #define UVM_UNLOCK_AND_WAIT(event,lock,intr,msg, timo) \
        thread_sleep_msg(event,lock,intr,msg, timo)
 
 #else
-
 #define UVM_UNLOCK_AND_WAIT(event,lock,intr,msg, timo) \
        thread_sleep_msg(event,NULL,intr,msg, timo)
-
-#endif
+#endif /* MULTIPROCESSOR || LOCKDEBUG */
 
 /*
  * UVM_PAGE_OWN: track page ownership (only if UVM_PAGE_TRKOWN)
  */
 
 #if defined(UVM_PAGE_TRKOWN)
-
 #define UVM_PAGE_OWN(PG, TAG) uvm_page_own(PG, TAG)
-
-#else /* UVM_PAGE_TRKOWN */
-
+#else
 #define UVM_PAGE_OWN(PG, TAG) /* nothing */
-
 #endif /* UVM_PAGE_TRKOWN */
 
 /*
@@ -183,4 +180,6 @@
 #include <uvm/uvm_page_i.h>
 #include <uvm/uvm_pager_i.h>
 
+#endif /* _KERNEL */
+
 #endif /* _UVM_UVM_H_ */
diff -r dbaf6e49516e -r cd5eb27370f8 sys/uvm/uvm_amap.h
--- a/sys/uvm/uvm_amap.h        Mon Jun 21 16:23:00 1999 +0000
+++ b/sys/uvm/uvm_amap.h        Mon Jun 21 17:25:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_amap.h,v 1.10 1999/01/28 14:46:27 chuck Exp $      */
+/*     $NetBSD: uvm_amap.h,v 1.11 1999/06/21 17:25:11 thorpej Exp $    */
 
 /*
  *
@@ -50,6 +50,8 @@
  * amap implementation-specific definitions.
  */
 
+#ifdef _KERNEL
+
 /*
  * part 1: amap interface
  */
@@ -134,6 +136,7 @@
 #define AMAP_SHARED    0x1     /* amap is shared */
 #define AMAP_REFALL    0x2     /* amap_ref: reference entire amap */
 
+#endif /* _KERNEL */
 
 /**********************************************************************/
 
@@ -237,6 +240,7 @@
 #define UVM_AMAP_LARGE 256     /* # of slots in "large" amap */
 #define UVM_AMAP_CHUNK 16      /* # of slots to chunk large amaps in */
 
+#ifdef _KERNEL
 
 /*
  * macros
@@ -279,4 +283,6 @@
                        __P((struct vm_amap *, int, int));
 #endif /* UVM_AMAP_PPREF */
 
+#endif /* _KERNEL */
+
 #endif /* _UVM_UVM_AMAP_H_ */
diff -r dbaf6e49516e -r cd5eb27370f8 sys/uvm/uvm_anon.h
--- a/sys/uvm/uvm_anon.h        Mon Jun 21 16:23:00 1999 +0000
+++ b/sys/uvm/uvm_anon.h        Mon Jun 21 17:25:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_anon.h,v 1.10 1999/03/26 17:34:15 chs Exp $        */
+/*     $NetBSD: uvm_anon.h,v 1.11 1999/06/21 17:25:11 thorpej Exp $    */
 
 /*
  *
@@ -92,6 +92,8 @@
  * locked by vm_map lock.
  */
 
+#ifdef _KERNEL
+
 /*
  * prototypes
  */
@@ -103,4 +105,6 @@
 struct vm_page *uvm_anon_lockloanpg __P((struct vm_anon *));
 void uvm_anon_dropswap __P((struct vm_anon *));
 
+#endif /* _KERNEL */
+
 #endif /* _UVM_UVM_ANON_H_ */
diff -r dbaf6e49516e -r cd5eb27370f8 sys/uvm/uvm_aobj.h
--- a/sys/uvm/uvm_aobj.h        Mon Jun 21 16:23:00 1999 +0000
+++ b/sys/uvm/uvm_aobj.h        Mon Jun 21 17:25:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_aobj.h,v 1.8 1999/03/26 17:34:15 chs Exp $ */
+/*     $NetBSD: uvm_aobj.h,v 1.9 1999/06/21 17:25:11 thorpej Exp $     */
 
 /*
  * Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
@@ -58,6 +58,8 @@
                                         * page is no longer PG_BUSY ... */
 #define UAO_FLAG_NOSWAP                0x8     /* aobj can't swap (kernel obj only!) */
 
+#ifdef _KERNEL
+
 /*
  * prototypes
  */
@@ -71,4 +73,6 @@
 
 extern struct uvm_pagerops aobj_pager;
 
+#endif /* _KERNEL */
+
 #endif /* _UVM_UVM_AOBJ_H_ */
diff -r dbaf6e49516e -r cd5eb27370f8 sys/uvm/uvm_ddb.h
--- a/sys/uvm/uvm_ddb.h Mon Jun 21 16:23:00 1999 +0000
+++ b/sys/uvm/uvm_ddb.h Mon Jun 21 17:25:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_ddb.h,v 1.2 1999/03/25 18:48:50 mrg Exp $  */
+/*     $NetBSD: uvm_ddb.h,v 1.3 1999/06/21 17:25:11 thorpej Exp $      */
 
 /*
  *
@@ -37,7 +37,9 @@
 #ifndef _UVM_UVM_DDB_H_
 #define _UVM_UVM_DDB_H_
 
-#if defined(DDB)
+#ifdef _KERNEL
+
+#ifdef DDB
 void                   uvm_map_print __P((vm_map_t, boolean_t));
 void                   uvm_map_printit __P((vm_map_t, boolean_t,
                                void (*) __P((const char *, ...))));
@@ -48,5 +50,8 @@
 void                   uvm_page_print __P((struct vm_page *, boolean_t));
 void                   uvm_page_printit __P((struct vm_page *, boolean_t,
                                void (*) __P((const char *, ...))));
-#endif
+#endif /* DDB */
+
+#endif /* _KERNEL */
+
 #endif _UVM_UVM_DDB_H_
diff -r dbaf6e49516e -r cd5eb27370f8 sys/uvm/uvm_device.h
--- a/sys/uvm/uvm_device.h      Mon Jun 21 16:23:00 1999 +0000
+++ b/sys/uvm/uvm_device.h      Mon Jun 21 17:25:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_device.h,v 1.7 1999/03/25 18:48:50 mrg Exp $       */
+/*     $NetBSD: uvm_device.h,v 1.8 1999/06/21 17:25:11 thorpej Exp $   */
 
 /*
  *
@@ -63,10 +63,14 @@
 #define UVM_DEVICE_HOLD                0x1     /* someone has a "hold" on it */
 #define UVM_DEVICE_WANTED      0x2     /* someone wants to put a "hold" on */
 
+#ifdef _KERNEL
+
 /*
  * prototypes
  */
 
 struct uvm_object *udv_attach __P((void *, vm_prot_t, vaddr_t, vsize_t));
 
+#endif /* _KERNEL */
+
 #endif /* _UVM_UVM_DEVICE_H_ */
diff -r dbaf6e49516e -r cd5eb27370f8 sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h      Mon Jun 21 16:23:00 1999 +0000
+++ b/sys/uvm/uvm_extern.h      Mon Jun 21 17:25:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_extern.h,v 1.30 1999/06/18 05:13:46 thorpej Exp $  */
+/*     $NetBSD: uvm_extern.h,v 1.31 1999/06/21 17:25:11 thorpej Exp $  */
 
 /*
  *
@@ -242,6 +242,7 @@
        struct uvm_object *mb_object;
 };
 
+#ifdef _KERNEL
 
 extern struct uvmexp uvmexp;
 
@@ -253,6 +254,8 @@
 #define uvm_km_zalloc(MAP,SIZE) uvm_km_alloc1(MAP,SIZE,TRUE)
 #define uvm_km_alloc(MAP,SIZE)  uvm_km_alloc1(MAP,SIZE,FALSE)
 
+#endif /* _KERNEL */
+
 /*
  * typedefs 
  */
@@ -260,6 +263,8 @@
 typedef unsigned int  uvm_flag_t;
 typedef int vm_fault_t;
 
+#ifdef _KERNEL
+
 /* uvm_aobj.c */
 struct uvm_object      *uao_create __P((vsize_t, int));
 void                   uao_detach __P((struct uvm_object *));
@@ -386,5 +391,6 @@
 boolean_t              uvm_vnp_uncache __P((struct vnode *));
 struct uvm_object      *uvn_attach __P((void *, vm_prot_t));
 
+#endif /* _KERNEL */
+
 #endif /* _UVM_UVM_EXTERN_H_ */
-
diff -r dbaf6e49516e -r cd5eb27370f8 sys/uvm/uvm_fault.h
--- a/sys/uvm/uvm_fault.h       Mon Jun 21 16:23:00 1999 +0000
+++ b/sys/uvm/uvm_fault.h       Mon Jun 21 17:25:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_fault.h,v 1.12 1999/06/16 22:11:23 thorpej Exp $   */
+/*     $NetBSD: uvm_fault.h,v 1.13 1999/06/21 17:25:11 thorpej Exp $   */
 
 /*
  *
@@ -65,6 +65,8 @@
        vsize_t size;                   /* size of interest */
 };
 
+#ifdef _KERNEL
+
 /*
  * fault prototypes
  */
@@ -83,4 +85,6 @@
 void uvm_fault_unwire __P((vm_map_t, vaddr_t, vaddr_t));
 void uvm_fault_unwire_locked __P((vm_map_t, vaddr_t, vaddr_t));
 
+#endif /* _KERNEL */
+
 #endif /* _UVM_UVM_FAULT_H_ */
diff -r dbaf6e49516e -r cd5eb27370f8 sys/uvm/uvm_glue.h
--- a/sys/uvm/uvm_glue.h        Mon Jun 21 16:23:00 1999 +0000
+++ b/sys/uvm/uvm_glue.h        Mon Jun 21 17:25:11 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_glue.h,v 1.5 1999/03/25 18:48:51 mrg Exp $ */
+/*     $NetBSD: uvm_glue.h,v 1.6 1999/06/21 17:25:11 thorpej Exp $     */
 
 /*
  *
@@ -37,10 +37,14 @@
 #ifndef _UVM_UVM_GLUE_H_
 #define _UVM_UVM_GLUE_H_
 
+#ifdef _KERNEL
+
 /*
  * uvm_glue.h
  */
 
 void uvm_swapout_threads __P((void));



Home | Main Index | Thread Index | Old Index