aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/amd64/amd64/intr.c5
-rw-r--r--sys/include/arch/amd64/intr.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c
index 3e3f309..c79195d 100644
--- a/sys/arch/amd64/amd64/intr.c
+++ b/sys/arch/amd64/amd64/intr.c
@@ -38,17 +38,20 @@
static struct intr_entry *intrs[256] = {0};
-void
+int
splraise(uint8_t s)
{
struct cpu_info *ci = this_cpu();
+ int old_ipl;
if (s < ci->ipl) {
panic("splraise IPL less than current IPL\n");
}
amd64_write_cr8(s);
+ old_ipl = ci->ipl;
ci->ipl = s;
+ return old_ipl;
}
void
diff --git a/sys/include/arch/amd64/intr.h b/sys/include/arch/amd64/intr.h
index af5edf2..c7c4583 100644
--- a/sys/include/arch/amd64/intr.h
+++ b/sys/include/arch/amd64/intr.h
@@ -52,7 +52,7 @@ struct intr_entry {
};
int intr_alloc_vector(const char *name, uint8_t priority);
-void splraise(uint8_t s);
+int splraise(uint8_t s);
void splx(uint8_t s);
#endif