summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/pcpu.h
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2009-09-04 05:40:06 +0000
committerjulian <julian@FreeBSD.org>2009-09-04 05:40:06 +0000
commit5ae8d08f60f62c6125cd2f302e42ee9a74cb1a06 (patch)
tree07d1ad8e7370dac3a284b1805e73129537794bcc /sys/i386/include/pcpu.h
parent29700115d84726fa773682f23f29f1dad757d491 (diff)
downloadFreeBSD-src-5ae8d08f60f62c6125cd2f302e42ee9a74cb1a06.zip
FreeBSD-src-5ae8d08f60f62c6125cd2f302e42ee9a74cb1a06.tar.gz
Bring i386 up to date with amd64 and others.
The macros for PCPU can be slightly simplified, which makes the resulting tangle qa lot easier to understand when trying to read them. MFC after: 4 weeks
Diffstat (limited to 'sys/i386/include/pcpu.h')
-rw-r--r--sys/i386/include/pcpu.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h
index 594077c..bd25d5a 100644
--- a/sys/i386/include/pcpu.h
+++ b/sys/i386/include/pcpu.h
@@ -152,7 +152,7 @@ extern struct pcpu *pcpup;
#define __PCPU_GET(name) __extension__ ({ \
__pcpu_type(name) __res; \
struct __s { \
- u_char __b[MIN(sizeof(__pcpu_type(name)), 4)]; \
+ u_char __b[MIN(sizeof(__res), 4)]; \
} __s; \
\
if (sizeof(__res) == 1 || sizeof(__res) == 2 || \
@@ -174,7 +174,7 @@ extern struct pcpu *pcpup;
#define __PCPU_ADD(name, val) do { \
__pcpu_type(name) __val; \
struct __s { \
- u_char __b[MIN(sizeof(__pcpu_type(name)), 4)]; \
+ u_char __b[MIN(sizeof(__val), 4)]; \
} __s; \
\
__val = (val); \
@@ -214,10 +214,10 @@ extern struct pcpu *pcpup;
/*
* Sets the value of the per-cpu variable name to value val.
*/
-#define __PCPU_SET(name, val) { \
+#define __PCPU_SET(name, val) do { \
__pcpu_type(name) __val; \
struct __s { \
- u_char __b[MIN(sizeof(__pcpu_type(name)), 4)]; \
+ u_char __b[MIN(sizeof(__val), 4)]; \
} __s; \
\
__val = (val); \
@@ -230,7 +230,7 @@ extern struct pcpu *pcpup;
} else { \
*__PCPU_PTR(name) = __val; \
} \
-}
+} while (0)
#define PCPU_GET(member) __PCPU_GET(pc_ ## member)
#define PCPU_ADD(member, val) __PCPU_ADD(pc_ ## member, val)
OpenPOWER on IntegriCloud