summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/cpufunc.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-03-21 06:19:08 +0000
committerimp <imp@FreeBSD.org>2002-03-21 06:19:08 +0000
commita85d713abc53071579d19131d57efd1905020036 (patch)
tree77fc4b8fd214e6d26b72d4c672eb8578196b0b43 /sys/amd64/include/cpufunc.h
parentdd261cc76ac7701beaf386498c3f3d3be8225619 (diff)
downloadFreeBSD-src-a85d713abc53071579d19131d57efd1905020036.zip
FreeBSD-src-a85d713abc53071579d19131d57efd1905020036.tar.gz
Fix abuses of cpu_critical_{enter,exit} by converting to
intr_{disable,restore} as well as providing an implemenation of intr_{disable,restore}. Reviewed by: jake, rwatson, jhb
Diffstat (limited to 'sys/amd64/include/cpufunc.h')
-rw-r--r--sys/amd64/include/cpufunc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 307e3d8..6bc01fa 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -578,6 +578,22 @@ cpu_critical_exit(critical_t eflags)
write_eflags(eflags);
}
+static __inline register_t
+intr_disable(void)
+{
+ register_t eflags;
+
+ eflags = read_eflags();
+ disable_intr();
+ return (eflags);
+}
+
+static __inline void
+intr_restore(register_t eflags)
+{
+ write_eflags(eflags);
+}
+
#else /* !__GNUC__ */
int breakpoint(void);
OpenPOWER on IntegriCloud