X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fmodules.c;h=b2923f7ca55a53f51ea0dd3fd4ce3b120b9539c5;hb=8a8a744341df513d00d2e60adf5e88636856e65b;hp=0409711dde045bf5309fedbb0cb08d1e68410948;hpb=efa38e0d56b1b620b6f4e5c4f91abc483a3065e2;p=tpg%2Facess2.git diff --git a/Kernel/modules.c b/Kernel/modules.c index 0409711d..b2923f7c 100644 --- a/Kernel/modules.c +++ b/Kernel/modules.c @@ -10,12 +10,13 @@ #define USE_UDI 0 // === PROTOTYPES === - int Module_int_Initialise(tModule *Module, char *ArgString); + int Module_int_Initialise(tModule *Module, const char *ArgString); +void Modules_int_GetBuiltinArray(void); void Modules_LoadBuiltins(void); void Modules_SetBuiltinParams(char *Name, char *ArgString); - int Module_RegisterLoader(tModuleLoader *Loader); - int Module_LoadMem(void *Buffer, Uint Length, char *ArgString); - int Module_LoadFile(char *Path, char *ArgString); +// int Module_RegisterLoader(tModuleLoader *Loader); +// int Module_LoadMem(void *Buffer, Uint Length, char *ArgString); +// int Module_LoadFile(char *Path, char *ArgString); int Module_int_ResolveDeps(tModule *Info); int Module_IsLoaded(const char *Name); @@ -26,13 +27,13 @@ EXPORT(Module_RegisterLoader); #if USE_UDI extern int UDI_LoadDriver(void *Base); #endif -extern void StartupPrint(char *Str); +extern void StartupPrint(const char *Str); extern void gKernelModules; extern void gKernelModulesEnd; // === GLOBALS === int giNumBuiltinModules = 0; -tSpinlock glModuleSpinlock; +tShortSpinlock glModuleSpinlock; tModule *gLoadedModules = NULL; tModuleLoader *gModule_Loaders = NULL; tModule *gLoadingModules = NULL; @@ -50,11 +51,11 @@ char **gasBuiltinModuleArgs; * \retval 0 Returned on success * \retval >0 Error code form the module's initialisation function */ -int Module_int_Initialise(tModule *Module, char *ArgString) +int Module_int_Initialise(tModule *Module, const char *ArgString) { int i, j; int ret; - char **deps; + const char **deps; char **args; tModule *mod; @@ -180,10 +181,10 @@ int Module_int_Initialise(tModule *Module, char *ArgString) LOG("ret = %i", ret); // Add to loaded list - LOCK( &glModuleSpinlock ); + SHORTLOCK( &glModuleSpinlock ); Module->Next = gLoadedModules; gLoadedModules = Module; - RELEASE( &glModuleSpinlock ); + SHORTREL( &glModuleSpinlock ); LEAVE_RET('i', 0); } @@ -254,7 +255,8 @@ void Modules_LoadBuiltins() /** * \brief Initialise a builtin module given it's name - * \example Used by VTerm to load an alternate video driver at runtime + * + * E.g. Used by VTerm to load an alternate video driver at runtime */ int Modules_InitialiseBuiltin(const char *Name) { @@ -320,7 +322,7 @@ int Module_RegisterLoader(tModuleLoader *Loader) * \fn int Module_LoadMem(void *Buffer, Uint Length, char *ArgString) * \brief Load a module from a memory location */ -int Module_LoadMem(void *Buffer, Uint Length, char *ArgString) +int Module_LoadMem(void *Buffer, Uint Length, const char *ArgString) { char path[VFS_MEMPATH_SIZE]; @@ -330,10 +332,10 @@ int Module_LoadMem(void *Buffer, Uint Length, char *ArgString) } /** - * \fn int Module_LoadFile(char *Path, char *ArgString) + * \fn int Module_LoadFile(const char *Path, const char *ArgString) * \brief Load a module from a file */ -int Module_LoadFile(char *Path, char *ArgString) +int Module_LoadFile(const char *Path, const char *ArgString) { void *base; tModule *info; @@ -394,7 +396,7 @@ int Module_LoadFile(char *Path, char *ArgString) */ int Module_int_ResolveDeps(tModule *Info) { - char **names = Info->Dependencies; + const char **names = Info->Dependencies; // Walk dependencies array for( ; *names; names++ )