goodbye PushRegs
This commit is contained in:
		
							parent
							
								
									f15a3ae263
								
							
						
					
					
						commit
						ee9c7f3bfc
					
				
					 4 changed files with 6 additions and 9 deletions
				
			
		
							
								
								
									
										2
									
								
								proc.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								proc.c
									
										
									
									
									
								
							| 
						 | 
					@ -104,7 +104,7 @@ copyproc(struct proc* p)
 | 
				
			||||||
  *np->tf = *p->tf;
 | 
					  *np->tf = *p->tf;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // Clear %eax so that fork system call returns 0 in child.
 | 
					  // 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).
 | 
					  // Set up new jmpbuf to start executing at forkret (see below).
 | 
				
			||||||
  memset(&np->jmpbuf, 0, sizeof np->jmpbuf);
 | 
					  memset(&np->jmpbuf, 0, sizeof np->jmpbuf);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -263,7 +263,7 @@ void
 | 
				
			||||||
syscall(void)
 | 
					syscall(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  struct proc *cp = curproc[cpu()];
 | 
					  struct proc *cp = curproc[cpu()];
 | 
				
			||||||
  int num = cp->tf->regs.eax;
 | 
					  int num = cp->tf->eax;
 | 
				
			||||||
  int ret = -1;
 | 
					  int ret = -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //cprintf("%x sys %d\n", cp, num);
 | 
					  //cprintf("%x sys %d\n", cp, num);
 | 
				
			||||||
| 
						 | 
					@ -309,5 +309,5 @@ syscall(void)
 | 
				
			||||||
    // XXX fault
 | 
					    // XXX fault
 | 
				
			||||||
    break;
 | 
					    break;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  cp->tf->regs.eax = ret;
 | 
					  cp->tf->eax = ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								trap.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								trap.c
									
										
									
									
									
								
							| 
						 | 
					@ -37,7 +37,7 @@ trap(struct Trapframe *tf)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if(v == T_SYSCALL){
 | 
					  if(v == T_SYSCALL){
 | 
				
			||||||
    struct proc *cp = curproc[cpu()];
 | 
					    struct proc *cp = curproc[cpu()];
 | 
				
			||||||
    int num = cp->tf->regs.eax;
 | 
					    int num = cp->tf->eax;
 | 
				
			||||||
    if(cp == 0)
 | 
					    if(cp == 0)
 | 
				
			||||||
      panic("syscall with no proc");
 | 
					      panic("syscall with no proc");
 | 
				
			||||||
    if(cp->killed)
 | 
					    if(cp->killed)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										7
									
								
								x86.h
									
										
									
									
									
								
							
							
						
						
									
										7
									
								
								x86.h
									
										
									
									
									
								
							| 
						 | 
					@ -339,7 +339,7 @@ sti(void)
 | 
				
			||||||
	__asm__ volatile("sti");
 | 
						__asm__ volatile("sti");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct PushRegs {
 | 
					struct Trapframe {
 | 
				
			||||||
    /* registers as pushed by pusha */
 | 
					    /* registers as pushed by pusha */
 | 
				
			||||||
    uint32_t edi;
 | 
					    uint32_t edi;
 | 
				
			||||||
    uint32_t esi;
 | 
					    uint32_t esi;
 | 
				
			||||||
| 
						 | 
					@ -349,10 +349,7 @@ struct PushRegs {
 | 
				
			||||||
    uint32_t edx;
 | 
					    uint32_t edx;
 | 
				
			||||||
    uint32_t ecx;
 | 
					    uint32_t ecx;
 | 
				
			||||||
    uint32_t eax;
 | 
					    uint32_t eax;
 | 
				
			||||||
};
 | 
					    /* rest of trap frame */
 | 
				
			||||||
 | 
					 | 
				
			||||||
struct Trapframe {
 | 
					 | 
				
			||||||
    struct PushRegs regs;
 | 
					 | 
				
			||||||
    uint16_t es;
 | 
					    uint16_t es;
 | 
				
			||||||
    uint16_t padding1;
 | 
					    uint16_t padding1;
 | 
				
			||||||
    uint16_t ds;
 | 
					    uint16_t ds;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue