diff --git a/src/dev/x86/i8259.cc b/src/dev/x86/i8259.cc index c78e12967f..9596eee96d 100644 --- a/src/dev/x86/i8259.cc +++ b/src/dev/x86/i8259.cc @@ -39,12 +39,8 @@ namespace gem5 { -X86ISA::I8259::I8259(const Params &p) - : BasicPioDevice(p, 2), - latency(p.pio_latency), - mode(p.mode), slave(p.slave), - IRR(0), ISR(0), IMR(0), - readIRR(true), initControlWord(0), autoEOI(false) +X86ISA::I8259::I8259(const Params &p) : BasicPioDevice(p, 2), + latency(p.pio_latency), mode(p.mode), slave(p.slave) { for (int i = 0; i < p.port_output_connection_count; i++) { output.push_back(new IntSourcePin( @@ -58,9 +54,6 @@ X86ISA::I8259::I8259(const Params &p) inputs.push_back(new IntSinkPin( csprintf("%s.inputs[%d]", name(), i), i, this)); } - - for (bool &state: pinStates) - state = false; } AddrRangeList diff --git a/src/dev/x86/i8259.hh b/src/dev/x86/i8259.hh index afd4894532..485664dbd4 100644 --- a/src/dev/x86/i8259.hh +++ b/src/dev/x86/i8259.hh @@ -43,8 +43,8 @@ namespace X86ISA class I8259 : public BasicPioDevice { protected: - static const int NumLines = 8; - bool pinStates[NumLines]; + static const inline int NumLines = 8; + bool pinStates[NumLines] = {}; void init() override; @@ -52,33 +52,33 @@ class I8259 : public BasicPioDevice std::vector *> output; std::vector *> inputs; enums::X86I8259CascadeMode mode; - I8259 *slave; + I8259 *slave = nullptr; // Interrupt Request Register - uint8_t IRR; + uint8_t IRR = 0; // In Service Register - uint8_t ISR; + uint8_t ISR = 0; // Interrupt Mask Register - uint8_t IMR; + uint8_t IMR = 0; // The higher order bits of the vector to return - uint8_t vectorOffset; + uint8_t vectorOffset = 0; - bool cascadeMode; + bool cascadeMode = false; // A bit vector of lines with responders attached, or the // responder id, depending // on if this is a requestor or responder PIC. - uint8_t cascadeBits; + uint8_t cascadeBits = 0; - bool edgeTriggered; - bool readIRR; + bool edgeTriggered = true; + bool readIRR = true; // State machine information for reading in initialization control words. - bool expectICW4; - int initControlWord; + bool expectICW4 = false; + int initControlWord = 0; // Whether or not the PIC is in auto EOI mode. - bool autoEOI; + bool autoEOI = false; void requestInterrupt(int line); void handleEOI(int line);