cpufunc.h (92781) | cpufunc.h (92805) |
---|---|
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 92781 2002-03-20 10:00:05Z dfr $ | 26 * $FreeBSD: head/sys/ia64/include/cpufunc.h 92805 2002-03-20 17:28:40Z dfr $ |
27 */ 28 29#ifndef _MACHINE_CPUFUNC_H_ 30#define _MACHINE_CPUFUNC_H_ 31 32#ifdef _KERNEL 33 34#include <sys/types.h> --- 255 unchanged lines hidden (view full) --- 290 critical_t psr; 291 292 __asm __volatile ("mov %0=psr;;" : "=r" (psr)); 293 disable_intr(); 294 return (psr); 295} 296 297static __inline void | 27 */ 28 29#ifndef _MACHINE_CPUFUNC_H_ 30#define _MACHINE_CPUFUNC_H_ 31 32#ifdef _KERNEL 33 34#include <sys/types.h> --- 255 unchanged lines hidden (view full) --- 290 critical_t psr; 291 292 __asm __volatile ("mov %0=psr;;" : "=r" (psr)); 293 disable_intr(); 294 return (psr); 295} 296 297static __inline void |
298intr_enable(critical_t psr) | 298intr_restore(critical_t psr) |
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{ | 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); | 312 intr_restore(psr); |
313} 314 315#endif /* _KERNEL */ 316 317#endif /* !_MACHINE_CPUFUNC_H_ */ | 313} 314 315#endif /* _KERNEL */ 316 317#endif /* !_MACHINE_CPUFUNC_H_ */ |