The Pedigree Project  0.1
Apic.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_X86_COMMON_APIC_H
21 #define KERNEL_MACHINE_X86_COMMON_APIC_H
22 
23 #if defined(APIC)
24 
25 #include "pedigree/kernel/compiler.h"
26 #include "pedigree/kernel/machine/IrqManager.h"
27 #include "pedigree/kernel/machine/types.h"
28 #include "pedigree/kernel/processor/types.h"
29 
30 class Device;
31 class IrqHandler;
32 
38 class Apic : public IrqManager
39 {
40  public:
42  inline Apic()
43  {
44  }
46  inline virtual ~Apic()
47  {
48  }
49 
50  //
51  // IrqManager interface
52  //
53  virtual irq_id_t
54  registerIsaIrqHandler(uint8_t, IrqHandler *handler, bool bEdge = false);
55  virtual irq_id_t
56  registerPciIrqHandler(IrqHandler *handler, Device *pDevice);
57  virtual void acknowledgeIrq(irq_id_t Id);
58  virtual void unregisterHandler(irq_id_t Id, IrqHandler *handler);
59  virtual void enable(irq_id_t Id, bool bEnable);
60 
61  bool initialise() INITIALISATION_ONLY;
62 
63  private:
66  Apic(const Apic &);
69  Apic &operator=(const Apic &);
70 
72  static Apic m_Instance;
73 };
74 
77 #endif
78 
79 #endif
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
virtual void acknowledgeIrq(irq_id_t Id)=0