Deleted Added
sdiff udiff text old ( 3145:85467cafadbb ) new ( 3169:65bef767b5de )
full compact
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

248 _status = Idle;
249}
250
251
252template <class T>
253Fault
254AtomicSimpleCPU::read(Addr addr, T &data, unsigned flags)
255{
256 data_read_req->setVirt(0, addr, sizeof(T), flags, thread->readPC());
257
258 if (traceData) {
259 traceData->setAddr(addr);
260 }
261
262 // translate to physical address
263 Fault fault = thread->translateDataReadReq(data_read_req);
264
265 // Now do the access.
266 if (fault == NoFault) {
267 data_read_pkt->reinitFromRequest();
268
269 dcache_latency = dcachePort.sendAtomic(data_read_pkt);
270 dcache_access = true;
271
272 assert(data_read_pkt->result == Packet::Success);
273 data = data_read_pkt->get<T>();
274
275 }
276
277 // This will need a new way to tell if it has a dcache attached.
278 if (data_read_req->getFlags() & UNCACHEABLE)
279 recordEvent("Uncached Read");
280
281 return fault;
282}
283
284#ifndef DOXYGEN_SHOULD_SKIP_THIS
285
286template

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

323 return read(addr, (uint32_t&)data, flags);
324}
325
326
327template <class T>
328Fault
329AtomicSimpleCPU::write(T data, Addr addr, unsigned flags, uint64_t *res)
330{
331 data_write_req->setVirt(0, addr, sizeof(T), flags, thread->readPC());
332
333 if (traceData) {
334 traceData->setAddr(addr);
335 }
336
337 // translate to physical address
338 Fault fault = thread->translateDataWriteReq(data_write_req);
339
340 // Now do the access.
341 if (fault == NoFault) {
342 data = htog(data);
343 data_write_pkt->reinitFromRequest();
344 data_write_pkt->dataStatic(&data);
345
346 dcache_latency = dcachePort.sendAtomic(data_write_pkt);
347 dcache_access = true;
348
349 assert(data_write_pkt->result == Packet::Success);
350
351 if (res && data_write_req->getFlags() & LOCKED) {
352 *res = data_write_req->getScResult();
353 }
354 }
355
356 // This will need a new way to tell if it's hooked up to a cache or not.
357 if (data_write_req->getFlags() & UNCACHEABLE)
358 recordEvent("Uncached Write");
359
360 // If the write needs to have a fault on the access, consider calling
361 // changeStatus() and changing it to "bad addr write" or something.
362 return fault;
363}
364
365

--- 191 unchanged lines hidden ---