-/* $OpenBSD: kern_fork.c,v 1.235 2021/03/23 10:30:40 mpi Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.236 2021/06/19 02:05:33 cheloha Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
rw_init(&pr->ps_lock, "pslock");
mtx_init(&pr->ps_mtx, IPL_MPFLOOR);
- timeout_set_kclock(&pr->ps_realit_to, realitexpire, pr, 0,
- KCLOCK_UPTIME);
+ timeout_set_kclock(&pr->ps_realit_to, realitexpire, pr,
+ KCLOCK_UPTIME, 0);
timeout_set(&pr->ps_rucheck_to, rucheck, pr);
}
-/* $OpenBSD: kern_timeout.c,v 1.84 2021/05/11 13:29:25 cheloha Exp $ */
+/* $OpenBSD: kern_timeout.c,v 1.85 2021/06/19 02:05:33 cheloha Exp $ */
/*
* Copyright (c) 2001 Thomas Nordin <nordin@openbsd.org>
* Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org>
}
static inline void
-_timeout_set(struct timeout *to, void (*fn)(void *), void *arg, int flags,
- int kclock)
+_timeout_set(struct timeout *to, void (*fn)(void *), void *arg, int kclock,
+ int flags)
{
to->to_func = fn;
to->to_arg = arg;
- to->to_flags = flags | TIMEOUT_INITIALIZED;
to->to_kclock = kclock;
+ to->to_flags = flags | TIMEOUT_INITIALIZED;
}
void
timeout_set(struct timeout *new, void (*fn)(void *), void *arg)
{
- _timeout_set(new, fn, arg, 0, KCLOCK_NONE);
+ _timeout_set(new, fn, arg, KCLOCK_NONE, 0);
}
void
timeout_set_flags(struct timeout *to, void (*fn)(void *), void *arg, int flags)
{
- _timeout_set(to, fn, arg, flags, KCLOCK_NONE);
+ _timeout_set(to, fn, arg, KCLOCK_NONE, flags);
}
void
timeout_set_proc(struct timeout *new, void (*fn)(void *), void *arg)
{
- _timeout_set(new, fn, arg, TIMEOUT_PROC, KCLOCK_NONE);
+ _timeout_set(new, fn, arg, KCLOCK_NONE, TIMEOUT_PROC);
}
void
timeout_set_kclock(struct timeout *to, void (*fn)(void *), void *arg,
- int flags, int kclock)
+ int kclock, int flags)
{
- _timeout_set(to, fn, arg, flags | TIMEOUT_KCLOCK, kclock);
+ _timeout_set(to, fn, arg, kclock, flags | TIMEOUT_KCLOCK);
}
int
-/* $OpenBSD: timeout.h,v 1.41 2021/05/29 01:32:49 cheloha Exp $ */
+/* $OpenBSD: timeout.h,v 1.42 2021/06/19 02:05:33 cheloha Exp $ */
/*
* Copyright (c) 2000-2001 Artur Grabowski <art@openbsd.org>
* All rights reserved.
#define KCLOCK_UPTIME 0 /* uptime clock; time since boot */
#define KCLOCK_MAX 1
-#define __TIMEOUT_INITIALIZER(fn, arg, flags, kclock) { \
+#define __TIMEOUT_INITIALIZER(_fn, _arg, _kclock, _flags) { \
.to_list = { NULL, NULL }, \
.to_abstime = { .tv_sec = 0, .tv_nsec = 0 }, \
- .to_func = (fn), \
- .to_arg = (arg), \
+ .to_func = (_fn), \
+ .to_arg = (_arg), \
.to_time = 0, \
- .to_flags = (flags) | TIMEOUT_INITIALIZED, \
- .to_kclock = (kclock) \
+ .to_flags = (_flags) | TIMEOUT_INITIALIZED, \
+ .to_kclock = (_kclock) \
}
-#define TIMEOUT_INITIALIZER_KCLOCK(fn, arg, flags, kclock) \
- __TIMEOUT_INITIALIZER((fn), (args), (flags) | TIMEOUT_KCLOCK, (kclock))
+#define TIMEOUT_INITIALIZER_KCLOCK(_fn, _arg, _kclock, _flags) \
+ __TIMEOUT_INITIALIZER((_fn), (_args), (_kclock), (_flags) | TIMEOUT_KCLOCK)
-#define TIMEOUT_INITIALIZER_FLAGS(fn, arg, flags) \
- __TIMEOUT_INITIALIZER((fn), (args), (flags), KCLOCK_NONE)
+#define TIMEOUT_INITIALIZER_FLAGS(_fn, _arg, _flags) \
+ __TIMEOUT_INITIALIZER((_fn), (_args), KCLOCK_NONE, (_flags))
#define TIMEOUT_INITIALIZER(_f, _a) \
- __TIMEOUT_INITIALIZER((_f), (_a), 0, KCLOCK_NONE)
+ __TIMEOUT_INITIALIZER((_f), (_a), KCLOCK_NONE, 0)
void timeout_set(struct timeout *, void (*)(void *), void *);
void timeout_set_flags(struct timeout *, void (*)(void *), void *, int);