Date: Thu, 24 Aug 2006 16:26:12 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 104951 for review Message-ID: <200608241626.k7OGQCxN004311@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=104951 Change 104951 by gonzo@gonzo_hq on 2006/08/24 16:26:09 o Unbreak kernel build: move helper routines to the top of the file so they'll be defined before used. Affected files ... .. //depot/projects/mips2/src/sys/mips/include/cpufunc.h#16 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/include/cpufunc.h#16 (text+ko) ==== @@ -28,13 +28,55 @@ #ifndef _MACHINE_CPUFUNC_H_ #define _MACHINE_CPUFUNC_H_ -#ifdef _KERNEL - #include <sys/types.h> #include <machine/cpuregs.h> +/* + * These functions are required by user-land atomi ops + */ static __inline void +mips_barrier(void) +{ + __asm __volatile (".set noreorder\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + ".set reorder\n\t" + : : : "memory"); +} + +static __inline void +mips_wbflush(void) +{ + __asm __volatile ("sync" : : : "memory"); + mips_barrier(); +#if 0 + __asm __volatile("mtc0 %0, $12\n" /* MIPS_COP_0_STATUS */ + : : "r" (flag)); +#endif +} + +static __inline void +mips_read_membar(void) +{ + /* Nil */ +} + +static __inline void +mips_write_membar(void) +{ + mips_wbflush(); +} + +#ifdef _KERNEL + +static __inline void mips_tlbp(void) { __asm __volatile ("tlbp"); @@ -194,47 +236,4 @@ #endif /* _KERNEL */ -/* - * These functions are required by user-land atomi ops - */ - -static __inline void -mips_barrier(void) -{ - __asm __volatile (".set noreorder\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - ".set reorder\n\t" - : : : "memory"); -} - -static __inline void -mips_wbflush(void) -{ - __asm __volatile ("sync" : : : "memory"); - mips_barrier(); -#if 0 - __asm __volatile("mtc0 %0, $12\n" /* MIPS_COP_0_STATUS */ - : : "r" (flag)); -#endif -} - -static __inline void -mips_read_membar(void) -{ - /* Nil */ -} - -static __inline void -mips_write_membar(void) -{ - mips_wbflush(); -} - #endif /* !_MACHINE_CPUFUNC_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608241626.k7OGQCxN004311>