svn commit: r201550 - user/kmacy/releng_8_rump/lib/libunet

Kip Macy kmacy at FreeBSD.org
Tue Jan 5 05:40:08 UTC 2010


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 <sys/mman.h>
 #include <sys/refcount.h>
 #include <sys/ucred.h>
+#include <sys/time.h>
 
 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)); 
-
-


More information about the svn-src-user mailing list