diff options
author | Joe Perches <joe@perches.com> | 2008-03-23 04:03:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:26 -0400 |
commit | 46e1abc63e736644265e7ec2897f963a4ace5993 (patch) | |
tree | 6fcb9b4b79e47528f2384ebb19eec4faed5139db /include/asm-x86 | |
parent | 69bdb7bcc6b9494b1738c6f6dd3fe553c9c6978e (diff) |
include/asm-x86/pda.h: checkpatch cleanups - formatting only
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/pda.h | 80 |
1 files changed, 42 insertions, 38 deletions
diff --git a/include/asm-x86/pda.h b/include/asm-x86/pda.h index d9dc209c24ad..101fb9e11954 100644 --- a/include/asm-x86/pda.h +++ b/include/asm-x86/pda.h | |||
@@ -57,34 +57,36 @@ extern struct x8664_pda _proxy_pda; | |||
57 | 57 | ||
58 | #define pda_offset(field) offsetof(struct x8664_pda, field) | 58 | #define pda_offset(field) offsetof(struct x8664_pda, field) |
59 | 59 | ||
60 | #define pda_to_op(op, field, val) do { \ | 60 | #define pda_to_op(op, field, val) \ |
61 | typedef typeof(_proxy_pda.field) T__; \ | 61 | do { \ |
62 | if (0) { T__ tmp__; tmp__ = (val); } /* type checking */ \ | 62 | typedef typeof(_proxy_pda.field) T__; \ |
63 | switch (sizeof(_proxy_pda.field)) { \ | 63 | if (0) { T__ tmp__; tmp__ = (val); } /* type checking */ \ |
64 | case 2: \ | 64 | switch (sizeof(_proxy_pda.field)) { \ |
65 | asm(op "w %1,%%gs:%c2" : \ | 65 | case 2: \ |
66 | "+m" (_proxy_pda.field) : \ | 66 | asm(op "w %1,%%gs:%c2" : \ |
67 | "ri" ((T__)val), \ | 67 | "+m" (_proxy_pda.field) : \ |
68 | "i"(pda_offset(field))); \ | 68 | "ri" ((T__)val), \ |
69 | break; \ | 69 | "i"(pda_offset(field))); \ |
70 | case 4: \ | 70 | break; \ |
71 | asm(op "l %1,%%gs:%c2" : \ | 71 | case 4: \ |
72 | "+m" (_proxy_pda.field) : \ | 72 | asm(op "l %1,%%gs:%c2" : \ |
73 | "ri" ((T__)val), \ | 73 | "+m" (_proxy_pda.field) : \ |
74 | "i" (pda_offset(field))); \ | 74 | "ri" ((T__)val), \ |
75 | break; \ | 75 | "i" (pda_offset(field))); \ |
76 | case 8: \ | 76 | break; \ |
77 | asm(op "q %1,%%gs:%c2": \ | 77 | case 8: \ |
78 | "+m" (_proxy_pda.field) : \ | 78 | asm(op "q %1,%%gs:%c2": \ |
79 | "ri" ((T__)val), \ | 79 | "+m" (_proxy_pda.field) : \ |
80 | "i"(pda_offset(field))); \ | 80 | "ri" ((T__)val), \ |
81 | break; \ | 81 | "i"(pda_offset(field))); \ |
82 | default: \ | 82 | break; \ |
83 | __bad_pda_field(); \ | 83 | default: \ |
84 | } \ | 84 | __bad_pda_field(); \ |
85 | } while (0) | 85 | } \ |
86 | } while (0) | ||
86 | 87 | ||
87 | #define pda_from_op(op,field) ({ \ | 88 | #define pda_from_op(op, field) \ |
89 | ({ \ | ||
88 | typeof(_proxy_pda.field) ret__; \ | 90 | typeof(_proxy_pda.field) ret__; \ |
89 | switch (sizeof(_proxy_pda.field)) { \ | 91 | switch (sizeof(_proxy_pda.field)) { \ |
90 | case 2: \ | 92 | case 2: \ |
@@ -92,23 +94,24 @@ extern struct x8664_pda _proxy_pda; | |||
92 | "=r" (ret__) : \ | 94 | "=r" (ret__) : \ |
93 | "i" (pda_offset(field)), \ | 95 | "i" (pda_offset(field)), \ |
94 | "m" (_proxy_pda.field)); \ | 96 | "m" (_proxy_pda.field)); \ |
95 | break; \ | 97 | break; \ |
96 | case 4: \ | 98 | case 4: \ |
97 | asm(op "l %%gs:%c1,%0": \ | 99 | asm(op "l %%gs:%c1,%0": \ |
98 | "=r" (ret__): \ | 100 | "=r" (ret__): \ |
99 | "i" (pda_offset(field)), \ | 101 | "i" (pda_offset(field)), \ |
100 | "m" (_proxy_pda.field)); \ | 102 | "m" (_proxy_pda.field)); \ |
101 | break; \ | 103 | break; \ |
102 | case 8: \ | 104 | case 8: \ |
103 | asm(op "q %%gs:%c1,%0": \ | 105 | asm(op "q %%gs:%c1,%0": \ |
104 | "=r" (ret__) : \ | 106 | "=r" (ret__) : \ |
105 | "i" (pda_offset(field)), \ | 107 | "i" (pda_offset(field)), \ |
106 | "m" (_proxy_pda.field)); \ | 108 | "m" (_proxy_pda.field)); \ |
107 | break; \ | 109 | break; \ |
108 | default: \ | 110 | default: \ |
109 | __bad_pda_field(); \ | 111 | __bad_pda_field(); \ |
110 | } \ | 112 | } \ |
111 | ret__; }) | 113 | ret__; \ |
114 | }) | ||
112 | 115 | ||
113 | #define read_pda(field) pda_from_op("mov", field) | 116 | #define read_pda(field) pda_from_op("mov", field) |
114 | #define write_pda(field, val) pda_to_op("mov", field, val) | 117 | #define write_pda(field, val) pda_to_op("mov", field, val) |
@@ -117,12 +120,13 @@ extern struct x8664_pda _proxy_pda; | |||
117 | #define or_pda(field, val) pda_to_op("or", field, val) | 120 | #define or_pda(field, val) pda_to_op("or", field, val) |
118 | 121 | ||
119 | /* This is not atomic against other CPUs -- CPU preemption needs to be off */ | 122 | /* This is not atomic against other CPUs -- CPU preemption needs to be off */ |
120 | #define test_and_clear_bit_pda(bit, field) ({ \ | 123 | #define test_and_clear_bit_pda(bit, field) \ |
121 | int old__; \ | 124 | ({ \ |
122 | asm volatile("btr %2,%%gs:%c3\n\tsbbl %0,%0" \ | 125 | int old__; \ |
123 | : "=r" (old__), "+m" (_proxy_pda.field) \ | 126 | asm volatile("btr %2,%%gs:%c3\n\tsbbl %0,%0" \ |
124 | : "dIr" (bit), "i" (pda_offset(field)) : "memory"); \ | 127 | : "=r" (old__), "+m" (_proxy_pda.field) \ |
125 | old__; \ | 128 | : "dIr" (bit), "i" (pda_offset(field)) : "memory");\ |
129 | old__; \ | ||
126 | }) | 130 | }) |
127 | 131 | ||
128 | #endif | 132 | #endif |