diff options
author | phk <phk@FreeBSD.org> | 2002-10-01 14:01:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-10-01 14:01:58 +0000 |
commit | d37750606b92be69e6809225530c3e1b98d89252 (patch) | |
tree | abfecfadca0afdbcaa4c8fc1f9e5c4552223a9dd /sys/amd64/include/pcpu.h | |
parent | 810d5e3a0b576d3b2548ad95c958fa1d170aba81 (diff) | |
download | FreeBSD-src-d37750606b92be69e6809225530c3e1b98d89252.zip FreeBSD-src-d37750606b92be69e6809225530c3e1b98d89252.tar.gz |
A more lint friendly #ifdef lint section.
Diffstat (limited to 'sys/amd64/include/pcpu.h')
-rw-r--r-- | sys/amd64/include/pcpu.h | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index f8d6998..a680645 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -31,24 +31,6 @@ #ifdef _KERNEL -#ifndef __GNUC__ - -#ifndef lint -#error gcc or lint is required to use this file -#else /* lint */ -#define __PCPU_PTR(name) -#define __PCPU_GET(name) -#define __PCPU_SET(name, val) -#define PCPU_GET(member) __PCPU_GET(pc_ ## member) -#define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) -#define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) -#define PCPU_MD_FIELDS \ - int foo; \ - char bar -#endif /* lint */ - -#else /* __GNUC__ */ - #include <machine/segments.h> #include <machine/tss.h> @@ -70,6 +52,16 @@ u_int32_t pc_fpending; /* pending fast interrupts */ \ u_int32_t pc_spending /* pending soft interrupts */ +#if defined(lint) + +extern struct pcpu *pcpup; + +#define PCPU_GET(member) (pcpup->pc_ ## member) +#define PCPU_PTR(member) (&pcpup->pc_ ## member) +#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value)) + +#elif defined(__GNUC__) + /* * Evaluates to the byte offset of the per-cpu variable name. */ @@ -160,7 +152,9 @@ #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) -#endif /* __GNUC__ */ +#else +#error gcc or lint is required to use this file +#endif #endif /* _KERNEL */ |