X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fdev%2Fisa_fake.hh;h=07657ad7dfc141a4128ddd484018fba7b7b8eadb;hb=eae1e97fb002b44a9d8c46df2da1ddc1d0156ce4;hp=65d44f6a597873a1cfb945a3ac94c87d1c3c9fc1;hpb=ba2eae5d528487900d1510fc0a160e660f2c394c;p=gem5.git diff --git a/src/dev/isa_fake.hh b/src/dev/isa_fake.hh index 65d44f6a5..07657ad7d 100644 --- a/src/dev/isa_fake.hh +++ b/src/dev/isa_fake.hh @@ -24,6 +24,8 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Ali Saidi */ /** @file @@ -33,46 +35,55 @@ #ifndef __ISA_FAKE_HH__ #define __ISA_FAKE_HH__ -#include "dev/tsunami.hh" +#include + #include "base/range.hh" #include "dev/io_device.hh" +// #include "dev/alpha/tsunami.hh" +#include "mem/packet.hh" +#include "params/IsaFake.hh" /** - * IsaFake is a device that returns -1 on all reads and - * accepts all writes. It is meant to be placed at an address range + * IsaFake is a device that returns, BadAddr, 1 or 0 on all reads and + * rites. It is meant to be placed at an address range * so that an mcheck doesn't occur when an os probes a piece of hw - * that doesn't exist (e.g. UARTs1-3). + * that doesn't exist (e.g. UARTs1-3), or catch requests in the memory system + * that have no responders.. */ class IsaFake : public BasicPioDevice { - public: - struct Params : public BasicPioDevice::Params - { - Addr pio_size; - }; protected: - const Params *params() const { return (const Params*)_params; } + uint8_t retData8; + uint16_t retData16; + uint32_t retData32; + uint64_t retData64; public: + typedef IsaFakeParams Params; + const Params * + params() const + { + return dynamic_cast(_params); + } /** - * The constructor for Tsunmami Fake just registers itself with the MMU. + * The constructor for Isa Fake just registers itself with the MMU. * @param p params structure */ IsaFake(Params *p); /** * This read always returns -1. - * @param req The memory request. + * @param pkt The memory request. * @param data Where to put the data. */ - virtual Tick read(Packet *pkt); + virtual Tick read(PacketPtr pkt); /** * All writes are simply ignored. - * @param req The memory request. + * @param pkt The memory request. * @param data the data to not write. */ - virtual Tick write(Packet *pkt); + virtual Tick write(PacketPtr pkt); }; -#endif // __TSUNAMI_FAKE_HH__ +#endif // __ISA_FAKE_HH__