added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / .unmaintained / arm-all / Drivers / irq.hidd.sa1100 / irq_init.c
blobbd9ca4b92bca750ba7bbd97baf3e3eab23071778
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: IRQ system for standalone i386 AROS
6 Lang: english
7 */
9 #include <exec/types.h>
10 #include <exec/lists.h>
11 #include <proto/exec.h>
12 #include <proto/oop.h>
13 #include <oop/oop.h>
14 #include <utility/utility.h>
15 #include <aros/asmcall.h>
16 #include <exec/interrupts.h>
17 #include <exec/execbase.h>
18 #include <hardware/intbits.h>
20 #include "irq.h"
22 #undef SysBase
24 /* Customize libheader.c */
25 #define LC_SYSBASE_FIELD(lib) (((LIBBASETYPEPTR )(lib))->sysbase)
26 #define LC_SEGLIST_FIELD(lib) (((LIBBASETYPEPTR )(lib))->seglist)
27 #define LC_RESIDENTNAME irqHidd_resident
28 #define LC_RESIDENTFLAGS RTF_AUTOINIT|RTF_COLDSTART
29 #define LC_RESIDENTPRI 90
30 #define LC_LIBBASESIZE sizeof(LIBBASETYPE)
31 #define LC_LIBHEADERTYPEPTR LIBBASETYPEPTR
32 #define LC_LIB_FIELD(lib) (((LIBBASETYPEPTR)(lib))->library)
34 #define LC_NO_OPENLIB
35 #define LC_NO_EXPUNGELIB
36 #define LC_NO_CLOSELIB
39 #define NOEXPUNGE
41 struct irqbase
43 struct Library library;
44 struct ExecBase *sysbase;
45 BPTR seglist;
46 struct irq_staticdata *isd;
49 #include <libcore/libheader.c>
51 #undef SDEBUG
52 #undef DEBUG
53 #define DEBUG 1
54 #include <aros/debug.h>
56 #undef SysBase
57 #define SysBase ((lh)->sysbase)
59 ULONG SAVEDS STDARGS LC_BUILDNAME(L_InitLib) (LC_LIBHEADERTYPEPTR lh)
61 struct irq_staticdata *isd;
63 D(bug("IRQ: Initializing\n"));
65 isd = AllocMem( sizeof (struct irq_staticdata), MEMF_CLEAR|MEMF_PUBLIC );
66 lh->isd = isd;
67 if (isd)
69 isd->sysbase = SysBase;
70 isd->oopbase = OpenLibrary(AROSOOP_NAME, 0);
71 if (isd->oopbase)
73 isd->utilitybase = OpenLibrary(UTILITYNAME, 37);
74 if (isd->utilitybase)
76 int i;
78 /* Initialize IRQ lists */
79 for (i = 0; i < vHidd_IRQ_NumIRQ; i++)
81 NEWLIST(&isd->irqlist[i]);
84 isd->irqclass = init_irqclass(isd);
86 if(isd->irqclass)
88 Disable();
89 init_Servers(isd); /* Initialize all known IRQ servers */
90 D(bug("%s %d\n",__FUNCTION__,__LINE__));
91 Enable(); /* Turn interrupts on */
93 D(bug("XYZ Init OK\n"));
94 return TRUE;
97 CloseLibrary(isd->oopbase);
99 FreeMem(isd, sizeof (struct irq_staticdata));
101 return FALSE;
104 #undef SysBase