The Pedigree Project  0.1
kernel/core/processor/ppc32/InterruptManager.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_PROCESSOR_PPC32_INTERRUPTMANAGER_H
21 #define KERNEL_PROCESSOR_PPC32_INTERRUPTMANAGER_H
22 
23 #include "pedigree/kernel/Spinlock.h"
24 #include "pedigree/kernel/compiler.h"
25 #include "pedigree/kernel/processor/InterruptManager.h"
26 #include "pedigree/kernel/processor/SyscallManager.h"
27 #include "pedigree/kernel/processor/Syscalls.h"
28 #include "pedigree/kernel/processor/types.h"
29 
35 {
36  public:
40  {
41  return m_Instance;
42  }
43 
44  // InterruptManager Interface
45  virtual bool
46  registerInterruptHandler(size_t interruptNumber, InterruptHandler *handler);
47 
48 #ifdef DEBUGGER
50  size_t interruptNumber, InterruptHandler *handler);
51  virtual size_t getBreakpointInterruptNumber() PURE;
52  virtual size_t getDebugInterruptNumber() PURE;
53 #endif
54 
55  // SyscallManager Interface
56  virtual bool
57  registerSyscallHandler(Service_t Service, SyscallHandler *handler);
58  virtual uintptr_t syscall(
59  Service_t service, uintptr_t function, uintptr_t p1 = 0,
60  uintptr_t p2 = 0, uintptr_t p3 = 0, uintptr_t p4 = 0, uintptr_t p5 = 0);
61 
65  static void initialiseProcessor();
66 
67  private:
71  static void interrupt(InterruptState &interruptState);
81  virtual ~PPC32InterruptManager();
82 
83  InterruptHandler *m_pHandler[64];
84 #ifdef DEBUGGER
85 
87 #endif
88 
90 
93 
96 };
97 
98 #define SYSCALL_INTERRUPT_NUMBER 9
99 #define TRAP_INTERRUPT_NUMBER 6
100 #define TRACE_INTERRUPT_NUMBER 10
101 
104 #endif
virtual size_t getDebugInterruptNumber() PURE
virtual bool registerInterruptHandlerDebugger(size_t interruptNumber, InterruptHandler *handler)
virtual bool registerSyscallHandler(Service_t Service, SyscallHandler *handler)
Handles interrupts and interrupt registrations from kernel components.
PPC32InterruptManager & operator=(const PPC32InterruptManager &)
static void interrupt(InterruptState &interruptState)
Abstract base class for interrupt-handlers.
virtual bool registerInterruptHandler(size_t interruptNumber, InterruptHandler *handler)
virtual uintptr_t syscall(Service_t service, uintptr_t function, uintptr_t p1=0, uintptr_t p2=0, uintptr_t p3=0, uintptr_t p4=0, uintptr_t p5=0)
virtual size_t getBreakpointInterruptNumber() PURE