-
-/* syscall stuff, very untested
- * the current approach which includes copying
- * part of the stack will work badly for
- * varargs functions.
- * if we were to store the top three words on the
- * stack (eip, ss, eflags) somwhere and add 14 to
- * %esp ....
- */
-asm(".globl syscall_entry\n" \
- "syscall_entry:\n" \
- "movl 12(%esp), %eax\n" \
- "movl %esp, %ebx\n" \
- "addl $16, %ebx\n" \
- "pushl %ebx\n" \
- "pushl %eax\n" \
- "call do_syscall\n" \
- "addl $8, %esp\n" \
- "iret\n");
-
-void __attribute__ ((regparm(0))) syscall_entry(void);
-
-int __attribute__ ((regparm(0))) do_syscall(u32 nr, u32 *stack)
-{
- if (nr<NR_SYSCALLS) {
- /* We copy 8 args of the syscall,
- * this will be a problem with the
- * printf syscall .... */
- int (*fp)(u32, u32, u32, u32,
- u32, u32, u32, u32);
- fp = syscall_tbl[nr];
- return fp(stack[0], stack[1], stack[2], stack[3],
- stack[4], stack[5], stack[6], stack[7]);
- }
-
- return -1;
-}
-
-