Deleted Added
sdiff udiff text old ( 12086:069c529a76fd ) new ( 13106:3af014b59080 )
full compact
1/*
2 * Copyright (c) 2010-2011 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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

46#include "params/CpuLocalTimer.hh"
47
48/** @file
49 * This implements the cpu local timer from the Cortex-A9 MPCore
50 * Technical Reference Manual rev r2p2 (ARM DDI 0407F)
51 */
52
53class BaseGic;
54
55class CpuLocalTimer : public BasicPioDevice
56{
57 protected:
58 class Timer : public Serializable
59 {
60
61 public:

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

91 EndBitUnion(WatchdogCtrl)
92
93 protected:
94 std::string _name;
95
96 /** Pointer to parent class */
97 CpuLocalTimer *parent;
98
99 /** Number of interrupt to cause/clear */
100 uint32_t intNumTimer;
101 uint32_t intNumWatchdog;
102
103 /** Cpu this timer is attached to */
104 uint32_t cpuNum;
105
106 /** Control register as specified above */
107 TimerCtrl timerControl;
108 WatchdogCtrl watchdogControl;
109
110 /** If timer has caused an interrupt. This is irrespective of
111 * interrupt enable */
112 bool rawIntTimer;
113 bool rawIntWatchdog;

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

130 void watchdogAtZero();
131 EventFunctionWrapper watchdogZeroEvent;
132 public:
133 /** Restart the counter ticking at val
134 * @param val the value to start at */
135 void restartTimerCounter(uint32_t val);
136 void restartWatchdogCounter(uint32_t val);
137
138 Timer();
139
140 std::string name() const { return _name; }
141
142 /** Handle read for a single timer */
143 void read(PacketPtr pkt, Addr daddr);
144
145 /** Handle write for a single timer */
146 void write(PacketPtr pkt, Addr daddr);
147
148 void serialize(CheckpointOut &cp) const override;
149 void unserialize(CheckpointIn &cp) override;
150
151 friend class CpuLocalTimer;
152 };
153
154 static const int CPU_MAX = 8;
155
156 /** Pointer to the GIC for causing an interrupt */
157 BaseGic *gic;
158
159 /** Timers that do the actual work */
160 Timer localTimer[CPU_MAX];
161
162 public:
163 typedef CpuLocalTimerParams Params;
164 const Params *
165 params() const
166 {
167 return dynamic_cast<const Params *>(_params);
168 }
169 /**
170 * The constructor for RealView just registers itself with the MMU.
171 * @param p params structure
172 */
173 CpuLocalTimer(Params *p);
174
175 /**
176 * Handle a read to the device
177 * @param pkt The memory request.
178 * @return Returns latency of device read
179 */
180 Tick read(PacketPtr pkt) override;
181
182 /**

--- 13 unchanged lines hidden ---