1/* 2 * Copyright (c) 2006 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; --- 26 unchanged lines hidden (view full) --- 35 36#include <cstring> 37 38#include "base/trace.hh" 39#include "dev/sparc/mm_disk.hh" 40#include "dev/platform.hh" 41#include "mem/port.hh" 42#include "mem/packet_access.hh" |
43#include "sim/byteswap.hh" 44#include "sim/system.hh" 45 |
46MmDisk::MmDisk(const Params *p) |
47 : BasicPioDevice(p), image(p->image), curSector((off_t)-1), dirty(false) 48{ 49 std::memset(&diskData, 0, SectorSize); 50 pioSize = image->size() * SectorSize; 51} 52 53Tick 54MmDisk::read(PacketPtr pkt) --- 112 unchanged lines hidden (view full) --- 167 // serialization 168 int bytes_read; 169 if (dirty) { 170 bytes_read = image->write(diskData, curSector); 171 assert(bytes_read == SectorSize); 172 } 173} 174 |
175MmDisk * 176MmDiskParams::create() |
177{ |
178 return new MmDisk(this); |
179} |