Changeset 3e828ea in mainline for kernel/arch/mips32/src/interrupt.c


Ignore:
Timestamp:
2019-09-23T12:49:29Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9be2358
Parents:
9259d20 (diff), 1a4ec93f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiri Svoboda <jiri@…> (2019-09-22 12:49:07)
git-committer:
Jiri Svoboda <jiri@…> (2019-09-23 12:49:29)
Message:

Merge changes from master, especially Meson build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/src/interrupt.c

    r9259d20 r3e828ea  
    4141#include <ipc/sysipc.h>
    4242
    43 #define IRQ_COUNT   8
    44 #define TIMER_IRQ   7
    45 
    46 function virtual_timer_fnc = NULL;
    47 static irq_t timer_irq;
    48 
    4943// TODO: This is SMP unsafe!!!
    5044
     
    5246static unsigned long nextcount;
    5347static unsigned long lastcount;
     48
     49/** Table of interrupt handlers. */
     50int_handler_t int_handler[MIPS_INTERRUPTS] = { };
    5451
    5552/** Disable interrupts.
     
    113110}
    114111
    115 static irq_ownership_t timer_claim(irq_t *irq)
    116 {
    117         return IRQ_ACCEPT;
    118 }
    119 
    120 static void timer_irq_handler(irq_t *irq)
     112static void timer_interrupt_handler(unsigned int intr)
    121113{
    122114        if (cp0_count_read() < lastcount)
     
    135127        cp0_compare_write(nextcount);
    136128
    137         /*
    138          * We are holding a lock which prevents preemption.
    139          * Release the lock, call clock() and reacquire the lock again.
    140          */
    141         irq_spinlock_unlock(&irq->lock, false);
    142129        clock();
    143         irq_spinlock_lock(&irq->lock, false);
    144 
    145         if (virtual_timer_fnc != NULL)
    146                 virtual_timer_fnc();
    147130}
    148131
     
    150133void interrupt_init(void)
    151134{
    152         irq_init(IRQ_COUNT, IRQ_COUNT);
    153 
    154         irq_initialize(&timer_irq);
    155         timer_irq.inr = TIMER_IRQ;
    156         timer_irq.claim = timer_claim;
    157         timer_irq.handler = timer_irq_handler;
    158         irq_register(&timer_irq);
     135        int_handler[INT_TIMER] = timer_interrupt_handler;
    159136
    160137        timer_start();
    161         cp0_unmask_int(TIMER_IRQ);
     138        cp0_unmask_int(INT_TIMER);
    162139}
    163140
Note: See TracChangeset for help on using the changeset viewer.