simple_disk.hh revision 56
12SN/A/* 29428SAndreas.Sandberg@ARM.com * Copyright (c) 2003 The Regents of The University of Michigan 39920Syasuko.eckert@amd.com * All rights reserved. 48733Sgeoffrey.blake@arm.com * 58733Sgeoffrey.blake@arm.com * Redistribution and use in source and binary forms, with or without 68733Sgeoffrey.blake@arm.com * modification, are permitted provided that the following conditions are 78733Sgeoffrey.blake@arm.com * met: redistributions of source code must retain the above copyright 88733Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer; 98733Sgeoffrey.blake@arm.com * redistributions in binary form must reproduce the above copyright 108733Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer in the 118733Sgeoffrey.blake@arm.com * documentation and/or other materials provided with the distribution; 128733Sgeoffrey.blake@arm.com * neither the name of the copyright holders nor the names of its 138733Sgeoffrey.blake@arm.com * contributors may be used to endorse or promote products derived from 148733Sgeoffrey.blake@arm.com * this software without specific prior written permission. 152190SN/A * 162SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272SN/A */ 282SN/A 292SN/A/* @file 302SN/A * Simple disk interface for the system console 312SN/A */ 322SN/A 332SN/A#ifndef __SIMPLE_DISK_HH__ 342SN/A#define __SIMPLE_DISK_HH__ 352SN/A 362SN/A#include "mem/functional_mem/physical_memory.hh" 372SN/A#include "sim/sim_object.hh" 382SN/A 392SN/Aclass DiskImage; 402665SN/A 412665SN/A/* 422SN/A * Trivial interface to a disk image used by the System Console 432SN/A */ 442680Sktlim@umich.educlass SimpleDisk : public SimObject 452680Sktlim@umich.edu{ 462SN/Apublic: 478229Snate@binkert.org typedef uint64_t baddr_t; 487680Sgblack@eecs.umich.edu 497680Sgblack@eecs.umich.eduprotected: 506329Sgblack@eecs.umich.edu PhysicalMemory *physmem; 513453Sgblack@eecs.umich.edu DiskImage *image; 526216Snate@binkert.org 536658Snate@binkert.orgpublic: 5412104Snathanael.premillieu@arm.com SimpleDisk(const std::string &name, PhysicalMemory *pmem, DiskImage *img); 552SN/A ~SimpleDisk(); 562190SN/A 572190SN/A void read(Addr addr, baddr_t block, int count) const; 583453Sgblack@eecs.umich.edu void write(Addr addr, baddr_t block, int count); 593453Sgblack@eecs.umich.edu}; 609020Sgblack@eecs.umich.edu#endif // __SIMPLE_DISK_HH__ 616022Sgblack@eecs.umich.edu