diff --git a/src/dev/x86/cmos.cc b/src/dev/x86/cmos.cc index 19fab68078..d1419221c3 100644 --- a/src/dev/x86/cmos.cc +++ b/src/dev/x86/cmos.cc @@ -56,7 +56,7 @@ X86ISA::Cmos::read(PacketPtr pkt) pkt->setLE(address); break; case 0x1: - pkt->setLE(readRegister(address)); + pkt->setLE(readRegister(address.regNum)); break; default: panic("Read from undefined CMOS port.\n"); @@ -75,7 +75,8 @@ X86ISA::Cmos::write(PacketPtr pkt) address = pkt->getLE(); break; case 0x1: - writeRegister(address, pkt->getLE()); + // Ignore the NMI mask bit since we never try to generate one anyway. + writeRegister(address.regNum, pkt->getLE()); break; default: panic("Write to undefined CMOS port.\n"); diff --git a/src/dev/x86/cmos.hh b/src/dev/x86/cmos.hh index 72937af372..de64d5acd4 100644 --- a/src/dev/x86/cmos.hh +++ b/src/dev/x86/cmos.hh @@ -29,6 +29,7 @@ #ifndef __DEV_X86_CMOS_HH__ #define __DEV_X86_CMOS_HH__ +#include "base/bitunion.hh" #include "dev/intpin.hh" #include "dev/io_device.hh" #include "dev/mc146818.hh" @@ -45,7 +46,12 @@ class Cmos : public BasicPioDevice protected: Tick latency; - uint8_t address; + BitUnion8(CmosAddress) + Bitfield<6, 0> regNum; + Bitfield<7> nmiMask; + EndBitUnion(CmosAddress) + + CmosAddress address; static const int numRegs = 128;