Deleted Added
sdiff udiff text old ( 10568:e70523bd0d26 ) new ( 10653:e3fc6bc7f97e )
full compact
1/*
2 * Copyright (c) 2012-2013 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

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

193 static const PrivateFlagsType VALID_EXTRA_DATA = 0x00000080;
194
195 /** These flags are *not* cleared when a Request object is reused
196 (assigned a new address). */
197 static const PrivateFlagsType STICKY_PRIVATE_FLAGS =
198 VALID_CONTEXT_ID | VALID_THREAD_ID;
199
200 private:
201 /**
202 * The physical address of the request. Valid only if validPaddr
203 * is set.
204 */
205 Addr _paddr;
206
207 /**
208 * The size of the request. This field must be set when vaddr or
209 * paddr is written via setVirt() or setPhys(), so it is always
210 * valid as long as one of the address fields is valid.
211 */
212 int _size;
213
214 /** The requestor ID which is unique in the system for all ports
215 * that are capable of issuing a transaction
216 */
217 MasterID _masterId;
218
219 /** Flag structure for the request. */
220 Flags _flags;

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

249 int _contextId;
250 /** The thread ID (id within this CPU) */
251 int _threadId;
252
253 /** program counter of initiating access; for tracing/debugging */
254 Addr _pc;
255
256 public:
257 /** Minimal constructor. No fields are initialized.
258 * (Note that _flags and privateFlags are cleared by Flags
259 * default constructor.)
260 */
261 Request()
262 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0),
263 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0),
264 _extraData(0), _contextId(0), _threadId(0), _pc(0),
265 translateDelta(0), accessDelta(0), depth(0)
266 {}
267
268 /**
269 * Constructor for physical (e.g. device) requests. Initializes
270 * just physical address, size, flags, and timestamp (to curTick()).
271 * These fields are adequate to perform a request.
272 */
273 Request(Addr paddr, int size, Flags flags, MasterID mid)
274 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0),
275 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0),
276 _extraData(0), _contextId(0), _threadId(0), _pc(0),
277 translateDelta(0), accessDelta(0), depth(0)
278 {
279 setPhys(paddr, size, flags, mid);
280 }
281
282 Request(Addr paddr, int size, Flags flags, MasterID mid, Tick time)
283 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0),
284 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0),
285 _extraData(0), _contextId(0), _threadId(0), _pc(0),
286 translateDelta(0), accessDelta(0), depth(0)
287 {
288 setPhys(paddr, size, flags, mid, time);
289 }
290
291 Request(Addr paddr, int size, Flags flags, MasterID mid, Tick time, Addr pc)
292 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0),
293 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0),
294 _extraData(0), _contextId(0), _threadId(0), _pc(0),
295 translateDelta(0), accessDelta(0), depth(0)
296 {
297 setPhys(paddr, size, flags, mid, time);
298 privateFlags.set(VALID_PC);
299 _pc = pc;
300 }
301
302 Request(int asid, Addr vaddr, int size, Flags flags, MasterID mid, Addr pc,
303 int cid, ThreadID tid)
304 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0),
305 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0),
306 _extraData(0), _contextId(0), _threadId(0), _pc(0),
307 translateDelta(0), accessDelta(0), depth(0)
308 {
309 setVirt(asid, vaddr, size, flags, mid, pc);
310 setThreadContext(cid, tid);

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

319 setThreadContext(int context_id, ThreadID tid)
320 {
321 _contextId = context_id;
322 _threadId = tid;
323 privateFlags.set(VALID_CONTEXT_ID|VALID_THREAD_ID);
324 }
325
326 /**
327 * Set up a physical (e.g. device) request in a previously
328 * allocated Request object.
329 */
330 void
331 setPhys(Addr paddr, int size, Flags flags, MasterID mid, Tick time)
332 {
333 assert(size >= 0);
334 _paddr = paddr;
335 _size = size;
336 _time = time;
337 _masterId = mid;
338 _flags.clear(~STICKY_FLAGS);
339 _flags.set(flags);
340 privateFlags.clear(~STICKY_PRIVATE_FLAGS);
341 privateFlags.set(VALID_PADDR|VALID_SIZE);
342 depth = 0;
343 accessDelta = 0;
344 //translateDelta = 0;
345 }
346
347 void
348 setPhys(Addr paddr, int size, Flags flags, MasterID mid)
349 {
350 setPhys(paddr, size, flags, mid, curTick());
351 }
352
353 /**
354 * Set up a virtual (e.g., CPU) request in a previously
355 * allocated Request object.
356 */
357 void
358 setVirt(int asid, Addr vaddr, int size, Flags flags, MasterID mid, Addr pc)
359 {
360 assert(size >= 0);
361 _asid = asid;
362 _vaddr = vaddr;
363 _size = size;
364 _masterId = mid;
365 _pc = pc;
366 _time = curTick();

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

392 * Generate two requests as if this request had been split into two
393 * pieces. The original request can't have been translated already.
394 */
395 void splitOnVaddr(Addr split_addr, RequestPtr &req1, RequestPtr &req2)
396 {
397 assert(privateFlags.isSet(VALID_VADDR));
398 assert(privateFlags.noneSet(VALID_PADDR));
399 assert(split_addr > _vaddr && split_addr < _vaddr + _size);
400 req1 = new Request;
401 *req1 = *this;
402 req2 = new Request;
403 *req2 = *this;
404 req1->_size = split_addr - _vaddr;
405 req2->_vaddr = split_addr;
406 req2->_size = _size - req1->_size;
407 }
408
409 /**
410 * Accessor for paddr.
411 */

--- 245 unchanged lines hidden ---