daniel.tian
unread,Nov 1, 2011, 3:22:26 AM11/1/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MV5sim
Hi, guys:
I have some questions about how the syscalls are emulated.
Here is the piece of code from the asm_api.h
unsigned long asm_callsys(unsigned long callnum, unsigned long arg0,
unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned
long arg4)
{
unsigned long retval;
/*
asm volatile( "mov %0, $0\n\t"
".byte 0x60, 0x00, 0x00, 0x04\n\t"
"mov $0, %1\n\t"
:"r="(retval)
:"r"(arg2)
);
*/
asm volatile( ".byte 0x60, 0x00, 0x00, 0x04\n\t"
"mov $0, %0\n\t"
:"r="(retval)
:
);
return retval;
}
ulong asm_get_kernel_handler(ulong contextID)
{
ulong val;
asm volatile( ".byte 0x6a, 0x00, 0x00, 0x04\n\t"
"mov $0, %0\n\t"
:"r="(val)
:
);
return val;
}
What does the "".byte 0x6a, 0x00, 0x00, 0x04\n\t"" mean?
I don't quite understand how the M5/MV5 handle the syscall callback.
Any suggestion is appreciated.
Thanks.
Daniel