isa_device.hh (10461:afeb5cdb3907) | isa_device.hh (10609:ae5582819481) |
---|---|
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 | 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 |
|
49/** 50 * Base class for devices that use the MiscReg interfaces. 51 * 52 * This class provides a well-defined interface that the ArmISA class 53 * can use when forwarding MiscReg accesses to a device model (e.g., a 54 * PMU or GIC). 55 */ 56class BaseISADevice 57{ 58 public: | 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(); |
60 virtual ~BaseISADevice() {} 61 | 62 virtual ~BaseISADevice() {} 63 |
64 virtual void setISA(ISA *isa); 65 |
|
62 /** 63 * Write to a system register belonging to this device. 64 * 65 * @param misc_reg Register number (see miscregs.hh) 66 * @param val Value to store 67 */ 68 virtual void setMiscReg(int misc_reg, MiscReg val) = 0; 69 70 /** 71 * Read a system register belonging to this device. 72 * 73 * @param misc_reg Register number (see miscregs.hh) 74 * @return Register value. 75 */ 76 virtual MiscReg readMiscReg(int misc_reg) = 0; | 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; |
|
77}; 78 79/** 80 * Dummy device that prints a warning when it is accessed. 81 * 82 * This device can be used as a placeholder when a real device model 83 * is not present. For example, the ISA code uses it to avoid having 84 * to check for a PMU in the register access code. --- 15 unchanged lines hidden --- | 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 --- |