ANSI'ify.
This commit is contained in:
parent
424346ba85
commit
8fd9032b90
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_allocsys.c,v 1.12 2000/06/27 17:41:14 mrg Exp $ */
|
||||
/* $NetBSD: kern_allocsys.c,v 1.13 2000/07/14 07:14:33 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -125,9 +125,7 @@ int bufcache = BUFCACHE; /* % of RAM to use for buffer cache */
|
|||
*/
|
||||
|
||||
caddr_t
|
||||
allocsys(v, mdcallback)
|
||||
caddr_t v;
|
||||
caddr_t (*mdcallback) __P((caddr_t));
|
||||
allocsys(caddr_t v, caddr_t (*mdcallback)(caddr_t))
|
||||
{
|
||||
|
||||
/* Calculate the number of callwheels if necessary. */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_kthread.c,v 1.10 2000/05/28 05:49:06 thorpej Exp $ */
|
||||
/* $NetBSD: kern_kthread.c,v 1.11 2000/07/14 07:15:05 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -60,17 +60,8 @@ int kthread_create_now;
|
|||
* The VM space and limits, etc. will be shared with proc0.
|
||||
*/
|
||||
int
|
||||
#if __STDC__
|
||||
kthread_create1(void (*func)(void *), void *arg,
|
||||
struct proc **newpp, const char *fmt, ...)
|
||||
#else
|
||||
kthread_create1(func, arg, newpp, fmt, va_alist)
|
||||
void (*func) __P((void *));
|
||||
void *arg;
|
||||
struct proc **newpp;
|
||||
const char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
struct proc *p2;
|
||||
int error;
|
||||
|
@ -106,8 +97,7 @@ kthread_create1(func, arg, newpp, fmt, va_alist)
|
|||
* current context.
|
||||
*/
|
||||
void
|
||||
kthread_exit(ecode)
|
||||
int ecode;
|
||||
kthread_exit(int ecode)
|
||||
{
|
||||
|
||||
/*
|
||||
|
@ -130,7 +120,7 @@ kthread_exit(ecode)
|
|||
|
||||
struct kthread_q {
|
||||
SIMPLEQ_ENTRY(kthread_q) kq_q;
|
||||
void (*kq_func) __P((void *));
|
||||
void (*kq_func)(void *);
|
||||
void *kq_arg;
|
||||
};
|
||||
|
||||
|
@ -142,9 +132,7 @@ SIMPLEQ_HEAD(, kthread_q) kthread_q = SIMPLEQ_HEAD_INITIALIZER(kthread_q);
|
|||
* the caller to create threads for e.g. file systems and device drivers.
|
||||
*/
|
||||
void
|
||||
kthread_create(func, arg)
|
||||
void (*func) __P((void *));
|
||||
void *arg;
|
||||
kthread_create(void (*func)(void *), void *arg)
|
||||
{
|
||||
struct kthread_q *kq;
|
||||
|
||||
|
@ -165,7 +153,7 @@ kthread_create(func, arg)
|
|||
}
|
||||
|
||||
void
|
||||
kthread_run_deferred_queue()
|
||||
kthread_run_deferred_queue(void)
|
||||
{
|
||||
struct kthread_q *kq;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kern_lock.c,v 1.32 2000/06/10 18:44:43 sommerfeld Exp $ */
|
||||
/* $NetBSD: kern_lock.c,v 1.33 2000/07/14 07:16:44 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -102,7 +102,7 @@
|
|||
*/
|
||||
#include <machine/stdarg.h>
|
||||
|
||||
void lock_printf __P((const char *fmt, ...));
|
||||
void lock_printf(const char *fmt, ...);
|
||||
|
||||
int lock_debug_syslog = 0; /* defaults to printf, but can be patched */
|
||||
#endif
|
||||
|
@ -259,13 +259,7 @@ do { \
|
|||
* or log to syslog.
|
||||
*/
|
||||
void
|
||||
#ifdef __STDC__
|
||||
lock_printf(const char *fmt, ...)
|
||||
#else
|
||||
lock_printf(fmt, va_alist)
|
||||
char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
@ -282,12 +276,7 @@ lock_printf(fmt, va_alist)
|
|||
* Initialize a lock; required before use.
|
||||
*/
|
||||
void
|
||||
lockinit(lkp, prio, wmesg, timo, flags)
|
||||
struct lock *lkp;
|
||||
int prio;
|
||||
const char *wmesg;
|
||||
int timo;
|
||||
int flags;
|
||||
lockinit(struct lock *lkp, int prio, const char *wmesg, int timo, int flags)
|
||||
{
|
||||
|
||||
memset(lkp, 0, sizeof(struct lock));
|
||||
|
@ -307,8 +296,7 @@ lockinit(lkp, prio, wmesg, timo, flags)
|
|||
* Determine the status of a lock.
|
||||
*/
|
||||
int
|
||||
lockstatus(lkp)
|
||||
struct lock *lkp;
|
||||
lockstatus(struct lock *lkp)
|
||||
{
|
||||
int lock_type = 0;
|
||||
|
||||
|
@ -344,10 +332,8 @@ lockstatus(lkp)
|
|||
* accepted shared locks and shared-to-exclusive upgrades to go away.
|
||||
*/
|
||||
int
|
||||
lockmgr(lkp, flags, interlkp)
|
||||
__volatile struct lock *lkp;
|
||||
u_int flags;
|
||||
struct simplelock *interlkp;
|
||||
lockmgr(__volatile struct lock *lkp, u_int flags,
|
||||
struct simplelock *interlkp)
|
||||
{
|
||||
int error;
|
||||
pid_t pid;
|
||||
|
@ -678,8 +664,7 @@ lockmgr(lkp, flags, interlkp)
|
|||
* routines to display ststus about contained locks.
|
||||
*/
|
||||
void
|
||||
lockmgr_printinfo(lkp)
|
||||
__volatile struct lock *lkp;
|
||||
lockmgr_printinfo(__volatile struct lock *lkp)
|
||||
{
|
||||
|
||||
if (lkp->lk_sharecount)
|
||||
|
@ -743,7 +728,7 @@ int simple_lock_debugger = 0;
|
|||
#define SLOCK_WHERE(str, alp, id, l) \
|
||||
do { \
|
||||
lock_printf(str); \
|
||||
lock_printf("lock: %p, currently at: %s:%d\n", (alp), (id), (l)); \
|
||||
lock_printf("lock: %p, currently at: %s:%d\n", (alp), (id), (l)); \
|
||||
SLOCK_MP(); \
|
||||
if ((alp)->lock_file != NULL) \
|
||||
lock_printf("last locked: %s:%d\n", (alp)->lock_file, \
|
||||
|
@ -759,8 +744,7 @@ do { \
|
|||
* they are being called.
|
||||
*/
|
||||
void
|
||||
simple_lock_init(alp)
|
||||
struct simplelock *alp;
|
||||
simple_lock_init(struct simplelock *alp)
|
||||
{
|
||||
|
||||
#if defined(MULTIPROCESSOR) /* { */
|
||||
|
@ -776,10 +760,7 @@ simple_lock_init(alp)
|
|||
}
|
||||
|
||||
void
|
||||
_simple_lock(alp, id, l)
|
||||
__volatile struct simplelock *alp;
|
||||
const char *id;
|
||||
int l;
|
||||
_simple_lock(__volatile struct simplelock *alp, const char *id, int l)
|
||||
{
|
||||
cpuid_t cpu_id = cpu_number();
|
||||
int s;
|
||||
|
@ -826,10 +807,7 @@ _simple_lock(alp, id, l)
|
|||
}
|
||||
|
||||
int
|
||||
_simple_lock_try(alp, id, l)
|
||||
__volatile struct simplelock *alp;
|
||||
const char *id;
|
||||
int l;
|
||||
_simple_lock_try(__volatile struct simplelock *alp, const char *id, int l)
|
||||
{
|
||||
cpuid_t cpu_id = cpu_number();
|
||||
int s, rv = 0;
|
||||
|
@ -878,10 +856,7 @@ _simple_lock_try(alp, id, l)
|
|||
}
|
||||
|
||||
void
|
||||
_simple_unlock(alp, id, l)
|
||||
__volatile struct simplelock *alp;
|
||||
const char *id;
|
||||
int l;
|
||||
_simple_unlock(__volatile struct simplelock *alp, const char *id, int l)
|
||||
{
|
||||
int s;
|
||||
|
||||
|
@ -922,7 +897,7 @@ _simple_unlock(alp, id, l)
|
|||
}
|
||||
|
||||
void
|
||||
simple_lock_dump()
|
||||
simple_lock_dump(void)
|
||||
{
|
||||
struct simplelock *alp;
|
||||
int s;
|
||||
|
@ -940,8 +915,7 @@ simple_lock_dump()
|
|||
}
|
||||
|
||||
void
|
||||
simple_lock_freecheck(start, end)
|
||||
void *start, *end;
|
||||
simple_lock_freecheck(void *start, void *end)
|
||||
{
|
||||
struct simplelock *alp;
|
||||
int s;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kthread.h,v 1.3 1999/07/06 21:44:09 thorpej Exp $ */
|
||||
/* $NetBSD: kthread.h,v 1.4 2000/07/14 07:15:06 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -47,12 +47,12 @@
|
|||
#ifdef _KERNEL
|
||||
#include <sys/proc.h> /* struct proc, tsleep(), wakeup() */
|
||||
|
||||
int kthread_create1 __P((void (*)(void *), void *, struct proc **,
|
||||
const char *, ...))
|
||||
int kthread_create1(void (*)(void *), void *, struct proc **,
|
||||
const char *, ...)
|
||||
__attribute__((__format__(__printf__,4,5)));
|
||||
void kthread_create __P((void (*)(void *), void *));
|
||||
void kthread_run_deferred_queue __P((void));
|
||||
void kthread_exit __P((int)) __attribute__((__noreturn__));
|
||||
void kthread_create(void (*)(void *), void *);
|
||||
void kthread_run_deferred_queue(void);
|
||||
void kthread_exit(int) __attribute__((__noreturn__));
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* _SYS_KTHREAD_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lock.h,v 1.31 2000/06/07 16:37:24 thorpej Exp $ */
|
||||
/* $NetBSD: lock.h,v 1.32 2000/07/14 07:16:45 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -273,12 +273,11 @@ struct lock {
|
|||
|
||||
struct proc;
|
||||
|
||||
void lockinit __P((struct lock *, int prio, const char *wmesg, int timo,
|
||||
int flags));
|
||||
int lockmgr __P((__volatile struct lock *, u_int flags,
|
||||
struct simplelock *));
|
||||
int lockstatus __P((struct lock *));
|
||||
void lockmgr_printinfo __P((__volatile struct lock *));
|
||||
void lockinit(struct lock *, int prio, const char *wmesg, int timo,
|
||||
int flags);
|
||||
int lockmgr(__volatile struct lock *, u_int flags, struct simplelock *);
|
||||
int lockstatus(struct lock *);
|
||||
void lockmgr_printinfo(__volatile struct lock *);
|
||||
|
||||
#define spinlockinit(lkp, name, flags) \
|
||||
lockinit((lkp), 0, (name), 0, (flags) | LK_SPIN)
|
||||
|
@ -287,18 +286,17 @@ void lockmgr_printinfo __P((__volatile struct lock *));
|
|||
lockmgr((lkp), (flags) | LK_SPIN, (intrlk))
|
||||
|
||||
#if defined(LOCKDEBUG)
|
||||
void _simple_lock __P((__volatile struct simplelock *, const char *, int));
|
||||
int _simple_lock_try __P((__volatile struct simplelock *, const char *,
|
||||
int));
|
||||
void _simple_unlock __P((__volatile struct simplelock *, const char *, int));
|
||||
void _simple_lock(__volatile struct simplelock *, const char *, int);
|
||||
int _simple_lock_try(__volatile struct simplelock *, const char *, int);
|
||||
void _simple_unlock(__volatile struct simplelock *, const char *, int);
|
||||
|
||||
#define simple_lock(alp) _simple_lock((alp), __FILE__, __LINE__)
|
||||
#define simple_lock_try(alp) _simple_lock_try((alp), __FILE__, __LINE__)
|
||||
#define simple_unlock(alp) _simple_unlock((alp), __FILE__, __LINE__)
|
||||
|
||||
void simple_lock_init __P((struct simplelock *));
|
||||
void simple_lock_dump __P((void));
|
||||
void simple_lock_freecheck __P((void *, void *));
|
||||
void simple_lock_init(struct simplelock *);
|
||||
void simple_lock_dump(void);
|
||||
void simple_lock_freecheck(void *, void *);
|
||||
#elif defined(MULTIPROCESSOR)
|
||||
#define simple_lock_init(alp) __cpu_simple_lock_init(&(alp)->lock_data)
|
||||
#define simple_lock(alp) __cpu_simple_lock(&(alp)->lock_data)
|
||||
|
|
Loading…
Reference in New Issue