From f70bfa97c0eccf16418115aaa9560a641c0b227f Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Sat, 18 Aug 2001 18:07:37 +0000 Subject: [PATCH] Spell ta 1 correctly as ta %xcc, 1. Use %pil for critical enter/exit instead of pstate.ie. Note that popc is not implemented in hardware on certain ultras, so we can't use it for inline ffs (suck). --- sys/sparc64/include/cpufunc.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/sys/sparc64/include/cpufunc.h b/sys/sparc64/include/cpufunc.h index be9e1ebcc28f..5e1aecf50f1a 100644 --- a/sys/sparc64/include/cpufunc.h +++ b/sys/sparc64/include/cpufunc.h @@ -117,31 +117,28 @@ static __inline void breakpoint(void) { - __asm __volatile("ta 1"); + __asm __volatile("ta %%xcc, 1" : :); } -/* - * XXX use %pil for these. - */ static __inline critical_t critical_enter(void) { - critical_t ie; + critical_t pil; - ie = rdpr(pstate); - if (ie & PSTATE_IE) - wrpr(pstate, ie, PSTATE_IE); - return (ie); + pil = rdpr(pil); + wrpr(pil, 0, 14); + return (pil); } static __inline void -critical_exit(critical_t ie) +critical_exit(critical_t pil) { - - if (ie & PSTATE_IE) - wrpr(pstate, ie, 0); + wrpr(pil, pil, 0); } +/* + * Ultrasparc II doesn't implement popc in hardware. Suck. + */ #if 0 #define HAVE_INLINE_FFS /*