1 /* Modules Definitions 2 ** 3 ** Distributed under the terms of the MIT License. 4 */ 5 6 #ifndef _FSSH_MODULE_H 7 #define _FSSH_MODULE_H 8 9 10 #include "fssh_os.h" 11 12 13 /* Every module exports a list of module_info structures. 14 * It defines the interface of the module and the name 15 * that is used to access the interface. 16 */ 17 18 typedef struct fssh_module_info { 19 const char *name; 20 uint32_t flags; 21 fssh_status_t (*std_ops)(int32_t, ...); 22 } fssh_module_info; 23 24 /* module standard operations */ 25 #define FSSH_B_MODULE_INIT 1 26 #define FSSH_B_MODULE_UNINIT 2 27 28 /* module flags */ 29 #define FSSH_B_KEEP_LOADED 0x00000001 30 31 32 /* Use the module_dependency structure to let the 33 * kernel automatically load modules yet depend on 34 * before B_MODULE_INIT is called. 35 */ 36 37 typedef struct fssh_module_dependency { 38 const char *name; 39 fssh_module_info **info; 40 } fssh_module_dependency; 41 42 43 #ifdef __cplusplus 44 extern "C" { 45 #endif 46 47 extern fssh_status_t fssh_get_module(const char *path, 48 fssh_module_info **_info); 49 extern fssh_status_t fssh_put_module(const char *path); 50 51 #ifdef __cplusplus 52 } 53 #endif 54 55 #endif /* _FSSH_MODULE_H */ 56