OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [tools/] [src/] [librw11/] [Rw11UnitDisk.hpp] - Blame information for rev 29

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 29 wfjm
// $Id: Rw11UnitDisk.hpp 647 2015-02-17 22:35:36Z mueller $
2 20 wfjm
//
3 29 wfjm
// Copyright 2013-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 20 wfjm
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
// 
14
// Revision History: 
15
// Date         Rev Version  Comment
16 29 wfjm
// 2015-02-18   647   1.0.1  add Nwrd2Nblk()
17 20 wfjm
// 2013-04-19   507   1.0    Initial version
18
// 2013-02-19   490   0.1    First draft
19
// ---------------------------------------------------------------------------
20
 
21
 
22
/*!
23
  \file
24 29 wfjm
  \version $Id: Rw11UnitDisk.hpp 647 2015-02-17 22:35:36Z mueller $
25 20 wfjm
  \brief   Declaration of class Rw11UnitDisk.
26
*/
27
 
28
#ifndef included_Retro_Rw11UnitDisk
29
#define included_Retro_Rw11UnitDisk 1
30
 
31
#include "Rw11VirtDisk.hpp"
32
 
33
#include "Rw11UnitVirt.hpp"
34
 
35
namespace Retro {
36
 
37
  class Rw11UnitDisk : public Rw11UnitVirt<Rw11VirtDisk> {
38
    public:
39
                    Rw11UnitDisk(Rw11Cntl* pcntl, size_t index);
40
                   ~Rw11UnitDisk();
41
 
42
      virtual void  SetType(const std::string& type);
43
 
44
      const std::string& Type() const;
45
      size_t        NCylinder() const;
46
      size_t        NHead() const;
47
      size_t        NSector() const;
48
      size_t        BlockSize() const;
49
      size_t        NBlock() const;
50
 
51
      uint32_t      Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se);
52
      void          Lba2Chs(uint32_t lba, uint16_t& cy, uint16_t& hd,
53
                            uint16_t& se);
54 29 wfjm
      uint32_t      Nwrd2Nblk(uint32_t nwrd);
55 20 wfjm
 
56
      void          SetWProt(bool wprot);
57
      bool          WProt() const;
58
 
59
      bool          VirtRead(size_t lba, size_t nblk, uint8_t* data,
60
                             RerrMsg& emsg);
61
      bool          VirtWrite(size_t lba, size_t nblk, const uint8_t* data,
62
                              RerrMsg& emsg);
63
 
64
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
65
 
66
    protected:
67
      std::string   fType;
68
      size_t        fNCyl;
69
      size_t        fNHead;
70
      size_t        fNSect;
71
      size_t        fBlksize;
72
      size_t        fNBlock;
73
      bool          fWProt;
74
  };
75
 
76
} // end namespace Retro
77
 
78
#include "Rw11UnitDisk.ipp"
79
 
80
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.