8 #define MODULE_MAGIC ('A'|('M'<<8)|('D'<<16)|('\2'<<24))
10 // IA32 - Architecture 1
11 #if ARCH == i386 || ARCH == i586
12 # define MODULE_ARCH_ID 1
13 // IA64 - Architecture 2
14 #elif ARCH == x64 || ARCH == x86_64
15 # define MODULE_ARCH_ID 2
17 # error "Unknown architecture when determining MODULE_ARCH_ID ('" #ARCH "')"
20 #define MODULE_DEFINE(_flags,_ver,_ident,_entry,_deinit,_deps...) char *_DriverDeps_##_ident[]={_deps};\
21 tModule __attribute__ ((section ("KMODULES"),unused)) _DriverInfo_##_ident=\
22 {MODULE_MAGIC,MODULE_ARCH_ID,_flags,_ver,NULL,#_ident,_entry,_deinit,_DriverDeps_##_ident}
24 typedef struct sModule {
31 int (*Init)(char **Arguments);
33 char **Dependencies; // NULL Terminated List
34 } __attribute__((packed)) tModule;
36 #define MODULE_INIT_SUCCESS 1
37 #define MODULE_INIT_FAILURE 0