summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2009-12-31 13:22:03 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2009-12-31 13:22:03 +0000
commita718007c7af9c78881f354864e294fed46e0d432 (patch)
treec8578d98f38d46d76ba4a08952b1b2cd5bfc55a9 /sys/arch
parent55e1c50d0ed5ac1843c1736a4e488693b76357b2 (diff)
Implement wrappers for enabling and disabling interrupts.
ok miod@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/hppa/include/intr.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/arch/hppa/include/intr.h b/sys/arch/hppa/include/intr.h
index 8cca16943e8..ab94763bd2a 100644
--- a/sys/arch/hppa/include/intr.h
+++ b/sys/arch/hppa/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.27 2009/12/31 12:52:35 jsing Exp $ */
+/* $OpenBSD: intr.h,v 1.28 2009/12/31 13:22:02 jsing Exp $ */
/*
* Copyright (c) 2002-2004 Michael Shalayeff
@@ -106,6 +106,23 @@ splx(int ncpl)
(void)spllower(ncpl);
}
+static __inline register_t
+hppa_intr_disable(void)
+{
+ register_t eiem;
+
+ __asm __volatile("mfctl %%cr15, %0": "=r" (eiem));
+ __asm __volatile("mtctl %r0, %cr15");
+
+ return eiem;
+}
+
+static __inline void
+hppa_intr_enable(register_t eiem)
+{
+ __asm __volatile("mtctl %0, %%cr15":: "r" (eiem));
+}
+
#define splsoftclock() splraise(IPL_SOFTCLOCK)
#define splsoftnet() splraise(IPL_SOFTNET)
#define splbio() splraise(IPL_BIO)