Subversion Repositories Kolibri OS

Rev

Rev 2118 | Rev 2231 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2118 serge 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
8
align 4
9
rerouteirqs:
10
 
11
        cli
12
        mov     al,0x11         ;  icw4, edge triggered
13
        out     0x20,al
14
        out     0xA0,al
15
 
16
        mov     al,0x20         ;  generate 0x20 +
17
        out     0x21,al
18
        mov     al,0x28         ;  generate 0x28 +
19
        out     0xA1,al
20
 
21
        mov     al,0x04         ;  slave at irq2
22
        out     0x21,al
23
        mov     al,0x02         ;  at irq9
24
        out     0xA1,al
25
 
26
        mov     al,0x01         ;  8086 mode
27
        out     0x21,al
28
        out     0xA1,al
29
 
30
        mov     al,255          ; mask all irq's
31
        out     0xA1,al
32
        out     0x21,al
33
 
34
        mov     al,255          ; mask all irq's
35
        out     0xA1,al
36
        out     0x21,al
37
        ret
38
 
39
 
40
align 4
41
;proc enable_irq stdcall, irq_line:dword
42
enable_irq:                                ; FIXME make fastcall
43
       mov ebx, [esp+4]  ;irq_line
44
       mov edx, 0x21
45
       cmp ebx, 8
46
       jb @F
47
       mov edx, 0xA1
48
       sub ebx,8
49
@@:
50
       in al,dx
51
       btr eax, ebx
52
       out dx, al
53
       ret 4
54
 
55
 
56
align 4
57
;proc irq_eoi fastcall, irq_line:dword
58
irq_eoi:
59
       cmp cl, 8
60
       mov al, 0x20
61
       jb @f
62
       out 0xa0, al
63
@@:
64
       out 0x20, al
65
       ret