projects
/
psx_test1
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
started working on interrupts
[psx_test1]
/
src
/
intr.c
1
#include "intr.h"
2
#include "debug.h"
3
4
static void (*handler[NUM_IRQS])(struct intr_frame*);
5
6
void set_irq_handler(int irq, void (*func)(struct intr_frame*))
7
{
8
handler[irq] = func;
9
}
10
11
void intr_dispatch(struct intr_frame *frm)
12
{
13
if(((frm->cause >> 2) & 0x1f) == 0) {
14
/* interrupt */
15
} else {
16
panic("unhandled exception");
17
}
18
}