summaryrefslogtreecommitdiffstats
path: root/sys/sys
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-08-18 22:36:09 +0000
committerwollman <wollman@FreeBSD.org>1994-08-18 22:36:09 +0000
commitf9fc827448679cf1d41e56512c34521bf06ce37a (patch)
tree6b83fdf6eb5926c2f3d175a83d24bf5a2611a012 /sys/sys
parent44fc281f480837836035856eb0af25443f0d2146 (diff)
downloadFreeBSD-src-f9fc827448679cf1d41e56512c34521bf06ce37a.zip
FreeBSD-src-f9fc827448679cf1d41e56512c34521bf06ce37a.tar.gz
Fix up some sloppy coding practices:
- Delete redundant declarations. - Add -Wredundant-declarations to Makefile.i386 so they don't come back. - Delete sloppy COMMON-style declarations of uninitialized data in header files. - Add a few prototypes. - Clean up warnings resulting from the above. NB: ioconf.c will still generate a redundant-declaration warning, which is unavoidable unless somebody volunteers to make `config' smarter.
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/bio.h18
-rw-r--r--sys/sys/buf.h18
-rw-r--r--sys/sys/callout.h6
-rw-r--r--sys/sys/dkstat.h31
-rw-r--r--sys/sys/imgact.h8
-rw-r--r--sys/sys/msgbuf.h4
-rw-r--r--sys/sys/proc.h13
-rw-r--r--sys/sys/socketvar.h4
-rw-r--r--sys/sys/syslog.h6
-rw-r--r--sys/sys/systm.h32
-rw-r--r--sys/sys/time.h8
-rw-r--r--sys/sys/timetc.h8
-rw-r--r--sys/sys/tty.h4
-rw-r--r--sys/sys/ucred.h10
14 files changed, 110 insertions, 60 deletions
diff --git a/sys/sys/bio.h b/sys/sys/bio.h
index 5ce8da1..7072545 100644
--- a/sys/sys/bio.h
+++ b/sys/sys/bio.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)buf.h 8.7 (Berkeley) 1/21/94
- * $Id: buf.h,v 1.4 1994/08/02 07:52:39 davidg Exp $
+ * $Id: buf.h,v 1.5 1994/08/06 09:15:33 davidg Exp $
*/
#ifndef _SYS_BUF_H_
@@ -177,14 +177,14 @@ TAILQ_HEAD(bqueues, buf) bufqueues[BUFFER_QUEUES];
#define B_SYNC 0x02 /* Do all allocations synchronously. */
#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. */
-struct buf *swbuf; /* Swap I/O buffer headers. */
-int nswbuf; /* Number of swap I/O buffer headers. */
-TAILQ_HEAD(swqueue, buf) bswlist;
-struct buf *bclnlist; /* Head of cleaned page list. */
+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 buf *swbuf; /* Swap I/O buffer headers. */
+extern int nswbuf; /* Number of swap I/O buffer headers. */
+extern TAILQ_HEAD(swqueue, buf) bswlist;
+extern struct buf *bclnlist; /* Head of cleaned page list. */
__BEGIN_DECLS
void allocbuf __P((struct buf *, int));
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 5ce8da1..7072545 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)buf.h 8.7 (Berkeley) 1/21/94
- * $Id: buf.h,v 1.4 1994/08/02 07:52:39 davidg Exp $
+ * $Id: buf.h,v 1.5 1994/08/06 09:15:33 davidg Exp $
*/
#ifndef _SYS_BUF_H_
@@ -177,14 +177,14 @@ TAILQ_HEAD(bqueues, buf) bufqueues[BUFFER_QUEUES];
#define B_SYNC 0x02 /* Do all allocations synchronously. */
#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. */
-struct buf *swbuf; /* Swap I/O buffer headers. */
-int nswbuf; /* Number of swap I/O buffer headers. */
-TAILQ_HEAD(swqueue, buf) bswlist;
-struct buf *bclnlist; /* Head of cleaned page list. */
+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 buf *swbuf; /* Swap I/O buffer headers. */
+extern int nswbuf; /* Number of swap I/O buffer headers. */
+extern TAILQ_HEAD(swqueue, buf) bswlist;
+extern struct buf *bclnlist; /* Head of cleaned page list. */
__BEGIN_DECLS
void allocbuf __P((struct buf *, int));
diff --git a/sys/sys/callout.h b/sys/sys/callout.h
index 67ad0d6..ab91468 100644
--- a/sys/sys/callout.h
+++ b/sys/sys/callout.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)callout.h 8.2 (Berkeley) 1/21/94
- * $Id$
+ * $Id: callout.h,v 1.2 1994/08/02 07:52:40 davidg Exp $
*/
struct callout {
@@ -47,6 +47,6 @@ struct callout {
};
#ifdef KERNEL
-struct callout *callfree, *callout, calltodo;
-int ncallout;
+extern struct callout *callfree, *callout, calltodo;
+extern int ncallout;
#endif
diff --git a/sys/sys/dkstat.h b/sys/sys/dkstat.h
index 5cc6bdd..2486ddb 100644
--- a/sys/sys/dkstat.h
+++ b/sys/sys/dkstat.h
@@ -36,9 +36,12 @@
* SUCH DAMAGE.
*
* @(#)dkstat.h 8.2 (Berkeley) 1/21/94
- * $Id$
+ * $Id: dkstat.h,v 1.2 1994/08/02 07:52:51 davidg Exp $
*/
+#ifndef _SYS_DKSTAT_H_
+#define _SYS_DKSTAT_H_ 1
+
#define CP_USER 0
#define CP_NICE 1
#define CP_SYS 2
@@ -48,18 +51,20 @@
#define DK_NDRIVE 8
#ifdef KERNEL
-long cp_time[CPUSTATES];
-long dk_seek[DK_NDRIVE];
-long dk_time[DK_NDRIVE];
-long dk_wds[DK_NDRIVE];
-long dk_wpms[DK_NDRIVE];
-long dk_xfer[DK_NDRIVE];
+extern long cp_time[CPUSTATES];
+extern long dk_seek[DK_NDRIVE];
+extern long dk_time[DK_NDRIVE];
+extern long dk_wds[DK_NDRIVE];
+extern long dk_wpms[DK_NDRIVE];
+extern long dk_xfer[DK_NDRIVE];
-int dk_busy;
-int dk_ndrive;
+extern int dk_busy;
+extern int dk_ndrive;
-long tk_cancc;
-long tk_nin;
-long tk_nout;
-long tk_rawcc;
+extern long tk_cancc;
+extern long tk_nin;
+extern long tk_nout;
+extern long tk_rawcc;
#endif
+
+#endif /* _SYS_DKSTAT_H_ */
diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h
index a32f4df..3517e80 100644
--- a/sys/sys/imgact.h
+++ b/sys/sys/imgact.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact.h,v 1.3 1994/05/25 09:14:16 rgrimes Exp $
+ * $Id: imgact.h,v 1.4 1994/08/13 03:50:34 wollman Exp $
*/
#ifndef __h_imgact
@@ -58,8 +58,14 @@ struct image_params {
struct execsw {
int (*ex_imgact)(struct image_params *);
+ const char *ex_name;
};
+#ifdef KERNEL
extern const struct execsw **execsw;
+extern int exec_extract_strings(struct image_params *);
+extern int exec_new_vmspace(struct image_params *);
+#endif
+
#endif /* __h_imgact */
diff --git a/sys/sys/msgbuf.h b/sys/sys/msgbuf.h
index d47058b..87f8552 100644
--- a/sys/sys/msgbuf.h
+++ b/sys/sys/msgbuf.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)msgbuf.h 8.1 (Berkeley) 6/2/93
- * $Id$
+ * $Id: msgbuf.h,v 1.2 1994/08/02 07:53:16 davidg Exp $
*/
#define MSG_BSIZE (4096 - 3 * sizeof(long))
@@ -43,5 +43,5 @@ struct msgbuf {
char msg_bufc[MSG_BSIZE]; /* buffer */
};
#ifdef KERNEL
-struct msgbuf *msgbufp;
+extern struct msgbuf *msgbufp;
#endif
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 98940e1..849fffa 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)proc.h 8.8 (Berkeley) 1/21/94
- * $Id$
+ * $Id: proc.h,v 1.3 1994/08/02 07:53:20 davidg Exp $
*/
#ifndef _SYS_PROC_H_
@@ -239,12 +239,12 @@ extern struct proc proc0; /* Process slot for swapper. */
extern int nprocs, maxproc; /* Current and max number of procs. */
extern int pidhashmask; /* In param.c. */
-volatile struct proc *allproc; /* List of active procs. */
-struct proc *zombproc; /* List of zombie procs. */
-struct proc *initproc, *pageproc; /* Process slots for init, pager. */
+extern volatile struct proc *allproc; /* List of active procs. */
+extern struct proc *zombproc; /* List of zombie procs. */
+extern struct proc *initproc, *pageproc; /* Process slots for init, pager. */
#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;
@@ -261,5 +261,8 @@ void sleep __P((void *chan, int pri));
int tsleep __P((void *chan, int pri, char *wmesg, int timo));
void unsleep __P((struct proc *));
void wakeup __P((void *chan));
+
+extern int chgproccnt(uid_t, int);
+
#endif /* KERNEL */
#endif /* !_SYS_PROC_H_ */
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 8271937..6ded3a6 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)socketvar.h 8.1 (Berkeley) 6/2/93
- * $Id$
+ * $Id: socketvar.h,v 1.2 1994/08/02 07:53:36 davidg Exp $
*/
#include <sys/select.h> /* for struct selinfo */
@@ -189,7 +189,7 @@ struct socket {
#define sowwakeup(so) sowakeup((so), &(so)->so_snd)
#ifdef KERNEL
-u_long sb_max;
+extern u_long sb_max;
/* to catch callers missing new second argument to sonewconn: */
#define sonewconn(head, connstatus) sonewconn1((head), (connstatus))
struct socket *sonewconn1 __P((struct socket *head, int connstatus));
diff --git a/sys/sys/syslog.h b/sys/sys/syslog.h
index 821f6a7..2f4e238 100644
--- a/sys/sys/syslog.h
+++ b/sys/sys/syslog.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)syslog.h 8.1 (Berkeley) 6/2/93
- * $Id$
+ * $Id: syslog.h,v 1.2 1994/08/02 07:53:43 davidg Exp $
*/
#define _PATH_LOG "/dev/log"
@@ -165,7 +165,9 @@ CODE facilitynames[] = {
#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
#define LOG_PERROR 0x20 /* log to stderr as well */
-#ifndef KERNEL
+#ifdef KERNEL
+
+#else /* not KERNEL */
/*
* Don't use va_list in the vsyslog() prototype. Va_list is typedef'd in two
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index a4b51e6..01d9a52 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)systm.h 8.4 (Berkeley) 2/23/94
- * $Id: systm.h,v 1.5 1994/08/05 09:28:55 davidg Exp $
+ * $Id: systm.h,v 1.6 1994/08/13 14:21:58 davidg Exp $
*/
#include <machine/cpufunc.h>
@@ -123,6 +123,7 @@ void tablefull __P((const char *));
void addlog __P((const char *, ...));
void log __P((int, const char *, ...));
void printf __P((const char *, ...));
+void uprintf __P((const char *, ...));
int sprintf __P((char *buf, const char *, ...));
void ttyprintf __P((struct tty *, const char *, ...));
@@ -148,9 +149,6 @@ int suword __P((void *base, int word));
int suiword __P((void *base, int word));
int hzto __P((struct timeval *tv));
-typedef void (*timeout_func_t)(void *);
-void timeout __P((void (*func)(void *), void *arg, int ticks));
-void untimeout __P((void (*func)(void *), void *arg));
void realitexpire __P((void *));
struct clockframe;
@@ -165,3 +163,29 @@ void stopprofclock __P((struct proc *));
void setstatclockrate __P((int hzrate));
#include <libkern/libkern.h>
+
+/* Initialize the world */
+extern void consinit(void);
+extern void kmeminit(void);
+extern void cpu_startup(void);
+extern void usrinfoinit(void);
+extern void rqinit(void);
+extern void vfsinit(void);
+extern void mbinit(void);
+extern void clist_init(void);
+extern void ifinit(void);
+extern void domaininit(void);
+extern void cpu_initclocks(void);
+extern void vntblinit(void);
+extern void nchinit(void);
+
+extern __dead void vm_pageout(void) __dead2; /* pagedaemon, called in proc 2 */
+extern __dead void vfs_update(void) __dead2; /* update, called in proc 3 */
+extern __dead void scheduler(void) __dead2; /* sched, called in process 0 */
+
+/* Timeouts */
+typedef void (timeout_t)(void *); /* actual timeout function type */
+typedef timeout_t *timeout_func_t; /* a pointer to this type */
+
+void timeout(timeout_func_t, void *, int);
+void untimeout(timeout_func_t, void *);
diff --git a/sys/sys/time.h b/sys/sys/time.h
index 00b9e2e..4d68a33 100644
--- a/sys/sys/time.h
+++ b/sys/sys/time.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)time.h 8.1 (Berkeley) 6/2/93
- * $Id$
+ * $Id: time.h,v 1.2 1994/08/02 07:53:47 davidg Exp $
*/
#ifndef _SYS_TIME_H_
@@ -106,7 +106,11 @@ struct clockinfo {
int profhz; /* profiling clock frequency */
};
-#ifndef KERNEL
+#ifdef KERNEL
+
+extern void microtime(struct timeval *);
+
+#else /* not KERNEL */
#include <time.h>
#ifndef _POSIX_SOURCE
diff --git a/sys/sys/timetc.h b/sys/sys/timetc.h
index 00b9e2e..4d68a33 100644
--- a/sys/sys/timetc.h
+++ b/sys/sys/timetc.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)time.h 8.1 (Berkeley) 6/2/93
- * $Id$
+ * $Id: time.h,v 1.2 1994/08/02 07:53:47 davidg Exp $
*/
#ifndef _SYS_TIME_H_
@@ -106,7 +106,11 @@ struct clockinfo {
int profhz; /* profiling clock frequency */
};
-#ifndef KERNEL
+#ifdef KERNEL
+
+extern void microtime(struct timeval *);
+
+#else /* not KERNEL */
#include <time.h>
#ifndef _POSIX_SOURCE
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index 93957a4..8b40a41 100644
--- a/sys/sys/tty.h
+++ b/sys/sys/tty.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.h 8.6 (Berkeley) 1/21/94
- * $Id$
+ * $Id: tty.h,v 1.2 1994/08/02 07:53:54 davidg Exp $
*/
#include <sys/termios.h>
@@ -178,7 +178,7 @@ extern char ttyin[], ttyout[], ttopen[], ttclos[], ttybg[], ttybuf[];
int b_to_q __P((char *cp, int cc, struct clist *q));
void catq __P((struct clist *from, struct clist *to));
-void clist_init __P((void));
+/* void clist_init __P((void)); */ /* defined in systm.h for main() */
int getc __P((struct clist *q));
void ndflush __P((struct clist *q, int cc));
int ndqb __P((struct clist *q, int flag));
diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h
index 2b4dc7d..d630c4f 100644
--- a/sys/sys/ucred.h
+++ b/sys/sys/ucred.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ucred.h 8.2 (Berkeley) 1/4/94
- * $Id$
+ * $Id: ucred.h,v 1.2 1994/08/02 07:54:00 davidg Exp $
*/
#ifndef _SYS_UCRED_H_
@@ -52,9 +52,11 @@ struct ucred {
#ifdef KERNEL
#define crhold(cr) (cr)->cr_ref++
-struct ucred *crget();
-struct ucred *crcopy();
-struct ucred *crdup();
+struct ucred *crget(void);
+struct ucred *crcopy(struct ucred *);
+struct ucred *crdup(struct ucred *);
+extern void crfree(struct ucred *);
+extern int suser(struct ucred *, short *);
#endif /* KERNEL */
#endif /* !_SYS_UCRED_H_ */
OpenPOWER on IntegriCloud