summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsc <rsc>2006-07-17 01:36:39 +0000
committerrsc <rsc>2006-07-17 01:36:39 +0000
commitee9c7f3bfc45563e4caebcb7995e75bf39a8e0f3 (patch)
tree0509dd8855210b0fcfca73c4181122b48d81bfdb
parentf15a3ae2633a9f3c76be7ce76b2ab85e2229e502 (diff)
downloadxv6-labs-ee9c7f3bfc45563e4caebcb7995e75bf39a8e0f3.tar.gz
xv6-labs-ee9c7f3bfc45563e4caebcb7995e75bf39a8e0f3.tar.bz2
xv6-labs-ee9c7f3bfc45563e4caebcb7995e75bf39a8e0f3.zip
goodbye PushRegs
-rw-r--r--proc.c2
-rw-r--r--syscall.c4
-rw-r--r--trap.c2
-rw-r--r--x86.h7
4 files changed, 6 insertions, 9 deletions
diff --git a/proc.c b/proc.c
index f0013f1..e916761 100644
--- a/proc.c
+++ b/proc.c
@@ -104,7 +104,7 @@ copyproc(struct proc* p)
*np->tf = *p->tf;
// Clear %eax so that fork system call returns 0 in child.
- np->tf->regs.eax = 0;
+ np->tf->eax = 0;
// Set up new jmpbuf to start executing at forkret (see below).
memset(&np->jmpbuf, 0, sizeof np->jmpbuf);
diff --git a/syscall.c b/syscall.c
index f86fa22..2ab9bbb 100644
--- a/syscall.c
+++ b/syscall.c
@@ -263,7 +263,7 @@ void
syscall(void)
{
struct proc *cp = curproc[cpu()];
- int num = cp->tf->regs.eax;
+ int num = cp->tf->eax;
int ret = -1;
//cprintf("%x sys %d\n", cp, num);
@@ -309,5 +309,5 @@ syscall(void)
// XXX fault
break;
}
- cp->tf->regs.eax = ret;
+ cp->tf->eax = ret;
}
diff --git a/trap.c b/trap.c
index c00a830..41b8c8f 100644
--- a/trap.c
+++ b/trap.c
@@ -37,7 +37,7 @@ trap(struct Trapframe *tf)
if(v == T_SYSCALL){
struct proc *cp = curproc[cpu()];
- int num = cp->tf->regs.eax;
+ int num = cp->tf->eax;
if(cp == 0)
panic("syscall with no proc");
if(cp->killed)
diff --git a/x86.h b/x86.h
index a25d875..267c2da 100644
--- a/x86.h
+++ b/x86.h
@@ -339,7 +339,7 @@ sti(void)
__asm__ volatile("sti");
}
-struct PushRegs {
+struct Trapframe {
/* registers as pushed by pusha */
uint32_t edi;
uint32_t esi;
@@ -349,10 +349,7 @@ struct PushRegs {
uint32_t edx;
uint32_t ecx;
uint32_t eax;
-};
-
-struct Trapframe {
- struct PushRegs regs;
+ /* rest of trap frame */
uint16_t es;
uint16_t padding1;
uint16_t ds;