View | Details | Raw Unified | Return to bug 277200 | Differences between
and this patch

Collapse All | Expand All

(-)b/xen/arch/x86/include/asm/alternative.h (-4 / +12 lines)
Lines 167-175 extern void alternative_branches(void); Link Here
167
#define ALT_CALL_arg5 "r8"
167
#define ALT_CALL_arg5 "r8"
168
#define ALT_CALL_arg6 "r9"
168
#define ALT_CALL_arg6 "r9"
169
169
170
#define ALT_CALL_ARG(arg, n) \
170
/*
171
    register typeof(arg) a ## n ## _ asm ( ALT_CALL_arg ## n ) = \
171
 * Use an union with an unsigned long in order to prevent clang >= 16.0.0 from
172
        ({ BUILD_BUG_ON(sizeof(arg) > sizeof(void *)); (arg); })
172
 * skipping a possible truncation of the value.  By using the union any
173
 * truncation is carried before the call instruction.
174
 */
175
#define ALT_CALL_ARG(arg, n)                                            \
176
    register union {                                                    \
177
        typeof(arg) e;                                                  \
178
        unsigned long r;                                                \
179
    } a ## n ## _ asm ( ALT_CALL_arg ## n ) = {                         \
180
        .e = ({ BUILD_BUG_ON(sizeof(arg) > sizeof(void *)); (arg); })   \
181
    }
173
#define ALT_CALL_NO_ARG(n) \
182
#define ALT_CALL_NO_ARG(n) \
174
    register unsigned long a ## n ## _ asm ( ALT_CALL_arg ## n )
183
    register unsigned long a ## n ## _ asm ( ALT_CALL_arg ## n )
175
184
176
- 

Return to bug 277200