2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: kbd Hidd for standalone i386 AROS
10 #include <hidd/keyboard.h>
11 #include <hidd/mouse.h>
12 #include <proto/exec.h>
13 #include <utility/utility.h>
20 #include <aros/debug.h>
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
},
35 LIBBASE
->ksd
.cs_KernelBase
= OpenResource("kernel.resource");
36 if (!LIBBASE
->ksd
.cs_KernelBase
)
39 LIBBASE
->ksd
.cs_UtilityBase
= OpenLibrary("utility.library", 36);
40 if (!LIBBASE
->ksd
.cs_UtilityBase
)
43 if (!OOP_ObtainAttrBases(attrbases
))
46 LIBBASE
->ksd
.hwMethodBase
= OOP_GetMethodID(IID_HW
, 0);
47 D(bug("[i8042] Initialization done\n"));
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
},
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)