Revision 321
correcting some problems
interrupts_func.c | ||
---|---|---|
77 | 77 |
if (subscribe_kbc_interrupt(KBC_IRQ, &kbc_id)) { |
78 | 78 |
printf("%s: failed to subscribe keyboard interrupts.\n", __func__); |
79 | 79 |
if (unsubscribe_all()) |
80 |
printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n"); |
|
80 |
printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n", __func__);
|
|
81 | 81 |
return SBCR_ERROR; |
82 | 82 |
} |
83 | 83 |
keyboard_subscribed = 1; |
... | ... | |
87 | 87 |
if (subscribe_mouse_interrupt(MOUSE_IRQ, &mouse_id)) { // subscribes mouse interrupts in exclusive mode |
88 | 88 |
printf("%s: failed to subscribe mouse interrupts.\n", __func__); |
89 | 89 |
if (unsubscribe_all()) |
90 |
printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n"); |
|
90 |
printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n", __func__);
|
|
91 | 91 |
return SBCR_ERROR; |
92 | 92 |
} |
93 | 93 |
mouse_subscribed = 1; |
94 | 94 |
if (sys_irqdisable(&mouse_id)) { // temporarily disables our interrupts notifications |
95 | 95 |
printf("%s: failed to disable mouse interrupts.\n", __func__); |
96 | 96 |
if (unsubscribe_all()) |
97 |
printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n"); |
|
97 |
printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n", __func__);
|
|
98 | 98 |
return SBCR_ERROR; |
99 | 99 |
} |
100 | 100 |
if (mouse_set_data_report(true)) { // enables mouse data reporting |
101 | 101 |
printf("%s: failed to enable mouse data reporting.\n", __func__); |
102 | 102 |
if (unsubscribe_all()) |
103 |
printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n"); |
|
103 |
printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n", __func__);
|
|
104 | 104 |
return SBCR_ERROR; |
105 | 105 |
} |
106 | 106 |
if (sys_irqenable(&mouse_id)) { // re-enables our interrupts notifications |
107 | 107 |
printf("%s: failed to enable mouse interrupts.\n", __func__); |
108 | 108 |
if (unsubscribe_all()) |
109 |
printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n"); |
|
109 |
printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n", __func__);
|
|
110 | 110 |
return SBCR_ERROR; |
111 | 111 |
} |
112 | 112 |
|
... | ... | |
134 | 134 |
// Unsubscribe Timer Interrupts |
135 | 135 |
if (timer_subscribed) { |
136 | 136 |
if (unsubscribe_interrupt(&timer_id)) { |
137 |
printf("%s: failed to unsubcribe timer interrupts.\n"); |
|
137 |
printf("%s: failed to unsubcribe timer interrupts.\n", __func__);
|
|
138 | 138 |
r = UNSBCR_ERROR; |
139 | 139 |
} |
140 | 140 |
timer_subscribed = 0; |
... | ... | |
143 | 143 |
// Unsubscribe Keyboard interrupts |
144 | 144 |
if (keyboard_subscribed) { |
145 | 145 |
if (unsubscribe_interrupt(&kbc_id)) { |
146 |
printf("%s: failed to unsubcribe keyboard interrupts.\n"); |
|
146 |
printf("%s: failed to unsubcribe keyboard interrupts.\n", __func__);
|
|
147 | 147 |
r = UNSBCR_ERROR; |
148 | 148 |
} |
149 | 149 |
keyboard_subscribed = 0; |
... | ... | |
152 | 152 |
// Unsubscribe Mouse Interrupts |
153 | 153 |
if (mouse_subscribed) { |
154 | 154 |
if (sys_irqdisable(&mouse_id)) { // temporarily disables our interrupts notifications |
155 |
printf("%s: failed to disable mouse interrupts.\n"); |
|
155 |
printf("%s: failed to disable mouse interrupts.\n", __func__);
|
|
156 | 156 |
r = UNSBCR_ERROR; |
157 | 157 |
} |
158 | 158 |
if (mouse_set_data_report(false)) { // disables mouse data reporting |
159 |
printf("%s: failed to disable mouse data reporting.\n"); |
|
159 |
printf("%s: failed to disable mouse data reporting.\n", __func__);
|
|
160 | 160 |
r = UNSBCR_ERROR; |
161 | 161 |
} |
162 | 162 |
if (sys_irqenable(&mouse_id)) { // re-enables our interrupts notifications |
163 |
printf("%s: failed to enable mouse interrupts.\n"); |
|
163 |
printf("%s: failed to enable mouse interrupts.\n", __func__);
|
|
164 | 164 |
r = UNSBCR_ERROR; |
165 | 165 |
} |
166 | 166 |
if (unsubscribe_interrupt(&mouse_id)) { // unsubscribes interrupts |
167 |
printf("%s: failed to unsubcribe mouse interrupts.\n"); |
|
167 |
printf("%s: failed to unsubcribe mouse interrupts.\n", __func__);
|
|
168 | 168 |
r = UNSBCR_ERROR; |
169 | 169 |
} |
170 | 170 |
mouse_subscribed = 0; |
... | ... | |
173 | 173 |
// Unsubscribe UART interrupts |
174 | 174 |
if (uart_subscribed) { |
175 | 175 |
if (unsubscribe_interrupt(&uart_id)) { |
176 |
printf("%s: failed to unsubcribe UART interrupts.\n"); |
|
176 |
printf("%s: failed to unsubcribe UART interrupts.\n", __func__);
|
|
177 | 177 |
r = UNSBCR_ERROR; |
178 | 178 |
} |
179 | 179 |
uart_enable_int_rx(COM1_ADDR); |
Also available in: Unified diff