diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-11-06 16:20:21 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-11-11 10:08:08 +0100 |
commit | 66659ff1ad6831b0ea7425fa6ecd8a8687523658 (patch) | |
tree | 48e22b475fa8854128e0861a33fed6f78c8094b5 /freebsd/sys/powerpc/include/machine/cpufunc.h | |
parent | Define __GLOBL1() and __GLOBL() (diff) | |
download | rtems-libbsd-66659ff1ad6831b0ea7425fa6ecd8a8687523658.tar.bz2 |
Update to FreeBSD 9.2
Diffstat (limited to 'freebsd/sys/powerpc/include/machine/cpufunc.h')
-rw-r--r-- | freebsd/sys/powerpc/include/machine/cpufunc.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/freebsd/sys/powerpc/include/machine/cpufunc.h b/freebsd/sys/powerpc/include/machine/cpufunc.h index f028b62c..425fd1ca 100644 --- a/freebsd/sys/powerpc/include/machine/cpufunc.h +++ b/freebsd/sys/powerpc/include/machine/cpufunc.h @@ -68,6 +68,15 @@ mtmsr(register_t value) __asm __volatile ("mtmsr %0; isync" :: "r"(value)); } +#ifdef __powerpc64__ +static __inline void +mtmsrd(register_t value) +{ + + __asm __volatile ("mtmsrd %0; isync" :: "r"(value)); +} +#endif + static __inline register_t mfmsr(void) { @@ -78,6 +87,7 @@ mfmsr(void) return (value); } +#ifndef __powerpc64__ static __inline void mtsrin(vm_offset_t va, register_t value) { @@ -94,6 +104,18 @@ mfsrin(vm_offset_t va) return (value); } +#endif + +static __inline register_t +mfctrl(void) +{ + register_t value; + + __asm __volatile ("mfspr %0,136" : "=r"(value)); + + return (value); +} + static __inline void mtdec(register_t value) @@ -126,6 +148,9 @@ static __inline u_quad_t mftb(void) { u_quad_t tb; + #ifdef __powerpc64__ + __asm __volatile ("mftb %0" : "=r"(tb)); + #else uint32_t *tbup = (uint32_t *)&tb; uint32_t *tblp = tbup + 1; @@ -133,6 +158,7 @@ mftb(void) *tbup = mfspr(TBR_TBU); *tblp = mfspr(TBR_TBL); } while (*tbup != mfspr(TBR_TBU)); + #endif return (tb); } @@ -150,21 +176,21 @@ static __inline void eieio(void) { - __asm __volatile ("eieio"); + __asm __volatile ("eieio" : : : "memory"); } static __inline void isync(void) { - __asm __volatile ("isync"); + __asm __volatile ("isync" : : : "memory"); } static __inline void powerpc_sync(void) { - __asm __volatile ("sync"); + __asm __volatile ("sync" : : : "memory"); } static __inline register_t |