cpufunc.h (256281) | cpufunc.h (289818) |
---|---|
1/*- 2 * Copyright (c) 2003 Peter Wemm. 3 * Copyright (c) 1993 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * | 1/*- 2 * Copyright (c) 2003 Peter Wemm. 3 * Copyright (c) 1993 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * |
30 * $FreeBSD: stable/10/sys/amd64/include/cpufunc.h 255331 2013-09-06 22:17:02Z gibbs $ | 30 * $FreeBSD: stable/10/sys/amd64/include/cpufunc.h 289818 2015-10-23 10:05:43Z avg $ |
31 */ 32 33/* 34 * Functions to provide access to special i386 instructions. 35 * This in included in sys/systm.h, and that file should be 36 * used in preference to this. 37 */ 38 --- 110 unchanged lines hidden (view full) --- 149#define HAVE_INLINE_FFSL 150 151static __inline int 152ffsl(long mask) 153{ 154 return (mask == 0 ? mask : (int)bsfq((u_long)mask) + 1); 155} 156 | 31 */ 32 33/* 34 * Functions to provide access to special i386 instructions. 35 * This in included in sys/systm.h, and that file should be 36 * used in preference to this. 37 */ 38 --- 110 unchanged lines hidden (view full) --- 149#define HAVE_INLINE_FFSL 150 151static __inline int 152ffsl(long mask) 153{ 154 return (mask == 0 ? mask : (int)bsfq((u_long)mask) + 1); 155} 156 |
157#define HAVE_INLINE_FFSLL 158 159static __inline int 160ffsll(long long mask) 161{ 162 return (ffsl((long)mask)); 163} 164 |
|
157#define HAVE_INLINE_FLS 158 159static __inline int 160fls(int mask) 161{ 162 return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1); 163} 164 165#define HAVE_INLINE_FLSL 166 167static __inline int 168flsl(long mask) 169{ 170 return (mask == 0 ? mask : (int)bsrq((u_long)mask) + 1); 171} 172 | 165#define HAVE_INLINE_FLS 166 167static __inline int 168fls(int mask) 169{ 170 return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1); 171} 172 173#define HAVE_INLINE_FLSL 174 175static __inline int 176flsl(long mask) 177{ 178 return (mask == 0 ? mask : (int)bsrq((u_long)mask) + 1); 179} 180 |
181#define HAVE_INLINE_FLSLL 182 183static __inline int 184flsll(long long mask) 185{ 186 return (flsl((long)mask)); 187} 188 |
|
173#endif /* _KERNEL */ 174 175static __inline void 176halt(void) 177{ 178 __asm __volatile("hlt"); 179} 180 --- 659 unchanged lines hidden --- | 189#endif /* _KERNEL */ 190 191static __inline void 192halt(void) 193{ 194 __asm __volatile("hlt"); 195} 196 --- 659 unchanged lines hidden --- |