Changeset 5626277 in mainline for arch


Ignore:
Timestamp:
2006-04-29T22:12:40Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
51a7dc1
Parents:
407862e
Message:

Added support for IRQ notifiactions.

  • seems to work correctly on ia32, amd64
  • the mips kbd probably lowers interrupts when the char is read from the port, we will have to find a way how to deal with it.
Location:
arch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/interrupt.c

    r407862e r5626277  
    4545#include <synch/spinlock.h>
    4646#include <arch/ddi/ddi.h>
     47#include <interrupt.h>
     48#include <ipc/sysipc.h>
    4749
    4850void print_info_errcode(int n, istate_t *istate)
     
    154156
    155157}
     158
     159static void ipc_int(int n, istate_t *istate)
     160{
     161        trap_virtual_eoi();
     162        ipc_irq_send_notif(n-IVT_IRQBASE);
     163}
     164
     165
     166/* Reregister irq to be IPC-ready */
     167void irq_ipc_bind_arch(__native irq)
     168{
     169        if (irq == IRQ_CLK)
     170                return;
     171        exc_register(IVT_IRQBASE+irq, "ipc_int", ipc_int);
     172}
  • arch/ia32/src/interrupt.c

    r407862e r5626277  
    4444#include <synch/spinlock.h>
    4545#include <arch/ddi/ddi.h>
     46#include <ipc/sysipc.h>
     47#include <interrupt.h>
    4648
    4749/*
     
    185187
    186188}
     189
     190static void ipc_int(int n, istate_t *istate)
     191{
     192        trap_virtual_eoi();
     193        ipc_irq_send_notif(n-IVT_IRQBASE);
     194}
     195
     196
     197/* Reregister irq to be IPC-ready */
     198void irq_ipc_bind_arch(__native irq)
     199{
     200        if (irq == IRQ_CLK)
     201                return;
     202        exc_register(IVT_IRQBASE+irq, "ipc_int", ipc_int);
     203}
  • arch/mips32/include/interrupt.h

    r407862e r5626277  
    3434#define IVT_ITEMS   40
    3535#define INT_OFFSET  32
     36#define IRQ_COUNT   8
    3637
    3738#define int_register(it, name, handler) exc_register(((it)+INT_OFFSET),name,handler)
  • arch/mips32/src/interrupt.c

    r407862e r5626277  
    3434#include <time/clock.h>
    3535#include <arch/drivers/arc.h>
     36
     37#include <ipc/sysipc.h>
    3638
    3739/** Disable interrupts.
     
    8486{
    8587        cp0_cause_write(cp0_cause_read() & ~(1 << 8)); /* clear SW0 interrupt */
     88        ipc_irq_send_notif(0);
    8689}
    8790
     
    8992{
    9093        cp0_cause_write(cp0_cause_read() & ~(1 << 9)); /* clear SW1 interrupt */
     94        ipc_irq_send_notif(1);
    9195}
    9296
     
    98102        int_register(1, "swint1", swint1);
    99103}
     104
     105#include <print.h>
     106static void ipc_int(int n, istate_t *istate)
     107{
     108        ipc_irq_send_notif(n-INT_OFFSET);
     109}
     110
     111/* Reregister irq to be IPC-ready */
     112void irq_ipc_bind_arch(__native irq)
     113{
     114        /* Do not allow to redefine timer */
     115        /* Swint0, Swint1 are already handled */
     116        if (irq == TIMER_IRQ || irq < 2)
     117                return;
     118        int_register(irq, "ipc_int", ipc_int);
     119}
Note: See TracChangeset for help on using the changeset viewer.