|
From: | Paolo Bonzini |
Subject: | Re: [PATCH v4 1/4] tls: add macros for coroutine-safe TLS variables |
Date: | Wed, 23 Feb 2022 10:47:06 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
On 2/21/22 15:29, Stefan Hajnoczi wrote:
+#define QEMU_DEFINE_CO_TLS(type, var) \ + static __thread type co_tls_##var; \ + type get_##var(void) { asm volatile(""); return co_tls_##var; } \ + void set_##var(type v) { asm volatile(""); co_tls_##var = v; } \ + type *get_ptr_##var(void) \ + { type *ptr = &co_tls_##var; asm volatile("" : "+rm" (ptr)); return ptr; } +
Is noinline needed here too in case LTO is used? Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |