[okl4-developer] KernelInterface syscall on ia32
Carl van Schaik
carl at ok-labs.com
Tue Feb 12 09:44:46 EST 2008
Hi Harry,
lock; nop
means, do an atomic nop. Ia-32 does not support this operation and thus
the hardware raises an exception. This is like a type of undefined
instruction and the kernel checks for the instruction sequence causing
the fault to determine whether the KernelInterface call was invoked.
-
regards
Carl
Harry Vennik wrote:
> Hi,
>
> I wonder how the KernelInterface syscall actually works for ia32.
>
> In arch/ia32/libs/l4/include/syscall.h the KernelInterface syscall
> stub is implemented as:
>
> 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;
> }
>
> This looks like a 'nop' instruction is doing the work, which can't be
> true because a 'nop' does nothing...
> So how do those output registers get their values?
>
> Btw: is there an ABI doc anywhere for OKL4 on ia32? The progmanual
> only includes the ABI for ARM...
>
> Regards,
>
> Harry
> ------------------------------------------------------------------------
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
>
More information about the Developer
mailing list