Changeset 8d2760f in mainline for kernel/arch/sparc64/src


Ignore:
Timestamp:
2008-11-29T20:24:47Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
57e76cb
Parents:
dfd77382
Message:

Add additional members to the irq_t structure so that an interrupt-driven driver
does not need to know how to clear the level interrupt. The z8530 was modified
in this way and is much more generic. The ns16550 driver has also been modified,
but awaits testing. The sparc64 interrupt mapping and dispatch code is now using
the new info and calls the clear-interrupt-routine itself.

Location:
kernel/arch/sparc64/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/drivers/fhc.c

    rdfd77382 r8d2760f  
    102102}
    103103
    104 void fhc_clear_interrupt(fhc_t *fhc, int inr)
     104void fhc_clear_interrupt(void *fhcp, int inr)
    105105{
     106        fhc_t *fhc = (fhc_t *)fhcp;
    106107        ASSERT(fhc->uart_imap);
    107108
  • kernel/arch/sparc64/src/drivers/kbd.c

    rdfd77382 r8d2760f  
    6464        ofw_tree_property_t *prop;
    6565        const char *name;
     66        cir_t cir;
     67        void *cir_arg;
    6668       
    6769        name = ofw_tree_node_name(node);
     
    110112                }
    111113                if (!ofw_fhc_map_interrupt(node->parent,
    112                     ((ofw_fhc_reg_t *) prop->value), interrupts, &inr)) {
     114                    ((ofw_fhc_reg_t *) prop->value), interrupts, &inr, &cir,
     115                    &cir_arg)) {
    113116                        printf("Failed to determine keyboard interrupt.\n");
    114117                        return;
     
    124127                }
    125128                if (!ofw_ebus_map_interrupt(node->parent,
    126                     ((ofw_ebus_reg_t *) prop->value), interrupts, &inr)) {
     129                    ((ofw_ebus_reg_t *) prop->value), interrupts, &inr, &cir,
     130                    &cir_arg)) {
    127131                        printf("Failed to determine keyboard interrupt.\n");
    128132                        return;
     
    147151#ifdef CONFIG_Z8530
    148152        case KBD_Z8530:
    149                 z8530_init(devno, inr, vaddr);
     153                z8530_init(devno, vaddr, inr, cir, cir_arg);
    150154                break;
    151155#endif
    152156#ifdef CONFIG_NS16550
    153157        case KBD_NS16550:
    154                 ns16550_init(devno, inr, (ioport_t)vaddr);
     158                ns16550_init(devno, (ioport_t)vaddr, inr, cir, cir_arg);
    155159                break;
    156160#endif
  • kernel/arch/sparc64/src/drivers/pci.c

    rdfd77382 r8d2760f  
    5555#define OBIO_CIR(ino)   (OBIO_CIR_BASE + ((ino) & INO_MASK))
    5656
    57 static void obio_enable_interrupt(pci_t *pci, int inr);
    58 static void obio_clear_interrupt(pci_t *pci, int inr);
    59 
    60 static pci_t *pci_sabre_init(ofw_tree_node_t *node);
    61 static pci_t *pci_psycho_init(ofw_tree_node_t *node);
     57static void obio_enable_interrupt(pci_t *, int);
     58static void obio_clear_interrupt(pci_t *, int);
     59
     60static pci_t *pci_sabre_init(ofw_tree_node_t *);
     61static pci_t *pci_psycho_init(ofw_tree_node_t *);
    6262
    6363/** PCI operations for Sabre model. */
     
    209209}
    210210
    211 void pci_clear_interrupt(pci_t *pci, int inr)
    212 {
     211void pci_clear_interrupt(void *pcip, int inr)
     212{
     213        pci_t *pci = (pci_t *)pcip;
     214
    213215        ASSERT(pci->op && pci->op->clear_interrupt);
    214216        pci->op->clear_interrupt(pci, inr);
  • kernel/arch/sparc64/src/trap/interrupt.c

    rdfd77382 r8d2760f  
    8080                 */
    8181                irq->handler(irq, irq->arg);
     82                /*
     83                 * See if there is a clear-interrupt-routine and call it.
     84                 */
     85                if (irq->cir) {
     86                        irq->cir(irq->cir_arg, irq->inr);
     87                }
    8288                spinlock_unlock(&irq->lock);
    8389        } else if (data0 > config.base) {
     
    99105#ifdef CONFIG_DEBUG
    100106                printf("cpu%u: spurious interrupt (intrcv=%#" PRIx64
    101                         ", data0=%#" PRIx64 ")\n", CPU->id, intrcv, data0);
     107                    ", data0=%#" PRIx64 ")\n", CPU->id, intrcv, data0);
    102108#endif
    103109        }
Note: See TracChangeset for help on using the changeset viewer.