pxe, tftp: make TimeoutTable static
[syslinux.git] / core / pxeisr.inc
bloba1db334ef4a7dd8dbb16f38f0be022341c64a2d0
2 ; Process a PXE interrupt
4                 section .text16
6                 global pxe_isr
7 pxe_isr:
8                 cld
9                 pusha
10                 push ds
11                 push es
12                 push fs
13                 push gs
15                 xor ax,ax
16                 mov ds,ax       
17                 mov es,ax
19                 mov bx,PXENV_UNDI_ISR
20                 mov di,pxenv_undi_isr_buf
22                 mov cx,pxenv_undi_isr_buf.size/2
23                 push di
24                 rep stosw
25                 pop di
26                 
27                 mov byte [pxenv_undi_isr_buf.funcflag],PXENV_UNDI_ISR_IN_START
29                 call pxenv
30                 jc .notus
32                 cmp word [pxenv_undi_isr_buf.funcflag],PXENV_UNDI_ISR_OUT_OURS
33                 jne .notus
35                 ; Its ours - set the flag for the return to PM.
36                 ; We need to EOI this ourselves, so that the
37                 ; leftover BC doesn't get control.
38                 mov byte [pxe_irq_pending],1
40                 cmp byte [pxe_irq_vector], 8
41                 mov al,0x20             ; Non-specific EOI
42                 jb .pri_pic
44                 out 0xA0, al            ; Secondary PIC
45 .pri_pic:
46                 out 0x20,al             ; Primary PIC
48                 pop gs
49                 pop fs
50                 pop es
51                 pop ds
52                 popa
53                 iret
55 .notus:
56                 pop gs
57                 pop fs
58                 pop es
59                 pop ds
60                 popa
61                 jmp 0:0
62                 global pxe_irq_chain
63 pxe_irq_chain   equ $-4
66 ; Emulate a PXE interrupt from the polling thread
67                 global pxe_poll
68 pxe_poll:
69                 pushf
70                 cli
71                 cld
72                 pusha
73                 push ds
74                 push es
75                 push fs
76                 push gs
78                 mov bx,PXENV_UNDI_ISR
79                 mov di,pxenv_undi_isr_buf
81                 mov cx,pxenv_undi_isr_buf.size/2
82                 push di
83                 rep stosw
84                 pop di
85                 
86                 mov byte [pxenv_undi_isr_buf.funcflag],PXENV_UNDI_ISR_IN_START
88                 call pxenv
89                 jc .notus
91                 cmp word [pxenv_undi_isr_buf.funcflag],PXENV_UNDI_ISR_OUT_OURS
92                 jne .notus
94                 ; Its ours - set the flag for the return to PM.
95                 ; We need to EOI this ourselves, so that the
96                 ; leftover BC doesn't get control.
97                 mov byte [pxe_irq_pending],1
99 .notus:
100                 pop gs
101                 pop fs
102                 pop es
103                 pop ds
104                 popa
105                 popf
106                 ret
108                 section .bss16
109                 alignb 4
110 pxenv_undi_isr_buf:
111 .status:        resw 1
112 .funcflag:      resw 1
113 .bufferlength:  resw 1
114 .framelen:      resw 1
115 .framehdrlen:   resw 1
116 .frame:         resw 2
117 .prottype:      resb 1
118 .pkttype:       resb 1
119 .size           equ $-pxenv_undi_isr_buf
121                 global pxe_irq_vector
122 pxe_irq_vector  resb 1                  ; PXE IRQ vector
123                 global pxe_irq_pending
124 pxe_irq_pending resb 1                  ; IRQ pending flag
126                 section .text16