Deleted Added
full compact
cpufunc.h (276084) cpufunc.h (289818)
1/*-
2 * Copyright (c) 1993 The Regents of the University of California.
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

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 1993 The Regents of the University of California.
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

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: stable/10/sys/i386/include/cpufunc.h 276084 2014-12-22 21:32:39Z jhb $
29 * $FreeBSD: stable/10/sys/i386/include/cpufunc.h 289818 2015-10-23 10:05:43Z avg $
30 */
31
32/*
33 * Functions to provide access to special i386 instructions.
34 * This in included in sys/systm.h, and that file should be
35 * used in preference to this.
36 */
37

--- 141 unchanged lines hidden (view full) ---

179 * Note that gcc-2's builtin ffs would be used if we didn't declare
180 * this inline or turn off the builtin. The builtin is faster but
181 * broken in gcc-2.4.5 and slower but working in gcc-2.5 and later
182 * versions.
183 */
184 return (mask == 0 ? mask : (int)bsfl((u_int)mask) + 1);
185}
186
30 */
31
32/*
33 * Functions to provide access to special i386 instructions.
34 * This in included in sys/systm.h, and that file should be
35 * used in preference to this.
36 */
37

--- 141 unchanged lines hidden (view full) ---

179 * Note that gcc-2's builtin ffs would be used if we didn't declare
180 * this inline or turn off the builtin. The builtin is faster but
181 * broken in gcc-2.4.5 and slower but working in gcc-2.5 and later
182 * versions.
183 */
184 return (mask == 0 ? mask : (int)bsfl((u_int)mask) + 1);
185}
186
187#define HAVE_INLINE_FFSL
188
189static __inline int
190ffsl(long mask)
191{
192 return (ffs((int)mask));
193}
194
187#define HAVE_INLINE_FLS
188
189static __inline int
190fls(int mask)
191{
192 return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1);
193}
194
195#define HAVE_INLINE_FLS
196
197static __inline int
198fls(int mask)
199{
200 return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1);
201}
202
203#define HAVE_INLINE_FLSL
204
205static __inline int
206flsl(long mask)
207{
208 return (fls((int)mask));
209}
210
195#endif /* _KERNEL */
196
197static __inline void
198halt(void)
199{
200 __asm __volatile("hlt");
201}
202

--- 600 unchanged lines hidden ---
211#endif /* _KERNEL */
212
213static __inline void
214halt(void)
215{
216 __asm __volatile("hlt");
217}
218

--- 600 unchanged lines hidden ---