[Top][All Lists]

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

Re: IDL issue - struct return vs. cap return

From: Jonathan S. Shapiro
Subject: Re: IDL issue - struct return vs. cap return
Date: Mon, 09 Jul 2007 20:42:27 -0400

On Mon, 2007-07-09 at 23:24 +0200, Neal H. Walfield wrote:
> > Because cap_t is a reference, you basically have two options if you want
> > to return a cap_t from an IDL procedure:
> > 
> >   1. Use a well-known return location, e.g. capability register 2.
> >   2. Call the capability location allocator from inside the stub, as
> >      in:
> > 
> >      f() {
> >       cap_t _retVal = alloc_cap_location();
> >       DO_SYSCALL_HERE(_retVal);
> >       return _retVal;
> >     }
> 3. The caller provides the address of the slot in which the function
>    should store the capability.  (You want this for the same reasons
>    you may not necessarily want a function to call malloc.)

This is exactly what happens when the return value is rotated to be an
OUT parameter.

What you seem to be advocating is that the location be passed in and
then be passed back out. What advantage is there to this?

Jonathan S. Shapiro, Ph.D.
Managing Director
The EROS Group, LLC

reply via email to

[Prev in Thread] Current Thread [Next in Thread]