Guest User

int_stub.S

a guest
May 14th, 2015
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .macro intr_stub nr
  2. .global intr_stub_\nr
  3. intr_stub_\nr:
  4.     pushl $0
  5.     pushl $\nr
  6.     jmp intr_common_handler
  7. .endm
  8.  
  9. intr_stub 0
  10. intr_stub 32
  11.  
  12. .extern handle_interrupt
  13. intr_common_handler:
  14.     push %ebp
  15.     push %edi
  16.     push %esi
  17.     push %edx
  18.     push %ecx
  19.     push %ebx
  20.     push %eax
  21.  
  22.     call handle_interrupt
  23.  
  24.     pop %eax
  25.     pop %ebx
  26.     pop %ecx
  27.     pop %edx
  28.     pop %esi
  29.     pop %edi
  30.     pop %ebp
  31.  
  32.     iret
Advertisement
Add Comment
Please, Sign In to add comment