revert between 56095 -> 55830 in arch
[AROS.git] / workbench / tools / SysExplorer / Modules / Storage / storage_init.c
blob8a5cc6b309a0f505bc509d251279c6a23b60d619
1 /*
2 Copyright (C) 2018-2019, The AROS Development Team.
3 $Id$
4 */
6 #include <aros/debug.h>
8 #include <proto/sysexp.h>
9 #include <proto/oop.h>
11 #include <aros/libcall.h>
12 #include <aros/asmcall.h>
13 #include <aros/symbolsets.h>
15 #include "storage_intern.h"
17 extern void StorageStartup(struct SysexpBase *);
19 #if (1) // TODO : Move into libbase
20 OOP_AttrBase HiddAttrBase;
21 OOP_AttrBase HWAttrBase;
22 OOP_AttrBase HiddBusAB;
23 OOP_AttrBase HiddStorageUnitAB;
25 OOP_MethodID HWBase;
26 OOP_MethodID HiddStorageControllerBase;
27 OOP_MethodID HiddStorageBusBase;
28 OOP_MethodID HiddStorageUnitBase;
29 #endif
31 const struct OOP_ABDescr storage_abd[] =
33 {IID_Hidd , &HiddAttrBase },
34 {IID_HW , &HWAttrBase },
35 {IID_Hidd_Bus , &HiddBusAB },
36 {IID_Hidd_StorageUnit , &HiddStorageUnitAB },
37 {NULL , NULL }
40 static int storageenum_init(struct SysexpStorageBase *StorageBase)
42 D(bug("[storage.sysexp] %s()\n", __func__));
44 OOP_ObtainAttrBases(storage_abd);
46 HWBase = OOP_GetMethodID(IID_HW, 0);
47 HiddStorageControllerBase = OOP_GetMethodID(IID_Hidd_StorageController, 0);
48 HiddStorageBusBase = OOP_GetMethodID(IID_Hidd_StorageBus, 0);
49 HiddStorageUnitBase = OOP_GetMethodID(IID_Hidd_StorageUnit, 0);
51 NEWLIST(&StorageBase->sesb_HandlerList);
52 D(bug("[storage.sysexp] %s: class list @ 0x%p\n", __func__, &StorageBase->sesb_HandlerList));
54 return 2;
57 ADD2INITLIB(storageenum_init, 10);
59 AROS_LH1(void, ModuleInit,
60 AROS_LHA(void *, SysexpBase, A0),
61 struct SysexpStorageBase *, StorageBase, 5, Storage
64 AROS_LIBFUNC_INIT
66 D(bug("[storage.sysexp] %s(%p)\n", __func__, SysexpBase));
68 StorageBase->sesb_SysexpBase = SysexpBase;
69 StorageBase->sesb_Module.sem_Node.ln_Name = "Storage.Module";
70 StorageBase->sesb_Module.sem_Node.ln_Pri = 100;
71 StorageBase->sesb_Module.sem_Startup = StorageStartup;
72 RegisterModule(&StorageBase->sesb_Module, StorageBase);
74 return;
76 AROS_LIBFUNC_EXIT