The Pedigree Project  0.1
IsaAtaController.h
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef ATA_ATA_CONTROLLER_H
21 #define ATA_ATA_CONTROLLER_H
22 
23 #include "AtaController.h"
24 #include "pedigree/kernel/machine/types.h"
25 #include "pedigree/kernel/processor/state_forward.h"
26 #include "pedigree/kernel/processor/types.h"
27 #include "pedigree/kernel/utilities/StaticString.h"
28 #include "pedigree/kernel/utilities/String.h"
29 
30 class Controller;
31 
35  : public AtaController /* public Controller, public RequestQueue, public
36  IrqHandler */
37 {
38  public:
39  IsaAtaController(Controller *pDev, int nController = 0);
40  virtual ~IsaAtaController();
41 
42  virtual void getName(String &str)
43  {
45  s.clear();
46  s += "isa-ata-";
47  s.append(m_nController);
48  str = String(static_cast<const char *>(s));
49  }
50 
51  virtual bool sendCommand(
52  size_t nUnit, uintptr_t pCommand, uint8_t nCommandSize,
53  uintptr_t pRespBuffer, uint16_t nRespBytes, bool bWrite);
54 
55  virtual uint64_t executeRequest(
56  uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5,
57  uint64_t p6, uint64_t p7, uint64_t p8);
58 
59  // IRQ handler callback.
60  virtual bool irq(irq_id_t number, InterruptState &state);
61 
62  private:
64  void operator=(const IsaAtaController &);
65 };
66 
67 #endif
Definition: String.h:49
virtual bool irq(irq_id_t number, InterruptState &state)
virtual uint64_t executeRequest(uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5, uint64_t p6, uint64_t p7, uint64_t p8)
virtual void getName(String &str)