summaryrefslogtreecommitdiffstats
path: root/sys/kern
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/kern
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/kern')
-rw-r--r--sys/kern/imgact_aout.c4
-rw-r--r--sys/kern/imgact_shell.c4
-rw-r--r--sys/kern/init_main.c4
-rw-r--r--sys/kern/kern_clock.c28
-rw-r--r--sys/kern/kern_exec.c7
-rw-r--r--sys/kern/kern_fork.c6
-rw-r--r--sys/kern/kern_ktrace.c3
-rw-r--r--sys/kern/kern_physio.c3
-rw-r--r--sys/kern/kern_proc.c5
-rw-r--r--sys/kern/kern_sysctl.c4
-rw-r--r--sys/kern/kern_tc.c28
-rw-r--r--sys/kern/kern_timeout.c28
-rw-r--r--sys/kern/kern_xxx.c7
-rw-r--r--sys/kern/subr_trap.c4
-rw-r--r--sys/kern/sys_process.c8
-rw-r--r--sys/kern/vfs_bio.c4
-rw-r--r--sys/kern/vfs_export.c3
-rw-r--r--sys/kern/vfs_init.c3
-rw-r--r--sys/kern/vfs_lookup.c3
-rw-r--r--sys/kern/vfs_subr.c3
20 files changed, 107 insertions, 52 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 4be4e50..31705a2 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact_aout.c,v 1.3 1993/12/30 01:39:29 davidg Exp $
+ * $Id: imgact_aout.c,v 1.5 1994/05/25 09:02:00 rgrimes Exp $
*/
#include <sys/param.h>
@@ -185,6 +185,6 @@ exec_aout_imgact(iparams)
* Since `const' objects end up in the text segment, TEXT_SET is the
* correct directive to use.
*/
-static const struct execsw aout_execsw = { exec_aout_imgact };
+static const struct execsw aout_execsw = { exec_aout_imgact, "a.out" };
TEXT_SET(execsw_set, aout_execsw);
diff --git a/sys/kern/imgact_shell.c b/sys/kern/imgact_shell.c
index 432c899..2884231 100644
--- a/sys/kern/imgact_shell.c
+++ b/sys/kern/imgact_shell.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: imgact_shell.c,v 1.3 1994/05/25 09:02:06 rgrimes Exp $
+ * $Id: imgact_shell.c,v 1.4 1994/08/13 03:50:23 wollman Exp $
*/
#include <sys/param.h>
@@ -141,5 +141,5 @@ exec_shell_imgact(iparams)
* Since `const' objects end up in the text segment, TEXT_SET is the
* correct directive to use.
*/
-static const struct execsw shell_execsw = { exec_shell_imgact };
+static const struct execsw shell_execsw = { exec_shell_imgact, "#!" };
TEXT_SET(execsw_set, shell_execsw);
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 7e8c70b..5089576 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
- * $Id$
+ * $Id: init_main.c,v 1.4 1994/08/02 07:41:49 davidg Exp $
*/
#include <sys/param.h>
@@ -304,7 +304,6 @@ main(framep)
/*
* Start update daemon (process 3).
*/
-#ifndef LAPTOP
if (fork(p, (void *) NULL, rval))
panic("failed fork update daemon");
if (rval[1]) {
@@ -315,7 +314,6 @@ main(framep)
vfs_update();
/*NOTREACHED*/
}
-#endif
/* The scheduler is an infinite loop. */
scheduler();
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index c963fda..5b365f5 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
- * $Id$
+ * $Id: kern_clock.c,v 1.3 1994/08/02 07:41:54 davidg Exp $
*/
#include <sys/param.h>
@@ -53,6 +53,26 @@
#include <sys/gmon.h>
#endif
+/* Does anybody else really care about these? */
+struct callout *callfree, *callout, calltodo;
+int ncallout;
+
+/* Some of these don't belong here, but it's easiest to concentrate them. */
+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];
+
+int dk_busy;
+int dk_ndrive = DK_NDRIVE;
+
+long tk_cancc;
+long tk_nin;
+long tk_nout;
+long tk_rawcc;
+
/*
* Clock handling routines.
*
@@ -257,7 +277,7 @@ softclock()
*/
void
timeout(ftn, arg, ticks)
- void (*ftn) __P((void *));
+ timeout_t ftn;
void *arg;
register int ticks;
{
@@ -302,7 +322,7 @@ timeout(ftn, arg, ticks)
void
untimeout(ftn, arg)
- void (*ftn) __P((void *));
+ timeout_t ftn;
void *arg;
{
register struct callout *p, *t;
@@ -400,8 +420,6 @@ stopprofclock(p)
}
}
-int dk_ndrive = DK_NDRIVE;
-
/*
* Statistics clock. Grab profile sample, and if divider reaches 0,
* do process and kernel statistics.
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index b54e09b..6602f7f 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_exec.c,v 1.2 1994/05/25 09:03:03 rgrimes Exp $
+ * $Id: kern_exec.c,v 1.3 1994/08/06 09:06:31 davidg Exp $
*/
#include <sys/param.h>
@@ -52,9 +52,10 @@
#include <machine/reg.h>
-int exec_extract_strings __P((struct image_params *));
int *exec_copyout_strings __P((struct image_params *));
+static int exec_check_permissions(struct image_params *);
+
/*
* execsw_set is constructed for us by the linker. Each of the items
* is a pointer to a `const struct execsw', hence the double pointer here.
@@ -479,7 +480,7 @@ exec_copyout_strings(iparams)
* Check permissions of file to execute.
* Return 0 for success or error code on failure.
*/
-int
+static int
exec_check_permissions(iparams)
struct image_params *iparams;
{
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index e0362e9..ce5d6aa 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_fork.c 8.6 (Berkeley) 4/8/94
- * $Id: kern_fork.c,v 1.3 1994/08/02 07:42:00 davidg Exp $
+ * $Id: kern_fork.c,v 1.4 1994/08/06 07:15:04 davidg Exp $
*/
#include <sys/param.h>
@@ -52,6 +52,8 @@
#include <sys/acct.h>
#include <sys/ktrace.h>
+static int fork1(struct proc *, int, int *);
+
struct fork_args {
int dummy;
};
@@ -79,7 +81,7 @@ vfork(p, uap, retval)
int nprocs = 1; /* process 0 */
-int
+static int
fork1(p1, isvfork, retval)
register struct proc *p1;
int isvfork, retval[];
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 711f1b6..c79620a 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -31,12 +31,13 @@
* SUCH DAMAGE.
*
* @(#)kern_ktrace.c 8.2 (Berkeley) 9/23/93
- * $Id$
+ * $Id: kern_ktrace.c,v 1.3 1994/08/02 07:42:02 davidg Exp $
*/
#ifdef KTRACE
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/file.h>
#include <sys/namei.h>
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index 007d37f..e29d0b9 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: kern_physio.c,v 1.5 1994/08/07 13:10:31 davidg Exp $
+ * $Id: kern_physio.c,v 1.6 1994/08/08 13:53:55 davidg Exp $
*/
#include <sys/param.h>
@@ -27,7 +27,6 @@
#include <vm/vm.h>
static void physwakeup();
-u_int minphys(struct buf *bp);
int
physio(strategy, bp, dev, rw, minp, uio)
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 11b3816..c4b34c9 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_proc.c 8.4 (Berkeley) 1/4/94
- * $Id$
+ * $Id: kern_proc.c,v 1.3 1994/08/02 07:42:07 davidg Exp $
*/
#include <sys/param.h>
@@ -50,6 +50,9 @@
#include <sys/ioctl.h>
#include <sys/tty.h>
+volatile struct proc *allproc; /* all processes */
+struct proc *zombproc; /* just zombies */
+
void pgdelete __P((struct pgrp *));
void fixjobc __P((struct proc *, struct pgrp *, int));
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 0896ebf..63e8dd6 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
- * $Id: kern_sysctl.c,v 1.5 1994/08/08 15:40:58 wollman Exp $
+ * $Id: kern_sysctl.c,v 1.7 1994/08/10 06:25:02 wollman Exp $
*/
/*
@@ -198,7 +198,7 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
struct proc *p;
{
int error, level, inthostid;
- extern char ostype[], osrelease[], version[];
+ extern char ostype[], osrelease[];
/* all sysctl names at this level are terminal */
if (namelen != 1 && !(name[0] == KERN_PROC || name[0] == KERN_PROF))
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index c963fda..5b365f5 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
- * $Id$
+ * $Id: kern_clock.c,v 1.3 1994/08/02 07:41:54 davidg Exp $
*/
#include <sys/param.h>
@@ -53,6 +53,26 @@
#include <sys/gmon.h>
#endif
+/* Does anybody else really care about these? */
+struct callout *callfree, *callout, calltodo;
+int ncallout;
+
+/* Some of these don't belong here, but it's easiest to concentrate them. */
+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];
+
+int dk_busy;
+int dk_ndrive = DK_NDRIVE;
+
+long tk_cancc;
+long tk_nin;
+long tk_nout;
+long tk_rawcc;
+
/*
* Clock handling routines.
*
@@ -257,7 +277,7 @@ softclock()
*/
void
timeout(ftn, arg, ticks)
- void (*ftn) __P((void *));
+ timeout_t ftn;
void *arg;
register int ticks;
{
@@ -302,7 +322,7 @@ timeout(ftn, arg, ticks)
void
untimeout(ftn, arg)
- void (*ftn) __P((void *));
+ timeout_t ftn;
void *arg;
{
register struct callout *p, *t;
@@ -400,8 +420,6 @@ stopprofclock(p)
}
}
-int dk_ndrive = DK_NDRIVE;
-
/*
* Statistics clock. Grab profile sample, and if divider reaches 0,
* do process and kernel statistics.
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index c963fda..5b365f5 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
- * $Id$
+ * $Id: kern_clock.c,v 1.3 1994/08/02 07:41:54 davidg Exp $
*/
#include <sys/param.h>
@@ -53,6 +53,26 @@
#include <sys/gmon.h>
#endif
+/* Does anybody else really care about these? */
+struct callout *callfree, *callout, calltodo;
+int ncallout;
+
+/* Some of these don't belong here, but it's easiest to concentrate them. */
+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];
+
+int dk_busy;
+int dk_ndrive = DK_NDRIVE;
+
+long tk_cancc;
+long tk_nin;
+long tk_nout;
+long tk_rawcc;
+
/*
* Clock handling routines.
*
@@ -257,7 +277,7 @@ softclock()
*/
void
timeout(ftn, arg, ticks)
- void (*ftn) __P((void *));
+ timeout_t ftn;
void *arg;
register int ticks;
{
@@ -302,7 +322,7 @@ timeout(ftn, arg, ticks)
void
untimeout(ftn, arg)
- void (*ftn) __P((void *));
+ timeout_t ftn;
void *arg;
{
register struct callout *p, *t;
@@ -400,8 +420,6 @@ stopprofclock(p)
}
}
-int dk_ndrive = DK_NDRIVE;
-
/*
* Statistics clock. Grab profile sample, and if divider reaches 0,
* do process and kernel statistics.
diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c
index 8f9b72b..216c750 100644
--- a/sys/kern/kern_xxx.c
+++ b/sys/kern/kern_xxx.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_xxx.c 8.2 (Berkeley) 11/14/93
- * $Id: kern_xxx.c,v 1.3 1994/08/02 07:42:23 davidg Exp $
+ * $Id: kern_xxx.c,v 1.4 1994/08/08 00:30:04 wollman Exp $
*/
#include <sys/param.h>
@@ -43,9 +43,6 @@
#include <sys/sysctl.h>
#include <sys/utsname.h>
-extern char domainname[MAXHOSTNAMELEN];
-extern int domainnamelen;
-
struct reboot_args {
int opt;
};
@@ -103,8 +100,6 @@ osethostname(p, uap, retval)
return (kern_sysctl(&name, 1, 0, 0, uap->hostname, uap->len));
}
-extern long hostid;
-
struct gethostid_args {
int dummy;
};
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 21cdac6..58c0090 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
- * $Id: trap.c,v 1.27 1994/08/01 11:25:28 davidg Exp $
+ * $Id: trap.c,v 1.28 1994/08/10 04:39:47 wollman Exp $
*/
/*
@@ -73,8 +73,6 @@
int trap_pfault __P((struct trapframe *, int));
void trap_fatal __P((struct trapframe *));
-extern int grow(struct proc *,u_int);
-
struct sysent sysent[];
int nsysent;
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 9acd200..2e886d3 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -28,10 +28,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sys_process.c,v 1.4 1994/08/08 13:00:14 davidg Exp $
+ * $Id: sys_process.c,v 1.5 1994/08/13 03:50:25 wollman Exp $
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/vnode.h>
#include <sys/ptrace.h>
@@ -83,7 +84,8 @@ pread (struct proc *procp, unsigned int addr, unsigned int *retval) {
rv = vm_map_pageable (kernel_map, kva, kva + PAGE_SIZE, 0);
if (!rv) {
*retval = 0;
- bcopy (kva + page_offset, retval, sizeof *retval);
+ bcopy ((caddr_t)kva + page_offset,
+ retval, sizeof *retval);
}
vm_map_remove (kernel_map, kva, kva + PAGE_SIZE);
}
@@ -174,7 +176,7 @@ pwrite (struct proc *procp, unsigned int addr, unsigned int datum) {
rv = vm_map_pageable (kernel_map, kva, kva + PAGE_SIZE, 0);
if (!rv) {
- bcopy (&datum, kva + page_offset, sizeof datum);
+ bcopy (&datum, (caddr_t)kva + page_offset, sizeof datum);
}
vm_map_remove (kernel_map, kva, kva + PAGE_SIZE);
}
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 810e28d..594dd7ba 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: vfs_bio.c,v 1.7 1994/08/07 14:53:20 davidg Exp $
+ * $Id: vfs_bio.c,v 1.8 1994/08/08 15:40:59 wollman Exp $
*/
#include <sys/param.h>
@@ -35,6 +35,8 @@
struct buf *buf; /* buffer header pool */
int nbuf; /* number of buffer headers calculated elsewhere */
+struct swqueue bswlist;
+struct buf *bclnlist; /* Head of cleaned page list. */
extern vm_map_t buffer_map, io_map;
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index a1a24f8..d088b28 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
- * $Id$
+ * $Id: vfs_subr.c,v 1.3 1994/08/02 07:43:27 davidg Exp $
*/
/*
@@ -240,7 +240,6 @@ vattr_null(vap)
extern int (**dead_vnodeop_p)();
extern void vclean();
long numvnodes;
-extern struct vattr va_null;
/*
* Return the next vnode from the free list.
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c
index 6b11461..48aac34 100644
--- a/sys/kern/vfs_init.c
+++ b/sys/kern/vfs_init.c
@@ -36,11 +36,12 @@
* SUCH DAMAGE.
*
* @(#)vfs_init.c 8.3 (Berkeley) 1/4/94
- * $Id$
+ * $Id: vfs_init.c,v 1.3 1994/08/02 07:43:22 davidg Exp $
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/mount.h>
#include <sys/time.h>
#include <sys/vnode.h>
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index bd51adc..50c48ad 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -36,10 +36,11 @@
* SUCH DAMAGE.
*
* @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94
- * $Id$
+ * $Id: vfs_lookup.c,v 1.2 1994/08/02 07:43:25 davidg Exp $
*/
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/syslimits.h>
#include <sys/time.h>
#include <sys/namei.h>
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index a1a24f8..d088b28 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
- * $Id$
+ * $Id: vfs_subr.c,v 1.3 1994/08/02 07:43:27 davidg Exp $
*/
/*
@@ -240,7 +240,6 @@ vattr_null(vap)
extern int (**dead_vnodeop_p)();
extern void vclean();
long numvnodes;
-extern struct vattr va_null;
/*
* Return the next vnode from the free list.
OpenPOWER on IntegriCloud