revert between 56095 -> 55830 in arch
[AROS.git] / arch / .unmaintained / arm-all / include / aros / core.h
blob9261767d8c984611968ad97fb4175560d03ee912
1 #ifndef AROS_CORE_H
2 #define AROS_CORE_H
4 /*
5 Copyright © 2000, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Interrupt core, part of kernel.resource
9 Lang: english
12 #include <exec/types.h>
13 #include <exec/execbase.h>
14 #include <asm/irq.h>
15 #include <asm/linkage.h>
17 /* Here are some macros used to build interrupt table in core file. */
19 #define IRQ_NAME2(nr) nr##_interrupt(void)
20 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
22 #define BUILD_IRQ(nr) \
23 /*asmlinkage*/ void IRQ_NAME(nr); \
24 __asm__( \
25 "\n\t.text\n\t" \
26 ".globl "SYMBOL_NAME_STR(IRQ) #nr "_interrupt\n\t" \
27 ".type "SYMBOL_NAME_STR(IRQ) #nr "_interrupt, function\n\t" \
28 "\n\t"__ALIGN_STR"\n" \
29 SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
30 "sub sp, sp, #(17*4)\n\t" \
31 "stmia sp, {r0-r12}\n\t" \
32 "add r8, sp, #(13*4)\n\t" \
33 "stmia r8, {sp,lr}^\n\t" \
34 "nop \n\t" \
35 "str lr, [sp, #(15*4)]\n\t" \
36 "mrs r8, spsr\n\t" \
37 "str r8, [sp, #(16*4)]\n\t" \
38 "mov r0,sp\n\t" \
39 "mov r1,#0\n\t" \
40 "bl "SYMBOL_NAME_STR(do_IRQ)"\n\t"\
41 "nop \n\t" \
42 "ldr r0, [sp, #(16*4)]\n\t" \
43 "msr spsr,r0\n\t" \
44 "ldr lr, [sp, #(15*4)]\n\t" \
45 "ldmia sp, {r0-lr}^\n\t" \
46 "nop \n\t" \
47 "add sp, sp, #(17*4)\n\t" \
48 "subs pc, lr, #4\n\t");
50 struct PlatformData
52 struct irqDescriptor irq_desc[NR_IRQS];
55 #define PLATFORMDATA(x) ((struct PlatformData *)(x)->PlatformData)
57 BOOL init_core(struct ExecBase *);
58 BOOL irqSet(int, struct irqServer *, void *, struct ExecBase *);
60 void disable_irq(unsigned int virq);
61 void enable_irq(unsigned int virq);
63 #endif