revert between 56095 -> 55830 in arch
[AROS.git] / rom / hidds / base / system / system_init.c
bloba131548e45d8a0246921e06112d94c61beb6d5e1
1 /*
2 Copyright © 2015-2017, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #include <aros/debug.h>
9 #include <stddef.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
22 #undef CSD
23 #define CSD(x) csd
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);
33 if (hwroot)
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__));
41 return TRUE;
44 D(bug("[HiddSystem] %s: failed\n", __PRETTY_FUNCTION__));
46 return FALSE;
49 static int System_Expunge(LIBBASETYPEPTR LIBBASE)
51 D(struct class_static_data *csd = &LIBBASE->hsi_csd;)
52 #if (0)
53 struct Library *OOPBase = csd->cs_OOPBase;
54 #endif
56 D(bug("[HiddSystem] %s(csd=%p)\n", __PRETTY_FUNCTION__, csd));
58 return TRUE;
61 ADD2INITLIB(System_Init, -2)
62 ADD2EXPUNGELIB(System_Expunge, -2)