Rev 1638 | Rev 2050 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1638 | Rev 2010 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2009. 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: 1638 $ |
8 | $Revision: 2010 $ |
9 | 9 | ||
Line 15... | Line 15... | ||
15 | PID_KERNEL equ 1 ;os_idle thread |
15 | PID_KERNEL equ 1 ;os_idle thread |
Line 16... | Line 16... | ||
16 | 16 | ||
17 | align 4 |
17 | align 4 |
Line -... | Line 18... | ||
- | 18 | proc attach_int_handler stdcall, irq:dword, handler:dword, access_rights:dword |
|
- | 19 | ||
- | 20 | pushfd |
|
18 | proc attach_int_handler stdcall, irq:dword, handler:dword, access_rights:dword |
21 | cli |
Line 19... | Line 22... | ||
19 | 22 | ||
20 | push ebx |
23 | push ebx |
21 | 24 | ||
Line 44... | Line 47... | ||
44 | mov [irq_owner + 4 * ebx], PID_KERNEL ; all handlers belong to a kernel |
47 | mov [irq_owner + 4 * ebx], PID_KERNEL ; all handlers belong to a kernel |
Line 45... | Line 48... | ||
45 | 48 | ||
46 | stdcall enable_irq, [irq] |
49 | stdcall enable_irq, [irq] |
47 | pop ebx |
50 | pop ebx |
- | 51 | mov eax, 1 |
|
48 | mov eax, 1 |
52 | popfd |
49 | ret |
53 | ret |
50 | .err: |
54 | .err: |
51 | pop ebx |
55 | pop ebx |
- | 56 | xor eax, eax |
|
52 | xor eax, eax |
57 | popfd |
53 | ret |
58 | ret |
Line 54... | Line 59... | ||
54 | endp |
59 | endp |
Line 98... | Line 103... | ||
98 | .irq_#num : |
103 | .irq_#num : |
99 | push num |
104 | push num |
100 | jmp .main |
105 | jmp .main |
101 | } |
106 | } |
Line 102... | Line 107... | ||
102 | 107 | ||
Line 103... | Line 108... | ||
103 | irq_serv_h 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12 |
108 | irq_serv_h 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15 |
104 | 109 | ||
105 | ; I don`t known how to use IRQ_RESERVE |
110 | ; I don`t known how to use IRQ_RESERVE |
106 | if IRQ_RESERVE > 16 |
111 | if IRQ_RESERVE > 16 |
Line 116... | Line 121... | ||
116 | mov es, bx |
121 | mov es, bx |
Line 117... | Line 122... | ||
117 | 122 | ||
118 | cmp [v86_irqhooks+eax*8], 0 |
123 | cmp [v86_irqhooks+eax*8], 0 |
Line -... | Line 124... | ||
- | 124 | jnz v86_irq |
|
- | 125 | ||
- | 126 | cmp al, 6 |
|
- | 127 | jnz @f |
|
- | 128 | push eax |
|
- | 129 | call [fdc_irq_func] |
|
- | 130 | pop eax |
|
- | 131 | @@: |
|
- | 132 | ||
- | 133 | cmp al, 14 |
|
- | 134 | jnz @f |
|
- | 135 | push eax |
|
- | 136 | call [irq14_func] |
|
- | 137 | pop eax |
|
- | 138 | @@: |
|
- | 139 | cmp al, 15 |
|
- | 140 | jnz @f |
|
- | 141 | push eax |
|
- | 142 | call [irq15_func] |
|
- | 143 | pop eax |
|
119 | jnz v86_irq |
144 | @@: |
120 | 145 | ||
121 | mov ebx, [irq_tab+eax*4] |
146 | mov ebx, [irq_tab+eax*4] |
Line 122... | Line 147... | ||
122 | test ebx, ebx |
147 | test ebx, ebx |