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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-armnommu/] [arch-a5k/] [irq.h] - Blame information for rev 1777

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 * include/asm-arm/arch-a5k/irq.h
3
 *
4
 * Copyright (C) 1996 Russell King
5
 *
6
 * Changelog:
7
 *   24-09-1996 RMK     Created
8
 *   10-10-1996 RMK     Brought up to date with arch-sa110eval
9
 *   22-10-1996 RMK     Changed interrupt numbers & uses new inb/outb macros
10
 */
11
 
12
#define BUILD_IRQ(s,n,m) \
13
        void IRQ##n##_interrupt(void); \
14
        void fast_IRQ##n##_interrupt(void); \
15
        void bad_IRQ##n##_interrupt(void); \
16
        void probe_IRQ##n##_interrupt(void);
17
 
18
/*
19
 * The timer is a special interrupt
20
 */
21
#define IRQ5_interrupt          timer_IRQ_interrupt
22
 
23
#define IRQ_INTERRUPT(n)        IRQ##n##_interrupt
24
#define FAST_INTERRUPT(n)       fast_IRQ##n##_interrupt
25
#define BAD_INTERRUPT(n)        bad_IRQ##n##_interrupt
26
#define PROBE_INTERRUPT(n)      probe_IRQ##n##_interrupt
27
 
28
static __inline__ void mask_irq(unsigned int irq)
29
{
30
        extern void ecard_disableirq (unsigned int);
31
        extern void ecard_disablefiq (unsigned int);
32
        unsigned char mask = 1 << (irq & 7);
33
 
34
        switch (irq >> 3) {
35
        case 0:
36
                outb(inb(IOC_IRQMASKA) & ~mask, IOC_IRQMASKA);
37
                break;
38
        case 1:
39
                outb(inb(IOC_IRQMASKB) & ~mask, IOC_IRQMASKB);
40
                break;
41
        case 4:
42
                ecard_disableirq (irq & 7);
43
                break;
44
        case 8:
45
                outb(inb(IOC_FIQMASK) & ~mask, IOC_FIQMASK);
46
                break;
47
        case 12:
48
                ecard_disablefiq (irq & 7);
49
        }
50
}
51
 
52
static __inline__ void unmask_irq(unsigned int irq)
53
{
54
        extern void ecard_enableirq (unsigned int);
55
        extern void ecard_enablefiq (unsigned int);
56
        unsigned char mask = 1 << (irq & 7);
57
 
58
        switch (irq >> 3) {
59
        case 0:
60
                outb(inb(IOC_IRQMASKA) | mask, IOC_IRQMASKA);
61
                break;
62
        case 1:
63
                outb(inb(IOC_IRQMASKB) | mask, IOC_IRQMASKB);
64
                break;
65
        case 4:
66
                ecard_enableirq (irq & 7);
67
                break;
68
        case 8:
69
                outb(inb(IOC_FIQMASK) | mask, IOC_FIQMASK);
70
                break;
71
        case 12:
72
                ecard_enablefiq (irq & 7);
73
        }
74
}
75
 
76
static __inline__ unsigned long get_enabled_irqs(void)
77
{
78
        return inb(IOC_IRQMASKA) | inb(IOC_IRQMASKB) << 8;
79
}
80
 
81
static __inline__ void irq_init_irq(void)
82
{
83
        outb(0, IOC_IRQMASKA);
84
        outb(0, IOC_IRQMASKB);
85
        outb(0, IOC_FIQMASK);
86
}

powered by: WebSVN 2.1.0

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