Re:Re: Another question about L4 system call

Bob <[email protected]> Sun, 7 Sep 2008 22:45:52 +0800 (CST)
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
 It's called in the same file ..And untill now I haven't start to build the l4 environment,i just want to have a glance of it, then i will do some practises.

 extern "C" void __L4_init_syscalls (void)
{
    L4_KernelInterfacePage_t * kip = (L4_KernelInterfacePage_t *)
 L4_KernelInterface ();
    // Make copy before starting to modify.
    __L4_copy_syscalls_out ();
    //L4_KDB_Enter ("Fixup syscalls");
    
    FIXUP (Ipc);
    FIXUP (Lipc);
    FIXUP (ExchangeRegisters);
    FIXUP (ThreadControl);
    FIXUP (SystemClock);
    FIXUP (ThreadSwitch);
    FIXUP (Schedule);
    FIXUP (Unmap);
    FIXUP (SpaceControl);
    FIXUP (ProcessorControl);
    FIXUP (MemoryControl);
}

Still have no idea about this question. especially the first. If don't enter system level first, isn't a system call will cause a page fault ?

在2008-09-05,"Hal Ashburner" <[email protected]> 写道:
>Bob wrote:
>> what's more, in file \user\lib\l4\ia32_syscall_init.cc
>> #define FIXUP(syscall) \
>> do { \
>> void __L4_##syscall (void); \
>> *(L4_Word8_t *) (__L4_##syscall) = 0xe9; \
>> *(L4_Word32_t *) ((L4_Word_t) __L4_##syscall + 1) = \
>> (L4_Word_t) kip + kip->syscall - (L4_Word_t) __L4_##syscall - 5;\
>> } while (0)
>>
>> But kip has no filed named syscall, so how kip->syscall in this marco 
>> work.
>You need to find where the FIXUP(); macro is called, and with what as 
>its argument.
>Then maybe run the file that contains FIXUP(whatever); through the 
>pre-processor to see what code actually gets compiled.
>K&R will explain how macros to you.
>
>All the best.