simple_disk.hh revision 5034
12817Sksewell@umich.edu/* 22817Sksewell@umich.edu * Copyright (c) 2001-2005 The Regents of The University of Michigan 32817Sksewell@umich.edu * All rights reserved. 42817Sksewell@umich.edu * 52817Sksewell@umich.edu * Redistribution and use in source and binary forms, with or without 62817Sksewell@umich.edu * modification, are permitted provided that the following conditions are 72817Sksewell@umich.edu * met: redistributions of source code must retain the above copyright 82817Sksewell@umich.edu * notice, this list of conditions and the following disclaimer; 92817Sksewell@umich.edu * redistributions in binary form must reproduce the above copyright 102817Sksewell@umich.edu * notice, this list of conditions and the following disclaimer in the 112817Sksewell@umich.edu * documentation and/or other materials provided with the distribution; 122817Sksewell@umich.edu * neither the name of the copyright holders nor the names of its 132817Sksewell@umich.edu * contributors may be used to endorse or promote products derived from 142817Sksewell@umich.edu * this software without specific prior written permission. 152817Sksewell@umich.edu * 162817Sksewell@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172817Sksewell@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182817Sksewell@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192817Sksewell@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202817Sksewell@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212817Sksewell@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222817Sksewell@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232817Sksewell@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242817Sksewell@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252817Sksewell@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262817Sksewell@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272817Sksewell@umich.edu * 282817Sksewell@umich.edu * Authors: Nathan Binkert 294202Sbinkertn@umich.edu */ 302817Sksewell@umich.edu 312817Sksewell@umich.edu/* @file 322817Sksewell@umich.edu * Simple disk interface for the system console 334202Sbinkertn@umich.edu */ 342817Sksewell@umich.edu 355192Ssaidi@eecs.umich.edu#ifndef __DEV_SIMPLE_DISK_HH__ 365192Ssaidi@eecs.umich.edu#define __DEV_SIMPLE_DISK_HH__ 375192Ssaidi@eecs.umich.edu 385192Ssaidi@eecs.umich.edu#include "sim/sim_object.hh" 395192Ssaidi@eecs.umich.edu#include "arch/isa_traits.hh" 404202Sbinkertn@umich.edu#include "params/SimpleDisk.hh" 414486Sbinkertn@umich.edu 424486Sbinkertn@umich.educlass DiskImage; 434486Sbinkertn@umich.educlass System; 444486Sbinkertn@umich.edu 454202Sbinkertn@umich.edu/* 464202Sbinkertn@umich.edu * Trivial interface to a disk image used by the System Console 474202Sbinkertn@umich.edu */ 484202Sbinkertn@umich.educlass SimpleDisk : public SimObject 495597Sgblack@eecs.umich.edu{ 504202Sbinkertn@umich.edu public: 515597Sgblack@eecs.umich.edu typedef uint64_t baddr_t; 524202Sbinkertn@umich.edu 534202Sbinkertn@umich.edu protected: 544202Sbinkertn@umich.edu System *system; 554202Sbinkertn@umich.edu DiskImage *image; 564202Sbinkertn@umich.edu 574202Sbinkertn@umich.edu public: 584202Sbinkertn@umich.edu typedef SimpleDiskParams Params; 594202Sbinkertn@umich.edu SimpleDisk(const Params *p); 604202Sbinkertn@umich.edu ~SimpleDisk(); 614202Sbinkertn@umich.edu 624202Sbinkertn@umich.edu void read(Addr addr, baddr_t block, int count) const; 634202Sbinkertn@umich.edu void write(Addr addr, baddr_t block, int count); 644202Sbinkertn@umich.edu}; 655597Sgblack@eecs.umich.edu 662817Sksewell@umich.edu#endif // __DEV_SIMPLE_DISK_HH__ 675192Ssaidi@eecs.umich.edu