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

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [platform/] [realview/] [irq.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Support for generic irq handling.
3
 *
4
 * Copyright (C) 2007 Bahadir Balban
5
 */
6
#include <l4/generic/irq.h>
7
#include <l4/generic/time.h>
8
#include INC_PLAT(offsets.h)
9
#include INC_PLAT(irq.h)
10
#include <l4/lib/bit.h>
11
#include <l4/platform/realview/irq.h>
12
 
13
/*
14
 * Timer handler for userspace
15
 */
16
int platform_timer_user_handler(struct irq_desc *desc)
17
{
18
        /* Ack the device irq */
19
        timer_irq_clear(PLATFORM_TIMER1_VBASE);
20
 
21
        /* Notify the userspace */
22
        irq_thread_notify(desc);
23
 
24
        return 0;
25
}
26
 
27
/*
28
 * Keyboard handler for userspace
29
 */
30
#define PL050_KMICR             0x00
31
#define PL050_KMI_RXINTR        (1 << 0x4)
32
int platform_keyboard_user_handler(struct irq_desc *desc)
33
{
34
        /*
35
         * Disable rx keyboard interrupt.
36
         * User will enable this
37
         */
38
        clrbit((unsigned int *)PLATFORM_KEYBOARD0_VBASE + PL050_KMICR,
39
               PL050_KMI_RXINTR);
40
 
41
        irq_thread_notify(desc);
42
        return 0;
43
}
44
 
45
/*
46
 * Mouse handler for userspace
47
 */
48
int platform_mouse_user_handler(struct irq_desc *desc)
49
{
50
        /*
51
         * Disable rx keyboard interrupt.
52
         * User will enable this
53
         */
54
        clrbit((unsigned int *)PLATFORM_KEYBOARD0_VBASE + PL050_KMICR,
55
               PL050_KMI_RXINTR);
56
 
57
        irq_thread_notify(desc);
58
        return 0;
59
}
60
 
61
int platform_timer_handler(struct irq_desc *desc)
62
{
63
        timer_irq_clear(PLATFORM_TIMER0_VBASE);
64
 
65
        return do_timer_irq();
66
}
67
 

powered by: WebSVN 2.1.0

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