The Pedigree Project  0.1
include/pedigree/kernel/machine/IrqManager.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 KERNEL_MACHINE_IRQMANAGER_H
21 #define KERNEL_MACHINE_IRQMANAGER_H
22 
23 #include "pedigree/kernel/machine/types.h"
24 #include "pedigree/kernel/processor/types.h"
25 
26 class Device;
27 class IrqHandler;
28 
34 {
35  public:
38  {
39  MitigationThreshold,
42  };
43 
49  virtual irq_id_t registerIsaIrqHandler(
50  uint8_t irq, IrqHandler *handler, bool bEdge = false) = 0;
52  virtual irq_id_t
53  registerPciIrqHandler(IrqHandler *handler, Device *pDevice) = 0;
57  virtual void acknowledgeIrq(irq_id_t Id) = 0;
60  virtual void unregisterHandler(irq_id_t Id, IrqHandler *handler) = 0;
61 
62  virtual void enable(uint8_t irq, bool enable) = 0;
63 
65  virtual void tick();
66 
68  virtual bool control(uint8_t irq, ControlCode code, size_t argument);
69 
70  protected:
72  IrqManager();
74  virtual ~IrqManager();
75 
76  private:
79  IrqManager(const IrqManager &);
83 };
84 
87 #endif
virtual ~IrqManager()
Definition: Device.h:43
virtual void unregisterHandler(irq_id_t Id, IrqHandler *handler)=0
virtual irq_id_t registerIsaIrqHandler(uint8_t irq, IrqHandler *handler, bool bEdge=false)=0
virtual irq_id_t registerPciIrqHandler(IrqHandler *handler, Device *pDevice)=0
IrqManager & operator=(const IrqManager &)
virtual void acknowledgeIrq(irq_id_t Id)=0
virtual bool control(uint8_t irq, ControlCode code, size_t argument)
Definition: IrqManager.cc:29
virtual void tick()
Definition: IrqManager.cc:25