From owner-svn-src-user@FreeBSD.ORG Tue Jan 5 05:40:08 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12083106568F; Tue, 5 Jan 2010 05:40:08 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00E1D8FC13; Tue, 5 Jan 2010 05:40:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o055e7Db001951; Tue, 5 Jan 2010 05:40:07 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o055e7nu001946; Tue, 5 Jan 2010 05:40:07 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201001050540.o055e7nu001946@svn.freebsd.org> From: Kip Macy Date: Tue, 5 Jan 2010 05:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201550 - user/kmacy/releng_8_rump/lib/libunet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 05:40:08 -0000 Author: kmacy Date: Tue Jan 5 05:40:07 2010 New Revision: 201550 URL: http://svn.freebsd.org/changeset/base/201550 Log: eliminate need for taskqueue by removing kqueue support from the first cut of libunet Modified: user/kmacy/releng_8_rump/lib/libunet/Makefile user/kmacy/releng_8_rump/lib/libunet/unet_compat.c user/kmacy/releng_8_rump/lib/libunet/unet_glue.c user/kmacy/releng_8_rump/lib/libunet/unet_subr_taskqueue.c Modified: user/kmacy/releng_8_rump/lib/libunet/Makefile ============================================================================== --- user/kmacy/releng_8_rump/lib/libunet/Makefile Tue Jan 5 05:37:49 2010 (r201549) +++ user/kmacy/releng_8_rump/lib/libunet/Makefile Tue Jan 5 05:40:07 2010 (r201550) @@ -11,7 +11,6 @@ LIB= unet UNET_KERN_COMMON_OBJS += \ kern_environment.o \ - kern_event.o \ kern_mbuf.o \ kern_module.o \ kern_mtxpool.o \ @@ -116,8 +115,9 @@ UNET_COMMON_SRCS= ${UNET_COMMON_OBJS:C/. SRCS= ${UNET_COMMON_SRCS} -CFLAGS+= -I${PREFIX} +CFLAGS+= -I./include CFLAGS+= -I./include/opt +CFLAGS+= -I${PREFIX} CFLAGS+= -D_KERNEL CFLAGS+= -DUNET CFLAGS+= -DMAXUSERS=32 Modified: user/kmacy/releng_8_rump/lib/libunet/unet_compat.c ============================================================================== --- user/kmacy/releng_8_rump/lib/libunet/unet_compat.c Tue Jan 5 05:37:49 2010 (r201549) +++ user/kmacy/releng_8_rump/lib/libunet/unet_compat.c Tue Jan 5 05:40:07 2010 (r201550) @@ -5,6 +5,7 @@ #include #include #include +#include struct malloc_type; @@ -69,4 +70,30 @@ panic(const char *fmt, ...) abort(); } +void +bintime(struct bintime *bt) +{ + struct timeval tv; + + gettimeofday(&tv, NULL); + timeval2bintime(&tv, bt); +} + +void +getmicrouptime(struct timeval *tvp) +{ + struct timeval tv; + + gettimeofday(&tv, NULL); +} + +void +getmicrotime(struct timeval *tvp) +{ + struct timeval tv; + + gettimeofday(&tv, NULL); +} + + Modified: user/kmacy/releng_8_rump/lib/libunet/unet_glue.c ============================================================================== --- user/kmacy/releng_8_rump/lib/libunet/unet_glue.c Tue Jan 5 05:37:49 2010 (r201549) +++ user/kmacy/releng_8_rump/lib/libunet/unet_glue.c Tue Jan 5 05:40:07 2010 (r201550) @@ -331,27 +331,6 @@ ppsratecheck(struct timeval *lasttime, i } } -void -bintime(struct bintime *bt) -{ - - panic(""); -} - -void -getmicrouptime(struct timeval *tvp) -{ - - panic(""); -} - -void -getmicrotime(struct timeval *tvp) -{ - - panic(""); -} - /* * Compute number of ticks in the specified amount of time. */ @@ -613,6 +592,7 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu ; } + /* * Send a SIGIO or SIGURG signal to a process or process group using stored * credentials rather than those of the current process. @@ -622,14 +602,47 @@ pgsigio(sigiop, sig, checkctty) struct sigio **sigiop; int sig, checkctty; { - panic(""); +#ifdef notyet + ksiginfo_t ksi; + struct sigio *sigio; + + ksiginfo_init(&ksi); + ksi.ksi_signo = sig; + ksi.ksi_code = SI_KERNEL; + + SIGIO_LOCK(); + sigio = *sigiop; + if (sigio == NULL) { + SIGIO_UNLOCK(); + return; + } + if (sigio->sio_pgid > 0) { + PROC_LOCK(sigio->sio_proc); + if (CANSIGIO(sigio->sio_ucred, sigio->sio_proc->p_ucred)) + psignal(sigio->sio_proc, sig); + PROC_UNLOCK(sigio->sio_proc); + } else if (sigio->sio_pgid < 0) { + struct proc *p; + + PGRP_LOCK(sigio->sio_pgrp); + LIST_FOREACH(p, &sigio->sio_pgrp->pg_members, p_pglist) { + PROC_LOCK(p); + if (CANSIGIO(sigio->sio_ucred, p->p_ucred) && + (checkctty == 0 || (p->p_flag & P_CONTROLT))) + psignal(p, sig); + PROC_UNLOCK(p); + } + PGRP_UNLOCK(sigio->sio_pgrp); + } + SIGIO_UNLOCK(); +#endif } void kproc_exit(int ecode) { - panic(""); + panic("kproc_exit unsupported"); } vm_offset_t @@ -719,3 +732,21 @@ malloc_uninit(void *data) uma_zfree_arg(mt_zone, mtip, slab); #endif } + +void +knote(struct knlist *list, long hint, int lockflags) +{ + +} + +void +knlist_destroy(struct knlist *knl) +{ + +} + +void +knlist_init_mtx(struct knlist *knl, struct mtx *lock) +{ + +} Modified: user/kmacy/releng_8_rump/lib/libunet/unet_subr_taskqueue.c ============================================================================== --- user/kmacy/releng_8_rump/lib/libunet/unet_subr_taskqueue.c Tue Jan 5 05:37:49 2010 (r201549) +++ user/kmacy/releng_8_rump/lib/libunet/unet_subr_taskqueue.c Tue Jan 5 05:40:07 2010 (r201550) @@ -39,80 +39,20 @@ struct taskqueue { #define TQ_FLAGS_PENDING (1 << 2) -struct taskqueue * -taskqueue_create(const char *name, int mflags, - taskqueue_enqueue_fn enqueue, - void *context) -{ - - panic(""); - return (NULL); - -} - -int -taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, - const char *name, ...) -{ - - - panic(""); - return (0); -} - - -void -taskqueue_run(struct taskqueue *queue) -{ - - panic(""); -} - +struct taskqueue *taskqueue_swi; int taskqueue_enqueue(struct taskqueue *queue, struct task *task) { - panic(""); + panic("should be unreachable"); return (0); } - void taskqueue_drain(struct taskqueue *queue, struct task *task) { - panic(""); + panic("should be unreachable"); } -void -taskqueue_free(struct taskqueue *queue) -{ - - panic(""); -} - -void -taskqueue_thread_enqueue(void *context) -{ - panic(""); - -} - -static void -taskqueue_swi_enqueue(void *context) -{ - swi_sched(taskqueue_ih, 0); -} - -static void -taskqueue_swi_run(void *dummy) -{ - taskqueue_run(taskqueue_swi); -} - -TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, NULL, - swi_add(NULL, "task queue", taskqueue_swi_run, NULL, SWI_TQ, - INTR_MPSAFE, &taskqueue_ih)); - -