From 03d6a592fec88fb3813b0f5d96475645c91e9aec Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 21 May 2006 03:43:48 +0000 Subject: [PATCH] Clean up more #include files. Create an internal __boolean_t so two or three sys/ header files don't have to juggle the type. Use _KERNEL_STRUCTURES in variuos pieces of user code that delve into kvm. Reported-by: Rumko , walt --- sys/bus/cam/scsi/scsi_all.h | 9 +++++- sys/cpu/i386/include/pmap.h | 6 ++-- sys/cpu/i386/include/profile.h | 9 +++--- sys/cpu/i386/include/stdint.h | 3 +- sys/i386/include/nexusvar.h | 9 ++++-- sys/i386/include/physio_proc.h | 27 ++++++++++++++---- sys/i386/include/pmap.h | 6 ++-- sys/i386/include/profile.h | 9 +++--- sys/i386/include/stdint.h | 3 +- sys/net/altq/altq_var.h | 10 ++++++- sys/net/dummynet/ip_dummynet.h | 6 +++- sys/net/if_arp.h | 5 +++- sys/net/ifq_var.h | 13 +++++++-- sys/net/netisr.h | 37 +++++++++++++++++++------ sys/net/radix.h | 8 ++---- sys/net/route.h | 4 +-- sys/net/slcompress.h | 4 ++- sys/netgraph/netgraph.h | 9 ++++-- sys/platform/pc32/include/nexusvar.h | 9 ++++-- sys/platform/pc32/include/physio_proc.h | 27 ++++++++++++++---- sys/sys/buf.h | 10 ++++--- sys/sys/bus_private.h | 11 ++++++-- sys/sys/camlib.h | 11 ++++++-- sys/sys/ckpt.h | 15 +++++++--- sys/sys/eventhandler.h | 9 ++++-- sys/sys/eventvar.h | 14 ++++++---- sys/sys/gmon.h | 4 ++- sys/sys/kernel.h | 17 ++++++++---- sys/sys/ktrace.h | 5 +++- sys/sys/libkern.h | 15 ++++++++-- sys/sys/linker.h | 10 +++++-- sys/sys/malloc.h | 15 +++++----- sys/sys/mbuf.h | 10 +++++-- sys/sys/mman.h | 9 +++++- sys/sys/mount.h | 8 ++++-- sys/sys/msfbuf.h | 12 ++++---- sys/sys/msgport2.h | 12 ++++++-- sys/sys/objcache.h | 7 +++-- sys/sys/pipe.h | 5 +++- sys/sys/power.h | 9 +++++- sys/sys/proc.h | 7 +++-- sys/sys/protosw.h | 17 ++++++++---- sys/sys/select.h | 11 ++++++-- sys/sys/socket.h | 10 ++++++- sys/sys/socketops.h | 15 ++++++++-- sys/sys/socketvar.h | 12 +++++++- sys/sys/spinlock2.h | 17 ++++++++++-- sys/sys/sysmsg.h | 7 +++-- sys/sys/systm.h | 6 ++-- sys/sys/thread2.h | 21 ++++++++------ sys/sys/tty.h | 23 ++++++++++++--- sys/sys/types.h | 27 ++++++++++++++++-- sys/sys/uio.h | 3 +- sys/sys/vnode.h | 34 +++++++++++++++++++---- sys/vm/pmap.h | 31 +++++++++++---------- sys/vm/swap_pager.h | 6 ++-- sys/vm/vm.h | 9 +++--- sys/vm/vm_page.h | 29 +++++++++++-------- usr.bin/netstat/atalk.c | 3 +- usr.bin/netstat/inet6.c | 3 +- usr.bin/netstat/ipx.c | 3 +- usr.bin/netstat/mbuf.c | 3 +- usr.bin/netstat/netgraph.c | 3 +- usr.bin/systat/mbufs.c | 3 +- usr.sbin/sicontrol/sicontrol.c | 3 +- 65 files changed, 527 insertions(+), 200 deletions(-) diff --git a/sys/bus/cam/scsi/scsi_all.h b/sys/bus/cam/scsi/scsi_all.h index 306b2c39a4..98a83968d9 100644 --- a/sys/bus/cam/scsi/scsi_all.h +++ b/sys/bus/cam/scsi/scsi_all.h @@ -15,7 +15,7 @@ * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * * $FreeBSD: src/sys/cam/scsi/scsi_all.h,v 1.14.2.5 2003/08/24 03:26:37 ken Exp $ - * $DragonFly: src/sys/bus/cam/scsi/scsi_all.h,v 1.4 2006/01/22 14:03:51 swildner Exp $ + * $DragonFly: src/sys/bus/cam/scsi/scsi_all.h,v 1.5 2006/05/21 03:43:38 dillon Exp $ */ /* @@ -25,7 +25,12 @@ #ifndef _SCSI_SCSI_ALL_H #define _SCSI_SCSI_ALL_H 1 +#ifndef _SYS_CDEFS_H_ #include +#endif +#if !defined(_KERNEL) && !defined(_STDIO_H_) +#include /* FILE for userland protos */ +#endif #ifdef _KERNEL #include "opt_scsi.h" @@ -768,6 +773,7 @@ const char * scsi_sense_desc(int asc, int ascq, scsi_sense_action scsi_error_action(int asc, int ascq, struct scsi_inquiry_data *inq_data); #ifdef _KERNEL + void scsi_sense_print(struct ccb_scsiio *csio); int scsi_interpret_sense(union ccb *ccb, u_int32_t sense_flags, @@ -776,6 +782,7 @@ int scsi_interpret_sense(union ccb *ccb, u_int32_t *timeout, scsi_sense_action error_action); #else + char * scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, char *str, int str_len); diff --git a/sys/cpu/i386/include/pmap.h b/sys/cpu/i386/include/pmap.h index 116b09d1c7..edaf3161b4 100644 --- a/sys/cpu/i386/include/pmap.h +++ b/sys/cpu/i386/include/pmap.h @@ -43,7 +43,7 @@ * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/include/pmap.h,v 1.65.2.3 2001/10/03 07:15:37 peter Exp $ - * $DragonFly: src/sys/cpu/i386/include/pmap.h,v 1.9 2006/05/20 02:42:06 dillon Exp $ + * $DragonFly: src/sys/cpu/i386/include/pmap.h,v 1.10 2006/05/21 03:43:44 dillon Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -246,7 +246,7 @@ typedef struct pv_entry { vm_offset_t pv_va; /* virtual address for mapping */ TAILQ_ENTRY(pv_entry) pv_list; TAILQ_ENTRY(pv_entry) pv_plist; - vm_page_t pv_ptem; /* VM page for pte */ + struct vm_page *pv_ptem; /* VM page for pte */ } *pv_entry_t; #ifdef _KERNEL @@ -275,7 +275,7 @@ pmap_t pmap_kernel (void); void *pmap_mapdev (vm_paddr_t, vm_size_t); void pmap_unmapdev (vm_offset_t, vm_size_t); unsigned *pmap_pte (pmap_t, vm_offset_t) __pure2; -vm_page_t pmap_use_pt (pmap_t, vm_offset_t); +struct vm_page *pmap_use_pt (pmap_t, vm_offset_t); #ifdef SMP void pmap_set_opt (void); #endif diff --git a/sys/cpu/i386/include/profile.h b/sys/cpu/i386/include/profile.h index f6280dfa9b..7819da62fe 100644 --- a/sys/cpu/i386/include/profile.h +++ b/sys/cpu/i386/include/profile.h @@ -32,12 +32,15 @@ * * @(#)profile.h 8.1 (Berkeley) 6/11/93 * $FreeBSD: src/sys/i386/include/profile.h,v 1.20 1999/12/29 04:33:05 peter Exp $ - * $DragonFly: src/sys/cpu/i386/include/profile.h,v 1.7 2006/05/20 02:42:06 dillon Exp $ + * $DragonFly: src/sys/cpu/i386/include/profile.h,v 1.8 2006/05/21 03:43:44 dillon Exp $ */ #ifndef _MACHINE_PROFILE_H_ #define _MACHINE_PROFILE_H_ +#ifndef _SYS_CDEFS_H_ +#include +#endif #ifndef _SYS_TYPES_H_ #include #endif @@ -136,13 +139,11 @@ void stopguprof (struct gmonparam *p); #else /* !_KERNEL */ -#include - __BEGIN_DECLS #ifdef __GNUC__ void mcount (void) __asm(".mcount"); #endif -static void _mcount (uintfptr_t frompc, uintfptr_t selfpc); +/*static void _mcount (uintfptr_t frompc, uintfptr_t selfpc);*/ __END_DECLS #endif /* _KERNEL */ diff --git a/sys/cpu/i386/include/stdint.h b/sys/cpu/i386/include/stdint.h index 2f857e1859..16b70ab3b3 100644 --- a/sys/cpu/i386/include/stdint.h +++ b/sys/cpu/i386/include/stdint.h @@ -36,7 +36,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/include/_stdint.h,v 1.1 2002/07/29 17:41:07 mike Exp $ - * $DragonFly: src/sys/cpu/i386/include/stdint.h,v 1.4 2006/01/02 06:02:01 y0netan1 Exp $ + * $DragonFly: src/sys/cpu/i386/include/stdint.h,v 1.5 2006/05/21 03:43:44 dillon Exp $ */ #ifndef _MACHINE_STDINT_H_ @@ -51,6 +51,7 @@ typedef short __int16_t; typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; +typedef int __boolean_t; /* * This mess is to override compiler options that might restrict long long diff --git a/sys/i386/include/nexusvar.h b/sys/i386/include/nexusvar.h index b428753826..bc201a2489 100644 --- a/sys/i386/include/nexusvar.h +++ b/sys/i386/include/nexusvar.h @@ -24,12 +24,14 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/include/nexusvar.h,v 1.1 2000/09/28 00:37:31 peter Exp $ - * $DragonFly: src/sys/i386/include/Attic/nexusvar.h,v 1.2 2006/05/20 02:42:06 dillon Exp $ + * $DragonFly: src/sys/i386/include/Attic/nexusvar.h,v 1.3 2006/05/21 03:43:44 dillon Exp $ */ #ifndef _MACHINE_NEXUSVAR_H_ #define _MACHINE_NEXUSVAR_H_ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + #ifndef _SYS_TYPES_H_ #include #endif @@ -56,8 +58,11 @@ static __inline void nexus_set_ ## A(device_t dev, T t) \ BUS_WRITE_IVAR(device_get_parent(dev), dev, NEXUS_IVAR_ ## B, v); \ } +#ifdef _KERNEL NEXUS_ACCESSOR(pcibus, PCIBUS, u_int32_t) +#endif #undef NEXUS_ACCESSOR -#endif /* !_MACHINE_NEXUSVAR_H_ */ +#endif /* _KERNEL || _KERNEL_STRUCTURES */ +#endif /* !_MACHINE_NEXUSVAR_H_ */ diff --git a/sys/i386/include/physio_proc.h b/sys/i386/include/physio_proc.h index d105521702..4aa5176dac 100644 --- a/sys/i386/include/physio_proc.h +++ b/sys/i386/include/physio_proc.h @@ -1,8 +1,3 @@ -/* $FreeBSD: src/sys/i386/include/physio_proc.h,v 1.1.2.1 2000/10/29 11:05:48 non Exp $ */ -/* $DragonFly: src/sys/i386/include/Attic/physio_proc.h,v 1.12 2005/08/07 15:43:02 joerg Exp $ */ -/* $NecBSD: physio_proc.h,v 3.4 1999/07/23 20:47:03 honda Exp $ */ -/* $NetBSD$ */ - /* * [NetBSD for NEC PC-98 series] * Copyright (c) 1998 @@ -30,13 +25,31 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD: src/sys/i386/include/physio_proc.h,v 1.1.2.1 2000/10/29 11:05:48 non Exp $ + * $DragonFly: src/sys/i386/include/Attic/physio_proc.h,v 1.13 2006/05/21 03:43:44 dillon Exp $ + * $NecBSD: physio_proc.h,v 3.4 1999/07/23 20:47:03 honda Exp $ + * $NetBSD$ */ + #ifndef _MACHINE_PHYSIO_PROC_H_ #define _MACHINE_PHYSIO_PROC_H_ +#ifndef _KERNEL + +#error "This file should not be included by userland programs." + +#else + +#ifndef _SYS_BUF_H_ #include +#endif +#ifndef _SYS_QUEUE_H_ #include +#endif +#ifndef _SYS_THREAD2_H_ #include +#endif struct physio_proc { }; @@ -57,4 +70,6 @@ physio_proc_init(void) { return; } -#endif /* _MACHINE_PHYSIO_PROC_H_ */ + +#endif /* _KERNEL */ +#endif /* _MACHINE_PHYSIO_PROC_H_ */ diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index 665953ef51..5ad28c25a6 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -43,7 +43,7 @@ * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/include/pmap.h,v 1.65.2.3 2001/10/03 07:15:37 peter Exp $ - * $DragonFly: src/sys/i386/include/Attic/pmap.h,v 1.9 2006/05/20 02:42:06 dillon Exp $ + * $DragonFly: src/sys/i386/include/Attic/pmap.h,v 1.10 2006/05/21 03:43:44 dillon Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -246,7 +246,7 @@ typedef struct pv_entry { vm_offset_t pv_va; /* virtual address for mapping */ TAILQ_ENTRY(pv_entry) pv_list; TAILQ_ENTRY(pv_entry) pv_plist; - vm_page_t pv_ptem; /* VM page for pte */ + struct vm_page *pv_ptem; /* VM page for pte */ } *pv_entry_t; #ifdef _KERNEL @@ -275,7 +275,7 @@ pmap_t pmap_kernel (void); void *pmap_mapdev (vm_paddr_t, vm_size_t); void pmap_unmapdev (vm_offset_t, vm_size_t); unsigned *pmap_pte (pmap_t, vm_offset_t) __pure2; -vm_page_t pmap_use_pt (pmap_t, vm_offset_t); +struct vm_page *pmap_use_pt (pmap_t, vm_offset_t); #ifdef SMP void pmap_set_opt (void); #endif diff --git a/sys/i386/include/profile.h b/sys/i386/include/profile.h index e185d15b74..7d3d11a96b 100644 --- a/sys/i386/include/profile.h +++ b/sys/i386/include/profile.h @@ -32,12 +32,15 @@ * * @(#)profile.h 8.1 (Berkeley) 6/11/93 * $FreeBSD: src/sys/i386/include/profile.h,v 1.20 1999/12/29 04:33:05 peter Exp $ - * $DragonFly: src/sys/i386/include/Attic/profile.h,v 1.7 2006/05/20 02:42:06 dillon Exp $ + * $DragonFly: src/sys/i386/include/Attic/profile.h,v 1.8 2006/05/21 03:43:44 dillon Exp $ */ #ifndef _MACHINE_PROFILE_H_ #define _MACHINE_PROFILE_H_ +#ifndef _SYS_CDEFS_H_ +#include +#endif #ifndef _SYS_TYPES_H_ #include #endif @@ -136,13 +139,11 @@ void stopguprof (struct gmonparam *p); #else /* !_KERNEL */ -#include - __BEGIN_DECLS #ifdef __GNUC__ void mcount (void) __asm(".mcount"); #endif -static void _mcount (uintfptr_t frompc, uintfptr_t selfpc); +/*static void _mcount (uintfptr_t frompc, uintfptr_t selfpc);*/ __END_DECLS #endif /* _KERNEL */ diff --git a/sys/i386/include/stdint.h b/sys/i386/include/stdint.h index 951e49c6bf..2bc3d90e01 100644 --- a/sys/i386/include/stdint.h +++ b/sys/i386/include/stdint.h @@ -36,7 +36,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/include/_stdint.h,v 1.1 2002/07/29 17:41:07 mike Exp $ - * $DragonFly: src/sys/i386/include/Attic/stdint.h,v 1.4 2006/01/02 06:02:01 y0netan1 Exp $ + * $DragonFly: src/sys/i386/include/Attic/stdint.h,v 1.5 2006/05/21 03:43:44 dillon Exp $ */ #ifndef _MACHINE_STDINT_H_ @@ -51,6 +51,7 @@ typedef short __int16_t; typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; +typedef int __boolean_t; /* * This mess is to override compiler options that might restrict long long diff --git a/sys/net/altq/altq_var.h b/sys/net/altq/altq_var.h index 7f2b679fb0..4a8da1202b 100644 --- a/sys/net/altq/altq_var.h +++ b/sys/net/altq/altq_var.h @@ -1,5 +1,5 @@ /* $KAME: altq_var.h,v 1.17 2004/04/20 05:09:08 kjc Exp $ */ -/* $DragonFly: src/sys/net/altq/altq_var.h,v 1.1 2005/02/11 22:25:57 joerg Exp $ */ +/* $DragonFly: src/sys/net/altq/altq_var.h,v 1.2 2006/05/21 03:43:46 dillon Exp $ */ /* * Copyright (C) 1998-2003 @@ -31,10 +31,18 @@ #ifdef _KERNEL +#ifndef _SYS_PARAM_H_ #include +#endif +#ifndef _SYS_KERNEL_H_ #include +#endif +#ifndef _SYS_MALLOC_H_ #include +#endif +#ifndef _SYS_QUEUE_H_ #include +#endif MALLOC_DECLARE(M_ALTQ); diff --git a/sys/net/dummynet/ip_dummynet.h b/sys/net/dummynet/ip_dummynet.h index f320eb3428..8d935de980 100644 --- a/sys/net/dummynet/ip_dummynet.h +++ b/sys/net/dummynet/ip_dummynet.h @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netinet/ip_dummynet.h,v 1.10.2.9 2003/05/13 09:31:06 maxim Exp $ - * $DragonFly: src/sys/net/dummynet/ip_dummynet.h,v 1.3 2004/09/15 20:30:09 joerg Exp $ + * $DragonFly: src/sys/net/dummynet/ip_dummynet.h,v 1.4 2006/05/21 03:43:46 dillon Exp $ */ #ifndef _IP_DUMMYNET_H @@ -110,6 +110,8 @@ struct dn_heap { struct dn_heap_entry *p ; /* really an array of "size" entries */ } ; +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + /* * struct dn_pkt identifies a packet in the dummynet queue, but * is also used to tag packets passed back to the various destinations @@ -145,6 +147,8 @@ struct dn_pkt { int flags ; /* flags, for ip_output (IPv6 ?) */ }; +#endif + /* * Overall structure of dummynet (with WF2Q+): diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h index 2c9b789dbe..1e7d3002fe 100644 --- a/sys/net/if_arp.h +++ b/sys/net/if_arp.h @@ -32,7 +32,7 @@ * * @(#)if_arp.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if_arp.h,v 1.14.2.3 2002/02/20 23:34:09 fjoe Exp $ - * $DragonFly: src/sys/net/if_arp.h,v 1.6 2006/05/20 02:42:08 dillon Exp $ + * $DragonFly: src/sys/net/if_arp.h,v 1.7 2006/05/21 03:43:45 dillon Exp $ */ #ifndef _NET_IF_ARP_H_ @@ -47,6 +47,9 @@ #ifndef _NET_IF_H_ #include #endif +#ifndef _NET_IF_VAR_H_ +#include +#endif /* * Address Resolution Protocol. diff --git a/sys/net/ifq_var.h b/sys/net/ifq_var.h index 1adb6a3a3c..dfabe90cf8 100644 --- a/sys/net/ifq_var.h +++ b/sys/net/ifq_var.h @@ -28,7 +28,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/net/ifq_var.h,v 1.7 2006/05/20 02:42:08 dillon Exp $ + * $DragonFly: src/sys/net/ifq_var.h,v 1.8 2006/05/21 03:43:45 dillon Exp $ */ /* * NOTE ON MPSAFE access. Routines which manipulate the packet queue must @@ -41,7 +41,13 @@ #ifndef _NET_IFQ_VAR_H_ #define _NET_IFQ_VAR_H_ -#if defined(_KERNEL) && !defined(_SYS_SYSTM_H_) +#ifndef _KERNEL + +#error "This file should not be included by userland programs." + +#else + +#ifndef _SYS_SYSTM_H_ #include #endif #ifndef _SYS_THREAD2_H_ @@ -205,4 +211,5 @@ ifq_set_maxlen(struct ifaltq *_ifq, int _len) void ifq_set_classic(struct ifaltq *); -#endif +#endif /* _KERNEL */ +#endif /* _NET_IFQ_VAR_H_ */ diff --git a/sys/net/netisr.h b/sys/net/netisr.h index cfbfbeb922..bab9b8a38a 100644 --- a/sys/net/netisr.h +++ b/sys/net/netisr.h @@ -82,14 +82,12 @@ * * @(#)netisr.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/netisr.h,v 1.21.2.5 2002/02/09 23:02:39 luigi Exp $ - * $DragonFly: src/sys/net/netisr.h,v 1.22 2006/01/31 19:05:35 dillon Exp $ + * $DragonFly: src/sys/net/netisr.h,v 1.23 2006/05/21 03:43:45 dillon Exp $ */ #ifndef _NET_NETISR_H_ #define _NET_NETISR_H_ -#include - /* * The networking code runs off software interrupts. * @@ -123,16 +121,27 @@ #define NETISR_MAX 32 -TAILQ_HEAD(notifymsglist, netmsg_so_notify); - -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) +#ifndef _SYS_TYPES_H_ +#include +#endif +#ifndef _SYS_QUEUE_H_ +#include +#endif +#ifndef _SYS_PROTOSW_H_ #include +#endif +#ifndef _SYS_MSGPORT_H_ +#include +#endif + +TAILQ_HEAD(notifymsglist, netmsg_so_notify); struct netmsg; typedef int (*netisr_fn_t)(struct netmsg *); -typedef boolean_t (*msg_predicate_fn_t)(struct netmsg *); +typedef __boolean_t (*msg_predicate_fn_t)(struct netmsg *); /* * Base class. All net messages must start with the same fields. @@ -169,6 +178,10 @@ struct netmsg_so_notify { #define NM_REVENT 0x1 /* event on receive buffer */ #define NM_SEVENT 0x2 /* event on send buffer */ +#endif + +#ifdef _KERNEL + /* * for dispatching pr_ functions, * until they can be converted to message-passing @@ -199,6 +212,10 @@ int netmsg_pr_timeout(lwkt_msg_t); int netmsg_so_notify(lwkt_msg_t); int netmsg_so_notify_abort(lwkt_msg_t); +#endif + +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + typedef lwkt_port_t (*lwkt_portfn_t)(struct mbuf **); struct netisr { @@ -208,6 +225,10 @@ struct netisr { struct netmsg ni_netmsg; /* for sched_netisr() (no-data) */ }; +#endif + +#ifdef _KERNEL + extern lwkt_port netisr_afree_rport; lwkt_port_t cpu0_portfn(struct mbuf **mptr); @@ -221,6 +242,6 @@ void netmsg_service_loop(void *arg); void netmsg_service_sync(void); void schednetisr(int); -#endif /* KERNEL */ +#endif /* _KERNEL */ #endif /* _NET_NETISR_H_ */ diff --git a/sys/net/radix.h b/sys/net/radix.h index 1cc8ff7646..48db7d3d84 100644 --- a/sys/net/radix.h +++ b/sys/net/radix.h @@ -32,7 +32,7 @@ * * @(#)radix.h 8.2 (Berkeley) 10/31/94 * $FreeBSD: src/sys/net/radix.h,v 1.16.2.1 2000/05/03 19:17:11 wollman Exp $ - * $DragonFly: src/sys/net/radix.h,v 1.10 2006/05/20 02:42:08 dillon Exp $ + * $DragonFly: src/sys/net/radix.h,v 1.11 2006/05/21 03:43:45 dillon Exp $ */ #ifndef _NET_RADIX_H_ @@ -161,8 +161,6 @@ struct radix_node_head { }; #ifndef _KERNEL -#include -#define boolean_t bool #define R_Malloc(p, t, n) (p = (t) malloc((n))) #define Free(p) free(p); #else @@ -172,8 +170,8 @@ struct radix_node_head { void rn_init (void); int rn_inithead (void **, int); -boolean_t rn_refines (char *, char *); -struct radix_node *rn_addmask (char *, boolean_t, int), +__boolean_t rn_refines (char *, char *); +struct radix_node *rn_addmask (char *, __boolean_t, int), *rn_addroute (char *, char *, struct radix_node_head *, struct radix_node [2]), *rn_delete (char *, char *, struct radix_node_head *), diff --git a/sys/net/route.h b/sys/net/route.h index c30358f096..7f9ebd23a9 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -82,7 +82,7 @@ * * @(#)route.h 8.4 (Berkeley) 1/9/95 * $FreeBSD: src/sys/net/route.h,v 1.36.2.5 2002/02/01 11:48:01 ru Exp $ - * $DragonFly: src/sys/net/route.h,v 1.19 2006/05/20 02:42:08 dillon Exp $ + * $DragonFly: src/sys/net/route.h,v 1.20 2006/05/21 03:43:45 dillon Exp $ */ #ifndef _NET_ROUTE_H_ @@ -356,7 +356,7 @@ void rtalloc (struct route *); void rtalloc_ign (struct route *, u_long); struct rtentry * - _rtlookup (struct sockaddr *, boolean_t, u_long); + _rtlookup (struct sockaddr *, __boolean_t, u_long); #define RTL_REPORTMSG TRUE #define RTL_DONTREPORT FALSE diff --git a/sys/net/slcompress.h b/sys/net/slcompress.h index 4bf32142b0..e76210aefd 100644 --- a/sys/net/slcompress.h +++ b/sys/net/slcompress.h @@ -35,7 +35,7 @@ * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: * - Initial distribution. * $FreeBSD: src/sys/net/slcompress.h,v 1.14.2.1 2000/05/05 13:37:06 jlemon Exp $ - * $DragonFly: src/sys/net/slcompress.h,v 1.4 2006/05/20 02:42:08 dillon Exp $ + * $DragonFly: src/sys/net/slcompress.h,v 1.5 2006/05/21 03:43:45 dillon Exp $ */ #ifndef _NET_SLCOMPRESS_H_ @@ -160,6 +160,8 @@ struct slcompress { /* flag values */ #define SLF_TOSS 1 /* tossing rcvd frames because of input err */ +struct mbuf; + void sl_compress_init (struct slcompress *, int); u_int sl_compress_tcp (struct mbuf *, struct ip *, struct slcompress *, int); diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 026ea8a049..5c186688cb 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -37,7 +37,7 @@ * Author: Julian Elischer * * $FreeBSD: src/sys/netgraph/netgraph.h,v 1.6.2.7 2002/04/14 23:31:08 julian Exp $ - * $DragonFly: src/sys/netgraph/netgraph.h,v 1.3 2006/05/20 02:42:11 dillon Exp $ + * $DragonFly: src/sys/netgraph/netgraph.h,v 1.4 2006/05/21 03:43:47 dillon Exp $ * $Whistle: netgraph.h,v 1.29 1999/11/01 07:56:13 julian Exp $ */ @@ -61,8 +61,10 @@ #endif #ifndef _KERNEL + #error "This file should not be included in user level programs" -#endif + +#else #define NG_ABI_VERSION NG_VERSION @@ -352,5 +354,6 @@ void ng_unname(node_p node); void ng_unref(node_p node); int ng_wait_node(node_p node, char *msg); -#endif /* _NETGRAPH_NETGRAPH_H_ */ +#endif /* _KERNEL */ +#endif /* _NETGRAPH_NETGRAPH_H_ */ diff --git a/sys/platform/pc32/include/nexusvar.h b/sys/platform/pc32/include/nexusvar.h index b0826d8ec1..cc97892a69 100644 --- a/sys/platform/pc32/include/nexusvar.h +++ b/sys/platform/pc32/include/nexusvar.h @@ -24,12 +24,14 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/include/nexusvar.h,v 1.1 2000/09/28 00:37:31 peter Exp $ - * $DragonFly: src/sys/platform/pc32/include/nexusvar.h,v 1.2 2006/05/20 02:42:06 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/include/nexusvar.h,v 1.3 2006/05/21 03:43:44 dillon Exp $ */ #ifndef _MACHINE_NEXUSVAR_H_ #define _MACHINE_NEXUSVAR_H_ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + #ifndef _SYS_TYPES_H_ #include #endif @@ -56,8 +58,11 @@ static __inline void nexus_set_ ## A(device_t dev, T t) \ BUS_WRITE_IVAR(device_get_parent(dev), dev, NEXUS_IVAR_ ## B, v); \ } +#ifdef _KERNEL NEXUS_ACCESSOR(pcibus, PCIBUS, u_int32_t) +#endif #undef NEXUS_ACCESSOR -#endif /* !_MACHINE_NEXUSVAR_H_ */ +#endif /* _KERNEL || _KERNEL_STRUCTURES */ +#endif /* !_MACHINE_NEXUSVAR_H_ */ diff --git a/sys/platform/pc32/include/physio_proc.h b/sys/platform/pc32/include/physio_proc.h index 8969d2cf44..20c8b3dfee 100644 --- a/sys/platform/pc32/include/physio_proc.h +++ b/sys/platform/pc32/include/physio_proc.h @@ -1,8 +1,3 @@ -/* $FreeBSD: src/sys/i386/include/physio_proc.h,v 1.1.2.1 2000/10/29 11:05:48 non Exp $ */ -/* $DragonFly: src/sys/platform/pc32/include/Attic/physio_proc.h,v 1.12 2005/08/07 15:43:02 joerg Exp $ */ -/* $NecBSD: physio_proc.h,v 3.4 1999/07/23 20:47:03 honda Exp $ */ -/* $NetBSD$ */ - /* * [NetBSD for NEC PC-98 series] * Copyright (c) 1998 @@ -30,13 +25,31 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD: src/sys/i386/include/physio_proc.h,v 1.1.2.1 2000/10/29 11:05:48 non Exp $ + * $DragonFly: src/sys/platform/pc32/include/Attic/physio_proc.h,v 1.13 2006/05/21 03:43:44 dillon Exp $ + * $NecBSD: physio_proc.h,v 3.4 1999/07/23 20:47:03 honda Exp $ + * $NetBSD$ */ + #ifndef _MACHINE_PHYSIO_PROC_H_ #define _MACHINE_PHYSIO_PROC_H_ +#ifndef _KERNEL + +#error "This file should not be included by userland programs." + +#else + +#ifndef _SYS_BUF_H_ #include +#endif +#ifndef _SYS_QUEUE_H_ #include +#endif +#ifndef _SYS_THREAD2_H_ #include +#endif struct physio_proc { }; @@ -57,4 +70,6 @@ physio_proc_init(void) { return; } -#endif /* _MACHINE_PHYSIO_PROC_H_ */ + +#endif /* _KERNEL */ +#endif /* _MACHINE_PHYSIO_PROC_H_ */ diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 2f812d8c13..dc66e4c7b9 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -37,12 +37,14 @@ * * @(#)buf.h 8.9 (Berkeley) 3/30/95 * $FreeBSD: src/sys/sys/buf.h,v 1.88.2.10 2003/01/25 19:02:23 dillon Exp $ - * $DragonFly: src/sys/sys/buf.h,v 1.35 2006/05/04 18:32:23 dillon Exp $ + * $DragonFly: src/sys/sys/buf.h,v 1.36 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_BUF_H_ #define _SYS_BUF_H_ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + #ifndef _SYS_QUEUE_H_ #include #endif @@ -395,6 +397,6 @@ int scan_all_buffers (int (*)(struct buf *, void *), void *); void reassignbuf (struct buf *); struct buf *trypbuf (int *); -#endif /* _KERNEL */ - -#endif /* !_SYS_BUF_H_ */ +#endif /* _KERNEL */ +#endif /* _KERNEL || _KERNEL_STRUCTURES */ +#endif /* !_SYS_BUF_H_ */ diff --git a/sys/sys/bus_private.h b/sys/sys/bus_private.h index 8f9fa7670b..fd15799a17 100644 --- a/sys/sys/bus_private.h +++ b/sys/sys/bus_private.h @@ -24,17 +24,21 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/bus_private.h,v 1.11.2.2 2000/08/03 00:25:22 peter Exp $ - * $DragonFly: src/sys/sys/bus_private.h,v 1.7 2004/12/30 07:01:52 cpressey Exp $ + * $DragonFly: src/sys/sys/bus_private.h,v 1.8 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_BUS_PRIVATE_H_ #define _SYS_BUS_PRIVATE_H_ #if !defined(_KERNEL) && !defined(_KERNEL_STRUCTURES) + #error "This file should not be included by userland programs." -#endif +#else + +#ifndef _SYS_BUS_H_ #include +#endif /* * Used to attach drivers to devclasses. @@ -138,4 +142,5 @@ struct device_op_desc { const char* name; /* unique name (for registration) */ }; -#endif /* !_SYS_BUS_PRIVATE_H_ */ +#endif /* _KERNEL || _KERNEL_STRUCTURES */ +#endif /* !_SYS_BUS_PRIVATE_H_ */ diff --git a/sys/sys/camlib.h b/sys/sys/camlib.h index e7b19f8a69..38592df076 100644 --- a/sys/sys/camlib.h +++ b/sys/sys/camlib.h @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/lib/libcam/camlib.h,v 1.2 1999/08/28 00:04:06 peter Exp $ - * $DragonFly: src/sys/sys/camlib.h,v 1.2 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/camlib.h,v 1.3 2006/05/21 03:43:47 dillon Exp $ */ /* * Buffer encoding/decoding routines taken from the original FreeBSD SCSI @@ -65,11 +65,18 @@ #ifndef _SYS_CAMLIB_H_ #define _SYS_CAMLIB_H_ +#ifndef _SYS_CDEFS_H_ #include +#endif +#ifndef _SYS_PARAM_H_ #include - +#endif +#ifndef _BUS_CAM_CAM_H_ #include +#endif +#ifndef _BUS_CAM_CAM_CCB_H_ #include +#endif #define CAM_ERRBUF_SIZE 2048 /* sizeof the CAM libarary error string */ diff --git a/sys/sys/ckpt.h b/sys/sys/ckpt.h index 51b870f689..5f664a2a8b 100644 --- a/sys/sys/ckpt.h +++ b/sys/sys/ckpt.h @@ -22,11 +22,17 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/ckpt.h,v 1.7 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/ckpt.h,v 1.8 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_CKPT_H_ #define _SYS_CKPT_H_ +#if !defined(_KERNEL) && !defined(_KERNEL_STRUCTURES) + +#error "This file should not be included by userland programs." + +#else + #ifndef _SYS_TYPES_H_ #include #endif @@ -102,7 +108,8 @@ struct vn_hdr { #define TRACE_EXIT #define TRACE_ERR #define PRINTF(args) -#endif -#endif +#endif /* DEBUG */ +#endif /* _KERNEL */ -#endif +#endif /* _KERNEL || _KERNEL_STRUCTURES */ +#endif /* _SYS_CKPT_H_ */ diff --git a/sys/sys/eventhandler.h b/sys/sys/eventhandler.h index 24078fb67f..ec5deadf1b 100644 --- a/sys/sys/eventhandler.h +++ b/sys/sys/eventhandler.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/eventhandler.h,v 1.5 2000/01/16 06:11:33 bde Exp $ - * $DragonFly: src/sys/sys/eventhandler.h,v 1.6 2004/12/30 07:01:52 cpressey Exp $ + * $DragonFly: src/sys/sys/eventhandler.h,v 1.7 2006/05/21 03:43:47 dillon Exp $ */ #include @@ -33,8 +33,10 @@ #define SYS_EVENTHANDLER_H #if !defined(_KERNEL) && !defined(_KERNEL_STRUCTURES) + #error "This file should not be included by userland programs." -#endif + +#else struct eventhandler_entry { @@ -167,4 +169,5 @@ EVENTHANDLER_DECLARE(shutdown_pre_sync, shutdown_fn); /* before fs sync */ EVENTHANDLER_DECLARE(shutdown_post_sync, shutdown_fn); /* after fs sync */ EVENTHANDLER_DECLARE(shutdown_final, shutdown_fn); -#endif /* SYS_EVENTHANDLER_H */ +#endif /* _KERNEL */ +#endif /* SYS_EVENTHANDLER_H */ diff --git a/sys/sys/eventvar.h b/sys/sys/eventvar.h index 324f7c3f0e..85cc751b1e 100644 --- a/sys/sys/eventvar.h +++ b/sys/sys/eventvar.h @@ -24,12 +24,18 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/eventvar.h,v 1.1.2.2 2000/07/18 21:49:12 jlemon Exp $ - * $DragonFly: src/sys/sys/eventvar.h,v 1.4 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/eventvar.h,v 1.5 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_EVENTVAR_H_ #define _SYS_EVENTVAR_H_ +#if !defined(_KERNEL) && !defined(_KERNEL_STRUCTURES) + +#error "This file should not be included by userland programs." + +#else + #ifndef _SYS_QUEUE_H_ #include #endif @@ -40,9 +46,6 @@ #include #endif -#if !defined(_KERNEL) && !defined(_KERNEL_STRUCTURES) -#error "This file should not be included by userland programs." -#endif #define KQ_NEVENTS 8 /* minimize copy{in,out} calls */ #define KQEXTENT 256 /* linear growth by this amount */ @@ -58,4 +61,5 @@ struct kqueue { struct kevent kq_kev[KQ_NEVENTS]; }; -#endif /* !_SYS_EVENTVAR_H_ */ +#endif /* _KERNEL */ +#endif /* !_SYS_EVENTVAR_H_ */ diff --git a/sys/sys/gmon.h b/sys/sys/gmon.h index 3e519a87ed..69e755398f 100644 --- a/sys/sys/gmon.h +++ b/sys/sys/gmon.h @@ -32,13 +32,15 @@ * * @(#)gmon.h 8.2 (Berkeley) 1/4/94 * $FreeBSD: src/sys/sys/gmon.h,v 1.15 1999/08/28 00:51:45 peter Exp $ - * $DragonFly: src/sys/sys/gmon.h,v 1.2 2003/06/17 04:28:58 dillon Exp $ + * $DragonFly: src/sys/sys/gmon.h,v 1.3 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_GMON_H_ #define _SYS_GMON_H_ +#ifndef _MACHINE_PROFILE_H_ #include +#endif /* * Structure prepended to gmon.out profiling data file. diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index e400cf0759..f701440c73 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -40,12 +40,16 @@ * * @(#)kernel.h 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/sys/kernel.h,v 1.63.2.9 2002/07/02 23:00:30 archie Exp $ - * $DragonFly: src/sys/sys/kernel.h,v 1.20 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/kernel.h,v 1.21 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_KERNEL_H_ #define _SYS_KERNEL_H_ +#ifndef _KERNEL +#error "This file should not be included by userland programs." +#else + #ifndef _SYS_PARAM_H_ #include #endif @@ -55,8 +59,9 @@ #ifdef _KERNEL -/* for intrhook below */ +#ifndef _SYS_QUEUE_H_ #include +#endif /* Global variables for the kernel. */ @@ -255,6 +260,7 @@ void sysinit_add (struct sysinit **, struct sysinit **); */ extern void tunable_int_init(void *); + struct tunable_int { const char *path; int *var; @@ -329,7 +335,10 @@ struct tunable_str { /* * Compatibility. To be deprecated after LKM is removed. */ +#ifndef _SYS_MODULE_H_ #include +#endif + #define PSEUDO_SET(sym, name) \ static int name ## _modevent(module_t mod, int type, void *data) \ { \ @@ -354,9 +363,6 @@ struct tunable_str { extern struct linker_set execsw_set; - - - struct intr_config_hook { TAILQ_ENTRY(intr_config_hook) ich_links; void (*ich_func) (void *); @@ -367,4 +373,5 @@ struct intr_config_hook { int config_intrhook_establish (struct intr_config_hook *); void config_intrhook_disestablish (struct intr_config_hook *); +#endif /* _KERNEL */ #endif /* !_SYS_KERNEL_H_*/ diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h index e7b7106f86..c4e4bf9b7f 100644 --- a/sys/sys/ktrace.h +++ b/sys/sys/ktrace.h @@ -32,7 +32,7 @@ * * @(#)ktrace.h 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/sys/sys/ktrace.h,v 1.19.2.3 2001/01/06 09:58:23 alfred Exp $ - * $DragonFly: src/sys/sys/ktrace.h,v 1.7 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/ktrace.h,v 1.8 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_KTRACE_H_ @@ -41,6 +41,9 @@ #ifndef _SYS_TYPES_H_ #include #endif +#ifndef _SYS_TIME_H_ +#include +#endif #ifndef _SYS_UIO_H_ #include #endif diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index d895d5d97e..f92d0898bf 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -32,15 +32,23 @@ * * @(#)libkern.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/sys/libkern.h,v 1.20.2.2 2001/09/30 21:12:54 luigi Exp $ - * $DragonFly: src/sys/sys/libkern.h,v 1.7 2004/05/05 00:17:45 hsu Exp $ + * $DragonFly: src/sys/sys/libkern.h,v 1.8 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_LIBKERN_H_ #define _SYS_LIBKERN_H_ +#if !defined(_KERNEL) +#error "This file should not be included by userland programs." +#else + +#ifndef _SYS_CDEFS_H_ #include +#endif +#ifndef _SYS_TYPES_H_ #include -#ifdef _KERNEL +#endif +#ifndef _SYS_SYSTM_H_ #include #endif @@ -129,4 +137,5 @@ memset(void *b, int c, size_t len) #define FNM_IGNORECASE FNM_CASEFOLD #define FNM_FILE_NAME FNM_PATHNAME -#endif /* !_SYS_LIBKERN_H_ */ +#endif /* _KERNEL */ +#endif /* !_SYS_LIBKERN_H_ */ diff --git a/sys/sys/linker.h b/sys/sys/linker.h index 5cac50906f..a1bf4cc4ec 100644 --- a/sys/sys/linker.h +++ b/sys/sys/linker.h @@ -24,20 +24,21 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/linker.h,v 1.17.2.1 2002/03/11 01:13:53 dd Exp $ - * $DragonFly: src/sys/sys/linker.h,v 1.8 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/linker.h,v 1.9 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_LINKER_H_ #define _SYS_LINKER_H_ -#ifdef _KERNEL - #ifndef _SYS_TYPES_H_ #include #endif #ifndef _SYS_PARAM_H_ #include #endif + +#ifdef _KERNEL + #ifndef _SYS_QUEUE_H_ #include #endif @@ -316,11 +317,14 @@ struct kld_sym_lookup { u_long symvalue; size_t symsize; }; + #define KLDSYM_LOOKUP 1 #ifndef _KERNEL +#ifndef _SYS_CDEFS_H_ #include +#endif __BEGIN_DECLS int kldload(const char *); diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index dd8937ccef..43907546c6 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -32,12 +32,19 @@ * * @(#)malloc.h 8.5 (Berkeley) 5/3/95 * $FreeBSD: src/sys/sys/malloc.h,v 1.48.2.2 2002/03/16 02:19:16 archie Exp $ - * $DragonFly: src/sys/sys/malloc.h,v 1.21 2005/03/28 18:49:25 joerg Exp $ + * $DragonFly: src/sys/sys/malloc.h,v 1.22 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_MALLOC_H_ #define _SYS_MALLOC_H_ +#ifndef _SYS_TYPES_H_ +#include +#endif +#ifndef _MACHINE_TYPES_H_ +#include /* vm_paddr_t and __* types */ +#endif + #ifndef _MACHINE_PARAM_H_ #include /* for SMP_MAXCPU */ #endif @@ -48,12 +55,6 @@ #include /* for VM_MIN_KERNEL_ADDRESS */ #endif -#define splmem splhigh - -#ifndef _MACHINE_TYPES_H_ -#include /* vm_paddr_t */ -#endif - #endif /* _KERNEL */ /* diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 2bfc8595e3..b33003d6c0 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -34,12 +34,14 @@ * * @(#)mbuf.h 8.5 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/mbuf.h,v 1.44.2.17 2003/04/15 06:15:02 silby Exp $ - * $DragonFly: src/sys/sys/mbuf.h,v 1.34 2006/05/20 06:32:41 dillon Exp $ + * $DragonFly: src/sys/sys/mbuf.h,v 1.35 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_MBUF_H_ #define _SYS_MBUF_H_ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + #ifndef _SYS_TYPES_H_ #include #endif @@ -589,6 +591,8 @@ m_tag_find(struct mbuf *m, int type, struct m_tag *start) { return m_tag_locate(m, MTAG_ABI_COMPAT, type, start); } -#endif /* _KERNEL */ -#endif /* !_SYS_MBUF_H_ */ +#endif /* _KERNEL */ + +#endif /* _KERNEL || _KERNEL_STRUCTURES */ +#endif /* !_SYS_MBUF_H_ */ diff --git a/sys/sys/mman.h b/sys/sys/mman.h index b92447e4ac..5cb1989f8b 100644 --- a/sys/sys/mman.h +++ b/sys/sys/mman.h @@ -32,13 +32,15 @@ * * @(#)mman.h 8.2 (Berkeley) 1/9/95 * $FreeBSD: src/sys/sys/mman.h,v 1.29.2.1 2001/08/25 07:25:43 dillon Exp $ - * $DragonFly: src/sys/sys/mman.h,v 1.3 2003/08/20 07:31:21 rob Exp $ + * $DragonFly: src/sys/sys/mman.h,v 1.4 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_MMAN_H_ #define _SYS_MMAN_H_ +#ifndef _SYS__POSIX_H_ #include +#endif /* * Inheritance for minherit() @@ -133,7 +135,12 @@ #ifndef _KERNEL +#ifndef _SYS_TYPES_H_ +#include +#endif +#ifndef _SYS_CDEFS_H_ #include +#endif __BEGIN_DECLS #ifdef _P1003_1B_VISIBLE diff --git a/sys/sys/mount.h b/sys/sys/mount.h index a70e51be6b..8ee1de3460 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -32,7 +32,7 @@ * * @(#)mount.h 8.21 (Berkeley) 5/20/95 * $FreeBSD: src/sys/sys/mount.h,v 1.89.2.7 2003/04/04 20:35:57 tegge Exp $ - * $DragonFly: src/sys/sys/mount.h,v 1.25 2006/05/07 00:24:58 dillon Exp $ + * $DragonFly: src/sys/sys/mount.h,v 1.26 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_MOUNT_H_ @@ -46,10 +46,14 @@ #endif /* !_POSIX_C_SOURCE */ #endif /* !_KERNEL */ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) +#ifndef _SYS_QUEUE_H_ #include -#ifdef _KERNEL +#endif +#ifndef _SYS_LOCK_H_ #include #endif +#endif struct thread; struct journal; diff --git a/sys/sys/msfbuf.h b/sys/sys/msfbuf.h index 70dcde1ba0..cbf3447615 100644 --- a/sys/sys/msfbuf.h +++ b/sys/sys/msfbuf.h @@ -39,14 +39,16 @@ * Copyright (c) 1998 David Greenman. All rights reserved. * src/sys/sys/sfbuf.h,v 1.4 2004/04/01 17:58:06 dillon * - * $DragonFly: src/sys/sys/msfbuf.h,v 1.11 2005/03/05 05:04:32 dillon Exp $ + * $DragonFly: src/sys/sys/msfbuf.h,v 1.12 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_MSFBUF_H_ #define _SYS_MSFBUF_H_ #if !defined(_KERNEL) && !defined(_KERNEL_STRUCTURES) + #error "This file should not be included by userland programs." -#endif + +#else #ifndef _SYS_QUEUE_H_ #include @@ -143,6 +145,6 @@ int msf_uio_iterate(struct uio *uio, void msf_buf_free(struct msf_buf *); void msf_buf_ref(struct msf_buf *); -#endif /* _KERNEL */ - -#endif +#endif /* _KERNEL */ +#endif /* _KERNEL || _KERNEL_STRUCTURES */ +#endif /* _SYS_MSFBUF_H_ */ diff --git a/sys/sys/msgport2.h b/sys/sys/msgport2.h index 216ebebb8d..5bb89f62be 100644 --- a/sys/sys/msgport2.h +++ b/sys/sys/msgport2.h @@ -3,12 +3,18 @@ * * Implements Inlines for LWKT messages and ports. * - * $DragonFly: src/sys/sys/msgport2.h,v 1.10 2004/06/04 20:35:39 dillon Exp $ + * $DragonFly: src/sys/sys/msgport2.h,v 1.11 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_MSGPORT2_H_ #define _SYS_MSGPORT2_H_ +#ifndef _KERNEL + +#error "This file should not be included by userland programs." + +#else + #ifndef _SYS_THREAD2_H_ #include #endif @@ -119,5 +125,5 @@ lwkt_checkmsg(lwkt_msg_t msg) return(msg->ms_flags & MSGF_DONE); } -#endif - +#endif /* _KERNEL */ +#endif /* _SYS_MSGPORT2_H_ */ diff --git a/sys/sys/objcache.h b/sys/sys/objcache.h index d71cae0a8a..153554cf28 100644 --- a/sys/sys/objcache.h +++ b/sys/sys/objcache.h @@ -29,12 +29,14 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/objcache.h,v 1.4 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/objcache.h,v 1.5 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _OBJCACHE_H_ #define _OBJCACHE_H_ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + #ifndef _SYS_TYPES_H_ #include #endif @@ -95,4 +97,5 @@ void objcache_nop_free(void *obj, void *allocator_args); #endif /* !_KERNEL */ -#endif +#endif /* _KERNEL || _KERNEL_STRUCTURES */ +#endif /* _SYS_OBJCACHE_H_ */ diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h index 4004311856..c78257d043 100644 --- a/sys/sys/pipe.h +++ b/sys/sys/pipe.h @@ -19,12 +19,14 @@ * are met. * * $FreeBSD: src/sys/sys/pipe.h,v 1.16 1999/12/29 04:24:45 peter Exp $ - * $DragonFly: src/sys/sys/pipe.h,v 1.8 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/pipe.h,v 1.9 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_PIPE_H_ #define _SYS_PIPE_H_ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + #ifndef _SYS_TYPES_H_ #include #endif @@ -114,4 +116,5 @@ struct pipe { int pipe_busy; /* busy flag, mostly to handle rundown sanely */ }; +#endif /* _KERNEL || _KERNEL_STRUCTURES */ #endif /* !_SYS_PIPE_H_ */ diff --git a/sys/sys/power.h b/sys/sys/power.h index 24e945d6bc..a12deeb1f3 100644 --- a/sys/sys/power.h +++ b/sys/sys/power.h @@ -24,12 +24,18 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/power.h,v 1.3.6.1 2003/08/18 20:22:23 jhb Exp $ - * $DragonFly: src/sys/sys/power.h,v 1.2 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/power.h,v 1.3 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_POWER_H_ #define _SYS_POWER_H_ +#ifndef _KERNEL + +#error "This file should not be included by userland programs." + +#else + #ifndef _SYS_TYPES_H_ #include #endif @@ -67,5 +73,6 @@ extern void power_profile_set_state(int); typedef void (*power_profile_change_hook)(void *, int); EVENTHANDLER_DECLARE(power_profile_change, power_profile_change_hook); +#endif /* _KERNEL */ #endif /* !_SYS_POWER_H_ */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index b3a1a6120c..33a926f4be 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -37,15 +37,17 @@ * * @(#)proc.h 8.15 (Berkeley) 5/19/95 * $FreeBSD: src/sys/sys/proc.h,v 1.99.2.9 2003/06/06 20:21:32 tegge Exp $ - * $DragonFly: src/sys/sys/proc.h,v 1.74 2006/05/17 20:20:55 dillon Exp $ + * $DragonFly: src/sys/sys/proc.h,v 1.75 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_PROC_H_ #define _SYS_PROC_H_ #if !defined(_KERNEL) && !defined(_KERNEL_STRUCTURES) + #error "Userland must include sys/user.h instead of sys/proc.h" -#endif + +#else #include /* For struct callout_handle. */ #include @@ -487,4 +489,5 @@ u_int32_t procrunnable (void); #endif /* _KERNEL */ +#endif /* _KERNEL || _KERNEL_STRUCTURES */ #endif /* !_SYS_PROC_H_ */ diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index ffd7a74540..d2f6cace15 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -32,7 +32,7 @@ * * @(#)protosw.h 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/sys/sys/protosw.h,v 1.28.2.2 2001/07/03 11:02:01 ume Exp $ - * $DragonFly: src/sys/sys/protosw.h,v 1.16 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/protosw.h,v 1.17 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_PROTOSW_H_ @@ -53,7 +53,8 @@ struct pr_output_info { pid_t p_pid; }; -/*#ifdef _KERNEL*/ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + /* * Protocol switch table. * @@ -102,7 +103,8 @@ struct protosw { /* flush any excess space possible */ const struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */ }; -/*#endif*/ + +#endif #define PR_SLOWHZ 2 /* 2 slow timeouts per second */ #define PR_FASTHZ 5 /* 5 fast timeouts per second */ @@ -178,7 +180,7 @@ char *prurequests[] = { }; #endif -#ifdef _KERNEL /* users shouldn't see this decl */ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) struct ifnet; struct stat; @@ -299,7 +301,7 @@ int pru_sense_null (struct socket *so, struct stat *sb); struct lwkt_port *cpu0_soport(struct socket *, struct sockaddr *, int); struct lwkt_port *sync_soport(struct socket *, struct sockaddr *, int); -#endif /* _KERNEL */ +#endif /* _KERNEL || _KERNEL_STRUCTURES */ /* * The arguments to the ctlinput routine are @@ -370,11 +372,16 @@ char *prcorequests[] = { }; #endif +/* + * Kernel prototypes + */ #ifdef _KERNEL + void pfctlinput (int, struct sockaddr *); void pfctlinput2 (int, struct sockaddr *, void *); struct protosw *pffindproto (int family, int protocol, int type); struct protosw *pffindtype (int family, int type); + #endif /* _KERNEL */ #endif /* _SYS_PROTOSW_H_ */ diff --git a/sys/sys/select.h b/sys/sys/select.h index da3ed1f02a..170776933c 100644 --- a/sys/sys/select.h +++ b/sys/sys/select.h @@ -32,14 +32,20 @@ * * @(#)select.h 8.2 (Berkeley) 1/4/94 * $FreeBSD: src/sys/sys/select.h,v 1.6.2.1 2000/05/05 03:50:02 jlemon Exp $ - * $DragonFly: src/sys/sys/select.h,v 1.5 2004/04/10 00:48:06 hsu Exp $ + * $DragonFly: src/sys/sys/select.h,v 1.6 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_SELECT_H_ #define _SYS_SELECT_H_ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + +#ifndef _SYS_EVENT_H_ #include /* for struct klist */ +#endif +#ifndef _SYS_NETISR_H_ #include /* for struct notifymsglist */ +#endif /* * Used to maintain information about processes that wish to be @@ -60,4 +66,5 @@ void selrecord (struct thread *selector, struct selinfo *); void selwakeup (struct selinfo *); #endif -#endif /* !_SYS_SELECT_H_ */ +#endif /* _KERNEL || _KERNEL_STRUCTURES */ +#endif /* !_SYS_SELECT_H_ */ diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 35f3b30e23..684baf72e9 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -32,12 +32,15 @@ * * @(#)socket.h 8.4 (Berkeley) 2/21/94 * $FreeBSD: src/sys/sys/socket.h,v 1.39.2.7 2001/07/03 11:02:01 ume Exp $ - * $DragonFly: src/sys/sys/socket.h,v 1.11 2005/07/15 17:54:48 eirikn Exp $ + * $DragonFly: src/sys/sys/socket.h,v 1.12 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_SOCKET_H_ #define _SYS_SOCKET_H_ +#ifndef _SYS_TYPES_H_ +#include +#endif #ifndef _MACHINE_STDINT_H_ #include #endif @@ -173,7 +176,10 @@ struct sockaddr { #define SOCK_MAXADDRLEN 255 /* longest possible addresses */ #ifdef _KERNEL + +#ifndef _SYS_LIBKERN_H_ #include /* for bcmp() */ +#endif static __inline boolean_t sa_equal(const struct sockaddr *a1, const struct sockaddr *a2) @@ -427,7 +433,9 @@ struct sf_hdtr { #ifndef _KERNEL +#ifndef _SYS_CDEFS_H_ #include +#endif __BEGIN_DECLS int accept (int, struct sockaddr *, socklen_t *); diff --git a/sys/sys/socketops.h b/sys/sys/socketops.h index e6b176c672..21f5ad4f24 100644 --- a/sys/sys/socketops.h +++ b/sys/sys/socketops.h @@ -30,7 +30,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/socketops.h,v 1.7 2006/05/06 02:43:13 dillon Exp $ + * $DragonFly: src/sys/sys/socketops.h,v 1.8 2006/05/21 03:43:47 dillon Exp $ */ /* @@ -54,12 +54,20 @@ #define _SOCKETOPS_H_ #ifndef _KERNEL + #error "This file should not be included by userland programs." -#endif +#else + +#ifndef _SYS_PROTOSW_H_ #include +#endif +#ifndef _SYS_SOCKET_H_ #include +#endif +#ifndef _SYS_SOCKETVAR_H_ #include +#endif /* * sosend() and soreceive() can block and also calls other pru_usrreq functions. @@ -105,4 +113,5 @@ int so_pru_sockaddr (struct socket *so, struct sockaddr **nam); int so_pru_sopoll (struct socket *so, int events, struct ucred *cred); int so_pr_ctloutput(struct socket *so, struct sockopt *sopt); -#endif +#endif /* _KERNEL */ +#endif /* _SYS_SOCKETOPS_H_ */ diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 4e8211ab01..98c3b34349 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -32,15 +32,23 @@ * * @(#)socketvar.h 8.3 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/socketvar.h,v 1.46.2.10 2003/08/24 08:24:39 hsu Exp $ - * $DragonFly: src/sys/sys/socketvar.h,v 1.23 2006/05/20 17:41:42 dillon Exp $ + * $DragonFly: src/sys/sys/socketvar.h,v 1.24 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_SOCKETVAR_H_ #define _SYS_SOCKETVAR_H_ +#ifndef _SYS_TYPES_H_ +#include +#endif +#ifndef _SYS_QUEUE_H_ #include /* for TAILQ macros */ +#endif +#ifndef _SYS_SELECT_H_ #include /* for struct selinfo */ +#endif +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) /* * Kernel structure per socket. * Contains send and receive buffer queues, @@ -123,6 +131,8 @@ struct socket { } *so_accf; }; +#endif + /* * Socket state bits. */ diff --git a/sys/sys/spinlock2.h b/sys/sys/spinlock2.h index 170865e7ee..29db53c42d 100644 --- a/sys/sys/spinlock2.h +++ b/sys/sys/spinlock2.h @@ -29,15 +29,27 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/spinlock2.h,v 1.7 2006/05/19 18:26:29 dillon Exp $ + * $DragonFly: src/sys/sys/spinlock2.h,v 1.8 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_SPINLOCK2_H_ #define _SYS_SPINLOCK2_H_ +#ifndef _KERNEL + +#error "This file should not be included by userland programs." + +#else + +#ifndef _SYS_THREAD2_H_ #include +#endif +#ifndef _MACHINE_ATOMIC_H_ #include +#endif +#ifndef _MACHINE_CPUFUNC_H_ #include +#endif #ifdef SMP @@ -179,5 +191,6 @@ spin_unlock(struct spinlock *mtx) crit_exit_id("spin"); } -#endif +#endif /* _KERNEL */ +#endif /* _SYS_SPINLOCK2_H_ */ diff --git a/sys/sys/sysmsg.h b/sys/sys/sysmsg.h index 7b9e2f3bf9..f94d03c47b 100644 --- a/sys/sys/sysmsg.h +++ b/sys/sys/sysmsg.h @@ -1,17 +1,18 @@ /* * SYS/SYSMSG.H * - * $DragonFly: src/sys/sys/sysmsg.h,v 1.8 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/sysmsg.h,v 1.9 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_SYSMSG_H_ #define _SYS_SYSMSG_H_ -#ifdef _KERNEL - #ifndef _SYS_MSGPORT_H_ #include #endif + +#ifdef _KERNEL + #ifndef _SYS_CALLOUT_H_ #include /* for struct callout */ #endif diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 824d0ffb54..88b18eff66 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -37,7 +37,7 @@ * * @(#)systm.h 8.7 (Berkeley) 3/29/95 * $FreeBSD: src/sys/sys/systm.h,v 1.111.2.18 2002/12/17 18:04:02 sam Exp $ - * $DragonFly: src/sys/sys/systm.h,v 1.36 2006/04/14 01:00:16 dillon Exp $ + * $DragonFly: src/sys/sys/systm.h,v 1.37 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -45,7 +45,7 @@ #ifndef _KERNEL #error "This file should not be included by userland programs." -#endif +#else #ifndef _MACHINE_TYPES_H_ #include @@ -319,4 +319,6 @@ dev_t udev2dev(udev_t x, int b); int uminor(udev_t dev); int umajor(udev_t dev); udev_t makeudev(int x, int y); + +#endif /* _KERNEL */ #endif /* !_SYS_SYSTM_H_ */ diff --git a/sys/sys/thread2.h b/sys/sys/thread2.h index 0514666177..ab02dfdc95 100644 --- a/sys/sys/thread2.h +++ b/sys/sys/thread2.h @@ -8,23 +8,30 @@ * on a different cpu will not be immediately scheduled by a yield() on * this cpu. * - * $DragonFly: src/sys/sys/thread2.h,v 1.26 2006/05/18 16:25:20 dillon Exp $ + * $DragonFly: src/sys/sys/thread2.h,v 1.27 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_THREAD2_H_ #define _SYS_THREAD2_H_ +#ifndef _KERNEL + +#error "This file should not be included by userland programs." + +#else + /* * Userland will have its own globaldata which it includes prior to this. */ -#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) +#ifndef _SYS_SYSTM_H_ +#include +#endif #ifndef _SYS_GLOBALDATA_H_ #include #endif #ifndef _MACHINE_CPUFUNC_H_ #include #endif -#endif /* * Critical section debugging @@ -66,8 +73,6 @@ */ #ifdef DEBUG_CRIT_SECTIONS -#include - static __inline void _debug_crit_enter(thread_t td, const char *id) { @@ -295,7 +300,7 @@ lwkt_send_ipiq2_bycpu(int dcpu, ipifunc2_t func, void *arg1, int arg2) return(lwkt_send_ipiq3_bycpu(dcpu, (ipifunc3_t)func, arg1, arg2)); } -#endif - -#endif +#endif /* SMP */ +#endif /* _KERNEL */ +#endif /* _SYS_THREAD2_H_ */ diff --git a/sys/sys/tty.h b/sys/sys/tty.h index 1ff1c85856..d7c9ca1d4a 100644 --- a/sys/sys/tty.h +++ b/sys/sys/tty.h @@ -37,15 +37,18 @@ * * @(#)tty.h 8.6 (Berkeley) 1/21/94 * $FreeBSD: src/sys/sys/tty.h,v 1.53.2.1 2001/02/26 04:23:21 jlemon Exp $ - * $DragonFly: src/sys/sys/tty.h,v 1.7 2004/10/12 19:20:48 dillon Exp $ + * $DragonFly: src/sys/sys/tty.h,v 1.8 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_TTY_H_ #define _SYS_TTY_H_ +#ifndef _SYS_TERMIOS_H_ #include +#endif +#ifndef _SYS_SELECT_H_ #include /* For struct selinfo. */ -#include +#endif /* * Clists are character lists, which is a variable length linked list @@ -60,6 +63,12 @@ struct clist { char *c_cl; /* Pointer to the last cblock. */ }; +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + +#ifndef _SYS_QUEUE_H_ +#include +#endif + /* * Per-tty structure. * @@ -116,6 +125,8 @@ struct tty { #define t_ospeed t_termios.c_ospeed #define t_time t_termios.c_time +#endif + /* * User data unfortunately has to be copied through buffers on the way to * and from clists. The buffers are on the stack so their sizes must be @@ -219,9 +230,13 @@ struct speedtab { #define TSA_PTS_READ(tp) ((void *)&(tp)->t_canq) #ifdef _KERNEL -#ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_TTYS); + +#ifndef _SYS_MALLOC_H_ +#include #endif + +MALLOC_DECLARE(M_TTYS); + extern struct tty *constty; /* Temporary virtual console. */ int b_to_q (char *cp, int cc, struct clist *q); diff --git a/sys/sys/types.h b/sys/sys/types.h index 8eed9b1c30..78559775b6 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -37,16 +37,24 @@ * * @(#)types.h 8.6 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/types.h,v 1.40.2.2 2001/04/21 14:53:06 ume Exp $ - * $DragonFly: src/sys/sys/types.h,v 1.12 2006/04/03 02:02:30 dillon Exp $ + * $DragonFly: src/sys/sys/types.h,v 1.13 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_TYPES_H_ #define _SYS_TYPES_H_ +#ifndef _SYS_CDEFS_H_ #include +#endif +#ifndef _STDINT_H_ #include +#endif +#ifndef _MACHINE_STDARG_H_ #include +#endif +#ifndef _MACHINE_ENDIANT_H_ #include +#endif #ifndef _MACHINE_TYPES_H_ #include #endif @@ -98,10 +106,23 @@ typedef __int32_t segsz_t; /* segment size */ typedef __int32_t swblk_t; /* swap offset */ typedef __uint32_t uid_t; /* user id */ -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + +#ifndef __BOOLEAN_T_DEFINED__ +#define __BOOLEAN_T_DEFINED__ typedef int boolean_t; +#endif + typedef u_int64_t uoff_t; -typedef struct vm_page *vm_page_t; + +#endif + +/* + * XXX dev_t has different meanings for userland vs kernel compiles. What + * do we do for _KERNEL_STRUCTURES ? For the moment stick with the userland + * meaning as being the more compatible solution. + */ +#ifdef _KERNEL struct specinfo; diff --git a/sys/sys/uio.h b/sys/sys/uio.h index e6f425eb98..5304d86958 100644 --- a/sys/sys/uio.h +++ b/sys/sys/uio.h @@ -32,7 +32,7 @@ * * @(#)uio.h 8.5 (Berkeley) 2/22/94 * $FreeBSD: src/sys/sys/uio.h,v 1.11.2.1 2001/09/28 16:58:35 dillon Exp $ - * $DragonFly: src/sys/sys/uio.h,v 1.12 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/uio.h,v 1.13 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_UIO_H_ @@ -93,6 +93,7 @@ struct uio { #if defined(_KERNEL) struct vm_object; +struct vm_page; void uio_yield (void); int uiomove (caddr_t, int, struct uio *); diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 66df72f132..d582a12166 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -32,27 +32,50 @@ * * @(#)vnode.h 8.7 (Berkeley) 2/4/94 * $FreeBSD: src/sys/sys/vnode.h,v 1.111.2.19 2002/12/29 18:19:53 dillon Exp $ - * $DragonFly: src/sys/sys/vnode.h,v 1.55 2006/05/18 16:25:20 dillon Exp $ + * $DragonFly: src/sys/sys/vnode.h,v 1.56 2006/05/21 03:43:47 dillon Exp $ */ #ifndef _SYS_VNODE_H_ #define _SYS_VNODE_H_ +#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) + +#ifndef _SYS_QUEUE_H_ #include +#endif +#ifndef _SYS_LOCK_H_ #include +#endif +#ifndef _SYS_SELECT_H_ #include +#endif +#ifndef _SYS_BIOTRACK_H_ #include +#endif +#ifndef _SYS_UIO_H_ #include +#endif +#ifndef _SYS_ACL_H_ #include +#endif +#ifndef _SYS_NAMECACHE_H_ #include -#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) +#endif +#ifndef _SYS_THREAD_H_ #include #endif +#ifndef _SYS_VFSOPS_H_ #include +#endif +#ifndef _SYS_VFSCACHE_H_ #include +#endif +#ifndef _SYS_TREE_H_ #include - +#endif +#ifndef _MACHINE_LOCK_H_ #include +#endif /* * The vnode is the focus of all file activity in UNIX. There is a @@ -637,6 +660,7 @@ extern struct vop_ops *default_vnode_vops; extern struct vop_ops *spec_vnode_vops; extern struct vop_ops *dead_vnode_vops; -#endif /* _KERNEL */ +#endif /* _KERNEL */ -#endif /* !_SYS_VNODE_H_ */ +#endif /* _KERNEL || _KERNEL_STRUCTURES */ +#endif /* !_SYS_VNODE_H_ */ diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h index 77148a2008..68eeba5b1d 100644 --- a/sys/vm/pmap.h +++ b/sys/vm/pmap.h @@ -62,7 +62,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/vm/pmap.h,v 1.33.2.4 2002/03/06 22:44:24 silby Exp $ - * $DragonFly: src/sys/vm/pmap.h,v 1.17 2006/05/20 02:42:15 dillon Exp $ + * $DragonFly: src/sys/vm/pmap.h,v 1.18 2006/05/21 03:43:47 dillon Exp $ */ /* @@ -89,38 +89,39 @@ struct proc; struct thread; +struct vm_page; void pmap_change_wiring (pmap_t, vm_offset_t, boolean_t); -void pmap_clear_modify (vm_page_t m); -void pmap_clear_reference (vm_page_t m); +void pmap_clear_modify (struct vm_page *m); +void pmap_clear_reference (struct vm_page *m); void pmap_collect (void); void pmap_copy (pmap_t, pmap_t, vm_offset_t, vm_size_t, - vm_offset_t); + vm_offset_t); void pmap_copy_page (vm_paddr_t, vm_paddr_t); void pmap_copy_page_frag (vm_paddr_t, vm_paddr_t, size_t bytes); void pmap_destroy (pmap_t); -void pmap_enter (pmap_t, vm_offset_t, vm_page_t, vm_prot_t, - boolean_t); +void pmap_enter (pmap_t, vm_offset_t, struct vm_page *, + vm_prot_t, boolean_t); vm_paddr_t pmap_extract (pmap_t pmap, vm_offset_t va); -vm_page_t pmap_extract_vmpage (pmap_t pmap, vm_offset_t va, int prot); +struct vm_page *pmap_extract_vmpage (pmap_t pmap, vm_offset_t va, int prot); void pmap_growkernel (vm_offset_t); void pmap_init (void); -boolean_t pmap_is_modified (vm_page_t m); -boolean_t pmap_ts_referenced (vm_page_t m); +boolean_t pmap_is_modified (struct vm_page *m); +boolean_t pmap_ts_referenced (struct vm_page *m); vm_offset_t pmap_map (vm_offset_t, vm_paddr_t, vm_paddr_t, int); void pmap_object_init_pt (pmap_t pmap, vm_offset_t addr, vm_prot_t prot, vm_object_t object, vm_pindex_t pindex, vm_offset_t size, int pagelimit); -boolean_t pmap_page_exists_quick (pmap_t pmap, vm_page_t m); -void pmap_page_protect (vm_page_t m, vm_prot_t prot); +boolean_t pmap_page_exists_quick (pmap_t pmap, struct vm_page *m); +void pmap_page_protect (struct vm_page *m, vm_prot_t prot); vm_paddr_t pmap_phys_address (int); void pmap_pinit (pmap_t); void pmap_pinit0 (pmap_t); void pmap_pinit2 (pmap_t); -void pmap_protect (pmap_t, vm_offset_t, vm_offset_t, - vm_prot_t); -void pmap_qenter (vm_offset_t, vm_page_t *, int); -void pmap_qenter2 (vm_offset_t, vm_page_t *, int, cpumask_t *); +void pmap_protect (pmap_t, vm_offset_t, vm_offset_t, vm_prot_t); +void pmap_qenter (vm_offset_t, struct vm_page **, int); +void pmap_qenter2 (vm_offset_t, struct vm_page **, int, + cpumask_t *); void pmap_qremove (vm_offset_t, int); void pmap_kenter (vm_offset_t, vm_paddr_t); void pmap_kenter_quick (vm_offset_t, vm_paddr_t); diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h index 4860aef236..fd42343071 100644 --- a/sys/vm/swap_pager.h +++ b/sys/vm/swap_pager.h @@ -37,7 +37,7 @@ * * from: @(#)swap_pager.h 7.1 (Berkeley) 12/5/90 * $FreeBSD: src/sys/vm/swap_pager.h,v 1.28.2.1 2000/10/13 07:13:23 dillon Exp $ - * $DragonFly: src/sys/vm/swap_pager.h,v 1.4 2006/05/20 02:42:15 dillon Exp $ + * $DragonFly: src/sys/vm/swap_pager.h,v 1.5 2006/05/21 03:43:47 dillon Exp $ */ /* @@ -93,7 +93,7 @@ extern struct pagerlst swap_pager_un_object_list; extern int swap_pager_full; extern struct blist *swapblist; -void swap_pager_putpages (vm_object_t, vm_page_t *, int, boolean_t, int *); +void swap_pager_putpages (vm_object_t, struct vm_page **, int, boolean_t, int *); boolean_t swap_pager_haspage (vm_object_t object, vm_pindex_t pindex, int *before, int *after); int swap_pager_swp_alloc (vm_object_t, int); @@ -107,7 +107,7 @@ int swap_pager_reserve (vm_object_t, vm_pindex_t, vm_size_t); * newswap functions */ -void swap_pager_page_removed (vm_page_t, vm_object_t); +void swap_pager_page_removed (struct vm_page *, vm_object_t); /* choose underlying swap device and queue up I/O */ struct buf; diff --git a/sys/vm/vm.h b/sys/vm/vm.h index 8fb591c5cd..aad9fe2b3f 100644 --- a/sys/vm/vm.h +++ b/sys/vm/vm.h @@ -60,7 +60,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/vm/vm.h,v 1.16.2.1 2002/12/28 19:49:41 dillon Exp $ - * $DragonFly: src/sys/vm/vm.h,v 1.5 2006/05/20 02:42:15 dillon Exp $ + * $DragonFly: src/sys/vm/vm.h,v 1.6 2006/05/21 03:43:47 dillon Exp $ */ #ifndef VM_VM_H_ @@ -104,12 +104,11 @@ typedef struct vm_object *vm_object_t; struct vm_object_lock; typedef struct vm_object_lock *vm_object_lock_t; -#ifndef _KERNEL - /* - * This is defined in for the kernel so that vnode_if.h - * doesn't have to include . + * This is also defined in vm/vm_page.h. */ +#ifndef __VM_PAGE_T_DEFINED__ +#define __VM_PAGE_T_DEFINED__ struct vm_page; typedef struct vm_page *vm_page_t; #endif diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index cef109c873..83cf5f19a8 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -62,7 +62,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/vm/vm_page.h,v 1.75.2.8 2002/03/06 01:07:09 dillon Exp $ - * $DragonFly: src/sys/vm/vm_page.h,v 1.23 2006/05/20 02:42:15 dillon Exp $ + * $DragonFly: src/sys/vm/vm_page.h,v 1.24 2006/05/21 03:43:47 dillon Exp $ */ /* @@ -79,9 +79,6 @@ #ifndef _SYS_TYPES_H_ #include #endif -#if defined(_KERNEL) && !defined(_SYS_SYSTM_H_) -#include -#endif #ifndef _MACHINE_PMAP_H_ #include #endif @@ -94,6 +91,9 @@ #ifdef _KERNEL +#ifndef _SYS_SYSTM_H_ +#include +#endif #ifndef _SYS_THREAD2_H_ #include #endif @@ -132,12 +132,14 @@ TAILQ_HEAD(pglist, vm_page); struct msf_buf; +struct vm_object; + struct vm_page { TAILQ_ENTRY(vm_page) pageq; /* vm_page_queues[] list (P) */ struct vm_page *hnext; /* hash table link (O,P) */ TAILQ_ENTRY(vm_page) listq; /* pages in same object (O) */ - vm_object_t object; /* which object am I in (O,P)*/ + struct vm_object *object; /* which object am I in (O,P)*/ vm_pindex_t pindex; /* offset into object (O,P) */ vm_paddr_t phys_addr; /* physical address of page */ struct md_page md; /* machine dependant stuff */ @@ -165,6 +167,11 @@ struct vm_page { struct msf_buf *msf_hint; /* first page of an msfbuf map */ }; +#ifndef __VM_PAGE_T_DEFINED__ +#define __VM_PAGE_T_DEFINED__ +typedef struct vm_page *vm_page_t; +#endif + /* * note: currently use SWAPBLK_NONE as an absolute value rather then * a flag bit. @@ -308,7 +315,7 @@ extern struct vpgqueues vm_page_queues[PQ_COUNT]; */ extern int vm_page_zero_count; -extern vm_page_t vm_page_array; /* First resident page in table */ +extern struct vm_page *vm_page_array; /* First resident page in table */ extern int vm_page_array_size; /* number of vm_page_t's */ extern long first_page; /* first physical page number */ @@ -415,17 +422,17 @@ vm_page_io_finish(vm_page_t m) void vm_page_unhold(vm_page_t mem); void vm_page_activate (vm_page_t); -vm_page_t vm_page_alloc (vm_object_t, vm_pindex_t, int); -vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); +vm_page_t vm_page_alloc (struct vm_object *, vm_pindex_t, int); +vm_page_t vm_page_grab (struct vm_object *, vm_pindex_t, int); void vm_page_cache (vm_page_t); int vm_page_try_to_cache (vm_page_t); int vm_page_try_to_free (vm_page_t); void vm_page_dontneed (vm_page_t); void vm_page_deactivate (vm_page_t); -void vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t); -vm_page_t vm_page_lookup (vm_object_t, vm_pindex_t); +void vm_page_insert (vm_page_t, struct vm_object *, vm_pindex_t); +vm_page_t vm_page_lookup (struct vm_object *, vm_pindex_t); void vm_page_remove (vm_page_t); -void vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t); +void vm_page_rename (vm_page_t, struct vm_object *, vm_pindex_t); vm_offset_t vm_page_startup (vm_offset_t); vm_page_t vm_add_new_page (vm_paddr_t pa); void vm_page_unmanage (vm_page_t); diff --git a/usr.bin/netstat/atalk.c b/usr.bin/netstat/atalk.c index 424d25c294..22fd606c47 100644 --- a/usr.bin/netstat/atalk.c +++ b/usr.bin/netstat/atalk.c @@ -32,9 +32,10 @@ * * @(#)atalk.c 1.1 (Whistle) 6/6/96 * $FreeBSD: src/usr.bin/netstat/atalk.c,v 1.13.2.2 2001/09/17 14:53:17 ru Exp $ - * $DragonFly: src/usr.bin/netstat/atalk.c,v 1.2 2003/06/17 04:29:30 dillon Exp $ + * $DragonFly: src/usr.bin/netstat/atalk.c,v 1.3 2006/05/21 03:43:47 dillon Exp $ */ +#define _KERNEL_STRUCTURES #include #include #include diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c index 85f44ea6d4..2809057989 100644 --- a/usr.bin/netstat/inet6.c +++ b/usr.bin/netstat/inet6.c @@ -32,12 +32,13 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/netstat/inet6.c,v 1.3.2.11 2001/09/17 14:53:17 ru Exp $ - * $DragonFly: src/usr.bin/netstat/inet6.c,v 1.6 2005/08/04 17:31:23 drhodus Exp $ + * $DragonFly: src/usr.bin/netstat/inet6.c,v 1.7 2006/05/21 03:43:47 dillon Exp $ * * @(#)inet6.c 8.4 (Berkeley) 4/20/94 */ #ifdef INET6 +#define _KERNEL_STRUCTURES #include #include #include diff --git a/usr.bin/netstat/ipx.c b/usr.bin/netstat/ipx.c index b5ee622e26..8d3ab21236 100644 --- a/usr.bin/netstat/ipx.c +++ b/usr.bin/netstat/ipx.c @@ -32,9 +32,10 @@ * * @(#)ns.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/netstat/ipx.c,v 1.13.2.1 2001/08/10 09:07:09 ru Exp $ - * $DragonFly: src/usr.bin/netstat/ipx.c,v 1.3 2005/08/04 17:31:23 drhodus Exp $ + * $DragonFly: src/usr.bin/netstat/ipx.c,v 1.4 2006/05/21 03:43:47 dillon Exp $ */ +#define _KERNEL_STRUCTURES #include #include #include diff --git a/usr.bin/netstat/mbuf.c b/usr.bin/netstat/mbuf.c index daeba2be67..0d9830876a 100644 --- a/usr.bin/netstat/mbuf.c +++ b/usr.bin/netstat/mbuf.c @@ -32,9 +32,10 @@ * * @(#)mbuf.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/netstat/mbuf.c,v 1.17.2.3 2001/08/10 09:07:09 ru Exp $ - * $DragonFly: src/usr.bin/netstat/mbuf.c,v 1.5 2005/08/04 17:31:23 drhodus Exp $ + * $DragonFly: src/usr.bin/netstat/mbuf.c,v 1.6 2006/05/21 03:43:47 dillon Exp $ */ +#define _KERNEL_STRUCTURES #include #include #include diff --git a/usr.bin/netstat/netgraph.c b/usr.bin/netstat/netgraph.c index 8008fcc0c2..f9bf35a1dc 100644 --- a/usr.bin/netstat/netgraph.c +++ b/usr.bin/netstat/netgraph.c @@ -32,11 +32,12 @@ * OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/netstat/netgraph.c,v 1.3.2.2 2001/08/10 09:07:09 ru Exp $ - * $DragonFly: src/usr.bin/netstat/netgraph.c,v 1.3 2003/08/08 04:18:43 dillon Exp $ + * $DragonFly: src/usr.bin/netstat/netgraph.c,v 1.4 2006/05/21 03:43:47 dillon Exp $ * * $Id: atalk.c,v 1.11 1998/07/06 21:01:22 bde Exp $ */ +#define _KERNEL_STRUCTURES #include #include #include diff --git a/usr.bin/systat/mbufs.c b/usr.bin/systat/mbufs.c index bb5533e407..c7b4c300a9 100644 --- a/usr.bin/systat/mbufs.c +++ b/usr.bin/systat/mbufs.c @@ -32,9 +32,10 @@ * * @(#)mbufs.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/systat/mbufs.c,v 1.10.2.1 2000/08/26 09:36:55 ps Exp $ - * $DragonFly: src/usr.bin/systat/mbufs.c,v 1.5 2005/03/12 10:38:42 y0netan1 Exp $ + * $DragonFly: src/usr.bin/systat/mbufs.c,v 1.6 2006/05/21 03:43:47 dillon Exp $ */ +#define _KERNEL_STRUCTURES #include #include #include diff --git a/usr.sbin/sicontrol/sicontrol.c b/usr.sbin/sicontrol/sicontrol.c index a81e2b2ac1..9816b1b223 100644 --- a/usr.sbin/sicontrol/sicontrol.c +++ b/usr.sbin/sicontrol/sicontrol.c @@ -31,9 +31,10 @@ * NO EVENT SHALL THE AUTHORS BE LIABLE. * * $FreeBSD: src/usr.sbin/sicontrol/sicontrol.c,v 1.12.2.1 2000/12/11 01:03:39 obrien Exp $ - * $DragonFly: src/usr.sbin/sicontrol/sicontrol.c,v 1.3 2003/08/08 04:18:48 dillon Exp $ + * $DragonFly: src/usr.sbin/sicontrol/sicontrol.c,v 1.4 2006/05/21 03:43:48 dillon Exp $ */ +#define _KERNEL_STRUCTURES #include #include #include -- 2.41.0