|
44 | 44 | ALT_NEW_CONTENT \vendor_id, \errata_id, \enable, \new_c
|
45 | 45 | .endm
|
46 | 46 |
|
47 |
| -#define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ |
48 |
| - ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k) |
49 |
| - |
50 | 47 | .macro ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \
|
51 | 48 | new_c_2, vendor_id_2, errata_id_2, enable_2
|
52 | 49 | ALTERNATIVE_CFG \old_c, \new_c_1, \vendor_id_1, \errata_id_1, \enable_1
|
53 | 50 | ALT_NEW_CONTENT \vendor_id_2, \errata_id_2, \enable_2, \new_c_2
|
54 | 51 | .endm
|
55 | 52 |
|
56 |
| -#define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ |
57 |
| - CONFIG_k_1, \ |
58 |
| - new_c_2, vendor_id_2, errata_id_2, \ |
59 |
| - CONFIG_k_2) \ |
60 |
| - ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, \ |
61 |
| - IS_ENABLED(CONFIG_k_1), \ |
62 |
| - new_c_2, vendor_id_2, errata_id_2, \ |
63 |
| - IS_ENABLED(CONFIG_k_2) |
| 53 | +#define __ALTERNATIVE_CFG(...) ALTERNATIVE_CFG __VA_ARGS__ |
| 54 | +#define __ALTERNATIVE_CFG_2(...) ALTERNATIVE_CFG_2 __VA_ARGS__ |
64 | 55 |
|
65 | 56 | #else /* !__ASSEMBLY__ */
|
66 | 57 |
|
|
102 | 93 | "887 :\n" \
|
103 | 94 | ALT_NEW_CONTENT(vendor_id, errata_id, enable, new_c)
|
104 | 95 |
|
105 |
| -#define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ |
106 |
| - __ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)) |
107 |
| - |
108 |
| -#define __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ |
109 |
| - enable_1, \ |
110 |
| - new_c_2, vendor_id_2, errata_id_2, \ |
111 |
| - enable_2) \ |
112 |
| - __ALTERNATIVE_CFG(old_c, new_c_1, vendor_id_1, errata_id_1, enable_1) \ |
| 96 | +#define __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \ |
| 97 | + new_c_2, vendor_id_2, errata_id_2, enable_2) \ |
| 98 | + __ALTERNATIVE_CFG(old_c, new_c_1, vendor_id_1, errata_id_1, enable_1) \ |
113 | 99 | ALT_NEW_CONTENT(vendor_id_2, errata_id_2, enable_2, new_c_2)
|
114 | 100 |
|
115 |
| -#define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ |
116 |
| - CONFIG_k_1, \ |
117 |
| - new_c_2, vendor_id_2, errata_id_2, \ |
118 |
| - CONFIG_k_2) \ |
119 |
| - __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, \ |
120 |
| - IS_ENABLED(CONFIG_k_1), \ |
121 |
| - new_c_2, vendor_id_2, errata_id_2, \ |
122 |
| - IS_ENABLED(CONFIG_k_2)) |
123 |
| - |
124 | 101 | #endif /* __ASSEMBLY__ */
|
125 | 102 |
|
| 103 | +#define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ |
| 104 | + __ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)) |
| 105 | + |
| 106 | +#define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, CONFIG_k_1, \ |
| 107 | + new_c_2, vendor_id_2, errata_id_2, CONFIG_k_2) \ |
| 108 | + __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, IS_ENABLED(CONFIG_k_1), \ |
| 109 | + new_c_2, vendor_id_2, errata_id_2, IS_ENABLED(CONFIG_k_2)) |
| 110 | + |
126 | 111 | #else /* CONFIG_RISCV_ALTERNATIVE */
|
127 | 112 | #ifdef __ASSEMBLY__
|
128 | 113 |
|
|
173 | 158 | * on the following sample code and then replace ALTERNATIVE() with
|
174 | 159 | * ALTERNATIVE_2() to append its customized content.
|
175 | 160 | */
|
176 |
| -#define ALTERNATIVE_2(old_content, new_content_1, vendor_id_1, \ |
177 |
| - errata_id_1, CONFIG_k_1, \ |
178 |
| - new_content_2, vendor_id_2, \ |
179 |
| - errata_id_2, CONFIG_k_2) \ |
180 |
| - _ALTERNATIVE_CFG_2(old_content, new_content_1, vendor_id_1, \ |
181 |
| - errata_id_1, CONFIG_k_1, \ |
182 |
| - new_content_2, vendor_id_2, \ |
183 |
| - errata_id_2, CONFIG_k_2) |
| 161 | +#define ALTERNATIVE_2(old_content, new_content_1, vendor_id_1, errata_id_1, CONFIG_k_1, \ |
| 162 | + new_content_2, vendor_id_2, errata_id_2, CONFIG_k_2) \ |
| 163 | + _ALTERNATIVE_CFG_2(old_content, new_content_1, vendor_id_1, errata_id_1, CONFIG_k_1, \ |
| 164 | + new_content_2, vendor_id_2, errata_id_2, CONFIG_k_2) |
184 | 165 |
|
185 | 166 | #endif
|
0 commit comments