summaryrefslogtreecommitdiff
path: root/fd.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 /fd.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 'fd.c')
-rw-r--r--fd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fd.c b/fd.c
index 983497f..d162813 100644
--- a/fd.c
+++ b/fd.c
@@ -13,6 +13,12 @@ struct devsw devsw[NDEV];
struct fd fds[NFD];
+void
+fd_init(void)
+{
+ initlock(&fd_table_lock, "fd_table");
+}
+
/*
* allocate a file descriptor number for curproc.
*/