X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Fmodules.h;h=d72813369ea6f0804559ae13449466536dc087d7;hb=02b341123f87f8a395c3cb10d390ae54a7fc53fd;hp=8862112cbd9f7a7264c08275d7e726113cf229b3;hpb=3a0833fe87ee8735ee5dc99375ee55c656a2ac67;p=tpg%2Facess2.git diff --git a/Kernel/include/modules.h b/Kernel/include/modules.h index 8862112c..d7281336 100644 --- a/Kernel/include/modules.h +++ b/Kernel/include/modules.h @@ -36,7 +36,7 @@ #if ARCHDIR == x86 # define MODULE_ARCH_ID 1 // IA64 - Architecture 2 -#elif ARCHDIR == x64 +#elif ARCHDIR == x86_64 # define MODULE_ARCH_ID 2 #else # error "Unknown architecture when determining MODULE_ARCH_ID ('" #ARCHDIR "')" @@ -53,7 +53,7 @@ * Contains the identifiers of the required modules. */ #define MODULE_DEFINE(_flags,_ver,_ident,_entry,_deinit,_deps...) \ - char *EXPAND_CONCAT(_DriverDeps_,_ident)[]={_deps};\ + const char *EXPAND_CONCAT(_DriverDeps_,_ident)[]={_deps};\ tModule __attribute__ ((section ("KMODULES"),unused))\ EXPAND_CONCAT(_DriverInfo_,_ident)=\ {MODULE_MAGIC,MODULE_ARCH_ID,_flags,_ver,NULL,EXPAND_STR(_ident),\ @@ -71,10 +71,10 @@ typedef struct sModule Uint8 Flags; //!< Module Flags Uint16 Version; //!< Module Version in Major.Minor 8.8 form struct sModule *Next; //!< Next module in list (not to be touched by the driver) - char *Name; //!< Module Name/Identifier + const char *Name; //!< Module Name/Identifier int (*Init)(char **Arguments); //!< Module initialiser / entrypoint - void (*Deinit)(); //!< Cleanup Function - char **Dependencies; //!< NULL terminated list of dependencies + void (*Deinit)(void); //!< Cleanup Function + const char **Dependencies; //!< NULL terminated list of dependencies } PACKED tModule; /** @@ -87,6 +87,7 @@ enum eModuleErrors MODULE_ERR_NOTNEEDED, //!< Module not needed MODULE_ERR_MALLOC, //!< Error with malloc/realloc/calloc + MODULE_ERR_BADMODULE, //!< Bad module (only used by loader) MODULE_ERR_MAX //!< Maximum defined error code }; @@ -112,4 +113,11 @@ typedef struct sModuleLoader */ extern int Module_RegisterLoader(tModuleLoader *Loader); +/** + * \brief Initialises (if needed) a named module + * \param Name Module name to initialise + * \return -1 on not existing, 0 if the module initialised (or if it was already initialised) + */ +extern int Module_EnsureLoaded(const char *Name); + #endif