Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

undiisr.S 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. FILE_LICENCE ( GPL2_OR_LATER )
  2. #define PXENV_UNDI_ISR 0x0014
  3. #define PXENV_UNDI_ISR_IN_START 1
  4. #define PXENV_UNDI_ISR_OUT_OURS 0
  5. #define PXENV_UNDI_ISR_OUT_NOT_OURS 1
  6. #define IRQ_PIC_CUTOFF 8
  7. #define ICR_EOI_NON_SPECIFIC 0x20
  8. #define PIC1_ICR 0x20
  9. #define PIC2_ICR 0xa0
  10. .text
  11. .arch i386
  12. .code16
  13. .section ".text16", "ax", @progbits
  14. .globl undiisr
  15. undiisr:
  16. /* Preserve registers */
  17. pushw %ds
  18. pushw %es
  19. pushw %fs
  20. pushw %gs
  21. pushfl
  22. pushal
  23. /* Set up our segment registers */
  24. movw %cs:rm_ds, %ax
  25. movw %ax, %ds
  26. /* Check that we have an UNDI entry point */
  27. cmpw $0, pxeparent_entry_point
  28. je chain
  29. /* Issue UNDI API call */
  30. movw %ax, %es
  31. movw $undinet_params, %di
  32. movw $PXENV_UNDI_ISR, %bx
  33. movw $PXENV_UNDI_ISR_IN_START, funcflag
  34. pushw %es
  35. pushw %di
  36. pushw %bx
  37. lcall *pxeparent_entry_point
  38. cli /* Just in case */
  39. addw $6, %sp
  40. cmpw $PXENV_UNDI_ISR_OUT_OURS, funcflag
  41. jne eoi
  42. trig: /* Record interrupt occurence */
  43. incb undiisr_trigger_count
  44. eoi: /* Send EOI */
  45. movb $ICR_EOI_NON_SPECIFIC, %al
  46. cmpb $IRQ_PIC_CUTOFF, undiisr_irq
  47. jb 1f
  48. outb %al, $PIC2_ICR
  49. 1: outb %al, $PIC1_ICR
  50. jmp exit
  51. chain: /* Chain to next handler */
  52. pushfw
  53. lcall *undiisr_next_handler
  54. exit: /* Restore registers and return */
  55. cli
  56. popal
  57. movzwl %sp, %esp
  58. addr32 movl -20(%esp), %esp /* %esp isn't restored by popal */
  59. popfl
  60. popw %gs
  61. popw %fs
  62. popw %es
  63. popw %ds
  64. iret
  65. .section ".data16", "aw", @progbits
  66. undinet_params:
  67. status: .word 0
  68. funcflag: .word 0
  69. bufferlength: .word 0
  70. framelength: .word 0
  71. frameheaderlength: .word 0
  72. frame: .word 0, 0
  73. prottype: .byte 0
  74. pkttype: .byte 0