Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Move _insque()/_remque() to libkern. Once remaining uses...



details:   https://anonhg.NetBSD.org/src/rev/0c46fc926a47
branches:  trunk
changeset: 513757:0c46fc926a47
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Aug 12 08:35:31 2001 +0000

description:
Move _insque()/_remque() to libkern. Once remaining uses would
be converted to <sys/queue.h> macros, _insque()/_remque() would be eliminated
altogether.

diffstat:

 sys/arch/alpha/alpha/support.c   |  64 ------------------------------
 sys/arch/alpha/conf/files.alpha  |   3 +-
 sys/arch/arm/arm32/stubs.c       |  45 +--------------------
 sys/arch/hpcarm/hpcarm/stubs.c   |  45 +--------------------
 sys/arch/i386/i386/machdep.c     |  41 +-------------------
 sys/arch/pc532/pc532/machdep.c   |  41 +-------------------
 sys/arch/sh3/sh3/sh3_machdep.c   |  40 +------------------
 sys/arch/x86_64/x86_64/machdep.c |  41 +-------------------
 sys/lib/libkern/Makefile         |   3 +-
 sys/lib/libkern/_que.c           |  84 ++++++++++++++++++++++++++++++++++++++++
 10 files changed, 93 insertions(+), 314 deletions(-)

diffs (truncated from 524 to 300 lines):

diff -r 7c2ca99fcdea -r 0c46fc926a47 sys/arch/alpha/alpha/support.c
--- a/sys/arch/alpha/alpha/support.c    Sun Aug 12 00:20:32 2001 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/* $NetBSD: support.c,v 1.8 2001/01/03 22:15:38 thorpej Exp $ */
-
-/*
- * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- * 
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- * 
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
- * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- * 
- * Carnegie Mellon requests users of this software to return to
- *
- *  Software Distribution Coordinator  or  Software.Distribution%CS.CMU.EDU@localhost
- *  School of Computer Science
- *  Carnegie Mellon University
- *  Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-#include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-
-__KERNEL_RCSID(0, "$NetBSD: support.c,v 1.8 2001/01/03 22:15:38 thorpej Exp $");
-
-/*
- * Some C support functions that aren't (yet) in libkern or assembly.
- */
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/errno.h>
-
-struct qelem {
-       struct qelem *q_forw;
-       struct qelem *q_back;
-};
-
-void
-_insque(void *entry, void *pred)
-{
-       struct qelem *e = (struct qelem *) entry;
-       struct qelem *p = (struct qelem *) pred;
-
-       e->q_forw = p->q_forw;
-       e->q_back = p;
-       p->q_forw->q_back = e;
-       p->q_forw = e;
-}
-
-void
-_remque(void *element)
-{
-       struct qelem *e = (struct qelem *) element;
-       e->q_forw->q_back = e->q_back;
-       e->q_back->q_forw = e->q_forw;
-}
diff -r 7c2ca99fcdea -r 0c46fc926a47 sys/arch/alpha/conf/files.alpha
--- a/sys/arch/alpha/conf/files.alpha   Sun Aug 12 00:20:32 2001 +0000
+++ b/sys/arch/alpha/conf/files.alpha   Sun Aug 12 08:35:31 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.alpha,v 1.140 2001/06/18 02:00:48 christos Exp $
+# $NetBSD: files.alpha,v 1.141 2001/08/12 08:35:32 jdolecek Exp $
 #
 # alpha-specific configuration info
 
@@ -492,7 +492,6 @@
 file   arch/alpha/alpha/process_machdep.c
 file   arch/alpha/alpha/procfs_machdep.c       procfs
 file   arch/alpha/alpha/prom.c
-file   arch/alpha/alpha/support.c
 file   arch/alpha/alpha/sys_machdep.c
 file   arch/alpha/alpha/syscall.c
 file   arch/alpha/alpha/trap.c
diff -r 7c2ca99fcdea -r 0c46fc926a47 sys/arch/arm/arm32/stubs.c
--- a/sys/arch/arm/arm32/stubs.c        Sun Aug 12 00:20:32 2001 +0000
+++ b/sys/arch/arm/arm32/stubs.c        Sun Aug 12 08:35:31 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stubs.c,v 1.1 2001/07/28 13:28:04 chris Exp $  */
+/*     $NetBSD: stubs.c,v 1.2 2001/08/12 08:35:33 jdolecek Exp $       */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -55,49 +55,6 @@
 extern dev_t dumpdev;
 extern BootConfig bootconfig;
 
-/* These queue functions are candiates for arm32/machdep.c */
-struct queue {
-       struct queue *q_next, *q_prev;
-};
-
-/*
- * insert an element into a queue
- */
-
-void
-_insque(v1, v2)
-       void *v1;
-       void *v2;
-{
-       struct queue *elem = v1, *head = v2;
-       struct queue *next;
-
-       next = head->q_next;
-       elem->q_next = next;
-       head->q_next = elem;
-       elem->q_prev = head;
-       next->q_prev = elem;
-}
-
-/*
- * remove an element from a queue
- */
-
-void
-_remque(v)
-       void *v;
-{
-       struct queue *elem = v;
-       struct queue *next, *prev;
-
-       next = elem->q_next;
-       prev = elem->q_prev;
-       next->q_prev = prev;
-       prev->q_next = next;
-       elem->q_prev = 0;
-}
-
-
 /*
  * These variables are needed by /sbin/savecore
  */
diff -r 7c2ca99fcdea -r 0c46fc926a47 sys/arch/hpcarm/hpcarm/stubs.c
--- a/sys/arch/hpcarm/hpcarm/stubs.c    Sun Aug 12 00:20:32 2001 +0000
+++ b/sys/arch/hpcarm/hpcarm/stubs.c    Sun Aug 12 08:35:31 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stubs.c,v 1.6 2001/06/29 02:40:28 toshii Exp $ */
+/*     $NetBSD: stubs.c,v 1.7 2001/08/12 08:35:32 jdolecek Exp $       */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -55,49 +55,6 @@
 extern dev_t dumpdev;
 extern BootConfig bootconfig;
 
-/* These queue functions are candiates for arm32/machdep.c */
-struct queue {
-       struct queue *q_next, *q_prev;
-};
-
-/*
- * insert an element into a queue
- */
-
-void
-_insque(v1, v2)
-       void *v1;
-       void *v2;
-{
-       struct queue *elem = v1, *head = v2;
-       struct queue *next;
-
-       next = head->q_next;
-       elem->q_next = next;
-       head->q_next = elem;
-       elem->q_prev = head;
-       next->q_prev = elem;
-}
-
-/*
- * remove an element from a queue
- */
-
-void
-_remque(v)
-       void *v;
-{
-       struct queue *elem = v;
-       struct queue *next, *prev;
-
-       next = elem->q_next;
-       prev = elem->q_prev;
-       next->q_prev = prev;
-       prev->q_next = next;
-       elem->q_prev = 0;
-}
-
-
 /*
  * These variables are needed by /sbin/savecore
  */
diff -r 7c2ca99fcdea -r 0c46fc926a47 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Sun Aug 12 00:20:32 2001 +0000
+++ b/sys/arch/i386/i386/machdep.c      Sun Aug 12 08:35:31 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.452 2001/08/03 01:24:40 thorpej Exp $    */
+/*     $NetBSD: machdep.c,v 1.453 2001/08/12 08:35:31 jdolecek Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -2833,45 +2833,6 @@
        identifycpu(curcpu());
 }
 
-struct queue {
-       struct queue *q_next, *q_prev;
-};
-
-/*
- * insert an element into a queue
- */
-void
-_insque(v1, v2)
-       void *v1;
-       void *v2;
-{
-       struct queue *elem = v1, *head = v2;
-       struct queue *next;
-
-       next = head->q_next;
-       elem->q_next = next;
-       head->q_next = elem;
-       elem->q_prev = head;
-       next->q_prev = elem;
-}
-
-/*
- * remove an element from a queue
- */
-void
-_remque(v)
-       void *v;
-{
-       struct queue *elem = v;
-       struct queue *next, *prev;
-
-       next = elem->q_next;
-       prev = elem->q_prev;
-       next->q_prev = prev;
-       prev->q_next = next;
-       elem->q_prev = 0;
-}
-
 #ifdef COMPAT_NOMID
 static int
 exec_nomid(p, epp)
diff -r 7c2ca99fcdea -r 0c46fc926a47 sys/arch/pc532/pc532/machdep.c
--- a/sys/arch/pc532/pc532/machdep.c    Sun Aug 12 00:20:32 2001 +0000
+++ b/sys/arch/pc532/pc532/machdep.c    Sun Aug 12 08:35:31 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.123 2001/06/02 18:09:18 chs Exp $        */
+/*     $NetBSD: machdep.c,v 1.124 2001/08/12 08:35:33 jdolecek Exp $   */
 
 /*-
  * Copyright (c) 1996 Matthias Pfaller.
@@ -1019,45 +1019,6 @@
        panic("main returned to init532\n");
 }
 
-struct queue {
-       struct queue *q_next, *q_prev;
-};
-
-/*
- * insert an element into a queue
- */
-void
-_insque(v1, v2)
-       void *v1;
-       void *v2;
-{
-       register struct queue *elem = v1, *head = v2;
-       register struct queue *next;
-
-       next = head->q_next;
-       elem->q_next = next;
-       head->q_next = elem;
-       elem->q_prev = head;
-       next->q_prev = elem;
-}
-
-/*
- * remove an element from a queue
- */
-void
-_remque(v)
-       void *v;
-{



Home | Main Index | Thread Index | Old Index