OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [glue/] [arm/] [ipi.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Copyright 2010 B Labs.Ltd.
3
 *
4
 * Author: Prem Mallappa  <prem.mallappa@b-labs.co.uk>
5
 *
6
 * Description: IPI handler for all ARM SMP cores
7
 */
8
 
9
#include INC_GLUE(ipi.h)
10
#include INC_GLUE(smp.h)
11
#include INC_SUBARCH(cpu.h)
12
#include <l4/lib/printk.h>
13
#include <l4/drivers/irq/gic/gic.h>
14
#include <l4/generic/time.h>
15
 
16
/* This should be in a file something like exception.S */
17
int ipi_handler(struct irq_desc *desc)
18
{
19
        int ipi_event = (desc - irq_desc_array) / sizeof(struct irq_desc);
20
 
21
//      printk("CPU%d: entered IPI%d\n", smp_get_cpuid(),
22
//             (desc - irq_desc_array) / sizeof(struct irq_desc));
23
 
24
        switch (ipi_event) {
25
        case IPI_TIMER_EVENT:
26
                // printk("CPU%d: Handling timer ipi\n", smp_get_cpuid());
27
                secondary_timer_irq();
28
                break;
29
        default:
30
                printk("CPU%d: IPI with no meaning: %d\n",
31
                       smp_get_cpuid(), ipi_event);
32
                break;
33
        }
34
        return 0;
35
}
36
 
37
void smp_send_ipi(unsigned int cpumask, int ipi_num)
38
{
39
        gic_send_ipi(cpumask, ipi_num);
40
}
41
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.