2 Copyright © 2015-2017, The AROS Development Team. All rights reserved.
7 #include <aros/debug.h>
10 #include <exec/types.h>
12 #include <proto/exec.h>
13 #include <proto/oop.h>
15 #include <aros/symbolsets.h>
16 #include <hidd/hidd.h>
18 #include "system_intern.h"
20 #include LC_LIBDEFS_FILE
25 static int System_Init(LIBBASETYPEPTR LIBBASE
)
27 struct class_static_data
*csd
= &LIBBASE
->hsi_csd
;
28 struct Library
*OOPBase
= csd
->cs_OOPBase
;
30 D(bug("[HiddSystem] %s()\n", __PRETTY_FUNCTION__
));
32 OOP_Object
*hwroot
= OOP_NewObject(NULL
, CLID_HW_Root
, NULL
);
35 csd
->hwAttrBase
= OOP_ObtainAttrBase(IID_HW
);
36 csd
->hwMethodBase
= OOP_GetMethodID(IID_HW
, 0);
38 if (HW_AddDriver(hwroot
, csd
->oopclass
, NULL
))
40 D(bug("[HiddSystem] %s: initialised\n", __PRETTY_FUNCTION__
));
44 D(bug("[HiddSystem] %s: failed\n", __PRETTY_FUNCTION__
));
49 static int System_Expunge(LIBBASETYPEPTR LIBBASE
)
51 D(struct class_static_data
*csd
= &LIBBASE
->hsi_csd
;)
53 struct Library
*OOPBase
= csd
->cs_OOPBase
;
56 D(bug("[HiddSystem] %s(csd=%p)\n", __PRETTY_FUNCTION__
, csd
));
61 ADD2INITLIB(System_Init
, -2)
62 ADD2EXPUNGELIB(System_Expunge
, -2)