2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: IRQ system for standalone i386 AROS
9 #include <exec/types.h>
10 #include <exec/lists.h>
11 #include <proto/exec.h>
12 #include <proto/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>
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)
35 #define LC_NO_EXPUNGELIB
36 #define LC_NO_CLOSELIB
43 struct Library library
;
44 struct ExecBase
*sysbase
;
46 struct irq_staticdata
*isd
;
49 #include <libcore/libheader.c>
54 #include <aros/debug.h>
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
);
69 isd
->sysbase
= SysBase
;
70 isd
->oopbase
= OpenLibrary(AROSOOP_NAME
, 0);
73 isd
->utilitybase
= OpenLibrary(UTILITYNAME
, 37);
78 /* Initialize IRQ lists */
79 for (i
= 0; i
< vHidd_IRQ_NumIRQ
; i
++)
81 NEWLIST(&isd
->irqlist
[i
]);
84 isd
->irqclass
= init_irqclass(isd
);
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"));
97 CloseLibrary(isd
->oopbase
);
99 FreeMem(isd
, sizeof (struct irq_staticdata
));