Rev 2050 | Rev 2434 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2050 | Rev 2106 | ||
---|---|---|---|
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: 2050 $ |
8 | $Revision: 2106 $ |
9 | 9 | ||
Line 10... | Line 10... | ||
10 | 10 | ||
11 | DRV_COMPAT equ 5 ;minimal required drivers version |
11 | DRV_COMPAT equ 5 ;minimal required drivers version |
Line 12... | Line -... | ||
12 | DRV_CURRENT equ 5 ;current drivers model version |
- | |
13 | - | ||
14 | DRV_VERSION equ (DRV_COMPAT shl 16) or DRV_CURRENT |
- | |
15 | PID_KERNEL equ 1 ;os_idle thread |
- | |
16 | - | ||
17 | - | ||
18 | uglobal |
- | |
19 | - | ||
20 | irq_rights rd IRQ_RESERVE |
- | |
21 | - | ||
22 | endg |
- | |
23 | - | ||
24 | proc get_int_handler stdcall, irq:dword |
- | |
25 | - | ||
26 | mov eax, [irq] |
- | |
27 | - | ||
28 | cmp [irq_rights + 4 * eax], dword 1 |
- | |
29 | ja .err |
- | |
30 | - | ||
31 | mov eax, [irq_tab + 4 * eax] |
- | |
32 | ret |
- | |
33 | - | ||
34 | .err: |
- | |
35 | xor eax, eax |
- | |
36 | ret |
- | |
37 | - | ||
38 | endp |
- | |
39 | - | ||
40 | align 4 |
- | |
41 | proc detach_int_handler |
- | |
42 | - | ||
43 | ret |
- | |
44 | endp |
- | |
45 | - | ||
46 | - | ||
47 | align 16 |
- | |
48 | ;; proc irq_serv |
- | |
49 | - | ||
50 | irq_serv: |
- | |
51 | - | ||
52 | ; .irq_1: |
- | |
53 | ; push 1 |
- | |
54 | ; jmp .main |
- | |
55 | ; etc... |
- | |
56 | - | ||
57 | macro irq_serv_h [num] { |
- | |
58 | forward |
- | |
59 | align 4 |
- | |
60 | .irq_#num : |
- | |
61 | push num |
- | |
62 | jmp .main |
- | |
63 | } |
- | |
64 | - | ||
65 | irq_serv_h 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15 |
- | |
66 | - | ||
67 | ; I don`t known how to use IRQ_RESERVE |
- | |
68 | if IRQ_RESERVE > 16 |
- | |
69 | irq_serv_h 16, 17, 18, 19, 20, 21, 22, 23 |
- | |
70 | end if |
- | |
71 | - | ||
72 | align 16 |
- | |
73 | .main: |
- | |
74 | save_ring3_context |
- | |
75 | mov ebp, [esp + 32] |
- | |
76 | mov bx, app_data ;os_data |
- | |
77 | mov ds, bx |
- | |
78 | mov es, bx |
- | |
79 | - | ||
80 | cmp [v86_irqhooks+ebp*8], 0 |
- | |
81 | jnz v86_irq |
- | |
82 | - | ||
83 | cmp bp, 6 |
- | |
84 | jnz @f |
- | |
85 | push ebp |
- | |
86 | call [fdc_irq_func] |
- | |
87 | pop ebp |
- | |
88 | @@: |
- | |
89 | - | ||
90 | cmp bp, 14 |
- | |
91 | jnz @f |
- | |
92 | push ebp |
- | |
93 | call [irq14_func] |
- | |
94 | pop ebp |
- | |
95 | @@: |
- | |
96 | cmp bp, 15 |
- | |
97 | jnz @f |
- | |
98 | push ebp |
- | |
99 | call [irq15_func] |
- | |
100 | pop ebp |
- | |
101 | @@: |
- | |
102 | bts [pending_irq_set], ebp |
- | |
103 | - | ||
104 | lea esi, [irqh_tab+ebp*8] ; esi= list head |
- | |
105 | mov ebx, esi |
- | |
106 | .next: |
- | |
107 | mov ebx, [ebx+IRQH.list.next] ; ebx= irqh pointer |
- | |
108 | cmp ebx, esi |
- | |
109 | je .done |
- | |
110 | - | ||
111 | push ebx ; FIX THIS |
- | |
112 | push edi |
- | |
113 | push esi |
- | |
114 | - | ||
115 | push [ebx+IRQH.data] |
- | |
116 | call [ebx+IRQH.handler] |
- | |
117 | add esp, 4 |
- | |
118 | - | ||
119 | pop esi |
- | |
120 | pop edi |
- | |
121 | pop ebx |
- | |
122 | - | ||
123 | test eax, eax |
- | |
124 | jz .next |
- | |
125 | - | ||
126 | btr [pending_irq_set], ebp |
- | |
127 | jmp .next |
- | |
128 | - | ||
129 | .done: |
- | |
130 | btr [pending_irq_set], ebp |
- | |
131 | jnc .exit |
- | |
132 | - | ||
133 | inc [bogus_irq+ebp*4] |
- | |
134 | .exit: |
- | |
135 | mov [check_idle_semaphore],5 |
- | |
136 | - | ||
137 | mov eax, ebp |
- | |
Line 138... | Line 12... | ||
138 | 12 | DRV_CURRENT equ 6 ;current drivers model version |
|
139 | call IRQ_EOI |
13 | |
Line 140... | Line 14... | ||
140 | restore_ring3_context |
14 | DRV_VERSION equ (DRV_COMPAT shl 16) or DRV_CURRENT |
Line 745... | Line 619... | ||
745 | jnz .fix_sec |
619 | jnz .fix_sec |
746 | .exit: |
620 | .exit: |
747 | ret |
621 | ret |
748 | endp |
622 | endp |
Line -... | Line 623... | ||
- | 623 | ||
749 | 624 | align 4 |
|
750 | proc rebase_coff stdcall uses ebx esi, coff:dword, sym:dword, \ |
625 | proc rebase_coff stdcall uses ebx esi, coff:dword, sym:dword, \ |
751 | delta:dword |
626 | delta:dword |
752 | locals |
627 | locals |
753 | n_sec dd ? |
628 | n_sec dd ? |