}
-Fault *
+Fault
AlphaITB::translate(MemReqPtr &req) const
{
InternalProcReg *ipr = req->xc->regs.ipr;
}
}
-Fault *
+Fault
AlphaDTB::translate(MemReqPtr &req, bool write) const
{
RegFile *regs = &req->xc->regs;
fault(req, (write ? MM_STAT_WR_MASK : 0) |
MM_STAT_DTB_MISS_MASK);
if (write) { write_misses++; } else { read_misses++; }
- return (req->flags & VPTE) ? (Fault *)PDtbMissFault : (Fault *)NDtbMissFault;
+ return (req->flags & VPTE) ? (Fault)PDtbMissFault : (Fault)NDtbMissFault;
}
req->paddr = (pte->ppn << AlphaISA::PageShift) +
AlphaITB(const std::string &name, int size);
virtual void regStats();
- Fault * translate(MemReqPtr &req) const;
+ Fault translate(MemReqPtr &req) const;
};
class AlphaDTB : public AlphaTLB
AlphaDTB(const std::string &name, int size);
virtual void regStats();
- Fault * translate(MemReqPtr &req, bool write) const;
+ Fault translate(MemReqPtr &req, bool write) const;
};
#endif // __ALPHA_MEMORY_HH__
// alpha exceptions - value equals trap address, update with MD_FAULT_TYPE
//
const Addr
-AlphaISA::fault_addr(Fault * fault)
+AlphaISA::fault_addr(Fault fault)
{
//Check for the system wide faults
if(fault == NoFault) return 0x0000;
}
void
-ExecContext::ev5_trap(Fault * fault)
+ExecContext::ev5_trap(Fault fault)
{
DPRINTF(Fault, "Fault %s at PC: %#x\n", fault->name, regs.pc);
cpu->recordEvent(csprintf("Fault %s", fault->name));
void
-AlphaISA::intr_post(RegFile *regs, Fault * fault, Addr pc)
+AlphaISA::intr_post(RegFile *regs, Fault fault, Addr pc)
{
InternalProcReg *ipr = regs->ipr;
bool use_pc = (fault == NoFault);
// that's it! (orders of magnitude less painful than x86)
}
-Fault *
+Fault
ExecContext::hwrei()
{
uint64_t *ipr = regs.ipr;
}
uint64_t
-ExecContext::readIpr(int idx, Fault * &fault)
+ExecContext::readIpr(int idx, Fault &fault)
{
uint64_t *ipr = regs.ipr;
uint64_t retval = 0; // return value, default 0
int break_ipl = -1;
#endif
-Fault *
+Fault
ExecContext::setIpr(int idx, uint64_t val)
{
uint64_t *ipr = regs.ipr;
IntegerOverflowFaultType * const IntegerOverflowFault =
new IntegerOverflowFaultType("intover", 16, 0x0501);
-Fault ** ListOfFaults[] = {
- (Fault **)&NoFault,
- (Fault **)&ResetFault,
- (Fault **)&MachineCheckFault,
- (Fault **)&ArithmeticFault,
- (Fault **)&InterruptFault,
- (Fault **)&NDtbMissFault,
- (Fault **)&PDtbMissFault,
- (Fault **)&AlignmentFault,
- (Fault **)&DtbPageFault,
- (Fault **)&DtbAcvFault,
- (Fault **)&ItbMissFault,
- (Fault **)&ItbPageFault,
- (Fault **)&ItbAcvFault,
- (Fault **)&UnimplementedOpcodeFault,
- (Fault **)&FloatEnableFault,
- (Fault **)&PalFault,
- (Fault **)&IntegerOverflowFault,
+Fault * ListOfFaults[] = {
+ (Fault *)&NoFault,
+ (Fault *)&ResetFault,
+ (Fault *)&MachineCheckFault,
+ (Fault *)&ArithmeticFault,
+ (Fault *)&InterruptFault,
+ (Fault *)&NDtbMissFault,
+ (Fault *)&PDtbMissFault,
+ (Fault *)&AlignmentFault,
+ (Fault *)&DtbPageFault,
+ (Fault *)&DtbAcvFault,
+ (Fault *)&ItbMissFault,
+ (Fault *)&ItbPageFault,
+ (Fault *)&ItbAcvFault,
+ (Fault *)&UnimplementedOpcodeFault,
+ (Fault *)&FloatEnableFault,
+ (Fault *)&PalFault,
+ (Fault *)&IntegerOverflowFault,
};
-int NumFaults = sizeof(ListOfFaults) / sizeof(Fault **);
+int NumFaults = sizeof(ListOfFaults) / sizeof(Fault *);
#include "sim/faults.hh"
#include "arch/isa_traits.hh" //For the Addr type
-class AlphaFault : public Fault
+class AlphaFault : public FaultBase
{
public:
AlphaFault(char * newName, int newId, Addr newVect)
- : Fault(newName, newId), vect(newVect)
+ : FaultBase(newName, newId), vect(newVect)
{;}
Addr vect;
{;}
} * const IntegerOverflowFault;
-extern Fault ** ListOfFaults[];
+extern Fault * ListOfFaults[];
extern int NumFaults;
#endif // __FAULTS_HH__
/// @retval Full-system mode: NoFault if FP is enabled, FenFault
/// if not. Non-full-system mode: always returns NoFault.
#if FULL_SYSTEM
- inline Fault * checkFpEnableFault(%(CPU_exec_context)s *xc)
+ inline Fault checkFpEnableFault(%(CPU_exec_context)s *xc)
{
- Fault * fault = NoFault; // dummy... this ipr access should not fault
+ Fault fault = NoFault; // dummy... this ipr access should not fault
if (!EV5::ICSR_FPE(xc->readIpr(AlphaISA::IPR_ICSR, fault))) {
fault = FloatEnableFault;
}
return fault;
}
#else
- inline Fault * checkFpEnableFault(%(CPU_exec_context)s *xc)
+ inline Fault checkFpEnableFault(%(CPU_exec_context)s *xc)
{
return NoFault;
}
// FP instruction class execute method template. Handles non-standard
// rounding modes.
def template FloatingPointExecute {{
- Fault * %(class_name)s::execute(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
if (trappingMode != Imprecise && !warnedOnTrapping) {
warnedOnTrapping = true;
}
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
// rounding mode control is needed. Like BasicExecute, but includes
// check & warning for non-standard trapping mode.
def template FPFixedRoundingExecute {{
- Fault * %(class_name)s::execute(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
if (trappingMode != Imprecise && !warnedOnTrapping) {
warnedOnTrapping = true;
}
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
// Declarations for execute() methods.
def template BasicExecDeclare {{
- Fault * execute(%(CPU_exec_context)s *, Trace::InstRecord *) const;
+ Fault execute(%(CPU_exec_context)s *, Trace::InstRecord *) const;
}};
// Basic instruction class declaration template.
// Basic instruction class execute method template.
def template BasicExecute {{
- Fault * %(class_name)s::execute(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
}};
output exec {{
- Fault *
+ Fault
Nop::execute(%(CPU_exec_context)s *, Trace::InstRecord *) const
{
return NoFault;
def template InitiateAccDeclare {{
- Fault * initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const;
+ Fault initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const;
}};
def template CompleteAccDeclare {{
- Fault * completeAcc(uint8_t *, %(CPU_exec_context)s *, Trace::InstRecord *) const;
+ Fault completeAcc(uint8_t *, %(CPU_exec_context)s *, Trace::InstRecord *) const;
}};
def template EACompExecute {{
- Fault *
+ Fault
%(class_name)s::EAComp::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
}};
def template LoadMemAccExecute {{
- Fault *
+ Fault
%(class_name)s::MemAcc::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
def template LoadExecute {{
- Fault * %(class_name)s::execute(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
def template LoadInitiateAcc {{
- Fault * %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_src_decl)s;
def template LoadCompleteAcc {{
- Fault * %(class_name)s::completeAcc(uint8_t *data,
+ Fault %(class_name)s::completeAcc(uint8_t *data,
%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_src_decl)s;
def template StoreMemAccExecute {{
- Fault *
+ Fault
%(class_name)s::MemAcc::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
uint64_t write_result = 0;
%(fp_enable_check)s;
def template StoreExecute {{
- Fault * %(class_name)s::execute(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
uint64_t write_result = 0;
%(fp_enable_check)s;
}};
def template StoreInitiateAcc {{
- Fault * %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
uint64_t write_result = 0;
%(fp_enable_check)s;
def template StoreCompleteAcc {{
- Fault * %(class_name)s::completeAcc(uint8_t *data,
+ Fault %(class_name)s::completeAcc(uint8_t *data,
%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
- Fault * fault = NoFault;
+ Fault fault = NoFault;
uint64_t write_result = 0;
%(fp_enable_check)s;
def template MiscMemAccExecute {{
- Fault * %(class_name)s::MemAcc::execute(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::MemAcc::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
}};
def template MiscExecute {{
- Fault * %(class_name)s::execute(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
}};
def template MiscInitiateAcc {{
- Fault * %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
panic("Misc instruction does not support split access method!");
def template MiscCompleteAcc {{
- Fault * %(class_name)s::completeAcc(uint8_t *data,
+ Fault %(class_name)s::completeAcc(uint8_t *data,
%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
}};
output exec {{
- Fault *
+ Fault
FailUnimplemented::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
return UnimplementedOpcodeFault;
}
- Fault *
+ Fault
WarnUnimplemented::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
}};
output exec {{
- Fault *
+ Fault
Unknown::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
def template InitiateAccDeclare {{
- Fault * initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const;
+ Fault initiateAcc(%(CPU_exec_context)s *, Trace::InstRecord *) const;
}};
def template CompleteAccDeclare {{
- Fault * completeAcc(uint8_t *, %(CPU_exec_context)s *, Trace::InstRecord *) const;
+ Fault completeAcc(uint8_t *, %(CPU_exec_context)s *, Trace::InstRecord *) const;
}};
def template EACompExecute {{
- Fault *
+ Fault
%(class_name)s::EAComp::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
}};
def template LoadMemAccExecute {{
- Fault *
+ Fault
%(class_name)s::MemAcc::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
def template LoadExecute {{
- Fault * %(class_name)s::execute(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_decl)s;
def template LoadInitiateAcc {{
- Fault * %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_src_decl)s;
def template LoadCompleteAcc {{
- Fault * %(class_name)s::completeAcc(uint8_t *data,
+ Fault %(class_name)s::completeAcc(uint8_t *data,
%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
- Fault * fault = NoFault;
+ Fault fault = NoFault;
%(fp_enable_check)s;
%(op_src_decl)s;
def template StoreMemAccExecute {{
- Fault *
+ Fault
%(class_name)s::MemAcc::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
uint64_t write_result = 0;
%(fp_enable_check)s;
def template StoreExecute {{
- Fault * %(class_name)s::execute(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
uint64_t write_result = 0;
%(fp_enable_check)s;
}};
def template StoreInitiateAcc {{
- Fault * %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
+ Fault %(class_name)s::initiateAcc(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
Addr EA;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
uint64_t write_result = 0;
%(fp_enable_check)s;
def template StoreCompleteAcc {{
- Fault * %(class_name)s::completeAcc(uint8_t *data,
+ Fault %(class_name)s::completeAcc(uint8_t *data,
%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
- Fault * fault = NoFault;
+ Fault fault = NoFault;
uint64_t write_result = 0;
%(fp_enable_check)s;
fault = NoFault;
// note this is a local, not BaseDynInst::fault
- Fault * trans_fault = xc->translateDataReadReq(req);
+ Fault trans_fault = xc->translateDataReadReq(req);
if (trans_fault == NoFault && !(req->flags & UNCACHEABLE)) {
// It's a valid address to cacheable space. Record key MemReq
* @todo Need to find a way to get the cache block size here.
*/
template <class Impl>
-Fault *
+Fault
BaseDynInst<Impl>::copySrcTranslate(Addr src)
{
MemReqPtr req = new MemReq(src, xc, 64);
req->asid = asid;
// translate to physical address
- Fault * fault = xc->translateDataReadReq(req);
+ Fault fault = xc->translateDataReadReq(req);
if (fault == NoFault) {
xc->copySrcAddr = src;
* @todo Need to find a way to get the cache block size here.
*/
template <class Impl>
-Fault *
+Fault
BaseDynInst<Impl>::copy(Addr dest)
{
uint8_t data[64];
req->asid = asid;
// translate to physical address
- Fault * fault = xc->translateDataWriteReq(req);
+ Fault fault = xc->translateDataWriteReq(req);
if (fault == NoFault) {
Addr dest_addr = req->paddr;
#if 0
template <class Impl>
-Fault *
+Fault
BaseDynInst<Impl>::mem_access(mem_cmd cmd, Addr addr, void *p, int nbytes)
{
- Fault * fault;
+ Fault fault;
// check alignments, even speculative this test should always pass
if ((nbytes & nbytes - 1) != 0 || (addr & nbytes - 1) != 0) {
Trace::InstRecord *traceData;
template <class T>
- Fault * read(Addr addr, T &data, unsigned flags);
+ Fault read(Addr addr, T &data, unsigned flags);
template <class T>
- Fault * write(T data, Addr addr, unsigned flags,
+ Fault write(T data, Addr addr, unsigned flags,
uint64_t *res);
void prefetch(Addr addr, unsigned flags);
void writeHint(Addr addr, int size, unsigned flags);
- Fault * copySrcTranslate(Addr src);
- Fault * copy(Addr dest);
+ Fault copySrcTranslate(Addr src);
+ Fault copy(Addr dest);
/** @todo: Consider making this private. */
public:
ExecContext *xc;
/** The kind of fault this instruction has generated. */
- Fault * fault;
+ Fault fault;
/** The effective virtual address (lds & stores only). */
Addr effAddr;
public:
void
- trace_mem(Fault * fault, // last fault
+ trace_mem(Fault fault, // last fault
MemCmd cmd, // last command
Addr addr, // virtual address of access
void *p, // memory accessed
void dump(std::string &outstring);
/** Returns the fault type. */
- Fault * getFault() { return fault; }
+ Fault getFault() { return fault; }
/** Checks whether or not this instruction has had its branch target
* calculated yet. For now it is not utilized and is hacked to be
template<class Impl>
template<class T>
-inline Fault *
+inline Fault
BaseDynInst<Impl>::read(Addr addr, T &data, unsigned flags)
{
MemReqPtr req = new MemReq(addr, xc, sizeof(T), flags);
template<class Impl>
template<class T>
-inline Fault *
+inline Fault
BaseDynInst<Impl>::write(T data, Addr addr, unsigned flags, uint64_t *res)
{
if (traceData) {
}
void
-ExecContext::trap(Fault * fault)
+ExecContext::trap(Fault fault)
{
//TheISA::trap(fault); //One possible way to do it...
int getInstAsid() { return regs.instAsid(); }
int getDataAsid() { return regs.dataAsid(); }
- Fault * translateInstReq(MemReqPtr &req)
+ Fault translateInstReq(MemReqPtr &req)
{
return itb->translate(req);
}
- Fault * translateDataReadReq(MemReqPtr &req)
+ Fault translateDataReadReq(MemReqPtr &req)
{
return dtb->translate(req, false);
}
- Fault * translateDataWriteReq(MemReqPtr &req)
+ Fault translateDataWriteReq(MemReqPtr &req)
{
return dtb->translate(req, true);
}
int getInstAsid() { return asid; }
int getDataAsid() { return asid; }
- Fault * dummyTranslation(MemReqPtr &req)
+ Fault dummyTranslation(MemReqPtr &req)
{
#if 0
assert((req->vaddr >> 48 & 0xffff) == 0);
req->paddr = req->paddr | (Addr)req->asid << sizeof(Addr) * 8 - 16;
return NoFault;
}
- Fault * translateInstReq(MemReqPtr &req)
+ Fault translateInstReq(MemReqPtr &req)
{
return dummyTranslation(req);
}
- Fault * translateDataReadReq(MemReqPtr &req)
+ Fault translateDataReadReq(MemReqPtr &req)
{
return dummyTranslation(req);
}
- Fault * translateDataWriteReq(MemReqPtr &req)
+ Fault translateDataWriteReq(MemReqPtr &req)
{
return dummyTranslation(req);
}
#endif
template <class T>
- Fault * read(MemReqPtr &req, T &data)
+ Fault read(MemReqPtr &req, T &data)
{
#if FULL_SYSTEM && defined(TARGET_ALPHA)
if (req->flags & LOCKED) {
}
#endif
- Fault * error;
+ Fault error;
error = mem->read(req, data);
data = LittleEndianGuest::gtoh(data);
return error;
}
template <class T>
- Fault * write(MemReqPtr &req, T &data)
+ Fault write(MemReqPtr &req, T &data)
{
#if FULL_SYSTEM && defined(TARGET_ALPHA)
inst = new_inst;
}
- Fault * instRead(MemReqPtr &req)
+ Fault instRead(MemReqPtr &req)
{
return mem->read(req, inst);
}
}
#if FULL_SYSTEM
- uint64_t readIpr(int idx, Fault * &fault);
- Fault * setIpr(int idx, uint64_t val);
+ uint64_t readIpr(int idx, Fault &fault);
+ Fault setIpr(int idx, uint64_t val);
int readIntrFlag() { return regs.intrflag; }
void setIntrFlag(int val) { regs.intrflag = val; }
- Fault * hwrei();
+ Fault hwrei();
bool inPalMode() { return AlphaISA::PcPAL(regs.pc); }
- void ev5_trap(Fault * fault);
+ void ev5_trap(Fault fault);
bool simPalCheck(int palFunc);
#endif
* @todo How to do this properly so it's dependent upon ISA only?
*/
- void trap(Fault * fault);
+ void trap(Fault fault);
#if !FULL_SYSTEM
TheISA::IntReg getSyscallArg(int i)
// void clear_interrupt(int int_num, int index);
// void clear_interrupts();
- Fault * translateInstReq(MemReqPtr &req)
+ Fault translateInstReq(MemReqPtr &req)
{
return itb->translate(req);
}
- Fault * translateDataReadReq(MemReqPtr &req)
+ Fault translateDataReadReq(MemReqPtr &req)
{
return dtb->translate(req, false);
}
- Fault * translateDataWriteReq(MemReqPtr &req)
+ Fault translateDataWriteReq(MemReqPtr &req)
{
return dtb->translate(req, true);
}
#else
- Fault * dummyTranslation(MemReqPtr &req)
+ Fault dummyTranslation(MemReqPtr &req)
{
#if 0
assert((req->vaddr >> 48 & 0xffff) == 0);
return NoFault;
}
- Fault * translateInstReq(MemReqPtr &req)
+ Fault translateInstReq(MemReqPtr &req)
{
return dummyTranslation(req);
}
- Fault * translateDataReadReq(MemReqPtr &req)
+ Fault translateDataReadReq(MemReqPtr &req)
{
return dummyTranslation(req);
}
- Fault * translateDataWriteReq(MemReqPtr &req)
+ Fault translateDataWriteReq(MemReqPtr &req)
{
return dummyTranslation(req);
}
// look like.
#if FULL_SYSTEM
uint64_t *getIpr();
- uint64_t readIpr(int idx, Fault * &fault);
- Fault * setIpr(int idx, uint64_t val);
+ uint64_t readIpr(int idx, Fault &fault);
+ Fault setIpr(int idx, uint64_t val);
int readIntrFlag();
void setIntrFlag(int val);
- Fault * hwrei();
+ Fault hwrei();
bool inPalMode() { return AlphaISA::PcPAL(this->regFile.readPC()); }
bool inPalMode(uint64_t PC)
{ return AlphaISA::PcPAL(PC); }
- void trap(Fault * fault);
+ void trap(Fault fault);
bool simPalCheck(int palFunc);
void processInterrupts();
bool palShadowEnabled;
// Not sure this is used anywhere.
- void intr_post(RegFile *regs, Fault * fault, Addr pc);
+ void intr_post(RegFile *regs, Fault fault, Addr pc);
// Actually used within exec files. Implement properly.
void swapPALShadow(bool use_shadow);
// Called by CPU constructor. Can implement as I please.
template <class T>
- Fault * read(MemReqPtr &req, T &data)
+ Fault read(MemReqPtr &req, T &data)
{
#if FULL_SYSTEM && defined(TARGET_ALPHA)
if (req->flags & LOCKED) {
}
#endif
- Fault * error;
+ Fault error;
error = this->mem->read(req, data);
data = gtoh(data);
return error;
}
template <class T>
- Fault * read(MemReqPtr &req, T &data, int load_idx)
+ Fault read(MemReqPtr &req, T &data, int load_idx)
{
return this->iew.ldstQueue.read(req, data, load_idx);
}
template <class T>
- Fault * write(MemReqPtr &req, T &data)
+ Fault write(MemReqPtr &req, T &data)
{
#if FULL_SYSTEM && defined(TARGET_ALPHA)
}
template <class T>
- Fault * write(MemReqPtr &req, T &data, int store_idx)
+ Fault write(MemReqPtr &req, T &data, int store_idx)
{
return this->iew.ldstQueue.write(req, data, store_idx);
}
template <class Impl>
uint64_t
-AlphaFullCPU<Impl>::readIpr(int idx, Fault * &fault)
+AlphaFullCPU<Impl>::readIpr(int idx, Fault &fault)
{
return this->regFile.readIpr(idx, fault);
}
template <class Impl>
-Fault *
+Fault
AlphaFullCPU<Impl>::setIpr(int idx, uint64_t val)
{
return this->regFile.setIpr(idx, val);
// Can force commit stage to squash and stuff.
template <class Impl>
-Fault *
+Fault
AlphaFullCPU<Impl>::hwrei()
{
uint64_t *ipr = getIpr();
// stage.
template <class Impl>
void
-AlphaFullCPU<Impl>::trap(Fault * fault)
+AlphaFullCPU<Impl>::trap(Fault fault)
{
// Keep in mind that a trap may be initiated by fetch if there's a TLB
// miss
AlphaDynInst(StaticInstPtr &_staticInst);
/** Executes the instruction.*/
- Fault * execute()
+ Fault execute()
{
return this->fault = this->staticInst->execute(this, this->traceData);
}
void setFpcr(uint64_t val);
#if FULL_SYSTEM
- uint64_t readIpr(int idx, Fault * &fault);
- Fault * setIpr(int idx, uint64_t val);
- Fault * hwrei();
+ uint64_t readIpr(int idx, Fault &fault);
+ Fault setIpr(int idx, uint64_t val);
+ Fault hwrei();
int readIntrFlag();
void setIntrFlag(int val);
bool inPalMode();
- void trap(Fault * fault);
+ void trap(Fault fault);
bool simPalCheck(int palFunc);
#else
void syscall();
}
public:
- Fault * calcEA()
+ Fault calcEA()
{
return this->staticInst->eaCompInst()->execute(this, this->traceData);
}
- Fault * memAccess()
+ Fault memAccess()
{
return this->staticInst->memAccInst()->execute(this, this->traceData);
}
#if FULL_SYSTEM
template <class Impl>
uint64_t
-AlphaDynInst<Impl>::readIpr(int idx, Fault * &fault)
+AlphaDynInst<Impl>::readIpr(int idx, Fault &fault)
{
return this->cpu->readIpr(idx, fault);
}
template <class Impl>
-Fault *
+Fault
AlphaDynInst<Impl>::setIpr(int idx, uint64_t val)
{
return this->cpu->setIpr(idx, val);
}
template <class Impl>
-Fault *
+Fault
AlphaDynInst<Impl>::hwrei()
{
return this->cpu->hwrei();
template <class Impl>
void
-AlphaDynInst<Impl>::trap(Fault * fault)
+AlphaDynInst<Impl>::trap(Fault fault)
{
this->cpu->trap(fault);
}
}
// Check if the instruction caused a fault. If so, trap.
- Fault * inst_fault = head_inst->getFault();
+ Fault inst_fault = head_inst->getFault();
if (inst_fault != NoFault) {
if (!head_inst->isNop()) {
* @param fetch_PC The PC address that is being fetched from.
* @return Any fault that occured.
*/
- Fault * fetchCacheLine(Addr fetch_PC);
+ Fault fetchCacheLine(Addr fetch_PC);
inline void doSquash(const Addr &new_PC);
}
template <class Impl>
-Fault *
+Fault
SimpleFetch<Impl>::fetchCacheLine(Addr fetch_PC)
{
// Check if the instruction exists within the cache.
unsigned flags = 0;
#endif // FULL_SYSTEM
- Fault * fault = NoFault;
+ Fault fault = NoFault;
// Align the fetch PC so it's at the start of a cache block.
fetch_PC = icacheBlockAlignPC(fetch_PC);
Addr fetch_PC = cpu->readPC();
// Fault code for memory access.
- Fault * fault = NoFault;
+ Fault fault = NoFault;
// If returning from the delay of a cache miss, then update the status
// to running, otherwise do the cache access. Possibly move this up
}
#if FULL_SYSTEM
- uint64_t readIpr(int idx, Fault * &fault);
- Fault * setIpr(int idx, uint64_t val);
+ uint64_t readIpr(int idx, Fault &fault);
+ Fault setIpr(int idx, uint64_t val);
InternalProcReg *getIpr() { return ipr; }
int readIntrFlag() { return intrflag; }
void setIntrFlag(int val) { intrflag = val; }
//the DynInst level.
template <class Impl>
uint64_t
-PhysRegFile<Impl>::readIpr(int idx, Fault * &fault)
+PhysRegFile<Impl>::readIpr(int idx, Fault &fault)
{
uint64_t retval = 0; // return value, default 0
extern int break_ipl;
template <class Impl>
-Fault *
+Fault
PhysRegFile<Impl>::setIpr(int idx, uint64_t val)
{
uint64_t old;
int getInstAsid() { return xc->regs.instAsid(); }
int getDataAsid() { return xc->regs.dataAsid(); }
- Fault * translateInstReq(MemReqPtr &req)
+ Fault translateInstReq(MemReqPtr &req)
{
return itb->translate(req);
}
- Fault * translateDataReadReq(MemReqPtr &req)
+ Fault translateDataReadReq(MemReqPtr &req)
{
return dtb->translate(req, false);
}
- Fault * translateDataWriteReq(MemReqPtr &req)
+ Fault translateDataWriteReq(MemReqPtr &req)
{
return dtb->translate(req, true);
}
int getInstAsid() { return xc->asid; }
int getDataAsid() { return xc->asid; }
- Fault * dummyTranslation(MemReqPtr &req)
+ Fault dummyTranslation(MemReqPtr &req)
{
#if 0
assert((req->vaddr >> 48 & 0xffff) == 0);
req->paddr = req->paddr | (Addr)req->asid << sizeof(Addr) * 8 - 16;
return NoFault;
}
- Fault * translateInstReq(MemReqPtr &req)
+ Fault translateInstReq(MemReqPtr &req)
{
return dummyTranslation(req);
}
- Fault * translateDataReadReq(MemReqPtr &req)
+ Fault translateDataReadReq(MemReqPtr &req)
{
return dummyTranslation(req);
}
- Fault * translateDataWriteReq(MemReqPtr &req)
+ Fault translateDataWriteReq(MemReqPtr &req)
{
return dummyTranslation(req);
}
#endif
template <class T>
- Fault * read(Addr addr, T &data, unsigned flags, DynInstPtr inst);
+ Fault read(Addr addr, T &data, unsigned flags, DynInstPtr inst);
template <class T>
- Fault * write(T data, Addr addr, unsigned flags,
+ Fault write(T data, Addr addr, unsigned flags,
uint64_t *res, DynInstPtr inst);
void prefetch(Addr addr, unsigned flags)
// need to do this...
}
- Fault * copySrcTranslate(Addr src);
+ Fault copySrcTranslate(Addr src);
- Fault * copy(Addr dest);
+ Fault copy(Addr dest);
private:
bool executeInst(DynInstPtr &inst);
bool getOneInst();
- Fault * fetchCacheLine();
+ Fault fetchCacheLine();
InstSeqNum getAndIncrementInstSeq();
void setFpcr(uint64_t val) { xc->setFpcr(val); }
#if FULL_SYSTEM
- uint64_t readIpr(int idx, Fault * &fault) { return xc->readIpr(idx, fault); }
- Fault * setIpr(int idx, uint64_t val) { return xc->setIpr(idx, val); }
- Fault * hwrei() { return xc->hwrei(); }
+ uint64_t readIpr(int idx, Fault &fault) { return xc->readIpr(idx, fault); }
+ Fault setIpr(int idx, uint64_t val) { return xc->setIpr(idx, val); }
+ Fault hwrei() { return xc->hwrei(); }
int readIntrFlag() { return xc->readIntrFlag(); }
void setIntrFlag(int val) { xc->setIntrFlag(val); }
bool inPalMode() { return xc->inPalMode(); }
- void ev5_trap(Fault * fault) { xc->ev5_trap(fault); }
+ void ev5_trap(Fault fault) { xc->ev5_trap(fault); }
bool simPalCheck(int palFunc) { return xc->simPalCheck(palFunc); }
#else
void syscall() { xc->syscall(); }
// precise architected memory state accessor macros
template <class Impl>
template <class T>
-Fault *
+Fault
OoOCPU<Impl>::read(Addr addr, T &data, unsigned flags, DynInstPtr inst)
{
MemReqPtr readReq = new MemReq();
readReq->reset(addr, sizeof(T), flags);
// translate to physical address - This might be an ISA impl call
- Fault * fault = translateDataReadReq(readReq);
+ Fault fault = translateDataReadReq(readReq);
// do functional access
if (fault == NoFault)
template <class Impl>
template <class T>
-Fault *
+Fault
OoOCPU<Impl>::write(T data, Addr addr, unsigned flags,
uint64_t *res, DynInstPtr inst)
{
writeReq->reset(addr, sizeof(T), flags);
// translate to physical address
- Fault * fault = translateDataWriteReq(writeReq);
+ Fault fault = translateDataWriteReq(writeReq);
// do functional access
if (fault == NoFault)
{
}
-Fault *
+Fault
SimpleCPU::copySrcTranslate(Addr src)
{
static bool no_warn = true;
memReq->reset(src & ~(blk_size - 1), blk_size);
// translate to physical address
- Fault * fault = xc->translateDataReadReq(memReq);
+ Fault fault = xc->translateDataReadReq(memReq);
assert(fault != AlignmentFault);
return fault;
}
-Fault *
+Fault
SimpleCPU::copy(Addr dest)
{
static bool no_warn = true;
memReq->reset(dest & ~(blk_size -1), blk_size);
// translate to physical address
- Fault * fault = xc->translateDataWriteReq(memReq);
+ Fault fault = xc->translateDataWriteReq(memReq);
assert(fault != AlignmentFault);
// precise architected memory state accessor macros
template <class T>
-Fault *
+Fault
SimpleCPU::read(Addr addr, T &data, unsigned flags)
{
if (status() == DcacheMissStall || status() == DcacheMissSwitch) {
- Fault * fault = xc->read(memReq,data);
+ Fault fault = xc->read(memReq,data);
if (traceData) {
traceData->setAddr(addr);
memReq->reset(addr, sizeof(T), flags);
// translate to physical address
- Fault * fault = xc->translateDataReadReq(memReq);
+ Fault fault = xc->translateDataReadReq(memReq);
// if we have a cache, do cache access too
if (fault == NoFault && dcacheInterface) {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
template
-Fault *
+Fault
SimpleCPU::read(Addr addr, uint64_t &data, unsigned flags);
template
-Fault *
+Fault
SimpleCPU::read(Addr addr, uint32_t &data, unsigned flags);
template
-Fault *
+Fault
SimpleCPU::read(Addr addr, uint16_t &data, unsigned flags);
template
-Fault *
+Fault
SimpleCPU::read(Addr addr, uint8_t &data, unsigned flags);
#endif //DOXYGEN_SHOULD_SKIP_THIS
template<>
-Fault *
+Fault
SimpleCPU::read(Addr addr, double &data, unsigned flags)
{
return read(addr, *(uint64_t*)&data, flags);
}
template<>
-Fault *
+Fault
SimpleCPU::read(Addr addr, float &data, unsigned flags)
{
return read(addr, *(uint32_t*)&data, flags);
template<>
-Fault *
+Fault
SimpleCPU::read(Addr addr, int32_t &data, unsigned flags)
{
return read(addr, (uint32_t&)data, flags);
template <class T>
-Fault *
+Fault
SimpleCPU::write(T data, Addr addr, unsigned flags, uint64_t *res)
{
memReq->reset(addr, sizeof(T), flags);
// translate to physical address
- Fault * fault = xc->translateDataWriteReq(memReq);
+ Fault fault = xc->translateDataWriteReq(memReq);
// do functional access
if (fault == NoFault)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
template
-Fault *
+Fault
SimpleCPU::write(uint64_t data, Addr addr, unsigned flags, uint64_t *res);
template
-Fault *
+Fault
SimpleCPU::write(uint32_t data, Addr addr, unsigned flags, uint64_t *res);
template
-Fault *
+Fault
SimpleCPU::write(uint16_t data, Addr addr, unsigned flags, uint64_t *res);
template
-Fault *
+Fault
SimpleCPU::write(uint8_t data, Addr addr, unsigned flags, uint64_t *res);
#endif //DOXYGEN_SHOULD_SKIP_THIS
template<>
-Fault *
+Fault
SimpleCPU::write(double data, Addr addr, unsigned flags, uint64_t *res)
{
return write(*(uint64_t*)&data, addr, flags, res);
}
template<>
-Fault *
+Fault
SimpleCPU::write(float data, Addr addr, unsigned flags, uint64_t *res)
{
return write(*(uint32_t*)&data, addr, flags, res);
template<>
-Fault *
+Fault
SimpleCPU::write(int32_t data, Addr addr, unsigned flags, uint64_t *res)
{
return write((uint32_t)data, addr, flags, res);
traceData = NULL;
- Fault * fault = NoFault;
+ Fault fault = NoFault;
#if FULL_SYSTEM
if (checkInterrupts && check_interrupts() && !xc->inPalMode() &&
virtual void unserialize(Checkpoint *cp, const std::string §ion);
template <class T>
- Fault * read(Addr addr, T &data, unsigned flags);
+ Fault read(Addr addr, T &data, unsigned flags);
template <class T>
- Fault * write(T data, Addr addr, unsigned flags, uint64_t *res);
+ Fault write(T data, Addr addr, unsigned flags, uint64_t *res);
// These functions are only used in CPU models that split
// effective address computation from the actual memory access.
// need to do this...
}
- Fault * copySrcTranslate(Addr src);
+ Fault copySrcTranslate(Addr src);
- Fault * copy(Addr dest);
+ Fault copy(Addr dest);
// The register accessor methods provide the index of the
// instruction's operand (e.g., 0 or 1), not the architectural
void setFpcr(uint64_t val) { xc->setFpcr(val); }
#if FULL_SYSTEM
- uint64_t readIpr(int idx, Fault * &fault) { return xc->readIpr(idx, fault); }
- Fault * setIpr(int idx, uint64_t val) { return xc->setIpr(idx, val); }
- Fault * hwrei() { return xc->hwrei(); }
+ uint64_t readIpr(int idx, Fault &fault) { return xc->readIpr(idx, fault); }
+ Fault setIpr(int idx, uint64_t val) { return xc->setIpr(idx, val); }
+ Fault hwrei() { return xc->hwrei(); }
int readIntrFlag() { return xc->readIntrFlag(); }
void setIntrFlag(int val) { xc->setIntrFlag(val); }
bool inPalMode() { return xc->inPalMode(); }
- void ev5_trap(Fault * fault) { xc->ev5_trap(fault); }
+ void ev5_trap(Fault fault) { xc->ev5_trap(fault); }
bool simPalCheck(int palFunc) { return xc->simPalCheck(palFunc); }
#else
void syscall() { xc->syscall(); }
alphaAccess->intrClockFrequency = platform->intrFrequency();
}
-Fault *
+Fault
AlphaConsole::read(MemReqPtr &req, uint8_t *data)
{
memset(data, 0, req->size);
return NoFault;
}
-Fault *
+Fault
AlphaConsole::write(MemReqPtr &req, const uint8_t *data)
{
uint64_t val;
/**
* memory mapped reads and writes
*/
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
/**
* standard serialization routines for checkpointing
}
-Fault *
+Fault
BadDevice::read(MemReqPtr &req, uint8_t *data)
{
return NoFault;
}
-Fault *
+Fault
BadDevice::write(MemReqPtr &req, const uint8_t *data)
{
panic("Device %s not imlpmented\n", devname);
* @param data A pointer to write the read data to.
* @return The fault condition of the access.
*/
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
/**
* On a write event we just panic aand hopefully print a
* @param data The data to write.
* @return The fault condition of the access.
*/
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
/**
* Return how long this access will take.
}
}
-Fault *
+Fault
IdeController::read(MemReqPtr &req, uint8_t *data)
{
Addr offset;
return NoFault;
}
-Fault *
+Fault
IdeController::write(MemReqPtr &req, const uint8_t *data)
{
Addr offset;
* @param data Return the field read.
* @return The fault condition of the access.
*/
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
/**
* Write to the mmapped I/O control registers.
* @param data The data to write.
* @return The fault condition of the access.
*/
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
/**
* Serialize this object to the given output stream.
}
}
-Fault *
+Fault
IsaFake::read(MemReqPtr &req, uint8_t *data)
{
DPRINTF(Tsunami, "read va=%#x size=%d\n",
return NoFault;
}
-Fault *
+Fault
IsaFake::write(MemReqPtr &req, const uint8_t *data)
{
DPRINTF(Tsunami, "write - va=%#x size=%d \n",
* @param req The memory request.
* @param data Where to put the data.
*/
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
/**
* All writes are simply ignored.
* @param req The memory request.
* @param data the data to not write.
*/
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
/**
* Return how long this access will take.
* This reads the device registers, which are detailed in the NS83820
* spec sheet
*/
-Fault *
+Fault
NSGigE::read(MemReqPtr &req, uint8_t *data)
{
assert(ioEnable);
return NoFault;
}
-Fault *
+Fault
NSGigE::write(MemReqPtr &req, const uint8_t *data)
{
assert(ioEnable);
virtual void writeConfig(int offset, int size, const uint8_t *data);
virtual void readConfig(int offset, int size, uint8_t *data);
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
bool cpuIntrPending() const;
void cpuIntrAck() { cpuIntrClear(); }
}
-Fault *
+Fault
PciConfigAll::read(MemReqPtr &req, uint8_t *data)
{
return NoFault;
}
-Fault *
+Fault
PciConfigAll::write(MemReqPtr &req, const uint8_t *data)
{
Addr daddr = (req->paddr - (addr & EV5::PAddrImplMask));
* @param data Return the field read.
* @return The fault condition of the access.
*/
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
/**
* Write to PCI config spcae. If the device does not exit the simulator
* @return The fault condition of the access.
*/
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
/**
* Start up function to check if more than one person is using an interrupt line
p->configSpace->registerDevice(p->deviceNum, p->functionNum, this);
}
-Fault *
+Fault
PciDev::read(MemReqPtr &req, uint8_t *data)
{ return NoFault; }
-Fault *
+Fault
PciDev::write(MemReqPtr &req, const uint8_t *data)
{ return NoFault; }
-Fault *
+Fault
PciDev::readBar0(MemReqPtr &req, Addr daddr, uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::readBar1(MemReqPtr &req, Addr daddr, uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::readBar2(MemReqPtr &req, Addr daddr, uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::readBar3(MemReqPtr &req, Addr daddr, uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::readBar4(MemReqPtr &req, Addr daddr, uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::readBar5(MemReqPtr &req, Addr daddr, uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::writeBar0(MemReqPtr &req, Addr daddr, const uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::writeBar1(MemReqPtr &req, Addr daddr, const uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::writeBar2(MemReqPtr &req, Addr daddr, const uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::writeBar3(MemReqPtr &req, Addr daddr, const uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::writeBar4(MemReqPtr &req, Addr daddr, const uint8_t *data)
{ panic("not implemented"); }
-Fault *
+Fault
PciDev::writeBar5(MemReqPtr &req, Addr daddr, const uint8_t *data)
{ panic("not implemented"); }
*/
PciDev(Params *params);
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
public:
/**
* Implement the read/write as BAR accesses
*/
- Fault * readBar(MemReqPtr &req, uint8_t *data);
- Fault * writeBar(MemReqPtr &req, const uint8_t *data);
+ Fault readBar(MemReqPtr &req, uint8_t *data);
+ Fault writeBar(MemReqPtr &req, const uint8_t *data);
public:
/**
* Read from a specific BAR
*/
- virtual Fault * readBar0(MemReqPtr &req, Addr daddr, uint8_t *data);
- virtual Fault * readBar1(MemReqPtr &req, Addr daddr, uint8_t *data);
- virtual Fault * readBar2(MemReqPtr &req, Addr daddr, uint8_t *data);
- virtual Fault * readBar3(MemReqPtr &req, Addr daddr, uint8_t *data);
- virtual Fault * readBar4(MemReqPtr &req, Addr daddr, uint8_t *data);
- virtual Fault * readBar5(MemReqPtr &req, Addr daddr, uint8_t *data);
+ virtual Fault readBar0(MemReqPtr &req, Addr daddr, uint8_t *data);
+ virtual Fault readBar1(MemReqPtr &req, Addr daddr, uint8_t *data);
+ virtual Fault readBar2(MemReqPtr &req, Addr daddr, uint8_t *data);
+ virtual Fault readBar3(MemReqPtr &req, Addr daddr, uint8_t *data);
+ virtual Fault readBar4(MemReqPtr &req, Addr daddr, uint8_t *data);
+ virtual Fault readBar5(MemReqPtr &req, Addr daddr, uint8_t *data);
public:
/**
* Write to a specific BAR
*/
- virtual Fault * writeBar0(MemReqPtr &req, Addr daddr, const uint8_t *data);
- virtual Fault * writeBar1(MemReqPtr &req, Addr daddr, const uint8_t *data);
- virtual Fault * writeBar2(MemReqPtr &req, Addr daddr, const uint8_t *data);
- virtual Fault * writeBar3(MemReqPtr &req, Addr daddr, const uint8_t *data);
- virtual Fault * writeBar4(MemReqPtr &req, Addr daddr, const uint8_t *data);
- virtual Fault * writeBar5(MemReqPtr &req, Addr daddr, const uint8_t *data);
+ virtual Fault writeBar0(MemReqPtr &req, Addr daddr, const uint8_t *data);
+ virtual Fault writeBar1(MemReqPtr &req, Addr daddr, const uint8_t *data);
+ virtual Fault writeBar2(MemReqPtr &req, Addr daddr, const uint8_t *data);
+ virtual Fault writeBar3(MemReqPtr &req, Addr daddr, const uint8_t *data);
+ virtual Fault writeBar4(MemReqPtr &req, Addr daddr, const uint8_t *data);
+ virtual Fault writeBar5(MemReqPtr &req, Addr daddr, const uint8_t *data);
public:
/**
virtual void unserialize(Checkpoint *cp, const std::string §ion);
};
-inline Fault *
+inline Fault
PciDev::readBar(MemReqPtr &req, uint8_t *data)
{
if (isBAR(req->paddr, 0))
return MachineCheckFault;
}
-inline Fault *
+inline Fault
PciDev::writeBar(MemReqPtr &req, const uint8_t *data)
{
if (isBAR(req->paddr, 0))
/**
* I/O read of device register
*/
-Fault *
+Fault
Device::read(MemReqPtr &req, uint8_t *data)
{
assert(config.command & PCI_CMD_MSE);
- Fault * fault = readBar(req, data);
+ Fault fault = readBar(req, data);
if (fault == MachineCheckFault) {
panic("address does not map to a BAR pa=%#x va=%#x size=%d",
return fault;
}
-Fault *
+Fault
Device::readBar0(MemReqPtr &req, Addr daddr, uint8_t *data)
{
int cpu = (req->xc->regs.ipr[TheISA::IPR_PALtemp16] >> 8) & 0xff;
/**
* IPR read of device register
*/
-Fault *
+Fault
Device::iprRead(Addr daddr, int cpu, uint64_t &result)
{
if (!regValid(daddr))
/**
* I/O write of device register
*/
-Fault *
+Fault
Device::write(MemReqPtr &req, const uint8_t *data)
{
assert(config.command & PCI_CMD_MSE);
- Fault * fault = writeBar(req, data);
+ Fault fault = writeBar(req, data);
if (fault == MachineCheckFault) {
panic("address does not map to a BAR pa=%#x va=%#x size=%d",
return fault;
}
-Fault *
+Fault
Device::writeBar0(MemReqPtr &req, Addr daddr, const uint8_t *data)
{
int cpu = (req->xc->regs.ipr[TheISA::IPR_PALtemp16] >> 8) & 0xff;
* Memory Interface
*/
public:
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
void prepareIO(int cpu, int index);
void prepareRead(int cpu, int index);
void prepareWrite(int cpu, int index);
- Fault * iprRead(Addr daddr, int cpu, uint64_t &result);
- Fault * readBar0(MemReqPtr &req, Addr daddr, uint8_t *data);
- Fault * writeBar0(MemReqPtr &req, Addr daddr, const uint8_t *data);
+ Fault iprRead(Addr daddr, int cpu, uint64_t &result);
+ Fault readBar0(MemReqPtr &req, Addr daddr, uint8_t *data);
+ Fault writeBar0(MemReqPtr &req, Addr daddr, const uint8_t *data);
void regWrite(Addr daddr, int cpu, const uint8_t *data);
Tick cacheAccess(MemReqPtr &req);
tsunami->cchip = this;
}
-Fault *
+Fault
TsunamiCChip::read(MemReqPtr &req, uint8_t *data)
{
DPRINTF(Tsunami, "read va=%#x size=%d\n", req->vaddr, req->size);
return NoFault;
}
-Fault *
+Fault
TsunamiCChip::write(MemReqPtr &req, const uint8_t *data)
{
DPRINTF(Tsunami, "write - va=%#x value=%#x size=%d \n",
* @param data A pointer to write the read data to.
* @return The fault condition of the access.
*/
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
/**
* @param data The data to write.
* @return The fault condition of the access.
*/
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
/**
* post an RTC interrupt to the CPU
return Clock::Frequency / clockInterval;
}
-Fault *
+Fault
TsunamiIO::read(MemReqPtr &req, uint8_t *data)
{
DPRINTF(Tsunami, "io read va=%#x size=%d IOPorrt=%#x\n",
return NoFault;
}
-Fault *
+Fault
TsunamiIO::write(MemReqPtr &req, const uint8_t *data)
{
* @param data A pointer to write the read data to.
* @return The fault condition of the access.
*/
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
/**
* Process a write to one of the devices we emulate.
* @param data The data to write.
* @return The fault condition of the access.
*/
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
/**
* Post an PIC interrupt to the CPU via the CChip
tsunami->pchip = this;
}
-Fault *
+Fault
TsunamiPChip::read(MemReqPtr &req, uint8_t *data)
{
DPRINTF(Tsunami, "read va=%#x size=%d\n",
return NoFault;
}
-Fault *
+Fault
TsunamiPChip::write(MemReqPtr &req, const uint8_t *data)
{
DPRINTF(Tsunami, "write - va=%#x size=%d \n",
* @param data A pointer to write the read data to.
* @return The fault condition of the access.
*/
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
/**
* Process a write to the PChip.
* @param data The data to write.
* @return The fault condition of the access.
*/
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
/**
* Serialize this object to the given output stream.
Addr a, Addr s, HierParams *hier, Bus *bus, Tick pio_latency,
Platform *p);
- virtual Fault * read(MemReqPtr &req, uint8_t *data) = 0;
- virtual Fault * write(MemReqPtr &req, const uint8_t *data) = 0;
+ virtual Fault read(MemReqPtr &req, uint8_t *data) = 0;
+ virtual Fault write(MemReqPtr &req, const uint8_t *data) = 0;
/**
}
-Fault *
+Fault
Uart8250::read(MemReqPtr &req, uint8_t *data)
{
Addr daddr = req->paddr - (addr & EV5::PAddrImplMask);
}
-Fault *
+Fault
Uart8250::write(MemReqPtr &req, const uint8_t *data)
{
Addr daddr = req->paddr - (addr & EV5::PAddrImplMask);
Addr a, Addr s, HierParams *hier, Bus *pio_bus, Tick pio_latency,
Platform *p);
- virtual Fault * read(MemReqPtr &req, uint8_t *data);
- virtual Fault * write(MemReqPtr &req, const uint8_t *data);
+ virtual Fault read(MemReqPtr &req, uint8_t *data);
+ virtual Fault write(MemReqPtr &req, const uint8_t *data);
/**
class FnEvent;
// What does kernel stats expect is included?
class System;
-class Fault;
namespace Kernel {
void ivlb() { _ivlb++; }
void ivle() { _ivle++; }
void hwrei() { _hwrei++; }
- void fault(Fault * fault)
+ void fault(Fault fault)
{
if(fault == NoFault) _faults[0]++;
else if(fault == MachineCheckFault) _faults[2]++;
#ifndef __FAULTS_HH__
#define __FAULTS_HH__
-class Fault
+class FaultBase;
+typedef FaultBase * Fault;
+
+class FaultBase
{
public:
- Fault(char * newName, int newId = 0) : name(newName), id(newId) {;}
+ FaultBase(char * newName, int newId = 0) : name(newName), id(newId) {;}
const char * name;
int id;
};
-extern class NoFaultType : public Fault
+extern class NoFaultType : public FaultBase
{
public:
- NoFaultType(char * newName) : Fault(newName) {;}
+ NoFaultType(char * newName) : FaultBase(newName) {;}
} * const NoFault;
-extern class MachineCheckFaultType : public Fault
+extern class MachineCheckFaultType : public FaultBase
{
public:
- MachineCheckFaultType(char * newName) : Fault(newName) {;}
+ MachineCheckFaultType(char * newName) : FaultBase(newName) {;}
} * const MachineCheckFault;
-extern class AlignmentFaultType : public Fault
+extern class AlignmentFaultType : public FaultBase
{
public:
- AlignmentFaultType(char * newName) : Fault(newName) {;}
+ AlignmentFaultType(char * newName) : FaultBase(newName) {;}
} * const AlignmentFault;