/*
- * Copyright (c) 2014 ARM Limited
+ * Copyright (c) 2014, 2017 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
#include "arch/arm/registers.hh"
#include "base/compiler.hh"
+class ThreadContext;
+
namespace ArmISA
{
+class ISA;
+
/**
* Base class for devices that use the MiscReg interfaces.
*
class BaseISADevice
{
public:
- BaseISADevice() {}
+ BaseISADevice();
virtual ~BaseISADevice() {}
+ virtual void setISA(ISA *isa);
+ virtual void setThreadContext(ThreadContext *tc) {}
+
/**
* Write to a system register belonging to this device.
*
* @param misc_reg Register number (see miscregs.hh)
* @param val Value to store
*/
- virtual void setMiscReg(int misc_reg, MiscReg val) = 0;
+ virtual void setMiscReg(int misc_reg, RegVal val) = 0;
/**
* Read a system register belonging to this device.
* @param misc_reg Register number (see miscregs.hh)
* @return Register value.
*/
- virtual MiscReg readMiscReg(int misc_reg) = 0;
+ virtual RegVal readMiscReg(int misc_reg) = 0;
+
+ protected:
+ ISA *isa;
};
/**
: BaseISADevice() {}
~DummyISADevice() {}
- void setMiscReg(int misc_reg, MiscReg val) M5_ATTR_OVERRIDE;
- MiscReg readMiscReg(int misc_reg) M5_ATTR_OVERRIDE;
+ void setMiscReg(int misc_reg, RegVal val) override;
+ RegVal readMiscReg(int misc_reg) override;
};
}