x
This commit is contained in:
		
							parent
							
								
									3bfcaeaf01
								
							
						
					
					
						commit
						572e106e6f
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -1,6 +1,9 @@
 | 
				
			||||||
#include "param.h"
 | 
					#include "param.h"
 | 
				
			||||||
#include "x86.h"	
 | 
					#include "x86.h"	
 | 
				
			||||||
#include "mmu.h"
 | 
					#include "mmu.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# the offset of cs in trapframe (i.e., tf->cs - tf)
 | 
				
			||||||
 | 
					#define CSOFF  144
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
# vectors.S sends all traps here.
 | 
					# vectors.S sends all traps here.
 | 
				
			||||||
.globl alltraps
 | 
					.globl alltraps
 | 
				
			||||||
| 
						 | 
					@ -22,7 +25,7 @@ alltraps:
 | 
				
			||||||
  push %rbx
 | 
					  push %rbx
 | 
				
			||||||
  push %rax
 | 
					  push %rax
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  cmpw $KCSEG, 144(%rsp)   # compare to saved cs
 | 
					  cmpw $KCSEG, CSOFF(%rsp)   # compare to saved cs
 | 
				
			||||||
  jz 1f 
 | 
					  jz 1f 
 | 
				
			||||||
  swapgs
 | 
					  swapgs
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
| 
						 | 
					@ -33,7 +36,7 @@ alltraps:
 | 
				
			||||||
.globl trapret
 | 
					.globl trapret
 | 
				
			||||||
trapret:
 | 
					trapret:
 | 
				
			||||||
  cli
 | 
					  cli
 | 
				
			||||||
  cmpw $KCSEG, 144(%rsp)  # compare to saved cs
 | 
					  cmpw $KCSEG, CSOFF(%rsp)  # compare to saved cs
 | 
				
			||||||
  jz 1f
 | 
					  jz 1f
 | 
				
			||||||
  swapgs
 | 
					  swapgs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue