whitespace
[AROS.git] / rom / hidds / i8042 / kbd_init.c
blobdac5c23161fd5e351324fee5da5e51be63131cff
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: kbd Hidd for standalone i386 AROS
6 Lang: english
7 */
9 #include <hidd/hidd.h>
10 #include <hidd/keyboard.h>
11 #include <hidd/mouse.h>
12 #include <proto/exec.h>
13 #include <utility/utility.h>
15 #include "libbase.h"
17 #undef SDEBUG
18 #undef DEBUG
19 #define DEBUG 0
20 #include <aros/debug.h>
22 #undef OOPBase
23 #define OOPBase (LIBBASE->ksd.cs_OOPBase)
25 static int PCKbd_InitAttrs(struct kbdbase *LIBBASE)
27 struct OOP_ABDescr attrbases[] =
29 {IID_Hidd , &LIBBASE->ksd.hiddAttrBase},
30 {IID_Hidd_Kbd , &LIBBASE->ksd.hiddKbdAB },
31 {IID_Hidd_Mouse, &LIBBASE->ksd.hiddMouseAB },
32 {NULL , NULL }
35 LIBBASE->ksd.cs_KernelBase = OpenResource("kernel.resource");
36 if (!LIBBASE->ksd.cs_KernelBase)
37 return FALSE;
39 LIBBASE->ksd.cs_UtilityBase = OpenLibrary("utility.library", 36);
40 if (!LIBBASE->ksd.cs_UtilityBase)
41 return FALSE;
43 if (!OOP_ObtainAttrBases(attrbases))
44 return FALSE;
46 LIBBASE->ksd.hwMethodBase = OOP_GetMethodID(IID_HW, 0);
47 D(bug("[i8042] Initialization done\n"));
49 return TRUE;
52 /****************************************************************************************/
54 static int PCKbd_ExpungeAttrs(struct kbdbase *LIBBASE)
56 struct OOP_ABDescr attrbases[] =
58 {IID_Hidd , &LIBBASE->ksd.hiddAttrBase},
59 {IID_Hidd_Kbd , &LIBBASE->ksd.hiddKbdAB },
60 {IID_Hidd_Mouse, &LIBBASE->ksd.hiddMouseAB },
61 {NULL , NULL }
64 EnterFunc(bug("PCKbd_ExpungeAttrs\n"));
66 OOP_ReleaseAttrBases(attrbases);
68 if (!LIBBASE->ksd.cs_UtilityBase)
69 CloseLibrary(LIBBASE->ksd.cs_UtilityBase);
71 ReturnInt("PCKbd_ExpungeAttrs", int, TRUE);
74 /****************************************************************************************/
76 ADD2INITLIB(PCKbd_InitAttrs, 0)
77 ADD2EXPUNGELIB(PCKbd_ExpungeAttrs, 0)