Fix: c99: use __asm__ __volatile__
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 8 Mar 2023 21:53:32 +0000 (16:53 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 8 Mar 2023 21:53:32 +0000 (16:53 -0500)
Allow building with -std=c99 by using __asm__ __volatile__ rather than
asm volatile.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ideed00c3847065327c6d195d0b95b882dd82c2c3

14 files changed:
src/common/ringbuffer-clients/template.h
src/common/ringbuffer/frontend_api.h
src/common/ringbuffer/ring_buffer_frontend.c
src/lib/lttng-ust-common/fd-tracker.c
src/lib/lttng-ust-libc-wrapper/lttng-ust-malloc.c
src/lib/lttng-ust/lttng-context-cgroup-ns.c
src/lib/lttng-ust/lttng-context-ipc-ns.c
src/lib/lttng-ust/lttng-context-net-ns.c
src/lib/lttng-ust/lttng-context-perf-counters.c
src/lib/lttng-ust/lttng-context-procname.c
src/lib/lttng-ust/lttng-context-time-ns.c
src/lib/lttng-ust/lttng-context-uts-ns.c
src/lib/lttng-ust/lttng-context-vtid.c
src/lib/lttng-ust/lttng-ust-comm.c

index 824c344d5e7f4980f308774f77daee5f7cac7308..fe8f8e020d22af883bd9daecd1f156620eb4308c 100644 (file)
@@ -74,7 +74,7 @@ static DEFINE_URCU_TLS(private_ctx_stack_t, private_ctx_stack);
  */
 void RING_BUFFER_MODE_TEMPLATE_ALLOC_TLS(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(private_ctx_stack)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(private_ctx_stack)));
 }
 
 static inline uint64_t lib_ring_buffer_clock_read(
index a697ed2e0082c5a8adc0fe352cac543cdeb265c9..e35070736e36f32875e9512921c941a585147cbe 100644 (file)
@@ -26,7 +26,7 @@
  * Returns a nesting level >= 0 on success, -EPERM on failure (nesting
  * count too high).
  *
- * asm volatile and "memory" clobber prevent the compiler from moving
+ * __asm__ __volatile__ and "memory" clobber prevent the compiler from moving
  * instructions out of the ring buffer nesting count. This is required to ensure
  * that probe side-effects which can cause recursion (e.g. unforeseen traps,
  * divisions by 0, ...) are triggered within the incremented nesting count
index 817cc842a3d49373773b714c184cbc4058395a65..5dcc0be7263940a8e54973474b89d59f648a7a0d 100644 (file)
@@ -2582,7 +2582,7 @@ void lib_ring_buffer_check_deliver_slow(const struct lttng_ust_ring_buffer_confi
  */
 void lttng_ringbuffer_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(lib_ring_buffer_nesting)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(lib_ring_buffer_nesting)));
 }
 
 void lib_ringbuffer_signal_init(void)
index 70539cabe376e541635363f13e93b7d11517f5d1..a17907d03f3d426c2bf14443e3b472435b3392a7 100644 (file)
@@ -76,7 +76,7 @@ static int init_done;
  */
 void lttng_ust_fd_tracker_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(ust_fd_mutex_nest)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(ust_fd_mutex_nest)));
 }
 
 /*
index 3951f5b0fa3111283b71b7021fc67a9f16f5ee73..c96a51c9cce45bb2a4410e451e6a8281c029edf2 100644 (file)
@@ -428,7 +428,7 @@ int posix_memalign(void **memptr, size_t alignment, size_t size)
 static
 void lttng_ust_malloc_nesting_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(malloc_nesting)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(malloc_nesting)));
 }
 
 void lttng_ust_libc_wrapper_malloc_ctor(void)
index 34523ea1ad96b33f2bacdb48860597309283392c..7e49a7dc5119908c4af77626cf180897ff09188a 100644 (file)
@@ -157,5 +157,5 @@ error_find_context:
  */
 void lttng_cgroup_ns_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(cached_cgroup_ns)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(cached_cgroup_ns)));
 }
index 63401e8d5889a6ce7f8fabb6b45c17684b1340d5..f076e30736ceee6a35eb571bcdb9a372cc01c745 100644 (file)
@@ -155,5 +155,5 @@ error_find_context:
  */
 void lttng_ipc_ns_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(cached_ipc_ns)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(cached_ipc_ns)));
 }
index 960591c2586e41c0543d2aa975d6c9da5e7a13ff..1991473bdacda475023c2ee44fa844e371d801c0 100644 (file)
@@ -155,5 +155,5 @@ error_find_context:
  */
 void lttng_net_ns_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(cached_net_ns)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(cached_net_ns)));
 }
index 2db11436a9ad8fa320f7092d9420e21972dc2ad6..37be77df32f7e9911cdb80b3aad9001988f61b6a 100644 (file)
@@ -89,7 +89,7 @@ static DEFINE_URCU_TLS(int, ust_perf_mutex_nest);
  */
 void lttng_ust_perf_counter_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(ust_perf_mutex_nest)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(ust_perf_mutex_nest)));
 }
 
 void lttng_perf_lock(void)
@@ -181,7 +181,7 @@ uint64_t rdpmc(unsigned int counter)
 {
        unsigned int low, high;
 
-       asm volatile("rdpmc" : "=a" (low), "=d" (high) : "c" (counter));
+       __asm__ __volatile__("rdpmc" : "=a" (low), "=d" (high) : "c" (counter));
 
        return low | ((uint64_t) high) << 32;
 }
index b5bf77be611b28ee3d6d87ac5415da0470acafc6..66efefd9238895f2699179a7b3ffd8a6813d6a1f 100644 (file)
@@ -124,5 +124,5 @@ error_find_context:
  */
 void lttng_procname_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(cached_procname)[0]));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(cached_procname)[0]));
 }
index ec32a1deea2881793af572f95753f49fa02fd201..ff1e95d5dd8c97b71ad6386ad35a156674c5de7e 100644 (file)
@@ -154,5 +154,5 @@ error_find_context:
  */
 void lttng_time_ns_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(cached_time_ns)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(cached_time_ns)));
 }
index 06a978fd4184d561c9ff437a760bbd3ea7203bda..662209473ab151ef9294d99797098714e62eab86 100644 (file)
@@ -156,5 +156,5 @@ error_find_context:
  */
 void lttng_uts_ns_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(cached_uts_ns)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(cached_uts_ns)));
 }
index 880e34b90a1dae8aa9b95eec305ceaa08d0b5176..cfd0a117086b7d69b4f4ab2979b6d25aae8e40c8 100644 (file)
@@ -114,5 +114,5 @@ error_find_context:
  */
 void lttng_vtid_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(cached_vtid)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(cached_vtid)));
 }
index a07e1e12483bf051e68d973883fc439e9b611c44..d0cb9f249bdf158da42a064493809bd867967b6d 100644 (file)
@@ -389,13 +389,13 @@ const char *get_lttng_home_dir(void)
 static
 void lttng_nest_count_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(lttng_ust_nest_count)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(lttng_ust_nest_count)));
 }
 
 static
 void lttng_ust_mutex_nest_alloc_tls(void)
 {
-       asm volatile ("" : : "m" (URCU_TLS(ust_mutex_nest)));
+       __asm__ __volatile__ ("" : : "m" (URCU_TLS(ust_mutex_nest)));
 }
 
 /*
This page took 0.031947 seconds and 4 git commands to generate.