summaryrefslogtreecommitdiff
path: root/polux/linux-2.6.10/arch/arm/mach-mse500/entry-macro.S
blob: 6c0950b8c0882e9255edee4c03bf8190cefb5ef7 (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
/******************************************************************************
* EUROPE TECHNOLOGIES Software Support
*******************************************************************************
* The software is delivered "AS IS" without warranty or condition of any
* kind, either express, implied or statutory. This includes without
* limitation any warranty or condition with respect to merchantability or
* fitness for any particular purpose, or against the infringements of
* intellectual property rights of others.
*******************************************************************************
*
* HISTORY:
* 
*       +----- (NEW | MODify | ADD | DELete)
*       |
* No#   |   when       who                  what               
******+***+**********+********************+************************************
* 000  NEW  22/02/05   ET SW Application       Creation
*******************************************************************************
*/

#include <asm/hardware.h>

	.macro	disable_fiq
	.endm

/******************
 * IRQ Workflow !!
 ******************/
	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
	ldr	\base, =(APB_GIC_VA_BA_ASM)	@ base virtual address of SYS peripherals
#ifdef BUG_MULTILAYER
	ldr	\tmp, =(SFM_DUMMY)
        mov \irqnr, #0
        str \irqnr,[\tmp]
#endif /* BUG_MULTILAYER */
	ldr	\irqnr, [\base, #GIC_OFFSET_IVR_ASM]	 @ read IRQ vector register:de-asserts nIRQ to processor (and clears interrupt)
	ldr	\irqstat, [\base, #GIC_OFFSET_ISR_ASM]	 @ read interrupt source number
	teq	\irqstat, #0			             @ ISR is 0 when no currentinterrupt, or spurious interrupt
	@streq	\tmp, [\base, #GIC_OFFSET_EOICR_ASM] @ not going to be handledfurther, then ACK it now.

	/* WARNING: These lines override the default behaviour, */
	/* which is to loop back at the start of the macro after the handler */
		
	/* set r1 to registers address */
	movne	r1, sp

	/* set label 2 as return address */
	adrsvc	ne, lr, 2f
	.endm

	.macro	restore_cpr_and_check_status
        mov             r1, #0
        ldr	        r0, =(APB_GIC_VA_BA_ASM)
#ifdef BUG_MULTILAYER
	ldr	        r3, =(SFM_DUMMY)
        str             r1,[r3]
#endif /* BUG_MULTILAYER */
        str             r1, [r0, #GIC_OFFSET_EOICR_ASM]
        movs             r1, #0
	.endm


	/* This macro is called only for SPC2XXC platform */
	/* beacuse some processing must be done after the handler */
        /* and must work under RTAI */
	.macro	irq_prio_table
	.endm