mm_disk.cc (3898:42a529d97cf2) mm_disk.cc (3918:1f9a98d198e8)
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;

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

28 * Authors: Ali Saidi
29 */
30
31/** @file
32 * This device acts as a disk similar to the memory mapped disk device
33 * in legion. Any access is translated to an offset in the disk image.
34 */
35
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;

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

28 * Authors: Ali Saidi
29 */
30
31/** @file
32 * This device acts as a disk similar to the memory mapped disk device
33 * in legion. Any access is translated to an offset in the disk image.
34 */
35
36#include <cstring>
37
36#include "base/trace.hh"
37#include "dev/sparc/mm_disk.hh"
38#include "dev/platform.hh"
39#include "mem/port.hh"
40#include "mem/packet_access.hh"
41#include "sim/builder.hh"
42#include "sim/byteswap.hh"
43#include "sim/system.hh"
44
45MmDisk::MmDisk(Params *p)
46 : BasicPioDevice(p), image(p->image), curSector((uint64_t)-1), dirty(false)
47{
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/builder.hh"
44#include "sim/byteswap.hh"
45#include "sim/system.hh"
46
47MmDisk::MmDisk(Params *p)
48 : BasicPioDevice(p), image(p->image), curSector((uint64_t)-1), dirty(false)
49{
48 memset(&bytes, 0, SectorSize);
50 std::memset(&bytes, 0, SectorSize);
49 pioSize = image->size() * SectorSize;
50}
51
52Tick
53MmDisk::read(PacketPtr pkt)
54{
55 Addr accessAddr;
56 off_t sector;

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

94 pkt->result = Packet::Success;
95 return pioDelay;
96}
97
98Tick
99MmDisk::write(PacketPtr pkt)
100{
101 panic("need to implement\n");
51 pioSize = image->size() * SectorSize;
52}
53
54Tick
55MmDisk::read(PacketPtr pkt)
56{
57 Addr accessAddr;
58 off_t sector;

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

96 pkt->result = Packet::Success;
97 return pioDelay;
98}
99
100Tick
101MmDisk::write(PacketPtr pkt)
102{
103 panic("need to implement\n");
104 M5_DUMMY_RETURN
102}
103
104
105BEGIN_DECLARE_SIM_OBJECT_PARAMS(MmDisk)
106 Param<Addr> pio_addr;
107 Param<Tick> pio_latency;
108 Param<Addr> pio_size;
109 SimObjectParam<Platform *> platform;

--- 28 unchanged lines hidden ---
105}
106
107
108BEGIN_DECLARE_SIM_OBJECT_PARAMS(MmDisk)
109 Param<Addr> pio_addr;
110 Param<Tick> pio_latency;
111 Param<Addr> pio_size;
112 SimObjectParam<Platform *> platform;

--- 28 unchanged lines hidden ---