2 * @ingroup adf_os_public
3 * @file adf_os_module.h
4 * This file abstracts "kernel module" semantics.
7 #ifndef _ADF_OS_MODULE_H
8 #define _ADF_OS_MODULE_H
10 #include <adf_os_module_pvt.h>
12 typedef a_status_t (*module_init_func_t)(void);
15 * @brief Specify the module's entry point.
17 #define adf_os_virt_module_init(_mod_init_func) __adf_os_virt_module_init(_mod_init_func)
20 * @brief Specify the module's exit point.
22 #define adf_os_virt_module_exit(_mod_exit_func) __adf_os_virt_module_exit(_mod_exit_func)
25 * @brief Specify the module's name.
27 #define adf_os_virt_module_name(_name) __adf_os_virt_module_name(_name)
30 * @brief Specify the module's dependency on another module.
32 #define adf_os_module_dep(_name,_dep) __adf_os_module_dep(_name,_dep)
35 * @brief Export a symbol from a module.
37 #define adf_os_export_symbol(_sym) __adf_os_export_symbol(_sym)
40 * @brief Module parameter of type integer.
42 #define ADF_OS_PARAM_TYPE_INT32 __ADF_OS_PARAM_TYPE_INT32
45 * @brief Module parameter of type string.
47 #define ADF_OS_PARAM_TYPE_STRING __ADF_OS_PARAM_TYPE_STRING
50 * @brief Declare a module parameter.
52 * @param[in] name name of the parameter
53 * @param[in] type type of the parameter
55 * @note These provide the config data defined by the userland
56 * for this device. It can be queried at any time, given the name string
57 * Only two types are supported
58 * ADF_OS_PARAM_TYPE_STRING
59 * ADF_OS_PARAM_TYPE_INT32
60 * For example, say, the parameters name "my_int" and "my_name" are of
61 * variables of type int and string respectively. Then you would declare them
64 * adf_os_declare_param(my_int, ADF_OS_PARAM_TYPE_INT32);
65 * adf_os_declare_param(my_name, ADF_OS_PARAM_TYPE_STRING);
67 * To read the userland provided config value, you would do something like
70 * adf_os_read_param(my_name, &softc->sc_my_name);
75 * st = adf_os_read_param(my_int, &softc->sc_my_int);
84 #define adf_os_declare_param(_name, _type) __adf_os_declare_param(_name, _type)
87 * @brief Read a parameter's value
89 * @param[in] osdev os handle
90 * @param[in] name name of parameter
91 * @param[in] type type of parameter
92 * @param[out] val value read
94 * @note pval is a point to the variable. Therefore,
95 * for strings it is a_uint8_t **
96 * for integers it is a_int_t *
98 #define adf_os_read_param(_osdev, _name, _type, _pval) \
99 __adf_os_read_param(_osdev, _name, _type, _pval)
101 #endif /*_ADF_OS_MODULE_H*/