Deleted Added
sdiff udiff text old ( 4022:c422464ca16e ) new ( 4040:eb894f3fc168 )
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;

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

25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Steve Reinhardt
29 */
30
31#include "arch/locked_mem.hh"
32#include "arch/utility.hh"
33#include "cpu/exetrace.hh"
34#include "cpu/simple/timing.hh"
35#include "mem/packet.hh"
36#include "mem/packet_access.hh"
37#include "sim/builder.hh"
38#include "sim/system.hh"
39
40using namespace std;

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

307
308 return fault;
309}
310
311#ifndef DOXYGEN_SHOULD_SKIP_THIS
312
313template
314Fault
315TimingSimpleCPU::read(Addr addr, uint64_t &data, unsigned flags);
316
317template
318Fault
319TimingSimpleCPU::read(Addr addr, uint32_t &data, unsigned flags);
320
321template
322Fault

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

354template <class T>
355Fault
356TimingSimpleCPU::write(T data, Addr addr, unsigned flags, uint64_t *res)
357{
358 Request *req =
359 new Request(/* asid */ 0, addr, sizeof(T), flags, thread->readPC(),
360 cpu_id, /* thread ID */ 0);
361
362 // translate to physical address
363 Fault fault = thread->translateDataWriteReq(req);
364
365 // Now do the access.
366 if (fault == NoFault) {
367 assert(dcache_pkt == NULL);
368 dcache_pkt = new Packet(req, MemCmd::WriteReq, Packet::Broadcast);
369 dcache_pkt->allocate();
370 dcache_pkt->set(data);
371
372 bool do_access = true; // flag to suppress cache access
373
374 if (req->isLocked()) {
375 do_access = TheISA::handleLockedWrite(thread, req);
376 }
377
378 if (do_access) {
379 if (!dcachePort.sendTiming(dcache_pkt)) {
380 _status = DcacheRetry;
381 } else {
382 _status = DcacheWaitResponse;
383 // memory system takes ownership of packet
384 dcache_pkt = NULL;

--- 398 unchanged lines hidden ---