diff options
Diffstat (limited to 'src/dev')
-rw-r--r-- | src/dev/storage/ide_ctrl.cc | 2 | ||||
-rw-r--r-- | src/dev/storage/ide_ctrl.hh | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/dev/storage/ide_ctrl.cc b/src/dev/storage/ide_ctrl.cc index d1c9f7d73..12d606bee 100644 --- a/src/dev/storage/ide_ctrl.cc +++ b/src/dev/storage/ide_ctrl.cc @@ -83,7 +83,7 @@ IdeController::Channel::Channel( cmdAddr(0), cmdSize(_cmdSize), ctrlAddr(0), ctrlSize(_ctrlSize), master(NULL), slave(NULL), selected(NULL) { - memset(&bmiRegs, 0, sizeof(bmiRegs)); + bmiRegs.reset(); bmiRegs.status.dmaCap0 = 1; bmiRegs.status.dmaCap1 = 1; } diff --git a/src/dev/storage/ide_ctrl.hh b/src/dev/storage/ide_ctrl.hh index 94a9c65e5..24d3da02a 100644 --- a/src/dev/storage/ide_ctrl.hh +++ b/src/dev/storage/ide_ctrl.hh @@ -81,6 +81,10 @@ class IdeController : public PciDevice /** Registers used for bus master interface */ struct BMIRegs { + void reset() { + memset(static_cast<void *>(this), 0, sizeof(*this)); + } + BMICommandReg command; uint8_t reserved0; BMIStatusReg status; |