L4_SYSCALL_INVOKE is a negative PC value?
Zachary
czzcz at 126.com
Sun Sep 28 05:26:53 CEST 2014
Adam Lackorzynski <adam <at> os.inf.tu-dresden.de> writes:
>
> On Fri Sep 26, 2014 at 07:22:09 +0000, Zachary wrote:
> > In cache.h file(..\l4\pkg\l4sys\include\ARCH-arm\cache.h), a piece of
code
> > is as follows:
> >
> > l4_cache_op_arm_call(unsigned long op,
> > unsigned long start,
> > unsigned long end)
> > {
> > ...
> >
> > __asm__ __volatile__
> > (" <at> l4_cache_op_arm_call(start) \n\t"
> > "mov lr, pc \n\t"
> > "mov pc, %[sc] \n\t"
> > " <at> l4_cache_op_arm_call(end) \n\t"
> > :
> > "=r" (_op),
> > "=r" (_start),
> > "=r" (_end)
> > :
> > [sc] "i" (L4_SYSCALL_MEM_OP),
> > "0" (_op),
> > "1" (_start),
> > "2" (_end)
> > :
> > "cc", "memory", "lr"
> > );
> > }
> >
> > My question is whether the code means that PC jumps to the address of
> > L4_SYSCALL_MEM_OP(actual value is -0x00000010)? If it is true, then it
means
> > the address is 0xFFFFFFF0 ?
>
> Yes.
>
> > My second question is whether the address 0xFFFFFFF0 corresponds to the
> > sys_arm_mem_op in the following definition?
> > (..\kernel\fiasco\src\kern\arm\asm_entry.h)
>
> Yes, the syscall table is used to find the function to branch to.
>
> Adam
Thank you, Adam. Based on your reply, I have another question.
As the macro defined in L4Re source code, the branch adress is:
L4_SYSCALL_INVOKE 0xFFFFFFF4
L4_SYSCALL_MEM_OP 0xFFFFFFF0
This means the "L4_SYSCALL_INVOKE" is at the higher address.
And in asm_entry.h, the syscall table is:
.macro GEN_SYSCALL_TABLE
.align 4
.global sys_call_table
sys_call_table:
...
.word sys_kdb_ke
.word sys_ipc_wrapper
.word sys_arm_mem_op
...
.endm
On the contrary, this table tells me that the "sys_ipc_wrapper" is at the
lower address, so, why this happens?
Best,
Zacary
More information about the l4-hackers
mailing list