Use the wrtee inlines for booke.

This commit is contained in:
matt 2011-04-29 21:42:40 +00:00
parent cffe40e6be
commit 661fe6a80d
1 changed files with 13 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: profile.h,v 1.7 2006/07/07 21:28:03 ross Exp $ */
/* $NetBSD: profile.h,v 1.8 2011/04/29 21:42:40 matt Exp $ */
/*-
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
@ -26,6 +26,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef _KERNEL_OPT
#include "opt_ppcarch.h"
#endif
#define _MCOUNT_DECL void __mcount
#ifdef _LP64
@ -122,6 +126,12 @@ __asm(" .globl _mcount \n" \
#endif
#ifdef _KERNEL
#ifdef PPC_BOOKE
#include <powerpc/booke/cpuvar.h>
#define MCOUNT_ENTER do s = wrtee(0); while (/*CONSTCOND*/ 0)
#define MCOUNT_EXIT wrtee(s)
#else
#define MCOUNT_ENTER \
__asm volatile("mfmsr %0" : "=r"(s)); \
if ((s & (PSL_IR | PSL_DR)) != (PSL_IR | PSL_DR)) \
@ -132,3 +142,5 @@ __asm(" .globl _mcount \n" \
#define MCOUNT_EXIT \
__asm volatile("mtmsr %0" :: "r"(s))
#endif
#endif