aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/include/cpufunc.h
diff options
context:
space:
mode:
authorAlfredo Dal'Ava Junior <alfredo@FreeBSD.org>2020-11-06 13:34:30 +0000
committerAlfredo Dal'Ava Junior <alfredo@FreeBSD.org>2020-11-06 13:34:30 +0000
commit5d0e861910978450c46d2a65385aeb3286a17fa4 (patch)
tree5836c922d0bb36cbadf9c2b1d66f77107d125744 /sys/powerpc/include/cpufunc.h
parentf5074add758bbe64816245bd864638a42f6dc318 (diff)
downloadsrc-5d0e861910978450c46d2a65385aeb3286a17fa4.tar.gz
src-5d0e861910978450c46d2a65385aeb3286a17fa4.zip
Notes
Diffstat (limited to 'sys/powerpc/include/cpufunc.h')
-rw-r--r--sys/powerpc/include/cpufunc.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/powerpc/include/cpufunc.h b/sys/powerpc/include/cpufunc.h
index 7f332aa49118..1b94d565e67d 100644
--- a/sys/powerpc/include/cpufunc.h
+++ b/sys/powerpc/include/cpufunc.h
@@ -163,6 +163,25 @@ mttb(u_quad_t time)
mtspr(TBR_TBWL, (uint32_t)(time & 0xffffffff));
}
+
+static __inline register_t
+mffs(void)
+{
+ register_t value;
+
+ __asm __volatile ("mffs 0; stfd 0,0(%0)"
+ :: "b"(&value));
+
+ return (value);
+}
+
+static __inline void
+mtfsf(register_t value)
+{
+ __asm __volatile ("lfd 0,0(%0); mtfsf 0xff,0"
+ :: "b"(&value));
+}
+
static __inline void
eieio(void)
{