Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3905 → Rev 3906

/trunk/kernel/genarch/include/kbd/z8530.h
49,8 → 49,8
extern void z8530_release(void);
extern void z8530_interrupt(void);
extern char z8530_key_read(chardev_t *);
extern irq_ownership_t z8530_claim(void);
extern void z8530_irq_handler(irq_t *, void *, ...);
extern irq_ownership_t z8530_claim(void *);
extern void z8530_irq_handler(irq_t *);
 
#endif
 
/trunk/kernel/genarch/include/kbd/ns16550.h
46,8 → 46,8
extern void ns16550_grab(void);
extern void ns16550_release(void);
extern char ns16550_key_read(chardev_t *);
extern irq_ownership_t ns16550_claim(void);
extern void ns16550_irq_handler(irq_t *, void *, ...);
extern irq_ownership_t ns16550_claim(void *);
extern void ns16550_irq_handler(irq_t *);
 
#include <arch/types.h>
#ifndef ia64
/trunk/kernel/genarch/src/kbd/ns16550.c
210,12 → 210,12
}
}
 
irq_ownership_t ns16550_claim(void)
irq_ownership_t ns16550_claim(void *instance)
{
return (ns16550_lsr_read(&ns16550) & LSR_DATA_READY);
}
 
void ns16550_irq_handler(irq_t *irq, void *arg, ...)
void ns16550_irq_handler(irq_t *irq)
{
if (irq->notif_cfg.notify && irq->notif_cfg.answerbox)
ipc_irq_send_notif(irq);
/trunk/kernel/genarch/src/kbd/i8042.c
123,12 → 123,12
interrupts_restore(ipl);
}
 
static irq_ownership_t i8042_claim(void)
static irq_ownership_t i8042_claim(void *instance)
{
return IRQ_ACCEPT;
}
 
static void i8042_irq_handler(irq_t *irq, void *arg, ...)
static void i8042_irq_handler(irq_t *irq)
{
if (irq->notif_cfg.notify && irq->notif_cfg.answerbox)
ipc_irq_send_notif(irq);
/trunk/kernel/genarch/src/kbd/z8530.c
194,12 → 194,12
}
}
 
irq_ownership_t z8530_claim(void)
irq_ownership_t z8530_claim(void *instance)
{
return (z8530_read_a(&z8530, RR0) & RR0_RCA);
}
 
void z8530_irq_handler(irq_t *irq, void *arg, ...)
void z8530_irq_handler(irq_t *irq)
{
if (irq->notif_cfg.notify && irq->notif_cfg.answerbox)
ipc_irq_send_notif(irq);
/trunk/kernel/generic/include/ddi/irq.h
79,10 → 79,10
} irq_trigger_t;
 
struct irq;
typedef void (* irq_handler_t)(struct irq *irq, void *arg, ...);
typedef void (* irq_handler_t)(struct irq *);
 
/** Type for function used to clear the interrupt. */
typedef void (* cir_t)(void *arg, inr_t inr);
typedef void (* cir_t)(void *, inr_t);
 
/** IPC notification config structure.
*
139,11 → 139,11
/** Trigger level of the IRQ. */
irq_trigger_t trigger;
/** Claim ownership of the IRQ. */
irq_ownership_t (* claim)(void);
irq_ownership_t (* claim)(void *);
/** Handler for this IRQ and device. */
irq_handler_t handler;
/** Argument for the handler. */
void *arg;
/** Instance argument for the handler and the claim function. */
void *instance;
 
/** Clear interrupt routine. */
cir_t cir;
154,11 → 154,11
ipc_notif_cfg_t notif_cfg;
} irq_t;
 
extern void irq_init(count_t inrs, count_t chains);
extern void irq_initialize(irq_t *irq);
extern void irq_register(irq_t *irq);
extern irq_t *irq_dispatch_and_lock(inr_t inr);
extern irq_t *irq_find_and_lock(inr_t inr, devno_t devno);
extern void irq_init(count_t, count_t);
extern void irq_initialize(irq_t *);
extern void irq_register(irq_t *);
extern irq_t *irq_dispatch_and_lock(inr_t);
extern irq_t *irq_find_and_lock(inr_t, devno_t);
 
#endif
 
/trunk/kernel/generic/src/ddi/irq.c
39,7 → 39,8
*
* This code is designed to support:
* - multiple devices sharing single IRQ
* - multiple IRQs per signle device
* - multiple IRQs per single device
* - multiple instances of the same device
*
*
* Note about architectures.
144,7 → 145,7
irq->trigger = (irq_trigger_t) 0;
irq->claim = NULL;
irq->handler = NULL;
irq->arg = NULL;
irq->instance = NULL;
irq->cir = NULL;
irq->cir_arg = NULL;
irq->notif_cfg.notify = false;
306,7 → 307,8
spinlock_lock(&irq->lock);
if (devno == -1) {
/* Invoked by irq_dispatch_and_lock(). */
rv = ((irq->inr == inr) && (irq->claim() == IRQ_ACCEPT));
rv = ((irq->inr == inr) &&
(irq->claim(irq->instance) == IRQ_ACCEPT));
} else {
/* Invoked by irq_find_and_lock(). */
rv = ((irq->inr == inr) && (irq->devno == devno));
365,7 → 367,7
spinlock_lock(&irq->lock);
if (devno == -1) {
/* Invoked by irq_dispatch_and_lock() */
rv = (irq->claim() == IRQ_ACCEPT);
rv = (irq->claim(irq->instance) == IRQ_ACCEPT);
} else {
/* Invoked by irq_find_and_lock() */
rv = (irq->devno == devno);
/trunk/kernel/generic/src/console/console.c
101,7 → 101,7
*
* @return Always returns IRQ_DECLINE.
*/
static irq_ownership_t klog_claim(void)
static irq_ownership_t klog_claim(void *instance)
{
return IRQ_DECLINE;
}
/trunk/kernel/generic/src/console/kconsole.c
103,7 → 103,7
* @return Always returns IRQ_DECLINE.
*
*/
static irq_ownership_t kconsole_claim(void)
static irq_ownership_t kconsole_claim(void *instance)
{
return IRQ_DECLINE;
}
/trunk/kernel/arch/sparc64/include/cpu_node.h
55,4 → 55,5
#endif
 
/** @}
*/
*/
 
/trunk/kernel/arch/sparc64/include/cpu_family.h
79,4 → 79,5
#endif
 
/** @}
*/
*/
 
/trunk/kernel/arch/sparc64/src/trap/interrupt.c
86,7 → 86,7
/*
* The IRQ handler was found.
*/
irq->handler(irq, irq->arg);
irq->handler(irq);
/*
* See if there is a clear-interrupt-routine and call it.
*/
/trunk/kernel/arch/sparc64/src/drivers/sgcn.c
319,7 → 319,7
/**
* The driver works in polled mode, so no interrupt should be handled by it.
*/
static irq_ownership_t sgcn_claim(void)
static irq_ownership_t sgcn_claim(void *instance)
{
return IRQ_DECLINE;
}
327,7 → 327,7
/**
* The driver works in polled mode, so no interrupt should be handled by it.
*/
static void sgcn_irq_handler(irq_t *irq, void *arg, ...)
static void sgcn_irq_handler(irq_t *irq)
{
panic("Not yet implemented, SGCN works in polled mode.");
}
/trunk/kernel/arch/ia64/src/ski/ski.c
186,7 → 186,7
*
* @return Always IRQ_DECLINE.
*/
static irq_ownership_t ski_kbd_claim(void)
static irq_ownership_t ski_kbd_claim(void *instance)
{
return IRQ_DECLINE;
}
/trunk/kernel/arch/ia64/src/interrupt.c
266,7 → 266,7
case INTERRUPT_TIMER:
irq = irq_dispatch_and_lock(ivr.vector);
if (irq) {
irq->handler(irq, irq->arg);
irq->handler(irq);
spinlock_unlock(&irq->lock);
} else {
panic("Unhandled Internal Timer Interrupt (%d).",
283,7 → 283,7
/* Send EOI before processing the interrupt */
end_of_local_irq();
}
irq->handler(irq, irq->arg);
irq->handler(irq);
if (!irq->preack)
end_of_local_irq();
spinlock_unlock(&irq->lock);
/trunk/kernel/arch/ia64/src/drivers/it.c
56,8 → 56,8
 
static irq_t it_irq;
 
static irq_ownership_t it_claim(void);
static void it_interrupt(irq_t *irq, void *arg, ...);
static irq_ownership_t it_claim(void *);
static void it_interrupt(irq_t *irq);
 
/** Initialize Interval Timer. */
void it_init(void)
104,13 → 104,13
*
* @return Always IRQ_ACCEPT.
*/
irq_ownership_t it_claim(void)
irq_ownership_t it_claim(void *instance)
{
return IRQ_ACCEPT;
}
 
/** Process Interval Timer interrupt. */
void it_interrupt(irq_t *irq, void *arg, ...)
void it_interrupt(irq_t *irq)
{
int64_t c;
int64_t m;
/trunk/kernel/arch/arm32/src/drivers/gxemul.c
184,9 → 184,8
/** Process keyboard interrupt.
*
* @param irq IRQ information.
* @param arg Not used.
*/
static void gxemul_irq_handler(irq_t *irq, void *arg, ...)
static void gxemul_irq_handler(irq_t *irq)
{
if ((irq->notif_cfg.notify) && (irq->notif_cfg.answerbox)) {
ipc_irq_send_notif(irq);
204,7 → 203,7
}
}
 
static irq_ownership_t gxemul_claim(void)
static irq_ownership_t gxemul_claim(void *instance)
{
return IRQ_ACCEPT;
}
266,7 → 265,7
*((uint32_t*) gxemul_hw_map.rtc_freq) = frequency;
}
 
static irq_ownership_t gxemul_timer_claim(void)
static irq_ownership_t gxemul_timer_claim(void *instance)
{
return IRQ_ACCEPT;
}
276,7 → 275,7
* @param irq Interrupt information.
* @param arg Not used.
*/
static void gxemul_timer_irq_handler(irq_t *irq, void *arg, ...)
static void gxemul_timer_irq_handler(irq_t *irq)
{
/*
* We are holding a lock which prevents preemption.
370,7 → 369,7
irq_t *irq = irq_dispatch_and_lock(i);
if (irq) {
/* The IRQ handler was found. */
irq->handler(irq, irq->arg);
irq->handler(irq);
spinlock_unlock(&irq->lock);
} else {
/* Spurious interrupt.*/
/trunk/kernel/arch/ppc32/src/interrupt.c
73,7 → 73,7
ack = true;
}
irq->handler(irq, irq->arg);
irq->handler(irq);
spinlock_unlock(&irq->lock);
} else {
/*
/trunk/kernel/arch/ppc32/src/drivers/cuda.c
249,7 → 249,7
return -1;
}
 
static void cuda_irq_handler(irq_t *irq, void *arg, ...)
static void cuda_irq_handler(irq_t *irq)
{
if ((irq->notif_cfg.notify) && (irq->notif_cfg.answerbox))
ipc_irq_send_notif(irq);
264,7 → 264,7
}
}
 
static irq_ownership_t cuda_claim(void)
static irq_ownership_t cuda_claim(void *instance)
{
return IRQ_ACCEPT;
}
/trunk/kernel/arch/amd64/src/interrupt.c
173,7 → 173,7
trap_virtual_eoi();
ack = true;
}
irq->handler(irq, irq->arg);
irq->handler(irq);
spinlock_unlock(&irq->lock);
} else {
/*
/trunk/kernel/arch/mips32/src/exception.c
144,7 → 144,7
int i;
/* decode interrupt number and process the interrupt */
cause = (cp0_cause_read() >> 8) &0xff;
cause = (cp0_cause_read() >> 8) & 0xff;
for (i = 0; i < 8; i++) {
if (cause & (1 << i)) {
153,7 → 153,7
/*
* The IRQ handler was found.
*/
irq->handler(irq, irq->arg);
irq->handler(irq);
spinlock_unlock(&irq->lock);
} else {
/*
160,7 → 160,8
* Spurious interrupt.
*/
#ifdef CONFIG_DEBUG
printf("cpu%u: spurious interrupt (inum=%d)\n", CPU->id, i);
printf("cpu%u: spurious interrupt (inum=%d)\n",
CPU->id, i);
#endif
}
}
/trunk/kernel/arch/mips32/src/interrupt.c
100,12 → 100,12
cp0_compare_write(nextcount);
}
 
static irq_ownership_t timer_claim(void)
static irq_ownership_t timer_claim(void *instance)
{
return IRQ_ACCEPT;
}
 
static void timer_irq_handler(irq_t *irq, void *arg, ...)
static void timer_irq_handler(irq_t *irq)
{
unsigned long drift;
/trunk/kernel/arch/mips32/src/drivers/serial.c
112,7 → 112,7
}
 
/** Process keyboard interrupt. Does not work in simics? */
static void serial_irq_handler(irq_t *irq, void *arg, ...)
static void serial_irq_handler(irq_t *irq)
{
if ((irq->notif_cfg.notify) && (irq->notif_cfg.answerbox))
ipc_irq_send_notif(irq);
120,7 → 120,7
serial_handler();
}
 
static irq_ownership_t serial_claim(void)
static irq_ownership_t serial_claim(void *instance)
{
return IRQ_ACCEPT;
}
/trunk/kernel/arch/mips32/src/drivers/msim.c
94,7 → 94,7
}
 
/** Process keyboard interrupt. */
static void msim_irq_handler(irq_t *irq, void *arg, ...)
static void msim_irq_handler(irq_t *irq)
{
if ((irq->notif_cfg.notify) && (irq->notif_cfg.answerbox))
ipc_irq_send_notif(irq);
110,7 → 110,7
}
}
 
static irq_ownership_t msim_claim(void)
static irq_ownership_t msim_claim(void *instance)
{
return IRQ_ACCEPT;
}
/trunk/kernel/arch/ia32/src/smp/apic.c
132,12 → 132,12
#endif
}
 
static irq_ownership_t l_apic_timer_claim(void)
static irq_ownership_t l_apic_timer_claim(void *instance)
{
return IRQ_ACCEPT;
}
 
static void l_apic_timer_irq_handler(irq_t *irq, void *arg __attribute__((unused)), ...)
static void l_apic_timer_irq_handler(irq_t *irq)
{
/*
* Holding a spinlock could prevent clock() from preempting
/trunk/kernel/arch/ia32/src/interrupt.c
188,7 → 188,7
trap_virtual_eoi();
ack = true;
}
irq->handler(irq, irq->arg);
irq->handler(irq);
spinlock_unlock(&irq->lock);
} else {
/*
/trunk/kernel/arch/ia32/src/drivers/i8254.c
61,12 → 61,12
 
static irq_t i8254_irq;
 
static irq_ownership_t i8254_claim(void)
static irq_ownership_t i8254_claim(void *instance)
{
return IRQ_ACCEPT;
}
 
static void i8254_irq_handler(irq_t *irq, void *arg __attribute__((unused)), ...)
static void i8254_irq_handler(irq_t *irq)
{
/*
* This IRQ is responsible for kernel preemption.