Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys convert vmem, signals, powerhooks from CIRCLEQ -> TAILQ.
details: https://anonhg.NetBSD.org/src/rev/2326c394b5f2
branches: trunk
changeset: 791544:2326c394b5f2
user: christos <christos%NetBSD.org@localhost>
date: Fri Nov 22 21:04:11 2013 +0000
description:
convert vmem, signals, powerhooks from CIRCLEQ -> TAILQ.
diffstat:
sys/kern/kern_exec.c | 6 +++---
sys/kern/kern_fork.c | 6 +++---
sys/kern/kern_hook.c | 22 ++++++++++++----------
sys/kern/kern_lwp.c | 6 +++---
sys/kern/kern_sig.c | 28 +++++++++++++---------------
sys/kern/subr_vmem.c | 32 ++++++++++++++++----------------
sys/sys/siginfo.h | 4 ++--
sys/sys/signalvar.h | 8 ++++----
sys/sys/vmem_impl.h | 6 +++---
9 files changed, 59 insertions(+), 59 deletions(-)
diffs (truncated from 458 to 300 lines):
diff -r 76bdffe41bd7 -r 2326c394b5f2 sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c Fri Nov 22 20:15:06 2013 +0000
+++ b/sys/kern/kern_exec.c Fri Nov 22 21:04:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exec.c,v 1.365 2013/11/14 16:53:51 martin Exp $ */
+/* $NetBSD: kern_exec.c,v 1.366 2013/11/22 21:04:11 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.365 2013/11/14 16:53:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.366 2013/11/22 21:04:11 christos Exp $");
#include "opt_exec.h"
#include "opt_execfmt.h"
@@ -2226,7 +2226,7 @@
(unsigned) ((char *)&p2->p_endcopy - (char *)&p2->p_startcopy));
p2->p_vmspace = proc0.p_vmspace;
- CIRCLEQ_INIT(&p2->p_sigpend.sp_info);
+ TAILQ_INIT(&p2->p_sigpend.sp_info);
LIST_INIT(&p2->p_lwps);
LIST_INIT(&p2->p_sigwaiters);
diff -r 76bdffe41bd7 -r 2326c394b5f2 sys/kern/kern_fork.c
--- a/sys/kern/kern_fork.c Fri Nov 22 20:15:06 2013 +0000
+++ b/sys/kern/kern_fork.c Fri Nov 22 21:04:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_fork.c,v 1.192 2013/06/09 01:13:47 riz Exp $ */
+/* $NetBSD: kern_fork.c,v 1.193 2013/11/22 21:04:11 christos Exp $ */
/*-
* Copyright (c) 1999, 2001, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.192 2013/06/09 01:13:47 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_fork.c,v 1.193 2013/11/22 21:04:11 christos Exp $");
#include "opt_ktrace.h"
@@ -291,7 +291,7 @@
memcpy(&p2->p_startcopy, &p1->p_startcopy,
(unsigned) ((char *)&p2->p_endcopy - (char *)&p2->p_startcopy));
- CIRCLEQ_INIT(&p2->p_sigpend.sp_info);
+ TAILQ_INIT(&p2->p_sigpend.sp_info);
LIST_INIT(&p2->p_lwps);
LIST_INIT(&p2->p_sigwaiters);
diff -r 76bdffe41bd7 -r 2326c394b5f2 sys/kern/kern_hook.c
--- a/sys/kern/kern_hook.c Fri Nov 22 20:15:06 2013 +0000
+++ b/sys/kern/kern_hook.c Fri Nov 22 21:04:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_hook.c,v 1.5 2012/10/27 17:18:39 chs Exp $ */
+/* $NetBSD: kern_hook.c,v 1.6 2013/11/22 21:04:11 christos Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.5 2012/10/27 17:18:39 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.6 2013/11/22 21:04:11 christos Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@@ -314,14 +314,14 @@
* registration order, when powering up in registration order.
*/
struct powerhook_desc {
- CIRCLEQ_ENTRY(powerhook_desc) sfd_list;
+ TAILQ_ENTRY(powerhook_desc) sfd_list;
void (*sfd_fn)(int, void *);
void *sfd_arg;
char sfd_name[16];
};
-static CIRCLEQ_HEAD(, powerhook_desc) powerhook_list =
- CIRCLEQ_HEAD_INITIALIZER(powerhook_list);
+static TAILQ_HEAD(powerhook_head, powerhook_desc) powerhook_list =
+ TAILQ_HEAD_INITIALIZER(powerhook_list);
void *
powerhook_establish(const char *name, void (*fn)(int, void *), void *arg)
@@ -336,7 +336,7 @@
ndp->sfd_fn = fn;
ndp->sfd_arg = arg;
strlcpy(ndp->sfd_name, name, sizeof(ndp->sfd_name));
- CIRCLEQ_INSERT_HEAD(&powerhook_list, ndp, sfd_list);
+ TAILQ_INSERT_HEAD(&powerhook_list, ndp, sfd_list);
aprint_error("%s: WARNING: powerhook_establish is deprecated\n", name);
return (ndp);
@@ -348,14 +348,14 @@
#ifdef DIAGNOSTIC
struct powerhook_desc *dp;
- CIRCLEQ_FOREACH(dp, &powerhook_list, sfd_list)
+ TAILQ_FOREACH(dp, &powerhook_list, sfd_list)
if (dp == vhook)
goto found;
panic("powerhook_disestablish: hook %p not established", vhook);
found:
#endif
- CIRCLEQ_REMOVE(&powerhook_list, (struct powerhook_desc *)vhook,
+ TAILQ_REMOVE(&powerhook_list, (struct powerhook_desc *)vhook,
sfd_list);
free(vhook, M_DEVBUF);
}
@@ -372,14 +372,16 @@
why_name = why < __arraycount(pwr_names) ? pwr_names[why] : "???";
if (why == PWR_RESUME || why == PWR_SOFTRESUME) {
- CIRCLEQ_FOREACH_REVERSE(dp, &powerhook_list, sfd_list) {
+ TAILQ_FOREACH_REVERSE(dp, &powerhook_list, powerhook_head,
+ sfd_list)
+ {
if (powerhook_debug)
printf("dopowerhooks %s: %s (%p)\n",
why_name, dp->sfd_name, dp);
(*dp->sfd_fn)(why, dp->sfd_arg);
}
} else {
- CIRCLEQ_FOREACH(dp, &powerhook_list, sfd_list) {
+ TAILQ_FOREACH(dp, &powerhook_list, sfd_list) {
if (powerhook_debug)
printf("dopowerhooks %s: %s (%p)\n",
why_name, dp->sfd_name, dp);
diff -r 76bdffe41bd7 -r 2326c394b5f2 sys/kern/kern_lwp.c
--- a/sys/kern/kern_lwp.c Fri Nov 22 20:15:06 2013 +0000
+++ b/sys/kern/kern_lwp.c Fri Nov 22 21:04:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_lwp.c,v 1.175 2013/06/09 01:13:47 riz Exp $ */
+/* $NetBSD: kern_lwp.c,v 1.176 2013/11/22 21:04:11 christos Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.175 2013/06/09 01:13:47 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.176 2013/11/22 21:04:11 christos Exp $");
#include "opt_ddb.h"
#include "opt_lockdebug.h"
@@ -911,7 +911,7 @@
l2->l_sigstk = l1->l_sigstk;
l2->l_sigmask = l1->l_sigmask;
- CIRCLEQ_INIT(&l2->l_sigpend.sp_info);
+ TAILQ_INIT(&l2->l_sigpend.sp_info);
sigemptyset(&l2->l_sigpend.sp_set);
if (__predict_true(lid == 0)) {
diff -r 76bdffe41bd7 -r 2326c394b5f2 sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c Fri Nov 22 20:15:06 2013 +0000
+++ b/sys/kern/kern_sig.c Fri Nov 22 21:04:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_sig.c,v 1.318 2013/06/09 01:13:47 riz Exp $ */
+/* $NetBSD: kern_sig.c,v 1.319 2013/11/22 21:04:11 christos Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.318 2013/06/09 01:13:47 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.319 2013/11/22 21:04:11 christos Exp $");
#include "opt_ptrace.h"
#include "opt_compat_sunos.h"
@@ -519,11 +519,11 @@
{
ksiginfo_t *ksi;
- KASSERT(!CIRCLEQ_EMPTY(kq));
+ KASSERT(!TAILQ_EMPTY(kq));
- while (!CIRCLEQ_EMPTY(kq)) {
- ksi = CIRCLEQ_FIRST(kq);
- CIRCLEQ_REMOVE(kq, ksi, ksi_list);
+ while (!TAILQ_EMPTY(kq)) {
+ ksi = TAILQ_FIRST(kq);
+ TAILQ_REMOVE(kq, ksi, ksi_list);
pool_cache_put(ksiginfo_cache, ksi);
}
}
@@ -537,10 +537,10 @@
goto out;
/* Find siginfo and copy it out. */
- CIRCLEQ_FOREACH(ksi, &sp->sp_info, ksi_list) {
+ TAILQ_FOREACH(ksi, &sp->sp_info, ksi_list) {
if (ksi->ksi_signo != signo)
continue;
- CIRCLEQ_REMOVE(&sp->sp_info, ksi, ksi_list);
+ TAILQ_REMOVE(&sp->sp_info, ksi, ksi_list);
KASSERT((ksi->ksi_flags & KSI_FROMPOOL) != 0);
KASSERT((ksi->ksi_flags & KSI_QUEUED) != 0);
ksi->ksi_flags &= ~KSI_QUEUED;
@@ -626,7 +626,7 @@
if (ksi->ksi_signo < SIGRTMIN)
#endif
{
- CIRCLEQ_FOREACH(kp, &sp->sp_info, ksi_list) {
+ TAILQ_FOREACH(kp, &sp->sp_info, ksi_list) {
if (kp->ksi_signo == ksi->ksi_signo) {
KSI_COPY(ksi, kp);
kp->ksi_flags |= KSI_QUEUED;
@@ -636,7 +636,7 @@
}
ksi->ksi_flags |= KSI_QUEUED;
- CIRCLEQ_INSERT_TAIL(&sp->sp_info, ksi, ksi_list);
+ TAILQ_INSERT_TAIL(&sp->sp_info, ksi, ksi_list);
}
/*
@@ -654,14 +654,12 @@
else
sigminusset(mask, &sp->sp_set);
- ksi = CIRCLEQ_FIRST(&sp->sp_info);
- for (; ksi != (void *)&sp->sp_info; ksi = next) {
- next = CIRCLEQ_NEXT(ksi, ksi_list);
+ TAILQ_FOREACH_SAFE(ksi, &sp->sp_info, ksi_list, next) {
if (mask == NULL || sigismember(mask, ksi->ksi_signo)) {
- CIRCLEQ_REMOVE(&sp->sp_info, ksi, ksi_list);
+ TAILQ_REMOVE(&sp->sp_info, ksi, ksi_list);
KASSERT((ksi->ksi_flags & KSI_FROMPOOL) != 0);
KASSERT((ksi->ksi_flags & KSI_QUEUED) != 0);
- CIRCLEQ_INSERT_TAIL(kq, ksi, ksi_list);
+ TAILQ_INSERT_TAIL(kq, ksi, ksi_list);
}
}
}
diff -r 76bdffe41bd7 -r 2326c394b5f2 sys/kern/subr_vmem.c
--- a/sys/kern/subr_vmem.c Fri Nov 22 20:15:06 2013 +0000
+++ b/sys/kern/subr_vmem.c Fri Nov 22 21:04:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_vmem.c,v 1.86 2013/10/25 11:35:55 martin Exp $ */
+/* $NetBSD: subr_vmem.c,v 1.87 2013/11/22 21:04:11 christos Exp $ */
/*-
* Copyright (c)2006,2007,2008,2009 YAMAMOTO Takashi,
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_vmem.c,v 1.86 2013/10/25 11:35:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_vmem.c,v 1.87 2013/11/22 21:04:11 christos Exp $");
#if defined(_KERNEL)
#include "opt_ddb.h"
@@ -426,21 +426,21 @@
bt_remseg(vmem_t *vm, bt_t *bt)
{
- CIRCLEQ_REMOVE(&vm->vm_seglist, bt, bt_seglist);
+ TAILQ_REMOVE(&vm->vm_seglist, bt, bt_seglist);
}
static void
bt_insseg(vmem_t *vm, bt_t *bt, bt_t *prev)
{
- CIRCLEQ_INSERT_AFTER(&vm->vm_seglist, prev, bt, bt_seglist);
+ TAILQ_INSERT_AFTER(&vm->vm_seglist, prev, bt, bt_seglist);
}
static void
bt_insseg_tail(vmem_t *vm, bt_t *bt)
{
- CIRCLEQ_INSERT_TAIL(&vm->vm_seglist, bt, bt_seglist);
+ TAILQ_INSERT_TAIL(&vm->vm_seglist, bt, bt_seglist);
}
static void
@@ -900,7 +900,7 @@
qc_init(vm, qcache_max, ipl);
#endif /* defined(QCACHE) */
- CIRCLEQ_INIT(&vm->vm_seglist);
+ TAILQ_INIT(&vm->vm_seglist);
for (i = 0; i < VMEM_MAXORDER; i++) {
LIST_INIT(&vm->vm_freelist[i]);
}
@@ -1181,7 +1181,7 @@
bt->bt_start = start;
bt->bt_size -= btnew2->bt_size;
Home |
Main Index |
Thread Index |
Old Index