Skip site navigation (1)Skip section navigation (2)
Date:      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
Message-ID:  <M2001072321270608082@vaca.uniandes.edu.co>

next in thread | raw e-mail | index | archive | help

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-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?M2001072321270608082>