qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Portable inline asm to get address of TLS variable


From: Paolo Bonzini
Subject: Re: Portable inline asm to get address of TLS variable
Date: Thu, 17 Feb 2022 16:51:06 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 2/17/22 16:02, Serge Guelton wrote:
I took a quick look at C++20 coroutines since they are available in
compilers but the primitives look hard to use even from C++, let alone
>from C.

They're C++ only in GCC, too.  I really think that QEMU should be
compilable in C++, but I'm not sure how easy a sell it is.
It's perfectly fine to have one compilation unit written in C++ with a few
symbol in `extern "C"`. No need to touch the other part of the project.

It's not just one compilation unit, it's everything that uses coroutines so basically all of block/. But yes, good point---it means for example that you don't have to deal as much with lack of operators in C++ enums, which would be a huge PITA in compiling QEMU with C++. There would still be some churn such as adding extern "C" blocks to headers, etc.

The main change with C++20 coroutines would be to introduce co_await, co_return and std::future<> everywhere, which is also a pretty substantial change (possibly an improvement in the case of co_await and co_return, but still a lot of work).

That said, it's certainly valuable to try and get at least tests/unit/test-coroutine.c to run with C++ coroutines, and see how much work that is.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]