Deleted Added
sdiff udiff text old ( 3091:dba513d68c16 ) new ( 3170:37fd1e73f836 )
full compact
1/*
2 * Copyright (c) 2001-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;

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

105}
106
107Tick
108PhysicalMemory::calculateLatency(Packet *pkt)
109{
110 return lat;
111}
112
113void
114PhysicalMemory::doFunctionalAccess(Packet *pkt)
115{
116 assert(pkt->getAddr() + pkt->getSize() < params()->addrRange.size());
117
118 switch (pkt->cmd) {
119 case Packet::ReadReq:
120 memcpy(pkt->getPtr<uint8_t>(),
121 pmemAddr + pkt->getAddr() - params()->addrRange.start,
122 pkt->getSize());
123 break;
124 case Packet::WriteReq:
125 memcpy(pmemAddr + pkt->getAddr() - params()->addrRange.start,
126 pkt->getPtr<uint8_t>(),
127 pkt->getSize());
128 // temporary hack: will need to add real LL/SC implementation
129 // for cacheless systems later.
130 if (pkt->req->getFlags() & LOCKED) {
131 pkt->req->setScResult(1);
132 }
133 break;
134 default:
135 panic("unimplemented");
136 }
137
138 pkt->result = Packet::Success;
139}

--- 215 unchanged lines hidden ---