Subversion Repositories Kolibri OS

Rev

Rev 7136 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7136 Rev 7733
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2020. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 7136 $
8
$Revision: 7733 $
Line 9... Line 9...
9
 
9
 
Line 10... Line 10...
10
 
10
 
Line 18... Line 18...
18
irqh_tab            rd sizeof.LHEAD * IRQ_RESERVED / 4
18
irqh_tab            rd sizeof.LHEAD * IRQ_RESERVED / 4
Line 19... Line 19...
19
 
19
 
20
irqh_pool           rd sizeof.IRQH * IRQ_POOL_SIZE /4
20
irqh_pool           rd sizeof.IRQH * IRQ_POOL_SIZE /4
Line 21... Line 21...
21
next_irqh           rd 1
21
next_irqh           rd 1
22
 
22
 
Line 23... Line 23...
23
irq_active_set      rd 1
23
irq_active_set      rd (IRQ_RESERVED+31)/32
Line -... Line 24...
-
 
24
irq_failed          rd IRQ_RESERVED
-
 
25
 
-
 
26
endg
-
 
27
 
-
 
28
set_irq_active:
-
 
29
        mov     eax, ebp
-
 
30
        mov     ecx, ebp
-
 
31
        shr     ecx, 5
-
 
32
        and     eax, 31
-
 
33
        bts     [irq_active_set+ecx*4], eax
-
 
34
        ret
-
 
35
 
-
 
36
reset_irq_active:
-
 
37
        mov     eax, ebp
-
 
38
        mov     ecx, ebp
-
 
39
        shr     ecx, 5
24
irq_failed          rd IRQ_RESERVED
40
        and     eax, 31
25
 
41
        btr     [irq_active_set+ecx*4], eax
Line 26... Line 42...
26
endg
42
        ret
27
 
43
 
Line 135... Line 151...
135
}
151
}
Line 136... Line 152...
136
 
152
 
137
align 16
153
align 16
Line 138... Line -...
138
irq_serv:
-
 
139
 
-
 
140
; .irq_1:
154
irq_serv:
141
;      push 1
-
 
142
;      jmp .main
-
 
143
; etc...
155
 
144
 
156
rept 12 irqn:1  {irq_serv_h irqn}       ;  1--12
Line 145... Line 157...
145
irq_serv_h 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15
157
rept 18 irqn:14 {irq_serv_h irqn}       ; 14--31 (irq32 is vector 0x40)
Line 146... Line 158...
146
irq_serv_h 16, 17, 18, 19, 20, 21, 22, 23
158
rept 23 irqn:33 {irq_serv_h irqn}       ; 33--55
147
 
159
 
148
purge irq_serv_h
160
purge irq_serv_h
149
 
-
 
150
align 16
161
 
151
.main:
162
align 16
152
        save_ring3_context
163
.main:
153
 
164
        save_ring3_context
Line 154... Line 165...
154
        mov     ebp, [esp + 32]
165
        mov     ebp, [esp + 32]
155
        mov     bx, app_data;os_data
166
        mov     bx, app_data;os_data
Line 156... Line 167...
156
        mov     ds, bx
167
        mov     ds, bx
Line 157... Line 168...
157
        mov     es, bx
168
        mov     es, bx
158
 
169
 
159
        cmp     [v86_irqhooks+ebp*8], 0
170
        cmp     [v86_irqhooks+ebp*8], 0
160
        jnz     v86_irq
171
        jnz     v86_irq
Line 182... Line 193...
182
 
193
 
183
        test    eax, eax
194
        test    eax, eax
Line 184... Line 195...
184
        jz      .next
195
        jz      .next
185
 
196
 
186
        inc     [ebx+IRQH.num_ints]
197
        inc     [ebx+IRQH.num_ints]
Line 187... Line 198...
187
        btr     [irq_active_set], ebp
198
        call    reset_irq_active
188
        jmp     .next
199
        jmp     .next
189
 
200
 
Line 190... Line 201...
190
.done:
201
.done:
191
        btr     [irq_active_set], ebp
202
        call    reset_irq_active
192
        jnc     .exit
203
        jnc     .exit