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.4KB

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