arch-x86,arch-arm: Remove static variables in decoders (#1643)
There were a number of variables in the arm and x86 decoders that are static (e.g., the decode cache). It's a bit interesting that this doesn't cause problems with multiple cores since each core has its own decoder. However, this causes segfaults if you run different cores on different *host* threads. We are experimenting with running gem5 with multiple host thread (i.e., in parallel), and removing these static variables resolves the segfault. This change also adds const to any other static variables to ensure that they cannot be modified. Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
This commit is contained in:
@@ -94,7 +94,7 @@ class Decoder : public InstDecoder
|
||||
enums::DecoderFlavor decoderFlavor;
|
||||
|
||||
/// A cache of decoded instruction objects.
|
||||
static GenericISA::BasicDecodeCache<Decoder, ExtMachInst> defaultCache;
|
||||
GenericISA::BasicDecodeCache<Decoder, ExtMachInst> defaultCache;
|
||||
friend class GenericISA::BasicDecodeCache<Decoder, ExtMachInst>;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user