simple_disk.hh revision 5034
1955SN/A/*
2955SN/A * Copyright (c) 2001-2005 The Regents of The University of Michigan
35871Snate@binkert.org * All rights reserved.
41762SN/A *
5955SN/A * Redistribution and use in source and binary forms, with or without
6955SN/A * modification, are permitted provided that the following conditions are
7955SN/A * met: redistributions of source code must retain the above copyright
8955SN/A * notice, this list of conditions and the following disclaimer;
9955SN/A * redistributions in binary form must reproduce the above copyright
10955SN/A * notice, this list of conditions and the following disclaimer in the
11955SN/A * documentation and/or other materials provided with the distribution;
12955SN/A * neither the name of the copyright holders nor the names of its
13955SN/A * contributors may be used to endorse or promote products derived from
14955SN/A * this software without specific prior written permission.
15955SN/A *
16955SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17955SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18955SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19955SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20955SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21955SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22955SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23955SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24955SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25955SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26955SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27955SN/A *
28955SN/A * Authors: Nathan Binkert
292665Ssaidi@eecs.umich.edu */
302665Ssaidi@eecs.umich.edu
315863Snate@binkert.org/* @file
32955SN/A * Simple disk interface for the system console
33955SN/A */
34955SN/A
35955SN/A#ifndef __DEV_SIMPLE_DISK_HH__
36955SN/A#define __DEV_SIMPLE_DISK_HH__
372632Sstever@eecs.umich.edu
382632Sstever@eecs.umich.edu#include "sim/sim_object.hh"
392632Sstever@eecs.umich.edu#include "arch/isa_traits.hh"
402632Sstever@eecs.umich.edu#include "params/SimpleDisk.hh"
41955SN/A
422632Sstever@eecs.umich.educlass DiskImage;
432632Sstever@eecs.umich.educlass System;
442761Sstever@eecs.umich.edu
452632Sstever@eecs.umich.edu/*
462632Sstever@eecs.umich.edu * Trivial interface to a disk image used by the System Console
472632Sstever@eecs.umich.edu */
482761Sstever@eecs.umich.educlass SimpleDisk : public SimObject
492761Sstever@eecs.umich.edu{
502761Sstever@eecs.umich.edu  public:
512632Sstever@eecs.umich.edu    typedef uint64_t baddr_t;
522632Sstever@eecs.umich.edu
532761Sstever@eecs.umich.edu  protected:
542761Sstever@eecs.umich.edu    System  *system;
552761Sstever@eecs.umich.edu    DiskImage *image;
562761Sstever@eecs.umich.edu
572761Sstever@eecs.umich.edu  public:
582632Sstever@eecs.umich.edu    typedef SimpleDiskParams Params;
592632Sstever@eecs.umich.edu    SimpleDisk(const Params *p);
602632Sstever@eecs.umich.edu    ~SimpleDisk();
612632Sstever@eecs.umich.edu
622632Sstever@eecs.umich.edu    void read(Addr addr, baddr_t block, int count) const;
632632Sstever@eecs.umich.edu    void write(Addr addr, baddr_t block, int count);
642632Sstever@eecs.umich.edu};
65955SN/A
66955SN/A#endif // __DEV_SIMPLE_DISK_HH__
67955SN/A