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 "pedigree/kernel/machine/types.h"
24#include "pedigree/kernel/processor/types.h"
25#include "pedigree/kernel/utilities/StaticString.h"
26#include "pedigree/kernel/utilities/String.h"
27
28#include "AtaController.h"
29
30class Controller;
31
34class IsaAtaController : public AtaController /* public Controller, public RequestQueue, public
35 IrqHandler */
36{
37 public:
38 IsaAtaController(Controller* pDev, int nController = 0);
39 virtual ~IsaAtaController();
40 virtual void shutdown();
41
42 virtual void getName(String& str) {
44 s.clear();
45 s += "isa-ata-";
46 s.append(m_nController);
47 str = String(static_cast<const char*>(s));
48 }
49
50 virtual bool sendCommand(size_t nUnit, uintptr_t pCommand, uint8_t nCommandSize,
51 uintptr_t pRespBuffer, uint16_t nRespBytes, bool bWrite);
52
53 virtual uint64_t executeRequest(uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5,
54 uint64_t p6, uint64_t p7, uint64_t p8);
55
56 // IRQ handler callback.
57 virtual IrqDisposition irq(irq_id_t number);
58
59 private:
61 void operator=(const IsaAtaController&);
62
63 irq_id_t m_IrqId;
64};
65
66#endif
virtual void shutdown()
virtual IrqDisposition irq(irq_id_t number)
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)
IrqDisposition
Definition IrqHandler.h:31