simple_disk.hh revision 1717
17119Sgblack@eecs.umich.edu/* 27119Sgblack@eecs.umich.edu * Copyright (c) 2001-2003 The Regents of The University of Michigan 37120Sgblack@eecs.umich.edu * All rights reserved. 47120Sgblack@eecs.umich.edu * 57120Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without 67120Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are 77120Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright 87120Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer; 97120Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright 107120Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the 117120Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution; 127120Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its 137120Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 147120Sgblack@eecs.umich.edu * this software without specific prior written permission. 157119Sgblack@eecs.umich.edu * 167119Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 177119Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 187119Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 197119Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 207119Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 217119Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 227119Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 237119Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 247119Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 257119Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 267119Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 277119Sgblack@eecs.umich.edu */ 287119Sgblack@eecs.umich.edu 297119Sgblack@eecs.umich.edu/* @file 307119Sgblack@eecs.umich.edu * Simple disk interface for the system console 317119Sgblack@eecs.umich.edu */ 327119Sgblack@eecs.umich.edu 337119Sgblack@eecs.umich.edu#ifndef __DEV_SIMPLE_DISK_HH__ 347119Sgblack@eecs.umich.edu#define __DEV_SIMPLE_DISK_HH__ 357119Sgblack@eecs.umich.edu 367119Sgblack@eecs.umich.edu#include "sim/sim_object.hh" 377119Sgblack@eecs.umich.edu#include "targetarch/isa_traits.hh" 387119Sgblack@eecs.umich.edu 397119Sgblack@eecs.umich.educlass DiskImage; 407119Sgblack@eecs.umich.educlass PhysicalMemory; 417119Sgblack@eecs.umich.edu 427119Sgblack@eecs.umich.edu/* 437119Sgblack@eecs.umich.edu * Trivial interface to a disk image used by the System Console 447646Sgene.wu@arm.com */ 457646Sgene.wu@arm.comclass SimpleDisk : public SimObject 467646Sgene.wu@arm.com{ 477646Sgene.wu@arm.compublic: 487646Sgene.wu@arm.com typedef uint64_t baddr_t; 497646Sgene.wu@arm.com 507646Sgene.wu@arm.comprotected: 517646Sgene.wu@arm.com PhysicalMemory *physmem; 527646Sgene.wu@arm.com DiskImage *image; 537646Sgene.wu@arm.com 547646Sgene.wu@arm.compublic: 557646Sgene.wu@arm.com SimpleDisk(const std::string &name, PhysicalMemory *pmem, DiskImage *img); 567646Sgene.wu@arm.com ~SimpleDisk(); 577646Sgene.wu@arm.com 587646Sgene.wu@arm.com void read(Addr addr, baddr_t block, int count) const; 597646Sgene.wu@arm.com void write(Addr addr, baddr_t block, int count); 607646Sgene.wu@arm.com}; 617646Sgene.wu@arm.com 627646Sgene.wu@arm.com#endif // __DEV_SIMPLE_DISK_HH__ 637646Sgene.wu@arm.com