Deleted Added
sdiff udiff text old ( 225736 ) new ( 239996 )
full compact
1/*-
2 * Copyright (c) Peter Wemm
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: stable/9/sys/i386/include/pcpu.h 216956 2011-01-04 14:49:54Z rwatson $
27 */
28
29#ifndef _MACHINE_PCPU_H_
30#define _MACHINE_PCPU_H_
31
32#ifndef _SYS_CDEFS_H_
33#error "sys/cdefs.h is a prerequisite for this file"
34#endif

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

231} while (0)
232
233#define PCPU_GET(member) __PCPU_GET(pc_ ## member)
234#define PCPU_ADD(member, val) __PCPU_ADD(pc_ ## member, val)
235#define PCPU_INC(member) __PCPU_INC(pc_ ## member)
236#define PCPU_PTR(member) __PCPU_PTR(pc_ ## member)
237#define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val)
238
239static __inline __pure2 struct thread *
240__curthread(void)
241{
242 struct thread *td;
243
244 __asm("movl %%fs:0,%0" : "=r" (td));
245 return (td);
246}
247#define curthread (__curthread())
248
249#else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */
250
251#error "this file needs to be ported to your compiler"
252
253#endif /* lint, etc. */
254
255#endif /* _KERNEL */
256
257#endif /* !_MACHINE_PCPU_H_ */