aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/dev
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-28 11:25:12 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-28 11:25:12 +0100
commitf610cb7baa26b2803fce8b6e4604e8639c71d1d3 (patch)
treeb61a0bbed25be833625a4ca44b5decc7896e205f /src/kernel/dev
parentb5552cc9c7dd2d333106b1c69e6ff23aab19df47 (diff)
downloadkogata-f610cb7baa26b2803fce8b6e4604e8639c71d1d3.tar.gz
kogata-f610cb7baa26b2803fce8b6e4604e8639c71d1d3.zip
IRQ handlers must be written with caution!
Diffstat (limited to 'src/kernel/dev')
-rw-r--r--src/kernel/dev/pciide.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/kernel/dev/pciide.c b/src/kernel/dev/pciide.c
index f4474ba..429432f 100644
--- a/src/kernel/dev/pciide.c
+++ b/src/kernel/dev/pciide.c
@@ -165,22 +165,25 @@ static thread_t *wait_irq14 = 0, *wait_irq15 = 0, *wait_pciirq = 0;
void irq14_handler(registers_t *regs) {
if (wait_irq14) {
- resume_thread(wait_irq14, true);
+ thread_t *t = wait_irq14;
wait_irq14 = 0;
+ resume_thread(t, true); // may not return depending on conditions
}
}
void irq15_handler(registers_t *regs) {
if (wait_irq15) {
- resume_thread(wait_irq15, true);
+ thread_t *t = wait_irq15;
wait_irq15 = 0;
+ resume_thread(t, true);
}
}
void pciirq_handler(int pci_id) {
if (wait_pciirq) {
- resume_thread(wait_pciirq, true);
+ thread_t *t = wait_pciirq;
wait_pciirq = 0;
+ resume_thread(t, true);
}
}