@@ -131,8 +131,12 @@ extern "C" {
131131 _Generic((addr), \
132132 uint32_t *: __rte_bit_test32, \
133133 const uint32_t *: __rte_bit_test32, \
134+ volatile uint32_t *: __rte_bit_v_test32, \
135+ const volatile uint32_t *: __rte_bit_v_test32, \
134136 uint64_t *: __rte_bit_test64, \
135- const uint64_t *: __rte_bit_test64) \
137+ const uint64_t *: __rte_bit_test64, \
138+ volatile uint64_t *: __rte_bit_v_test64, \
139+ const volatile uint64_t *: __rte_bit_v_test64) \
136140 (addr, nr)
137141
138142/**
@@ -156,7 +160,9 @@ extern "C" {
156160#define rte_bit_set (addr , nr ) \
157161 _Generic((addr), \
158162 uint32_t *: __rte_bit_set32, \
159- uint64_t *: __rte_bit_set64) \
163+ volatile uint32_t *: __rte_bit_v_set32, \
164+ uint64_t *: __rte_bit_set64, \
165+ volatile uint64_t *: __rte_bit_v_set64) \
160166 (addr, nr)
161167
162168/**
@@ -180,7 +186,9 @@ extern "C" {
180186#define rte_bit_clear (addr , nr ) \
181187 _Generic((addr), \
182188 uint32_t *: __rte_bit_clear32, \
183- uint64_t *: __rte_bit_clear64) \
189+ volatile uint32_t *: __rte_bit_v_clear32, \
190+ uint64_t *: __rte_bit_clear64, \
191+ volatile uint64_t *: __rte_bit_v_clear64) \
184192 (addr, nr)
185193
186194/**
@@ -205,7 +213,9 @@ extern "C" {
205213#define rte_bit_assign (addr , nr , value ) \
206214 _Generic((addr), \
207215 uint32_t *: __rte_bit_assign32, \
208- uint64_t *: __rte_bit_assign64) \
216+ volatile uint32_t *: __rte_bit_v_assign32, \
217+ uint64_t *: __rte_bit_assign64, \
218+ volatile uint64_t *: __rte_bit_v_assign64) \
209219 (addr, nr, value)
210220
211221/**
@@ -229,7 +239,9 @@ extern "C" {
229239#define rte_bit_flip (addr , nr ) \
230240 _Generic((addr), \
231241 uint32_t *: __rte_bit_flip32, \
232- uint64_t *: __rte_bit_flip64) \
242+ volatile uint32_t *: __rte_bit_v_flip32, \
243+ uint64_t *: __rte_bit_flip64, \
244+ volatile uint64_t *: __rte_bit_v_flip64) \
233245 (addr, nr)
234246
235247/**
@@ -255,8 +267,12 @@ extern "C" {
255267 _Generic((addr), \
256268 uint32_t *: __rte_bit_atomic_test32, \
257269 const uint32_t *: __rte_bit_atomic_test32, \
270+ volatile uint32_t *: __rte_bit_atomic_v_test32, \
271+ const volatile uint32_t *: __rte_bit_atomic_v_test32, \
258272 uint64_t *: __rte_bit_atomic_test64, \
259- const uint64_t *: __rte_bit_atomic_test64) \
273+ const uint64_t *: __rte_bit_atomic_test64, \
274+ volatile uint64_t *: __rte_bit_atomic_v_test64, \
275+ const volatile uint64_t *: __rte_bit_atomic_v_test64) \
260276 (addr, nr, memory_order)
261277
262278/**
@@ -279,7 +295,9 @@ extern "C" {
279295#define rte_bit_atomic_set (addr , nr , memory_order ) \
280296 _Generic((addr), \
281297 uint32_t *: __rte_bit_atomic_set32, \
282- uint64_t *: __rte_bit_atomic_set64) \
298+ volatile uint32_t *: __rte_bit_atomic_v_set32, \
299+ uint64_t *: __rte_bit_atomic_set64, \
300+ volatile uint64_t *: __rte_bit_atomic_v_set64) \
283301 (addr, nr, memory_order)
284302
285303/**
@@ -302,7 +320,9 @@ extern "C" {
302320#define rte_bit_atomic_clear (addr , nr , memory_order ) \
303321 _Generic((addr), \
304322 uint32_t *: __rte_bit_atomic_clear32, \
305- uint64_t *: __rte_bit_atomic_clear64) \
323+ volatile uint32_t *: __rte_bit_atomic_v_clear32, \
324+ uint64_t *: __rte_bit_atomic_clear64, \
325+ volatile uint64_t *: __rte_bit_atomic_v_clear64) \
306326 (addr, nr, memory_order)
307327
308328/**
@@ -327,7 +347,9 @@ extern "C" {
327347#define rte_bit_atomic_assign (addr , nr , value , memory_order ) \
328348 _Generic((addr), \
329349 uint32_t *: __rte_bit_atomic_assign32, \
330- uint64_t *: __rte_bit_atomic_assign64) \
350+ volatile uint32_t *: __rte_bit_atomic_v_assign32, \
351+ uint64_t *: __rte_bit_atomic_assign64, \
352+ volatile uint64_t *: __rte_bit_atomic_v_assign64) \
331353 (addr, nr, value, memory_order)
332354
333355/**
@@ -351,7 +373,9 @@ extern "C" {
351373#define rte_bit_atomic_flip (addr , nr , memory_order ) \
352374 _Generic((addr), \
353375 uint32_t *: __rte_bit_atomic_flip32, \
354- uint64_t *: __rte_bit_atomic_flip64) \
376+ volatile uint32_t *: __rte_bit_atomic_v_flip32, \
377+ uint64_t *: __rte_bit_atomic_flip64, \
378+ volatile uint64_t *: __rte_bit_atomic_v_flip64) \
355379 (addr, nr, memory_order)
356380
357381/**
@@ -376,7 +400,9 @@ extern "C" {
376400#define rte_bit_atomic_test_and_set (addr , nr , memory_order ) \
377401 _Generic((addr), \
378402 uint32_t *: __rte_bit_atomic_test_and_set32, \
379- uint64_t *: __rte_bit_atomic_test_and_set64) \
403+ volatile uint32_t *: __rte_bit_atomic_v_test_and_set32, \
404+ uint64_t *: __rte_bit_atomic_test_and_set64, \
405+ volatile uint64_t *: __rte_bit_atomic_v_test_and_set64) \
380406 (addr, nr, memory_order)
381407
382408/**
@@ -401,7 +427,9 @@ extern "C" {
401427#define rte_bit_atomic_test_and_clear (addr , nr , memory_order ) \
402428 _Generic((addr), \
403429 uint32_t *: __rte_bit_atomic_test_and_clear32, \
404- uint64_t *: __rte_bit_atomic_test_and_clear64) \
430+ volatile uint32_t *: __rte_bit_atomic_v_test_and_clear32, \
431+ uint64_t *: __rte_bit_atomic_test_and_clear64, \
432+ volatile uint64_t *: __rte_bit_atomic_v_test_and_clear64) \
405433 (addr, nr, memory_order)
406434
407435/**
@@ -429,7 +457,9 @@ extern "C" {
429457#define rte_bit_atomic_test_and_assign (addr , nr , value , memory_order ) \
430458 _Generic((addr), \
431459 uint32_t *: __rte_bit_atomic_test_and_assign32, \
432- uint64_t *: __rte_bit_atomic_test_and_assign64) \
460+ volatile uint32_t *: __rte_bit_atomic_v_test_and_assign32, \
461+ uint64_t *: __rte_bit_atomic_test_and_assign64, \
462+ volatile uint64_t *: __rte_bit_atomic_v_test_and_assign64) \
433463 (addr, nr, value, memory_order)
434464
435465#define __RTE_GEN_BIT_TEST (variant , qualifier , size ) \
@@ -492,7 +522,8 @@ __rte_bit_ ## variant ## flip ## size(qualifier uint ## size ## _t *addr, unsign
492522 __RTE_GEN_BIT_FLIP(v, qualifier, size)
493523
494524#define __RTE_GEN_BIT_OPS_SIZE (size ) \
495- __RTE_GEN_BIT_OPS(,, size)
525+ __RTE_GEN_BIT_OPS(,, size) \
526+ __RTE_GEN_BIT_OPS(v_, volatile, size)
496527
497528__RTE_GEN_BIT_OPS_SIZE (32 )
498529__RTE_GEN_BIT_OPS_SIZE (64 )
@@ -617,7 +648,8 @@ __rte_bit_atomic_ ## variant ## test_and_assign ## size( \
617648 __RTE_GEN_BIT_ATOMIC_FLIP(variant, qualifier, size)
618649
619650#define __RTE_GEN_BIT_ATOMIC_OPS_SIZE (size ) \
620- __RTE_GEN_BIT_ATOMIC_OPS(,, size)
651+ __RTE_GEN_BIT_ATOMIC_OPS(,, size) \
652+ __RTE_GEN_BIT_ATOMIC_OPS(v_, volatile, size)
621653
622654__RTE_GEN_BIT_ATOMIC_OPS_SIZE (32 )
623655__RTE_GEN_BIT_ATOMIC_OPS_SIZE (64 )
@@ -1334,7 +1366,8 @@ rte_bit_ ## family ## fun(qualifier uint ## size ## _t *addr, arg1_type arg1_nam
13341366}
13351367
13361368#define __RTE_BIT_OVERLOAD_SZ_2 (family , fun , qualifier , size , arg1_type , arg1_name ) \
1337- __RTE_BIT_OVERLOAD_V_2(family,, fun, qualifier, size, arg1_type, arg1_name)
1369+ __RTE_BIT_OVERLOAD_V_2(family,, fun, qualifier, size, arg1_type, arg1_name) \
1370+ __RTE_BIT_OVERLOAD_V_2(family, v_, fun, qualifier volatile, size, arg1_type, arg1_name)
13381371
13391372#define __RTE_BIT_OVERLOAD_2 (family , fun , qualifier , arg1_type , arg1_name ) \
13401373 __RTE_BIT_OVERLOAD_SZ_2(family, fun, qualifier, 32, arg1_type, arg1_name) \
@@ -1348,7 +1381,9 @@ rte_bit_ ## family ## fun(qualifier uint ## size ## _t *addr, arg1_type arg1_nam
13481381}
13491382
13501383#define __RTE_BIT_OVERLOAD_SZ_2R (family , fun , qualifier , size , ret_type , arg1_type , arg1_name ) \
1351- __RTE_BIT_OVERLOAD_V_2R(family,, fun, qualifier, size, ret_type, arg1_type, arg1_name)
1384+ __RTE_BIT_OVERLOAD_V_2R(family,, fun, qualifier, size, ret_type, arg1_type, arg1_name) \
1385+ __RTE_BIT_OVERLOAD_V_2R(family, v_, fun, qualifier volatile, size, ret_type, arg1_type, \
1386+ arg1_name)
13521387
13531388#define __RTE_BIT_OVERLOAD_2R (family , fun , qualifier , ret_type , arg1_type , arg1_name ) \
13541389 __RTE_BIT_OVERLOAD_SZ_2R(family, fun, qualifier, 32, ret_type, arg1_type, arg1_name) \
@@ -1366,6 +1401,8 @@ rte_bit_ ## family ## fun(qualifier uint ## size ## _t *addr, arg1_type arg1_nam
13661401#define __RTE_BIT_OVERLOAD_SZ_3 (family , fun , qualifier , size , arg1_type , arg1_name , \
13671402 arg2_type , arg2_name ) \
13681403 __RTE_BIT_OVERLOAD_V_3(family,, fun, qualifier, size, arg1_type, arg1_name, \
1404+ arg2_type, arg2_name) \
1405+ __RTE_BIT_OVERLOAD_V_3(family, v_, fun, qualifier volatile, size, arg1_type, arg1_name, \
13691406 arg2_type, arg2_name)
13701407
13711408#define __RTE_BIT_OVERLOAD_3 (family , fun , qualifier , arg1_type , arg1_name , arg2_type , arg2_name ) \
@@ -1386,7 +1423,9 @@ rte_bit_ ## family ## fun(qualifier uint ## size ## _t *addr, arg1_type arg1_nam
13861423#define __RTE_BIT_OVERLOAD_SZ_3R (family , fun , qualifier , size , ret_type , arg1_type , arg1_name , \
13871424 arg2_type , arg2_name ) \
13881425 __RTE_BIT_OVERLOAD_V_3R(family,, fun, qualifier, size, ret_type, arg1_type, arg1_name, \
1389- arg2_type, arg2_name)
1426+ arg2_type, arg2_name) \
1427+ __RTE_BIT_OVERLOAD_V_3R(family, v_, fun, qualifier volatile, size, ret_type, \
1428+ arg1_type, arg1_name, arg2_type, arg2_name)
13901429
13911430#define __RTE_BIT_OVERLOAD_3R (family , fun , qualifier , ret_type , arg1_type , arg1_name , \
13921431 arg2_type , arg2_name ) \
@@ -1407,6 +1446,8 @@ rte_bit_ ## family ## fun(qualifier uint ## size ## _t *addr, arg1_type arg1_nam
14071446#define __RTE_BIT_OVERLOAD_SZ_4 (family , fun , qualifier , size , arg1_type , arg1_name , \
14081447 arg2_type , arg2_name , arg3_type , arg3_name ) \
14091448 __RTE_BIT_OVERLOAD_V_4(family,, fun, qualifier, size, arg1_type, arg1_name, \
1449+ arg2_type, arg2_name, arg3_type, arg3_name) \
1450+ __RTE_BIT_OVERLOAD_V_4(family, v_, fun, qualifier volatile, size, arg1_type, arg1_name, \
14101451 arg2_type, arg2_name, arg3_type, arg3_name)
14111452
14121453#define __RTE_BIT_OVERLOAD_4 (family , fun , qualifier , arg1_type , arg1_name , arg2_type , arg2_name , \
@@ -1429,7 +1470,9 @@ rte_bit_ ## family ## fun(qualifier uint ## size ## _t *addr, arg1_type arg1_nam
14291470#define __RTE_BIT_OVERLOAD_SZ_4R (family , fun , qualifier , size , ret_type , arg1_type , arg1_name , \
14301471 arg2_type , arg2_name , arg3_type , arg3_name ) \
14311472 __RTE_BIT_OVERLOAD_V_4R(family,, fun, qualifier, size, ret_type, arg1_type, arg1_name, \
1432- arg2_type, arg2_name, arg3_type, arg3_name)
1473+ arg2_type, arg2_name, arg3_type, arg3_name) \
1474+ __RTE_BIT_OVERLOAD_V_4R(family, v_, fun, qualifier volatile, size, ret_type, \
1475+ arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name)
14331476
14341477#define __RTE_BIT_OVERLOAD_4R (family , fun , qualifier , ret_type , arg1_type , arg1_name , \
14351478 arg2_type , arg2_name , arg3_type , arg3_name ) \
0 commit comments