1/*
2 * Copyright (c) 2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 32 unchanged lines hidden (view full) ---

41#define __ARCH_ARM_ISA_DEVICE_HH__
42
43#include "arch/arm/registers.hh"
44#include "base/compiler.hh"
45
46namespace ArmISA
47{
48
49class ISA;
50
51/**
52 * Base class for devices that use the MiscReg interfaces.
53 *
54 * This class provides a well-defined interface that the ArmISA class
55 * can use when forwarding MiscReg accesses to a device model (e.g., a
56 * PMU or GIC).
57 */
58class BaseISADevice
59{
60 public:
59 BaseISADevice() {}
61 BaseISADevice();
62 virtual ~BaseISADevice() {}
63
64 virtual void setISA(ISA *isa);
65
66 /**
67 * Write to a system register belonging to this device.
68 *
69 * @param misc_reg Register number (see miscregs.hh)
70 * @param val Value to store
71 */
72 virtual void setMiscReg(int misc_reg, MiscReg val) = 0;
73
74 /**
75 * Read a system register belonging to this device.
76 *
77 * @param misc_reg Register number (see miscregs.hh)
78 * @return Register value.
79 */
80 virtual MiscReg readMiscReg(int misc_reg) = 0;
81
82 protected:
83 ISA *isa;
84};
85
86/**
87 * Dummy device that prints a warning when it is accessed.
88 *
89 * This device can be used as a placeholder when a real device model
90 * is not present. For example, the ISA code uses it to avoid having
91 * to check for a PMU in the register access code.

--- 15 unchanged lines hidden ---