From owner-freebsd-questions Mon Jul 23 19:29:50 2001 Delivered-To: freebsd-questions@freebsd.org Received: from vaca.uniandes.edu.co (vaca.uniandes.edu.co [157.253.54.5]) by hub.freebsd.org (Postfix) with ESMTP id 892D937B406; Mon, 23 Jul 2001 19:29:36 -0700 (PDT) (envelope-from y-carden@uniandes.edu.co) Received: from vaca.uniandes.edu.co (localhost [127.0.0.1]) by vaca.uniandes.edu.co (8.12.0.Beta7/8.12.0.Beta7) with SMTP id f6O2R66C009444; Mon, 23 Jul 2001 21:27:11 -0500 (GMT+5) Received: (from webmail [157.253.54.4]) by vaca.uniandes.edu.co (NAVGW 2.5 bld 90) with SMTP id M2001072321270608082 ; Mon, 23 Jul 2001 21:27:06 -0500 From: y-carden@uniandes.edu.co To: hackers@FreeBSD.org Cc: questions@FreeBSD.org Subject: Invoking a userland function from kernel X-Mailer: Netscape Messenger Express 3.5.2 [Mozilla/4.72 [en] (X11; I; FreeBSD 4.0-RELEASE i386)] Date: Mon, 23 Jul 2001 21:27:06 -0500 Message-Id: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dear Friends I'm incorporating the Real Time Protocol RTP (rfc 1889) to FreeBSD 4.0 kernel. Months ago, I compiled successfully the RTP Library API developed by Lucent into the FreeBSD kernel with the right logical and technical adjustments for the BSD kernel of course (copyin, copyout, malloc, etc). I have changed many of the original API library functions to kernel systems calls, and it works fine. Now, I need invoke a userland function with several parameters from the a function into the kernel. How I can do? Do you know a example? I need to do this : /* ---- In the kernel function ----- */ void MyKernelFuntion(){ int id; void *opaque; struct timeval *tp; /* ... */ MyUserlandFunction (id, opaque, tp); /* ... */ } /* ---- In the userland ----- */ void MyUserlandFunction (int id, void *opaque, struct timeval *tp) int value = id * K + P; /* ... */ return; } /* ----- end ----- */ I don't need return data from userland function to kernel later. Well, MyKernelFunction() is only invoked for system calls that the userland process with MyUserlandFunction() have done before, of course. In other words, MyUserlandFuntion() is into the same userland process that invoke the system calls that call to MyKernelFunction(). Thanks for your help. +------------------------+ YONNY CARDENAS B. Systems Engineer y-carden@uniandes.edu.co Student M.Sc. UNIVERSIDAD DE LOS ANDES Santafe de Bogota D.C Colombia - South America To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message