diff options
author | markm <markm@FreeBSD.org> | 2002-07-15 13:29:40 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2002-07-15 13:29:40 +0000 |
commit | 5ac51e5b212ce73bdf5791ec07b3dd35d03b1eac (patch) | |
tree | d99b41fc9bb810aac3358bae2acac92dc9826885 /sys | |
parent | ba39a3d3df7f3e32e07165de5baafbb8263a405b (diff) | |
download | FreeBSD-src-5ac51e5b212ce73bdf5791ec07b3dd35d03b1eac.zip FreeBSD-src-5ac51e5b212ce73bdf5791ec07b3dd35d03b1eac.tar.gz |
Wrap GNU specific code in ifdefs, and help lint out by providing
some alternative definitions.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/include/pcpu.h | 20 | ||||
-rw-r--r-- | sys/i386/include/pcpu.h | 20 |
2 files changed, 36 insertions, 4 deletions
diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index eba526c..f8d6998 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -32,8 +32,22 @@ #ifdef _KERNEL #ifndef __GNUC__ -#error gcc is required to use this file -#endif + +#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> @@ -146,6 +160,8 @@ #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) +#endif /* __GNUC__ */ + #endif /* _KERNEL */ #endif /* ! _MACHINE_PCPU_H_ */ diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h index eba526c..f8d6998 100644 --- a/sys/i386/include/pcpu.h +++ b/sys/i386/include/pcpu.h @@ -32,8 +32,22 @@ #ifdef _KERNEL #ifndef __GNUC__ -#error gcc is required to use this file -#endif + +#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> @@ -146,6 +160,8 @@ #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) +#endif /* __GNUC__ */ + #endif /* _KERNEL */ #endif /* ! _MACHINE_PCPU_H_ */ |