cpufunc.h (66458) | cpufunc.h (74897) |
---|---|
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 66458 2000-09-29 13:46:07Z dfr $ | 26 * $FreeBSD: head/sys/ia64/include/cpufunc.h 74897 2001-03-28 02:31:54Z jhb $ |
27 */ 28 29#ifndef _MACHINE_CPUFUNC_H_ 30#define _MACHINE_CPUFUNC_H_ 31 32#ifdef _KERNEL 33 34#include <sys/types.h> --- 123 unchanged lines hidden (view full) --- 158} 159 160static __inline void 161writel(u_int addr, u_int32_t data) 162{ 163 return; /* TODO: implement this */ 164} 165 | 27 */ 28 29#ifndef _MACHINE_CPUFUNC_H_ 30#define _MACHINE_CPUFUNC_H_ 31 32#ifdef _KERNEL 33 34#include <sys/types.h> --- 123 unchanged lines hidden (view full) --- 158} 159 160static __inline void 161writel(u_int addr, u_int32_t data) 162{ 163 return; /* TODO: implement this */ 164} 165 |
166/* 167 * Bogus interrupt manipulation 168 */ | |
169static __inline void 170disable_intr(void) 171{ 172 __asm __volatile ("rsm psr.i;;"); 173} 174 175static __inline void 176enable_intr(void) 177{ 178 __asm __volatile (";; ssm psr.i;; srlz.d"); 179} 180 | 166static __inline void 167disable_intr(void) 168{ 169 __asm __volatile ("rsm psr.i;;"); 170} 171 172static __inline void 173enable_intr(void) 174{ 175 __asm __volatile (";; ssm psr.i;; srlz.d"); 176} 177 |
181static __inline u_int 182save_intr(void) | 178static __inline critical_t 179critical_enter(void) |
183{ | 180{ |
184 u_int psr; | 181 critical_t psr; 182 |
185 __asm __volatile ("mov %0=psr;;" : "=r" (psr)); | 183 __asm __volatile ("mov %0=psr;;" : "=r" (psr)); |
186 return psr; | 184 disable_intr(); 185 return (psr); |
187} 188 189static __inline void | 186} 187 188static __inline void |
190restore_intr(u_int psr) | 189critical_exit(critical_t psr) |
191{ 192 __asm __volatile ("mov psr.l=%0;; srlz.d" :: "r" (psr)); 193} 194 195#endif /* _KERNEL */ 196 197#endif /* !_MACHINE_CPUFUNC_H_ */ | 190{ 191 __asm __volatile ("mov psr.l=%0;; srlz.d" :: "r" (psr)); 192} 193 194#endif /* _KERNEL */ 195 196#endif /* !_MACHINE_CPUFUNC_H_ */ |