summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/cpufunc.h
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2009-10-01 22:05:38 +0000
committerkmacy <kmacy@FreeBSD.org>2009-10-01 22:05:38 +0000
commit46de945b601f1859257a366aa6caee9b16da01dc (patch)
tree7e02fd2d2ec6419f6f9898a422fe8bed10be5dc2 /sys/i386/include/cpufunc.h
parent93e81ca09874ae88cacfbc3f55e0e5ed994b77b0 (diff)
downloadFreeBSD-src-46de945b601f1859257a366aa6caee9b16da01dc.zip
FreeBSD-src-46de945b601f1859257a366aa6caee9b16da01dc.tar.gz
make read_eflags and write_eflags accomplish the same effect on PVM as native,
simplifying interrupt handling
Diffstat (limited to 'sys/i386/include/cpufunc.h')
-rw-r--r--sys/i386/include/cpufunc.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 78863d1..a0cecca 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -49,8 +49,8 @@ extern u_int xen_rcr2(void);
extern void xen_load_cr3(u_int data);
extern void xen_tlb_flush(void);
extern void xen_invlpg(u_int addr);
-extern int xen_save_and_cli(void);
-extern void xen_restore_flags(u_int eflags);
+extern void write_eflags(u_int eflags);
+extern u_int read_eflags(void);
#endif
struct region_descriptor;
@@ -293,7 +293,11 @@ ia32_pause(void)
}
static __inline u_int
+#ifdef XEN
+_read_eflags(void)
+#else
read_eflags(void)
+#endif
{
u_int ef;
@@ -335,7 +339,11 @@ wbinvd(void)
}
static __inline void
+#ifdef XEN
+_write_eflags(u_int ef)
+#else
write_eflags(u_int ef)
+#endif
{
__asm __volatile("pushl %0; popfl" : : "r" (ef));
}
@@ -653,23 +661,15 @@ intr_disable(void)
{
register_t eflags;
-#ifdef XEN
- eflags = xen_save_and_cli();
-#else
eflags = read_eflags();
disable_intr();
-#endif
return (eflags);
}
static __inline void
intr_restore(register_t eflags)
{
-#ifdef XEN
- xen_restore_flags(eflags);
-#else
write_eflags(eflags);
-#endif
}
#else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */
OpenPOWER on IntegriCloud