rtapi_module_param — Specifying module parameters
RTAPI_MP_ARRAY_INT(var, num, description)
RTAPI_MP_ARRAY_LONG(var, num, description)
RTAPI_MP_ARRAY_STRING(var, num, description)
The variable where the parameter should be stored
A short description of the parameter or module
The maximum number of values for an array parameter
The license of the module, for instance "GPL"
The author of the module
The pointer to the function to be exported
These macros are portable ways to declare kernel module parameters.
They must be used in the global scope, and are not followed by a terminating semicolon.
They must be used after the associated variable or function has been defined.
EXPORT_FUNCTION makes a symbol available for use by a subsequently loaded
It is unrelated to hal functions, which are described in hal_export_funct
module params are persistant for the life of the module.
This does not cause problems with standard kernel modules, which are intended to be created and loaded once only.
When using instantiated components, a module param needs to be zeroed or nulled after the value is extracted by the component instance.
Otherwise, when the next instantiation of the component is created, that same value will be passed to it, unless explicitly set in the invocation.
Interpretation of license strings
MODULE_LICENSE follows the kernel’s definition of license strings.
Notably, "GPL" indicates "GNU Public License v2 or later". (emphasis ours).
It is still good practice to include a license block which indicates the author, copyright date, and disclaimer of warranty as recommended by the GNU GPL.
(Yes, license should be spelt licence. Blame the US 'dumb down' of English grammar)
Not available in userspace code.