summaryrefslogtreecommitdiff
path: root/ide.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-08-10 22:08:14 +0000
committerrtm <rtm>2006-08-10 22:08:14 +0000
commit5be0039ce9e22f140a29e167526c64c723c5be3c (patch)
tree4096ed2b728cbee37dd2adee06e83f0e908f72b6 /ide.c
parent8a8be1b8c36e38f58f8ba3e425b6e701ad65abf3 (diff)
downloadxv6-labs-5be0039ce9e22f140a29e167526c64c723c5be3c.tar.gz
xv6-labs-5be0039ce9e22f140a29e167526c64c723c5be3c.tar.bz2
xv6-labs-5be0039ce9e22f140a29e167526c64c723c5be3c.zip
interrupts could be recursive since lapic_eoi() called before rti
so fast interrupts overflow the kernel stack fix: cli() before lapic_eoi()
Diffstat (limited to 'ide.c')
-rw-r--r--ide.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ide.c b/ide.c
index 67fb613..3532121 100644
--- a/ide.c
+++ b/ide.c
@@ -26,7 +26,7 @@ struct ide_request {
};
struct ide_request request[NREQUEST];
int head, tail;
-struct spinlock ide_lock = { "ide" };
+struct spinlock ide_lock;
int disk_channel;
@@ -46,6 +46,7 @@ ide_wait_ready(int check_error)
void
ide_init(void)
{
+ initlock(&ide_lock, "ide");
if (ncpu < 2) {
panic ("ide_init: disk interrupt is going to the second cpu\n");
}
@@ -61,7 +62,6 @@ ide_intr(void)
// cprintf("cpu%d: ide_intr\n", cpu());
wakeup(&request[tail]);
release(&ide_lock);
- lapic_eoi();
}
int