]> Devi Nivas Git - cs3210-lab1.git/commitdiff
goodbye PushRegs
authorrsc <rsc>
Mon, 17 Jul 2006 01:36:39 +0000 (01:36 +0000)
committerrsc <rsc>
Mon, 17 Jul 2006 01:36:39 +0000 (01:36 +0000)
proc.c
syscall.c
trap.c
x86.h

diff --git a/proc.c b/proc.c
index f0013f1eaa76275b416315bad608861cb0867bc0..e916761e3b72002e8aec4f06994b4e61319e1784 100644 (file)
--- 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);
index f86fa22a3e5a7aebb2eb94267cd8bd7dc4dc285f..2ab9bbb415e48069a79c3c193e06770a141d279a 100644 (file)
--- 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 c00a830f400700d399b0149cc999ab5346759004..41b8c8f238ef18667669e3fe7b1834af2499f6d7 100644 (file)
--- 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 a25d8759180eeb109873f5131b8380dd7c96e314..267c2da330fa9b5a1957af9719be387e2df85aad 100644 (file)
--- 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;