summaryrefslogtreecommitdiff
path: root/include/asm-arm/arch-mxc/entry-macro.S
blob: 23ae035e60bfbe572c0d39983756fcf43cdb9f9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 *  Copyright (C) 2007 Lennert Buytenhek <buytenh@wantstofly.org>
 *  Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
 */

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <asm/hardware.h>

	@ this macro disables fast irq (not implemented)
	.macro	disable_fiq
	.endm

	.macro  get_irqnr_preamble, base, tmp
	.endm

	.macro  arch_ret_to_user, tmp1, tmp2
	.endm

	@ this macro checks which interrupt occured
	@ and returns its number in irqnr
	@ and returns if an interrupt occured in irqstat
	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
	@ Can't use IO_ADDRESS macro. Otherwise compilation error
#ifdef CONFIG_MXC_TZIC
	ldr	\irqstat, =TZIC_IO_ADDRESS(TZIC_BASE_ADDR)
	@ Load offset & priority of the highest priority
	@ interrupt pending.
        @ 0xD80 is HIPND0 register
        ldr     \irqnr, =0
        ldr     \base, =0x0D80
1000:
        ldr     \tmp,   [\irqstat, \base]
        cmp     \tmp, #0
        bne     1001f
        addeq   \irqnr, \irqnr, #32
        addeq   \base, \base, #4
        cmp     \irqnr, #128
        blo     1000b
        b       2001f
1001:   ldr     \base, =1
1002:   tst     \tmp, \base
        bne     2002f
        movs    \base, \base, lsl #1
        addne   \irqnr, \irqnr, #1
        bne     1002b
2001:
        ldr  \irqnr, =0
2002:
        movs \irqnr, \irqnr
#else
	ldr	\base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR)
	@ Load offset & priority of the highest priority
	@ interrupt pending from AVIC_NIVECSR
	ldr	\irqstat, [\base, #0x40]
	@ Shift to get the decoded IRQ number, using ASR so
	@ 'no interrupt pending' becomes 0xffffffff
	mov	\irqnr, \irqstat, asr #16
	@ set zero flag if IRQ + 1 == 0
	adds	\tmp, \irqnr, #1
#endif  /*MXC_SUPPORT_TZIC*/
	.endm

	@ irq priority table (not used)
	.macro	irq_prio_table
	.endm