Subversion Repositories HelenOS

Rev

Rev 1922 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1922 Rev 1923
Line 34... Line 34...
34
 
34
 
35
#ifndef KERN_IRQ_H_
35
#ifndef KERN_IRQ_H_
36
#define KERN_IRQ_H_
36
#define KERN_IRQ_H_
37
 
37
 
38
#include <arch/types.h>
38
#include <arch/types.h>
-
 
39
#include <typedefs.h>
39
#include <adt/list.h>
40
#include <adt/list.h>
40
#include <ipc/ipc.h>
-
 
41
#include <ipc/irq.h>
41
#include <ipc/irq.h>
42
#include <atomic.h>
-
 
43
#include <synch/spinlock.h>
42
#include <synch/spinlock.h>
44
 
43
 
45
typedef enum {
44
typedef enum {
46
    IRQ_DECLINE,        /**< Decline to service. */
45
    IRQ_DECLINE,        /**< Decline to service. */
47
    IRQ_ACCEPT      /**< Accept to service. */
46
    IRQ_ACCEPT      /**< Accept to service. */
Line 50... Line 49...
50
typedef enum {
49
typedef enum {
51
    IRQ_TRIGGER_LEVEL = 1,
50
    IRQ_TRIGGER_LEVEL = 1,
52
    IRQ_TRIGGER_EDGE
51
    IRQ_TRIGGER_EDGE
53
} irq_trigger_t;
52
} irq_trigger_t;
54
 
53
 
55
typedef struct irq irq_t;
-
 
56
 
-
 
57
typedef void (* irq_handler_t)(irq_t *irq, void *arg, ...);
54
typedef void (* irq_handler_t)(irq_t *irq, void *arg, ...);
58
 
55
 
59
/** Structure representing one device IRQ.
56
/** Structure representing one device IRQ.
60
 *
57
 *
61
 * If one device has multiple interrupts, there will
58
 * If one device has multiple interrupts, there will
Line 85... Line 82...
85
    /** Handler for this IRQ and device. */
82
    /** Handler for this IRQ and device. */
86
    irq_handler_t handler;
83
    irq_handler_t handler;
87
    /** Argument for the handler. */
84
    /** Argument for the handler. */
88
    void *arg;
85
    void *arg;
89
 
86
 
90
    /** Answerbox of the task that wanted to be notified. */
-
 
91
    answerbox_t *notif_answerbox;
-
 
92
    /** Pseudo-code to be performed by the top-half
-
 
93
     *  before a notification is sent. */
87
    /** Notification configuration structure. */
94
    irq_code_t *code;
-
 
95
    /** Method of the notification. */
88
    ipc_notif_cfg_t notif_cfg;
96
    unative_t method;
-
 
97
    /** Counter of IRQ notifications. */
-
 
98
    atomic_t counter;
-
 
99
};
89
};
100
 
90
 
101
extern void irq_init(count_t inrs, count_t chains);
91
extern void irq_init(count_t inrs, count_t chains);
102
extern void irq_initialize(irq_t *irq);
92
extern void irq_initialize(irq_t *irq);
103
extern void irq_register(irq_t *irq);
93
extern void irq_register(irq_t *irq);