Changed Fault from a FaultBase * to a RefCountingPtr, added "new"s where appropriate, and took away the constant examples of each fault which where for comparing to a fault to determine its type.
arch/alpha/alpha_memory.cc:
arch/alpha/isa/decoder.isa:
Added news where faults are created.
arch/alpha/ev5.cc:
Changed places where a fault was compared to a fault type to use isA rather than ==
arch/alpha/faults.cc:
arch/alpha/faults.hh:
Changed Fault to be a RefCountingPtr
arch/alpha/isa/fp.isa:
Added a new where a FloatEnableFault was created.
arch/alpha/isa/unimp.isa:
arch/alpha/isa/unknown.isa:
Added a new where an UnimplementedFault is created.
base/refcnt.hh:
Added include of stddef.h for the NULL macro
cpu/base_dyn_inst.cc:
Added a new where an UnimplementedOpcodeFault is created.
cpu/o3/alpha_cpu_impl.hh:
Changed places where a fault was compared to a fault type to use isA rather than ==. Also changed fault->name to fault->name()
cpu/o3/regfile.hh:
Added new where UnimplementedOpcodeFaults are created.
cpu/simple/cpu.cc:
Changed places where a fault was compared to a fault type to use isA rather than ==. Also added a new where an Interrupt fault is created.
dev/alpha_console.cc:
Added news where MachineCheckFaults are created.
dev/pcidev.hh:
Added news where MachineCheckFaults are generated.
dev/sinic.cc:
Changed places where a fault was compared to a fault type to use isA rather than ==. Added news where MachineCheckFaults are created. Fixed a problem where m5.fast had unused variables.
kern/kernel_stats.cc:
Commented out where _faults is initialized. This statistic will probably be moved elsewhere in the future.
kern/kernel_stats.hh:
Commented out the declaration of _fault. when fault() is called, the fault increments its own stat.
sim/faults.cc:
sim/faults.hh:
Changed Fault from a FaultBase * to a RefCountingPtr.
--HG--
extra : convert_revision : b40ccfc42482d5a115e111dd897fa378d23c6c7d
This commit is contained in:
@@ -184,7 +184,7 @@ AlphaConsole::read(MemReqPtr &req, uint8_t *data)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return MachineCheckFault;
|
||||
return new MachineCheckFault;
|
||||
}
|
||||
|
||||
return NoFault;
|
||||
@@ -204,7 +204,7 @@ AlphaConsole::write(MemReqPtr &req, const uint8_t *data)
|
||||
val = *(uint64_t *)data;
|
||||
break;
|
||||
default:
|
||||
return MachineCheckFault;
|
||||
return new MachineCheckFault;
|
||||
}
|
||||
|
||||
Addr daddr = req->paddr - (addr & EV5::PAddrImplMask);
|
||||
@@ -257,7 +257,7 @@ AlphaConsole::write(MemReqPtr &req, const uint8_t *data)
|
||||
break;
|
||||
|
||||
default:
|
||||
return MachineCheckFault;
|
||||
return new MachineCheckFault;
|
||||
}
|
||||
|
||||
return NoFault;
|
||||
|
||||
@@ -272,7 +272,7 @@ PciDev::readBar(MemReqPtr &req, uint8_t *data)
|
||||
return readBar4(req, req->paddr - BARAddrs[4], data);
|
||||
if (isBAR(req->paddr, 5))
|
||||
return readBar5(req, req->paddr - BARAddrs[5], data);
|
||||
return MachineCheckFault;
|
||||
return new MachineCheckFault;
|
||||
}
|
||||
|
||||
inline Fault
|
||||
@@ -290,7 +290,7 @@ PciDev::writeBar(MemReqPtr &req, const uint8_t *data)
|
||||
return writeBar4(req, req->paddr - BARAddrs[4], data);
|
||||
if (isBAR(req->paddr, 5))
|
||||
return writeBar5(req, req->paddr - BARAddrs[5], data);
|
||||
return MachineCheckFault;
|
||||
return new MachineCheckFault;
|
||||
}
|
||||
|
||||
#endif // __DEV_PCIDEV_HH__
|
||||
|
||||
19
dev/sinic.cc
19
dev/sinic.cc
@@ -363,11 +363,11 @@ Device::read(MemReqPtr &req, uint8_t *data)
|
||||
assert(config.command & PCI_CMD_MSE);
|
||||
Fault fault = readBar(req, data);
|
||||
|
||||
if (fault == MachineCheckFault) {
|
||||
if (fault->isA<MachineCheckFault>()) {
|
||||
panic("address does not map to a BAR pa=%#x va=%#x size=%d",
|
||||
req->paddr, req->vaddr, req->size);
|
||||
|
||||
return MachineCheckFault;
|
||||
return new MachineCheckFault;
|
||||
}
|
||||
|
||||
return fault;
|
||||
@@ -459,11 +459,11 @@ Device::write(MemReqPtr &req, const uint8_t *data)
|
||||
assert(config.command & PCI_CMD_MSE);
|
||||
Fault fault = writeBar(req, data);
|
||||
|
||||
if (fault == MachineCheckFault) {
|
||||
if (fault->isA<MachineCheckFault>()) {
|
||||
panic("address does not map to a BAR pa=%#x va=%#x size=%d",
|
||||
req->paddr, req->vaddr, req->size);
|
||||
|
||||
return MachineCheckFault;
|
||||
return new MachineCheckFault;
|
||||
}
|
||||
|
||||
return fault;
|
||||
@@ -489,12 +489,17 @@ Device::writeBar0(MemReqPtr &req, Addr daddr, const uint8_t *data)
|
||||
panic("invalid size for %s: cpu=%d da=%#x pa=%#x va=%#x size=%d",
|
||||
info.name, cpu, daddr, req->paddr, req->vaddr, req->size);
|
||||
|
||||
//These are commmented out because when the DPRINTF below isn't used,
|
||||
//these values aren't used and gcc issues a warning. With -Werror,
|
||||
//this prevents compilation.
|
||||
//uint32_t reg32 = *(uint32_t *)data;
|
||||
uint64_t reg64 = *(uint64_t *)data;
|
||||
//uint64_t reg64 = *(uint64_t *)data;
|
||||
DPRINTF(EthernetPIO,
|
||||
"write %s: cpu=%d val=%#x da=%#x pa=%#x va=%#x size=%d\n",
|
||||
info.name, cpu, info.size == 4 ? (*(uint32_t *)data) : reg64, daddr,
|
||||
req->paddr, req->vaddr, req->size);
|
||||
info.name, cpu, info.size == 4 ?
|
||||
(*(uint32_t *)data) :
|
||||
(*(uint32_t *)data),
|
||||
daddr, req->paddr, req->vaddr, req->size);
|
||||
|
||||
prepareWrite(cpu, index);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user