Changeset 2b698d8 in mainline


Ignore:
Timestamp:
2010-10-01T18:57:06Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
49d871ea
Parents:
9d5bb4e
Message:

basic processing of the IPI interrupts from the dorder device

Location:
kernel/arch/mips32
Files:
1 added
2 edited

Legend:

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

    r9d5bb4e r2b698d8  
    3838#include <arch.h>
    3939#include <arch/cp0.h>
     40#include <arch/smp/dorder.h>
    4041#include <time/clock.h>
    4142#include <ipc/sysipc.h>
     
    4849function virtual_timer_fnc = NULL;
    4950static irq_t timer_irq;
     51static irq_t dorder_irq;
    5052
    5153// TODO: This is SMP unsafe!!!
     
    149151}
    150152
     153static irq_ownership_t dorder_claim(irq_t *irq)
     154{
     155        return IRQ_ACCEPT;
     156}
     157
     158static void dorder_irq_handler(irq_t *irq)
     159{
     160        dorder_ipi_ack(1 << dorder_cpuid());
     161}
     162
    151163/* Initialize basic tables for exception dispatching */
    152164void interrupt_init(void)
     
    163175        timer_start();
    164176        cp0_unmask_int(TIMER_IRQ);
     177       
     178        irq_initialize(&dorder_irq);
     179        dorder_irq.devno = device_assign_devno();
     180        dorder_irq.inr = DORDER_IRQ;
     181        dorder_irq.claim = dorder_claim;
     182        dorder_irq.handler = dorder_irq_handler;
     183        irq_register(&dorder_irq);
     184       
     185        cp0_unmask_int(DORDER_IRQ);
    165186}
    166187
  • kernel/arch/mips32/src/smp/dorder.c

    r9d5bb4e r2b698d8  
    3333 */
    3434
     35#include <typedefs.h>
    3536#include <smp/ipi.h>
     37#include <arch/smp/dorder.h>
     38
     39#define MSIM_DORDER_ADDRESS  0xB0000004
    3640
    3741#ifdef CONFIG_SMP
    3842
    39 #define MSIM_DORDER_ADDRESS  0xB0000004
    40 
    4143void ipi_broadcast_arch(int ipi)
    4244{
    43         *((volatile unsigned int *) MSIM_DORDER_ADDRESS) = 0x7FFFFFFF;
     45        *((volatile uint32_t *) MSIM_DORDER_ADDRESS) = 0x7fffffff;
    4446}
    4547
    4648#endif
    4749
     50uint32_t dorder_cpuid(void)
     51{
     52        return *((volatile uint32_t *) MSIM_DORDER_ADDRESS);
     53}
     54
     55void dorder_ipi_ack(uint32_t mask)
     56{
     57        *((volatile uint32_t *) (MSIM_DORDER_ADDRESS + 4)) = mask;
     58}
     59
    4860/** @}
    4961 */
Note: See TracChangeset for help on using the changeset viewer.