|
2 | 2 | #ifndef __ASM_ALTERNATIVE_MACROS_H
|
3 | 3 | #define __ASM_ALTERNATIVE_MACROS_H
|
4 | 4 |
|
| 5 | +#include <linux/bits.h> |
5 | 6 | #include <linux/const.h>
|
6 | 7 |
|
7 | 8 | #include <asm/cpucaps.h>
|
8 | 9 | #include <asm/insn-def.h>
|
9 | 10 |
|
10 |
| -#define ARM64_CB_BIT (UL(1) << 15) |
| 11 | +/* |
| 12 | + * Binutils 2.27.0 can't handle a 'UL' suffix on constants, so for the assembly |
| 13 | + * macros below we must use we must use `(1 << ARM64_CB_SHIFT)`. |
| 14 | + */ |
| 15 | +#define ARM64_CB_SHIFT 15 |
| 16 | +#define ARM64_CB_BIT BIT(ARM64_CB_SHIFT) |
11 | 17 |
|
12 | 18 | #if ARM64_NCAPS >= ARM64_CB_BIT
|
13 | 19 | #error "cpucaps have overflown ARM64_CB_BIT"
|
|
80 | 86 | __ALTERNATIVE_CFG(oldinstr, newinstr, feature, IS_ENABLED(cfg))
|
81 | 87 |
|
82 | 88 | #define ALTERNATIVE_CB(oldinstr, feature, cb) \
|
83 |
| - __ALTERNATIVE_CFG_CB(oldinstr, ARM64_CB_BIT | (feature), 1, cb) |
| 89 | + __ALTERNATIVE_CFG_CB(oldinstr, (1 << ARM64_CB_SHIFT) | (feature), 1, cb) |
84 | 90 | #else
|
85 | 91 |
|
86 | 92 | #include <asm/assembler.h>
|
|
150 | 156 | .macro alternative_cb cap, cb
|
151 | 157 | .set .Lasm_alt_mode, 0
|
152 | 158 | .pushsection .altinstructions, "a"
|
153 |
| - altinstruction_entry 661f, \cb, ARM64_CB_BIT | \cap, 662f-661f, 0 |
| 159 | + altinstruction_entry 661f, \cb, (1 << ARM64_CB_SHIFT) | \cap, 662f-661f, 0 |
154 | 160 | .popsection
|
155 | 161 | 661:
|
156 | 162 | .endm
|
|
0 commit comments