From bd228a81566befa6154807d327d8c873f6a76c79 Mon Sep 17 00:00:00 2001 From: rtm Date: Tue, 18 Jul 2006 19:22:37 +0000 Subject: prevent longjmp / forkret from writing over tf->edi --- syscall.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'syscall.c') diff --git a/syscall.c b/syscall.c index 58045d4..3f5e2ba 100644 --- a/syscall.c +++ b/syscall.c @@ -13,8 +13,7 @@ * System call number in %eax. * Arguments on the stack, from the user call to the C * library system call function. The saved user %esp points - * to a saved frame pointer, a program counter, and then - * the first argument. + * to a saved program counter, and then the first argument. * * Return value? Error indication? Errno? */ @@ -56,11 +55,11 @@ fetcharg(int argno, void *ip) } int -putint(struct proc *p, uint addr, int ip) +putint(struct proc *p, uint addr, int x) { if(addr > p->sz - 4) return -1; - memmove(p->mem + addr, &ip, 4); + memmove(p->mem + addr, &x, 4); return 0; } @@ -269,7 +268,6 @@ syscall(void) int num = cp->tf->eax; int ret = -1; - //cprintf("%x sys %d\n", cp, num); switch(num){ case SYS_fork: ret = sys_fork(); -- cgit v1.2.3