summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2002-07-03 21:19:09 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2002-07-03 21:19:09 +0000
commiteb8b984055f8fb6ff8166bb0fd825d0476a2bc93 (patch)
tree3da86c45136132455aa82d11f2f95d7f4a6b812b
parenteb5c5be45939713345204664aa86051b24effc40 (diff)
Change all variables definitions (int foo) in sys/sys/*.h to variable
declarations (extern int foo), and compensate in the appropriate locations.
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c7
-rw-r--r--sys/kern/kern_clock.c4
-rw-r--r--sys/kern/kern_synch.c5
-rw-r--r--sys/kern/tty.c4
-rw-r--r--sys/kern/uipc_mbuf.c7
-rw-r--r--sys/kern/vfs_cache.c4
-rw-r--r--sys/net/if.c4
-rw-r--r--sys/net/if.h10
-rw-r--r--sys/netinet/if_ether.h10
-rw-r--r--sys/netinet/ip_input.c4
-rw-r--r--sys/netinet/ip_var.h12
-rw-r--r--sys/sys/buf.h12
-rw-r--r--sys/sys/dkstat.h6
-rw-r--r--sys/sys/mbuf.h12
-rw-r--r--sys/sys/msg.h6
-rw-r--r--sys/sys/msgbuf.h4
-rw-r--r--sys/sys/namei.h4
-rw-r--r--sys/sys/proc.h7
-rw-r--r--sys/sys/socketvar.h4
-rw-r--r--sys/sys/timex.h4
-rw-r--r--sys/sys/vnode.h4
21 files changed, 80 insertions, 54 deletions
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index c4e0764f119..380ec6c5a6e 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.44 2002/06/15 17:23:31 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.45 2002/07/03 21:19:05 miod Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -153,6 +153,11 @@ extern vaddr_t avail_end;
#define BUFCACHEPERCENT 5
#endif
+#ifdef BUFPAGES
+int bufpages = BUFPAGES;
+#else
+int bufpages = 0;
+#endif
int bufcachepercent = BUFCACHEPERCENT;
int physmem;
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index dd83909ea44..b4db87d8e4b 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_clock.c,v 1.37 2002/06/07 21:20:02 art Exp $ */
+/* $OpenBSD: kern_clock.c,v 1.38 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*-
@@ -287,6 +287,8 @@ int fixtick; /* used by NTP for same */
int shifthz;
#endif
+long cp_time[CPUSTATES];
+
volatile struct timeval time;
volatile struct timeval mono_time;
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 364485d7d22..aa0b4d7002b 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_synch.c,v 1.43 2002/06/11 05:04:34 art Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.44 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*-
@@ -61,6 +61,9 @@
u_char curpriority; /* usrpri of curproc */
int lbolt; /* once a second sleep address */
+int whichqs; /* Bit mask summary of non-empty Q's. */
+struct prochd qs[NQS];
+
void scheduler_start(void);
void roundrobin(void *);
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 40b64ae5116..4092140d961 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.52 2002/06/11 05:06:18 art Exp $ */
+/* $OpenBSD: tty.c,v 1.53 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -165,6 +165,8 @@ u_char const char_type[] = {
struct ttylist_head ttylist; /* TAILQ_HEAD */
int tty_count;
+int64_t tk_cancc, tk_nin, tk_nout, tk_rawcc;
+
/*
* Initial open of tty, or (re)entry to standard tty line discipline.
*/
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 563f4eee68c..5e945e355d6 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.57 2002/03/14 01:27:05 millert Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.58 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -97,6 +97,11 @@ struct pool mclpool; /* mbuf cluster pool */
struct vm_map *mb_map;
+int max_linkhdr; /* largest link-level header */
+int max_protohdr; /* largest protocol header */
+int max_hdr; /* largest link+protocol header */
+int max_datalen; /* MHLEN - max_hdr */
+
void *mclpool_alloc(struct pool *, int);
void mclpool_release(struct pool *, void *);
struct mbuf *m_copym0(struct mbuf *, int, int, int, int);
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 16be7656747..252dccb912f 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_cache.c,v 1.7 2002/07/02 04:23:25 ericj Exp $ */
+/* $OpenBSD: vfs_cache.c,v 1.8 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: vfs_cache.c,v 1.13 1996/02/04 02:18:09 christos Exp $ */
/*
@@ -78,6 +78,8 @@ int doingcache = 1; /* 1 => enable the cache */
struct pool nch_pool;
+u_long nextvnodeid;
+
/*
* Look for a the name in the cache. We don't do this
* if the segment name is long, simply so the cache can avoid
diff --git a/sys/net/if.c b/sys/net/if.c
index df8c94bcaaa..3c8a4472731 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.62 2002/06/30 13:04:35 itojun Exp $ */
+/* $OpenBSD: if.c,v 1.63 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -140,6 +140,8 @@ ifinit()
int if_index = 0;
struct ifaddr **ifnet_addrs = NULL;
struct ifnet **ifindex2ifnet = NULL;
+struct ifnet_head ifnet;
+struct ifnet *lo0ifp;
/*
* Attach an interface to the
diff --git a/sys/net/if.h b/sys/net/if.h
index 165a6a9e869..fde45d75428 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.h,v 1.39 2002/06/30 13:04:35 itojun Exp $ */
+/* $OpenBSD: if.h,v 1.40 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
@@ -528,10 +528,10 @@ do { \
#define IFQ_INC_DROPS(ifq) ((ifq)->ifq_drops++)
#define IFQ_SET_MAXLEN(ifq, len) ((ifq)->ifq_maxlen = (len))
-struct ifnet_head ifnet;
-struct ifnet **ifindex2ifnet;
-struct ifnet *lo0ifp;
-int if_index;
+extern struct ifnet_head ifnet;
+extern struct ifnet **ifindex2ifnet;
+extern struct ifnet *lo0ifp;
+extern int if_index;
void ether_ifattach(struct ifnet *);
void ether_ifdetach(struct ifnet *);
diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h
index a6adc696f8c..26c6e258008 100644
--- a/sys/netinet/if_ether.h
+++ b/sys/netinet/if_ether.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.h,v 1.24 2002/06/14 21:35:00 todd Exp $ */
+/* $OpenBSD: if_ether.h,v 1.25 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: if_ether.h,v 1.22 1996/05/11 13:00:00 mycroft Exp $ */
/*
@@ -191,10 +191,10 @@ struct sockaddr_inarp {
#define RTF_PERMANENT_ARP RTF_PROTO3 /* only manual overwrite of entry */
#ifdef _KERNEL
-u_int8_t etherbroadcastaddr[ETHER_ADDR_LEN];
-u_int8_t ether_ipmulticast_min[ETHER_ADDR_LEN];
-u_int8_t ether_ipmulticast_max[ETHER_ADDR_LEN];
-struct ifqueue arpintrq;
+extern u_int8_t etherbroadcastaddr[ETHER_ADDR_LEN];
+extern u_int8_t ether_ipmulticast_min[ETHER_ADDR_LEN];
+extern u_int8_t ether_ipmulticast_max[ETHER_ADDR_LEN];
+extern struct ifqueue arpintrq;
void arpwhohas(struct arpcom *, struct in_addr *);
void arpintr(void);
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index e6852cad8da..d520ca07a97 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.104 2002/06/09 16:26:10 itojun Exp $ */
+/* $OpenBSD: ip_input.c,v 1.105 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -155,6 +155,8 @@ static __inline void ipq_unlock(void);
struct pool ipqent_pool;
+struct ipstat ipstat;
+
static __inline int
ipq_lock_try()
{
diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h
index 4d98cfadb8a..db5a29bd208 100644
--- a/sys/netinet/ip_var.h
+++ b/sys/netinet/ip_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_var.h,v 1.25 2002/06/09 16:26:10 itojun Exp $ */
+/* $OpenBSD: ip_var.h,v 1.26 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: ip_var.h,v 1.16 1996/02/13 23:43:20 christos Exp $ */
/*
@@ -158,13 +158,13 @@ struct ipstat {
#define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */
#define IP_MTUDISC 0x0400 /* pmtu discovery, set DF */
-struct ipstat ipstat;
+extern struct ipstat ipstat;
LIST_HEAD(ipqhead, ipq) ipq; /* ip reass. queue */
-int ip_defttl; /* default IP ttl */
+extern int ip_defttl; /* default IP ttl */
-int ip_mtudisc; /* mtu discovery */
-u_int ip_mtudisc_timeout; /* seconds to timeout mtu discovery */
-struct rttimer_queue *ip_mtudisc_timeout_q;
+extern int ip_mtudisc; /* mtu discovery */
+extern u_int ip_mtudisc_timeout; /* seconds to timeout mtu discovery */
+extern struct rttimer_queue *ip_mtudisc_timeout_q;
extern struct pool ipqent_pool;
int ip_ctloutput(int, struct socket *, int, int, struct mbuf **);
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index e56e01e448c..f19cdae4273 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.h,v 1.41 2002/05/23 15:31:57 art Exp $ */
+/* $OpenBSD: buf.h,v 1.42 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: buf.h,v 1.25 1997/04/09 21:12:17 mycroft Exp $ */
/*
@@ -187,14 +187,14 @@ struct cluster_info {
};
#ifdef _KERNEL
-int nbuf; /* The number of buffer headers */
-struct buf *buf; /* The buffer headers. */
-char *buffers; /* The buffer contents. */
-int bufpages; /* Number of memory pages in the buffer pool. */
+__BEGIN_DECLS
+extern int nbuf; /* The number of buffer headers */
+extern struct buf *buf; /* The buffer headers. */
+extern char *buffers; /* The buffer contents. */
+extern int bufpages; /* Number of memory pages in the buffer pool. */
extern struct pool bufpool;
-__BEGIN_DECLS
void allocbuf(struct buf *, int);
void bawrite(struct buf *);
void bdwrite(struct buf *);
diff --git a/sys/sys/dkstat.h b/sys/sys/dkstat.h
index 6c40fde86ff..c34e11079b4 100644
--- a/sys/sys/dkstat.h
+++ b/sys/sys/dkstat.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dkstat.h,v 1.5 2001/05/14 07:12:23 angelos Exp $ */
+/* $OpenBSD: dkstat.h,v 1.6 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: dkstat.h,v 1.8 1995/12/28 19:16:31 thorpej Exp $ */
/*-
@@ -50,7 +50,7 @@
#define DK_NDRIVE 8
#ifdef _KERNEL
-long cp_time[CPUSTATES];
+extern long cp_time[CPUSTATES];
-int64_t tk_cancc, tk_nin, tk_nout, tk_rawcc;
+extern int64_t tk_cancc, tk_nin, tk_nout, tk_rawcc;
#endif
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 241dce420fa..c9e9a4d0287 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.h,v 1.65 2002/06/11 02:19:56 frantzen Exp $ */
+/* $OpenBSD: mbuf.h,v 1.66 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
@@ -36,7 +36,7 @@
* @(#)mbuf.h 8.5 (Berkeley) 2/19/95
*/
-#ifndef M_WAITOK
+#ifndef _SYS_MALLOC_H_
#include <sys/malloc.h>
#endif
#include <sys/pool.h>
@@ -533,10 +533,10 @@ struct mbstat mbstat;
extern int nmbclust; /* limit on the # of clusters */
extern int mblowat; /* mbuf low water mark */
extern int mcllowat; /* mbuf cluster low water mark */
-int max_linkhdr; /* largest link-level header */
-int max_protohdr; /* largest protocol header */
-int max_hdr; /* largest link+protocol header */
-int max_datalen; /* MHLEN - max_hdr */
+extern int max_linkhdr; /* largest link-level header */
+extern int max_protohdr; /* largest protocol header */
+extern int max_hdr; /* largest link+protocol header */
+extern int max_datalen; /* MHLEN - max_hdr */
extern int mbtypes[]; /* XXX */
extern struct pool mbpool;
extern struct pool mclpool;
diff --git a/sys/sys/msg.h b/sys/sys/msg.h
index 7dec22cb8f7..11dfc7269c4 100644
--- a/sys/sys/msg.h
+++ b/sys/sys/msg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: msg.h,v 1.8 2002/03/14 01:27:14 millert Exp $ */
+/* $OpenBSD: msg.h,v 1.9 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: msg.h,v 1.9 1996/02/09 18:25:18 christos Exp $ */
/*
@@ -114,7 +114,9 @@ struct msginfo {
msgssz, /* size of a message segment (see notes above) */
msgseg; /* number of message segments */
};
-struct msginfo msginfo; /* XXX */
+#ifdef SYSVMSG
+extern struct msginfo msginfo;
+#endif
struct msg_sysctl_info {
struct msginfo msginfo;
diff --git a/sys/sys/msgbuf.h b/sys/sys/msgbuf.h
index 3da49adafe0..7546c738fd9 100644
--- a/sys/sys/msgbuf.h
+++ b/sys/sys/msgbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: msgbuf.h,v 1.5 2002/03/14 01:27:14 millert Exp $ */
+/* $OpenBSD: msgbuf.h,v 1.6 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: msgbuf.h,v 1.8 1995/03/26 20:24:27 jtc Exp $ */
/*
@@ -46,7 +46,7 @@ struct msgbuf {
char msg_bufc[1]; /* buffer */
};
#ifdef _KERNEL
-struct msgbuf *msgbufp;
+extern struct msgbuf *msgbufp;
void initmsgbuf(caddr_t buf, size_t bufsize);
#endif
diff --git a/sys/sys/namei.h b/sys/sys/namei.h
index a17a7f0be33..2a9aab95d36 100644
--- a/sys/sys/namei.h
+++ b/sys/sys/namei.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: namei.h,v 1.8 2002/03/14 01:27:14 millert Exp $ */
+/* $OpenBSD: namei.h,v 1.9 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: namei.h,v 1.11 1996/02/09 18:25:20 christos Exp $ */
/*
@@ -174,7 +174,7 @@ struct namecache {
};
#ifdef _KERNEL
-u_long nextvnodeid;
+extern u_long nextvnodeid;
int namei(struct nameidata *ndp);
int lookup(struct nameidata *ndp);
int relookup(struct vnode *dvp, struct vnode **vpp,
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 2cbe3442397..d2cc9018460 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.h,v 1.60 2002/05/16 16:16:52 provos Exp $ */
+/* $OpenBSD: proc.h,v 1.61 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
@@ -349,11 +349,12 @@ extern struct pool session_pool; /* memory pool for sessions */
extern struct pool pcred_pool; /* memory pool for pcreds */
#define NQS 32 /* 32 run queues. */
-int whichqs; /* Bit mask summary of non-empty Q's. */
+extern int whichqs; /* Bit mask summary of non-empty Q's. */
struct prochd {
struct proc *ph_link; /* Linked list of running processes. */
struct proc *ph_rlink;
-} qs[NQS];
+};
+extern struct prochd qs[NQS];
struct simplelock;
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index be6f9c45407..3fc8db55c9b 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: socketvar.h,v 1.27 2002/05/11 00:06:33 deraadt Exp $ */
+/* $OpenBSD: socketvar.h,v 1.28 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */
/*-
@@ -206,7 +206,7 @@ struct socket {
#define sowwakeup(so) sowakeup((so), &(so)->so_snd)
#ifdef _KERNEL
-u_long sb_max;
+extern u_long sb_max;
struct socket *sonewconn(struct socket *head, int connstatus);
/* strings for sleep message: */
diff --git a/sys/sys/timex.h b/sys/sys/timex.h
index 348afbbca65..80ed98804c2 100644
--- a/sys/sys/timex.h
+++ b/sys/sys/timex.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: timex.h,v 1.7 2002/03/14 01:27:14 millert Exp $ */
+/* $OpenBSD: timex.h,v 1.8 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: timex.h,v 1.2 1996/02/27 04:20:34 jonathan Exp $ */
/******************************************************************************
@@ -68,7 +68,7 @@
*
*/
#ifndef _SYS_TIMEX_H_
-#define _SYS_TIMEX_H_ 1
+#define _SYS_TIMEX_H_
#ifndef MSDOS /* Microsoft specific */
#include <sys/syscall.h>
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index c39b7930f48..cd98ccaedef 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnode.h,v 1.50 2002/06/16 16:54:27 miod Exp $ */
+/* $OpenBSD: vnode.h,v 1.51 2002/07/03 21:19:08 miod Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
@@ -336,7 +336,7 @@ extern struct vnodeop_desc *vnodeop_descs[];
/*
* Interlock for scanning list of vnodes attached to a mountpoint
*/
-struct simplelock mntvnode_slock;
+extern struct simplelock mntvnode_slock;
/*
* This macro is very helpful in defining those offsets in the vdesc struct.