]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
linux-user/arm/nwfpe: Use thread-local storage for qemufpa
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 13 Apr 2026 23:02:51 +0000 (09:02 +1000)
committerHelge Deller <deller@gmx.de>
Fri, 24 Apr 2026 22:38:32 +0000 (00:38 +0200)
Fix the thread safety of the emulation by not storing a
pointer in global storage.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Helge Deller <deller@gmx.de>
linux-user/arm/nwfpe/fpa11.c
linux-user/arm/nwfpe/fpa11.h

index 44783934b2ed8a7b8b5a41277691d1605e9a7d90..15888463f7ae78da01b4163c778afea5b1aab91b 100644 (file)
@@ -29,7 +29,7 @@
 //#include <asm/system.h>
 
 
-FPA11* qemufpa = NULL;
+__thread FPA11* qemufpa = NULL;
 
 /* Reset the FPA11 chip.  Called to initialize and reset the emulator. */
 void resetFPA11(void)
@@ -154,7 +154,6 @@ void SetRoundingPrecision(const unsigned int opcode)
 }
 
 /* Emulate the instruction in the opcode. */
-/* ??? This is not thread safe.  */
 unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa)
 {
   unsigned int nRc = 0;
index 20f9d2eb81dc2027b0d92f3acac0750ba16a3d22..659d38ae3aafaf4f8913e13436c0e3e4c14e4eb2 100644 (file)
@@ -74,7 +74,7 @@ typedef struct tagFPA11 {
     float_status fp_status;      /* QEMU float emulator status */
 } FPA11;
 
-extern FPA11* qemufpa;
+extern __thread FPA11* qemufpa;
 
 void resetFPA11(void);
 void SetRoundingMode(const unsigned int);