TEMU  4.4
The Terma Emulator
IrqController.h
Go to the documentation of this file.
1 //===------------------------------------------------------------*- C++ -*-===//
2 //
3 // TEMU: The Terma Emulator
4 // (c) Terma 2015
5 // Authors: Mattias Holm <maho (at) terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef TEMU_IRQ_CONTROLLER_H
10 #define TEMU_IRQ_CONTROLLER_H
11 
12 #include "temu-c/Support/Objsys.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 //! Interrupt controller interface. An interrupt controller can raise
19 //! and lower IRQ signals. For systems which has interrupts which can
20 //! be configured to be active high, low or rising or falling, the
21 //! raise and lower irq have different semantics. For rising edge
22 //! triggering, the raiseInterrupt function should trigger the IRQ.
23 
24 typedef struct temu_IrqControllerIface {
25  //! Raise interrupt
26  void (*raiseInterrupt)(void *Obj, uint8_t Irq);
27  //! Lower interrupt
28  void (*lowerInterrupt)(void *Obj, uint8_t Irq);
29 } temu_IrqCtrlIface;
30 #define TEMU_IRQ_CTRL_IFACE_TYPE "IrqCtrlIface"
31 TEMU_IFACE_REFERENCE_TYPE(temu_IrqCtrl);
32 
33 //! Interface to be defined for classes that uses an IRQ controller
34 //! object. An IRQ controller may acknowledge to the IRQ controller
35 //! client, or it may notify the IrqClient that the underlying IRQ
36 //! controller has been modified and any pending IRQs should be
37 //! re-issued. Typically, an updateInterrupt call happens if the IRQ
38 //! registers change in such a way that the IRQ controller does not
39 //! know the next interrupt to be issued. E.g. On the sparc, the
40 //! updateInterrupts function will be called on its IRQ controller
41 //! whenever the ET or PIL field has changed.
42 //! That is updateInterrupts are called by lazy IRQ controllers.
43 
44 typedef struct temu_IrqClientIface {
45  //! Acknowledge interrupt (IRQ controller should clear interrupt)
46  void (*ackInterrupt)(void *Obj, uint8_t Irq);
47  //! Called in case IRQ re-issuing is needed eg. when the IRQ
48  //! controlling registers have been modified.
49  //! IRQ controller should reevaluate interrupts and reraise them upstream.
50  void (*updateInterrupts)(void *Obj);
51 } temu_IrqClientIface;
52 #define TEMU_IRQ_CLIENT_IFACE_TYPE "IrqClientIface"
53 TEMU_IFACE_REFERENCE_TYPE(temu_IrqClient);
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif /* ! TEMU_IRQ_CONTROLLER_H */
temu_IrqClientIface
Definition: IrqController.h:44
temu_IrqControllerIface::raiseInterrupt
void(* raiseInterrupt)(void *Obj, uint8_t Irq)
Raise interrupt.
Definition: IrqController.h:26
temu_IrqClientIface::ackInterrupt
void(* ackInterrupt)(void *Obj, uint8_t Irq)
Acknowledge interrupt (IRQ controller should clear interrupt)
Definition: IrqController.h:46
temu_IrqClientIface::updateInterrupts
void(* updateInterrupts)(void *Obj)
Definition: IrqController.h:50
temu_IrqControllerIface::lowerInterrupt
void(* lowerInterrupt)(void *Obj, uint8_t Irq)
Lower interrupt.
Definition: IrqController.h:28
temu_IrqControllerIface
Definition: IrqController.h:24