Subversion Repositories Kolibri OS

Rev

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

Rev 405 Rev 420
Line 76... Line 76...
76
    dd   i40
76
    dd   i40
77
endg
77
endg
Line 78... Line 78...
78
 
78
 
79
macro save_ring3_context
79
macro save_ring3_context
80
{
-
 
81
    push    ds es
80
{
82
    pushad
81
    pushad
83
}
82
}
84
macro restore_ring3_context
83
macro restore_ring3_context
85
{
84
{
86
    popad
-
 
87
    pop    es ds
85
    popad
Line 88... Line 86...
88
}
86
}
89
 
87
 
90
; simply return control to interrupted process
88
; simply return control to interrupted process
Line 112... Line 110...
112
 
110
 
113
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15, 18
111
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15, 18
Line 114... Line 112...
114
exc_w_code 8, 10, 11, 12, 13, 14, 17
112
exc_w_code 8, 10, 11, 12, 13, 14, 17
115
 
113
 
116
exc_c:
114
exc_c:
117
        mov   ax, os_data
115
        mov   ax, app_data  ;èñêëþ÷åíèå
Line 118... Line 116...
118
        mov   ds, ax
116
        mov   ds, ax        ;çàãðóçèì ïðàâèëüíûå çíà÷åíè
119
        mov   es, ax
117
        mov   es, ax        ;â ðåãèñòðû
120
 
118
 
121
; test if debugging
119
; test if debugging
122
        cli
120
        cli
123
        mov   eax, [CURRENT_TASK]
121
        mov   eax, [CURRENT_TASK]
124
        shl   eax, 8
122
        shl   eax, 8
125
        mov   eax, [SLOT_BASE+eax+APPDATA.debugger_slot]
123
        mov   eax, [SLOT_BASE+eax+APPDATA.debugger_slot]
126
        test  eax, eax
124
        test  eax, eax
127
        jnz   .debug
125
        jnz   .debug
128
        sti
126
        sti
129
; not debuggee => say error and terminate
127
; not debuggee => say error and terminate
130
        add   esp, 28h
128
        add   esp, 0x20  ;28h
Line 131... Line 129...
131
        movzx eax, bl
129
        movzx eax, bl
Line 241... Line 239...
241
}
239
}
Line 242... Line 240...
242
 
240
 
Line 243... Line 241...
243
irqh 2,5,7,8,9,10,11
241
irqh 2,5,7,8,9,10,11
244
 
242
 
245
 irq_c:
243
irq_c:
246
     mov   ax, os_data
244
     mov   ax, app_data  ;os_data
247
     mov   ds, ax
245
     mov   ds, ax
248
     mov   es, ax
246
     mov   es, ax
249
     call  irqhandler
247
     call  irqhandler
Line 250... Line 248...
250
     restore_ring3_context
248
     restore_ring3_context
251
     iret
249
     iret
252
 
250
 
253
p_irq6:
251
p_irq6:
254
     save_ring3_context
252
     save_ring3_context
255
     mov   ax, os_data
253
     mov   ax, app_data  ;os_data
256
     mov   ds, ax
254
     mov   ds, ax
257
     mov   es, ax
255
     mov   es, ax
258
     call  fdc_irq
256
     call  fdc_irq
Line 259... Line 257...
259
     call  ready_for_next_irq
257
     call  ready_for_next_irq
260
     restore_ring3_context
258
     restore_ring3_context
261
     iret
259
     iret
262
 
260
 
263
p_irq3:
261
p_irq3:
264
     save_ring3_context
262
     save_ring3_context
265
     mov   ax, os_data
263
     mov   ax, app_data  ;os_data
266
     mov   ds, ax
264
     mov   ds, ax
Line 276... Line 274...
276
     restore_ring3_context
274
     restore_ring3_context
277
     iret
275
     iret
Line 278... Line 276...
278
 
276
 
279
p_irq4:
277
p_irq4:
280
     save_ring3_context
278
     save_ring3_context
281
     mov   ax, os_data
279
     mov   ax, app_data  ;os_data
282
     mov   ds, ax
280
     mov   ds, ax
283
     mov   es, ax
281
     mov   es, ax
284
     cmp   [com1_mouse_detected],0
282
     cmp   [com1_mouse_detected],0
285
     je    old_irq4_handler
283
     je    old_irq4_handler
Line 292... Line 290...
292
     restore_ring3_context
290
     restore_ring3_context
293
     iret
291
     iret
Line 294... Line 292...
294
 
292
 
295
p_irq12:
293
p_irq12:
296
     save_ring3_context
294
     save_ring3_context
297
     mov   ax, os_data
295
     mov   ax, app_data  ;os_data
298
     mov   ds, ax
296
     mov   ds, ax
299
     mov   es, ax
297
     mov   es, ax
300
     call  check_mouse_data_ps2
298
     call  check_mouse_data_ps2
301
     restore_ring3_context
299
     restore_ring3_context
Line 302... Line 300...
302
     iret
300
     iret
303
 
301
 
304
p_irq14:
302
p_irq14:
305
        save_ring3_context
303
        save_ring3_context
306
        mov     ax, os_data
304
        mov     ax, app_data  ;os_data
307
        mov     ds, ax
305
        mov     ds, ax
308
        mov     es, ax
306
        mov     es, ax
309
        call    [irq14_func]
307
        call    [irq14_func]
310
        call    ready_for_next_irq_1
308
        call    ready_for_next_irq_1
311
        restore_ring3_context
309
        restore_ring3_context
312
        iret
310
        iret
313
p_irq15:
311
p_irq15:
314
        save_ring3_context
312
        save_ring3_context
315
        mov     ax, os_data
313
        mov     ax, app_data  ;os_data
316
        mov     ds, ax
314
        mov     ds, ax
317
        mov     es, ax
315
        mov     es, ax
318
        call    [irq15_func]
316
        call    [irq15_func]
Line 333... Line 331...
333
     out   0x20, al
331
     out   0x20, al
334
     ret
332
     ret
Line 335... Line 333...
335
 
333
 
336
irqD:
334
irqD:
337
     save_ring3_context
335
     save_ring3_context
338
     mov   ax, os_data
336
     mov   ax, app_data  ;os_data
339
     mov   ds, ax
337
     mov   ds, ax
Line 340... Line 338...
340
     mov   es, ax
338
     mov   es, ax
341
 
339