Changeset 6cd9aa6 in mainline for kernel/generic


Ignore:
Timestamp:
2009-02-15T23:13:55Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
17f168e
Parents:
fa09449
Message:

IRQ handlers are using one superfluous argument and an unused elipsis.
On the other hand, IRQ claim functions would need to be passed the instance
argument.

Location:
kernel/generic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/ddi/irq.h

    rfa09449 r6cd9aa6  
    8080
    8181struct irq;
    82 typedef void (* irq_handler_t)(struct irq *irq, void *arg, ...);
     82typedef void (* irq_handler_t)(struct irq *);
    8383
    8484/** Type for function used to clear the interrupt. */
    85 typedef void (* cir_t)(void *arg, inr_t inr);
     85typedef void (* cir_t)(void *, inr_t);
    8686
    8787/** IPC notification config structure.
     
    140140        irq_trigger_t trigger;
    141141        /** Claim ownership of the IRQ. */
    142         irq_ownership_t (* claim)(void);
     142        irq_ownership_t (* claim)(void *);
    143143        /** Handler for this IRQ and device. */
    144144        irq_handler_t handler;
    145         /** Argument for the handler. */
    146         void *arg;
     145        /** Instance argument for the handler and the claim function. */
     146        void *instance;
    147147
    148148        /** Clear interrupt routine. */
     
    155155} irq_t;
    156156
    157 extern void irq_init(count_t inrs, count_t chains);
    158 extern void irq_initialize(irq_t *irq);
    159 extern void irq_register(irq_t *irq);
    160 extern irq_t *irq_dispatch_and_lock(inr_t inr);
    161 extern irq_t *irq_find_and_lock(inr_t inr, devno_t devno);
     157extern void irq_init(count_t, count_t);
     158extern void irq_initialize(irq_t *);
     159extern void irq_register(irq_t *);
     160extern irq_t *irq_dispatch_and_lock(inr_t);
     161extern irq_t *irq_find_and_lock(inr_t, devno_t);
    162162
    163163#endif
  • kernel/generic/src/console/console.c

    rfa09449 r6cd9aa6  
    102102 * @return Always returns IRQ_DECLINE.
    103103 */
    104 static irq_ownership_t klog_claim(void)
     104static irq_ownership_t klog_claim(void *instance)
    105105{
    106106        return IRQ_DECLINE;
  • kernel/generic/src/console/kconsole.c

    rfa09449 r6cd9aa6  
    104104 *
    105105 */
    106 static irq_ownership_t kconsole_claim(void)
     106static irq_ownership_t kconsole_claim(void *instance)
    107107{
    108108        return IRQ_DECLINE;
  • kernel/generic/src/ddi/irq.c

    rfa09449 r6cd9aa6  
    4040 * This code is designed to support:
    4141 * - multiple devices sharing single IRQ
    42  * - multiple IRQs per signle device
     42 * - multiple IRQs per single device
     43 * - multiple instances of the same device
    4344 *
    4445 *
     
    145146        irq->claim = NULL;
    146147        irq->handler = NULL;
    147         irq->arg = NULL;
     148        irq->instance = NULL;
    148149        irq->cir = NULL;
    149150        irq->cir_arg = NULL;
     
    307308        if (devno == -1) {
    308309                /* Invoked by irq_dispatch_and_lock(). */
    309                 rv = ((irq->inr == inr) && (irq->claim() == IRQ_ACCEPT));
     310                rv = ((irq->inr == inr) &&
     311                    (irq->claim(irq->instance) == IRQ_ACCEPT));
    310312        } else {
    311313                /* Invoked by irq_find_and_lock(). */
     
    366368        if (devno == -1) {
    367369                /* Invoked by irq_dispatch_and_lock() */
    368                 rv = (irq->claim() == IRQ_ACCEPT);
     370                rv = (irq->claim(irq->instance) == IRQ_ACCEPT);
    369371        } else {
    370372                /* Invoked by irq_find_and_lock() */
Note: See TracChangeset for help on using the changeset viewer.