simple_disk.hh revision 1762
1360SN/A/*
21458SN/A * Copyright (c) 2001-2005 The Regents of The University of Michigan
3360SN/A * All rights reserved.
4360SN/A *
5360SN/A * Redistribution and use in source and binary forms, with or without
6360SN/A * modification, are permitted provided that the following conditions are
7360SN/A * met: redistributions of source code must retain the above copyright
8360SN/A * notice, this list of conditions and the following disclaimer;
9360SN/A * redistributions in binary form must reproduce the above copyright
10360SN/A * notice, this list of conditions and the following disclaimer in the
11360SN/A * documentation and/or other materials provided with the distribution;
12360SN/A * neither the name of the copyright holders nor the names of its
13360SN/A * contributors may be used to endorse or promote products derived from
14360SN/A * this software without specific prior written permission.
15360SN/A *
16360SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17360SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18360SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19360SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20360SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21360SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22360SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23360SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24360SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25360SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26360SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu */
282665Ssaidi@eecs.umich.edu
292665Ssaidi@eecs.umich.edu/* @file
30360SN/A * Simple disk interface for the system console
31360SN/A */
321354SN/A
331354SN/A#ifndef __DEV_SIMPLE_DISK_HH__
34360SN/A#define __DEV_SIMPLE_DISK_HH__
352764Sstever@eecs.umich.edu
362764Sstever@eecs.umich.edu#include "sim/sim_object.hh"
372064SN/A#include "targetarch/isa_traits.hh"
38360SN/A
39360SN/Aclass DiskImage;
40360SN/Aclass PhysicalMemory;
41360SN/A
42360SN/A/*
43360SN/A * Trivial interface to a disk image used by the System Console
441809SN/A */
455543Ssaidi@eecs.umich.educlass SimpleDisk : public SimObject
461809SN/A{
473113Sgblack@eecs.umich.edupublic:
488229Snate@binkert.org  typedef uint64_t baddr_t;
498229Snate@binkert.org
503113Sgblack@eecs.umich.eduprotected:
517075Snate@binkert.org  PhysicalMemory  *physmem;
528229Snate@binkert.org  DiskImage *image;
537075Snate@binkert.org
54360SN/Apublic:
552474SN/A  SimpleDisk(const std::string &name, PhysicalMemory *pmem, DiskImage *img);
565543Ssaidi@eecs.umich.edu  ~SimpleDisk();
572462SN/A
581354SN/A  void read(Addr addr, baddr_t block, int count) const;
596216Snate@binkert.org  void write(Addr addr, baddr_t block, int count);
606658Snate@binkert.org};
612474SN/A
622680Sktlim@umich.edu#endif // __DEV_SIMPLE_DISK_HH__
638232Snate@binkert.org