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>
//#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)
}
/* Emulate the instruction in the opcode. */
-/* ??? This is not thread safe. */
unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa)
{
unsigned int nRc = 0;
float_status fp_status; /* QEMU float emulator status */
} FPA11;
-extern FPA11* qemufpa;
+extern __thread FPA11* qemufpa;
void resetFPA11(void);
void SetRoundingMode(const unsigned int);