Subversion Repositories HelenOS

Rev

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

Rev 4342 Rev 4343
Line 77... Line 77...
77
    IRQ_TRIGGER_LEVEL = 1,
77
    IRQ_TRIGGER_LEVEL = 1,
78
    IRQ_TRIGGER_EDGE
78
    IRQ_TRIGGER_EDGE
79
} irq_trigger_t;
79
} irq_trigger_t;
80
 
80
 
81
struct irq;
81
struct irq;
82
typedef void (* irq_handler_t)(struct irq *irq, void *arg, ...);
82
typedef void (* irq_handler_t)(struct irq *);
83
 
83
 
84
/** Type for function used to clear the interrupt. */
84
/** Type for function used to clear the interrupt. */
85
typedef void (* cir_t)(void *arg, inr_t inr);
85
typedef void (* cir_t)(void *, inr_t);
86
 
86
 
87
/** IPC notification config structure.
87
/** IPC notification config structure.
88
 *
88
 *
89
 * Primarily, this structure is encapsulated in the irq_t structure.
89
 * Primarily, this structure is encapsulated in the irq_t structure.
90
 * It is protected by irq_t::lock.
90
 * It is protected by irq_t::lock.
Line 137... Line 137...
137
    /** Actual IRQ number. -1 if not yet assigned. */
137
    /** Actual IRQ number. -1 if not yet assigned. */
138
    inr_t inr;
138
    inr_t inr;
139
    /** Trigger level of the IRQ. */
139
    /** Trigger level of the IRQ. */
140
    irq_trigger_t trigger;
140
    irq_trigger_t trigger;
141
    /** Claim ownership of the IRQ. */
141
    /** Claim ownership of the IRQ. */
142
    irq_ownership_t (* claim)(void);
142
    irq_ownership_t (* claim)(void *);
143
    /** Handler for this IRQ and device. */
143
    /** Handler for this IRQ and device. */
144
    irq_handler_t handler;
144
    irq_handler_t handler;
145
    /** Argument for the handler. */
145
    /** Instance argument for the handler and the claim function. */
146
    void *arg;
146
    void *instance;
147
 
147
 
148
    /** Clear interrupt routine. */
148
    /** Clear interrupt routine. */
149
    cir_t cir;
149
    cir_t cir;
150
    /** First argument to the clear interrupt routine. */
150
    /** First argument to the clear interrupt routine. */
151
    void *cir_arg;
151
    void *cir_arg;
152
 
152
 
153
    /** Notification configuration structure. */
153
    /** Notification configuration structure. */
154
    ipc_notif_cfg_t notif_cfg;
154
    ipc_notif_cfg_t notif_cfg;
155
} irq_t;
155
} irq_t;
156
 
156
 
157
extern void irq_init(count_t inrs, count_t chains);
157
extern void irq_init(count_t, count_t);
158
extern void irq_initialize(irq_t *irq);
158
extern void irq_initialize(irq_t *);
159
extern void irq_register(irq_t *irq);
159
extern void irq_register(irq_t *);
160
extern irq_t *irq_dispatch_and_lock(inr_t inr);
160
extern irq_t *irq_dispatch_and_lock(inr_t);
161
extern irq_t *irq_find_and_lock(inr_t inr, devno_t devno);
161
extern irq_t *irq_find_and_lock(inr_t, devno_t);
162
 
162
 
163
#endif
163
#endif
164
 
164
 
165
#endif
165
#endif
166
 
166