cpufunc.h (88441) | cpufunc.h (92781) |
---|---|
1/*- 2 * Copyright (c) 1998 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/ia64/include/cpufunc.h 88441 2001-12-23 16:04:29Z dfr $ | 26 * $FreeBSD: head/sys/ia64/include/cpufunc.h 92781 2002-03-20 10:00:05Z dfr $ |
27 */ 28 29#ifndef _MACHINE_CPUFUNC_H_ 30#define _MACHINE_CPUFUNC_H_ 31 32#ifdef _KERNEL 33 34#include <sys/types.h> --- 245 unchanged lines hidden (view full) --- 280 281static __inline void 282enable_intr(void) 283{ 284 __asm __volatile (";; ssm psr.i;; srlz.d"); 285} 286 287static __inline critical_t | 27 */ 28 29#ifndef _MACHINE_CPUFUNC_H_ 30#define _MACHINE_CPUFUNC_H_ 31 32#ifdef _KERNEL 33 34#include <sys/types.h> --- 245 unchanged lines hidden (view full) --- 280 281static __inline void 282enable_intr(void) 283{ 284 __asm __volatile (";; ssm psr.i;; srlz.d"); 285} 286 287static __inline critical_t |
288cpu_critical_enter(void) | 288intr_disable(void) |
289{ 290 critical_t psr; 291 292 __asm __volatile ("mov %0=psr;;" : "=r" (psr)); 293 disable_intr(); 294 return (psr); 295} 296 297static __inline void | 289{ 290 critical_t psr; 291 292 __asm __volatile ("mov %0=psr;;" : "=r" (psr)); 293 disable_intr(); 294 return (psr); 295} 296 297static __inline void |
298cpu_critical_exit(critical_t psr) | 298intr_enable(critical_t psr) |
299{ 300 __asm __volatile ("mov psr.l=%0;; srlz.d" :: "r" (psr)); 301} 302 | 299{ 300 __asm __volatile ("mov psr.l=%0;; srlz.d" :: "r" (psr)); 301} 302 |
303static __inline critical_t 304cpu_critical_enter(void) 305{ 306 return (intr_disable()); 307} 308 309static __inline void 310cpu_critical_exit(critical_t psr) 311{ 312 intr_enable(psr); 313} 314 |
|
303#endif /* _KERNEL */ 304 305#endif /* !_MACHINE_CPUFUNC_H_ */ | 315#endif /* _KERNEL */ 316 317#endif /* !_MACHINE_CPUFUNC_H_ */ |