diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/vdso/vdso2c.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/x86/vdso/vdso2c.c b/arch/x86/vdso/vdso2c.c index 450ac6eaf613..7a6bf50f9165 100644 --- a/arch/x86/vdso/vdso2c.c +++ b/arch/x86/vdso/vdso2c.c | |||
@@ -54,7 +54,7 @@ static void fail(const char *format, ...) | |||
54 | } | 54 | } |
55 | 55 | ||
56 | /* | 56 | /* |
57 | * Evil macros to do a little-endian read. | 57 | * Evil macros for little-endian reads and writes |
58 | */ | 58 | */ |
59 | #define GLE(x, bits, ifnot) \ | 59 | #define GLE(x, bits, ifnot) \ |
60 | __builtin_choose_expr( \ | 60 | __builtin_choose_expr( \ |
@@ -62,11 +62,24 @@ static void fail(const char *format, ...) | |||
62 | (__typeof__(*(x)))get_unaligned_le##bits(x), ifnot) | 62 | (__typeof__(*(x)))get_unaligned_le##bits(x), ifnot) |
63 | 63 | ||
64 | extern void bad_get_le(void); | 64 | extern void bad_get_le(void); |
65 | #define LAST_LE(x) \ | 65 | #define LAST_GLE(x) \ |
66 | __builtin_choose_expr(sizeof(*(x)) == 1, *(x), bad_get_le()) | 66 | __builtin_choose_expr(sizeof(*(x)) == 1, *(x), bad_get_le()) |
67 | 67 | ||
68 | #define GET_LE(x) \ | 68 | #define GET_LE(x) \ |
69 | GLE(x, 64, GLE(x, 32, GLE(x, 16, LAST_LE(x)))) | 69 | GLE(x, 64, GLE(x, 32, GLE(x, 16, LAST_GLE(x)))) |
70 | |||
71 | #define PLE(x, val, bits, ifnot) \ | ||
72 | __builtin_choose_expr( \ | ||
73 | (sizeof(*(x)) == bits/8), \ | ||
74 | put_unaligned_le##bits((val), (x)), ifnot) | ||
75 | |||
76 | extern void bad_put_le(void); | ||
77 | #define LAST_PLE(x, val) \ | ||
78 | __builtin_choose_expr(sizeof(*(x)) == 1, *(x) = (val), bad_put_le()) | ||
79 | |||
80 | #define PUT_LE(x, val) \ | ||
81 | PLE(x, val, 64, PLE(x, val, 32, PLE(x, val, 16, LAST_PLE(x, val)))) | ||
82 | |||
70 | 83 | ||
71 | #define NSYMS (sizeof(required_syms) / sizeof(required_syms[0])) | 84 | #define NSYMS (sizeof(required_syms) / sizeof(required_syms[0])) |
72 | 85 | ||