Need help about L4_KernelInterface()

Bob <[email protected]> Wed, 3 Sep 2008 16:54:36 +0800 (CST)
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
Hi, All

    I have a question about L4_KernelInterface().  I guess L4_KernelInterface() just get the fpage::kip's base address.
Such as used in file pingpong.cc 
L4_KernelInterfacePage_t * kip = (L4_KernelInterfacePage_t *) L4_KernelInterface ();

    But where L4_KernelInterface() is defined? I found in  file /user/include/l4/ia32/syscall.h

L4_INLINE void * L4_KernelInterface (L4_Word_t *ApiVersion,
				     L4_Word_t *ApiFlags,
				     L4_Word_t *KernelId)
{
    void * base_address;

    __asm__ __volatile__ (
	"/* L4_KernelInterface() */ 			\n"
	"	lock; nop				\n"

	: /* outputs */
	"=a" (base_address),
	"=c" (*ApiVersion),
	"=d" (*ApiFlags),
	"=S" (*KernelId)

	/* no inputs */
	/* no clobbers */
	);

    return base_address;
}

 I really don't understand this funtion, how can it return the fpage::kip's base address.


    Thanks, all!
    Bob.