diff options
author | 2009-12-31 13:22:02 +0000 | |
---|---|---|
committer | 2009-12-31 13:22:02 +0000 | |
commit | d06d375715d1695989fb61c869eb92720fec16da (patch) | |
tree | 68628a4e2e9c1ff226efd4260818706c956c22e5 /sys | |
parent | complain if we see weird @libs (so, not in system). (diff) | |
download | wireguard-openbsd-d06d375715d1695989fb61c869eb92720fec16da.tar.xz wireguard-openbsd-d06d375715d1695989fb61c869eb92720fec16da.zip |
Implement wrappers for enabling and disabling interrupts.
ok miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/include/intr.h | 19 |
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) |