Linux Kernel
3.7.1
|
Go to the source code of this file.
Data Structures | |
struct | kernel_param_ops |
struct | kernel_param |
struct | kparam_string |
struct | kparam_array |
Macros | |
#define | MODULE_PARAM_PREFIX KBUILD_MODNAME "." |
#define | MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) |
#define | ___module_cat(a, b) __mod_ ## a ## b |
#define | __module_cat(a, b) ___module_cat(a,b) |
#define | __MODULE_INFO(tag, name, info) struct __module_cat(name,__LINE__) {} |
#define | __MODULE_PARM_TYPE(name, _type) __MODULE_INFO(parmtype, name##type, #name ":" _type) |
#define | MODULE_PARM_DESC(_parm, desc) __MODULE_INFO(parm, _parm, #_parm ":" desc) |
#define | module_param(name, type, perm) module_param_named(name, name, type, perm) |
: the name of the cmdline and sysfs parameter (often the same as var) | |
core_param - define a historical core kernel parameter. | |
#define | core_param(name, var, type, perm) |
) is used to determine the number of elements in the | |
array, so the definition must be visible. | |
#define | module_param_array(name, type, nump, perm) module_param_array_named(name, name, type, nump, perm) |
Variables | |
struct kernel_param_ops | __attribute__ |
: the name of the parameter | |
module_param_string - a char array parameter : the string variable : the maximum length of the string, incl. terminator : visibility in sysfs. This actually copies the string when it's set (unlike type charp). is usually just sizeof(string). | |
#define | kparam_block_sysfs_write(name) |
#define | kparam_unblock_sysfs_write(name) |
#define | kparam_block_sysfs_read(name) |
#define | kparam_unblock_sysfs_read(name) |
#define | module_param_string(name, string, len, perm) |
: a valid C identifier which is the parameter name | |
module_param_array_named - renamed parameter which is an array of some type : the name of the array variable : the type, as per module_param() : optional pointer filled in with the number written : visibility in sysfs This exposes a different name than the actual variable name. See module_param_named() for why this might be necessary. | |
#define | module_param_array_named(name, array, type, nump, perm) |
struct kernel_param_ops | param_array_ops |
struct kernel_param_ops | param_ops_string |
int | param_set_copystring (const char *val, const struct kernel_param *) |
int | param_get_string (char *buffer, const struct kernel_param *kp) |
#define __level_param_cb | ( | name, | |
ops, | |||
arg, | |||
perm, | |||
level | |||
) | __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, level) |
Definition at line 142 of file moduleparam.h.
#define __module_cat | ( | a, | |
b | |||
) | ___module_cat(a,b) |
Definition at line 20 of file moduleparam.h.
Definition at line 28 of file moduleparam.h.
Definition at line 178 of file moduleparam.h.
#define __MODULE_PARM_TYPE | ( | name, | |
_type | |||
) | __MODULE_INFO(parmtype, name##type, #name ":" _type) |
Definition at line 31 of file moduleparam.h.
#define __moduleparam_const const |
Definition at line 173 of file moduleparam.h.
Definition at line 339 of file moduleparam.h.
Definition at line 151 of file moduleparam.h.
Definition at line 145 of file moduleparam.h.
Definition at line 160 of file moduleparam.h.
Definition at line 157 of file moduleparam.h.
#define kparam_block_sysfs_read | ( | name | ) |
Definition at line 232 of file moduleparam.h.
#define kparam_block_sysfs_write | ( | name | ) |
Definition at line 210 of file moduleparam.h.
#define kparam_unblock_sysfs_read | ( | name | ) |
Definition at line 242 of file moduleparam.h.
#define kparam_unblock_sysfs_write | ( | name | ) |
Definition at line 220 of file moduleparam.h.
Definition at line 163 of file moduleparam.h.
Definition at line 17 of file moduleparam.h.
module_param - typesafe helper for a module/cmdline parameter : the variable to alter, and exposed parameter name. : the type of the parameter : visibility in sysfs.
becomes the module parameter, or (prefixed by KBUILD_MODNAME and a ".") the kernel commandline parameter. Note that - is changed to _, so the user can use "foo-bar=1" even for variable "foo_bar".
is 0 if the the variable is not to appear in sysfs, or 0444 for world-readable, 0644 for root-writable, etc. Note that if it is writable, you may need to use kparam_block_sysfs_write() around accesses (esp. charp, which can be kfreed when it changes).
The is simply pasted to refer to a param_ops_#type and a param_check_#type: for convenience many standard types are provided but you can create your own by defining those variables.
Standard types are: byte, short, ushort, int, uint, long, ulong charp: a character pointer bool: a bool, values 0/1, y/n, Y/N. invbool: the above, only sense-reversed (N = true).
Definition at line 103 of file moduleparam.h.
#define module_param_array | ( | name, | |
type, | |||
nump, | |||
perm | |||
) | module_param_array_named(name, name, type, nump, perm) |
Definition at line 412 of file moduleparam.h.
Definition at line 426 of file moduleparam.h.
Definition at line 190 of file moduleparam.h.
#define module_param_cb | ( | name, | |
ops, | |||
arg, | |||
perm | |||
) | __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1) |
Definition at line 130 of file moduleparam.h.
#define MODULE_PARAM_PREFIX KBUILD_MODNAME "." |
Definition at line 13 of file moduleparam.h.
Definition at line 288 of file moduleparam.h.
#define MODULE_PARM_DESC | ( | _parm, | |
desc | |||
) | __MODULE_INFO(parm, _parm, #_parm ":" desc) |
Definition at line 36 of file moduleparam.h.
#define param_check_bint param_check_int |
Definition at line 397 of file moduleparam.h.
Definition at line 386 of file moduleparam.h.
Definition at line 345 of file moduleparam.h.
Definition at line 380 of file moduleparam.h.
Definition at line 360 of file moduleparam.h.
Definition at line 391 of file moduleparam.h.
Definition at line 370 of file moduleparam.h.
Definition at line 350 of file moduleparam.h.
Definition at line 365 of file moduleparam.h.
Definition at line 375 of file moduleparam.h.
Definition at line 355 of file moduleparam.h.
#define param_get_bint param_get_int |
Definition at line 396 of file moduleparam.h.
Definition at line 148 of file moduleparam.h.
Definition at line 154 of file moduleparam.h.
int param_get_bool | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
int param_get_byte | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
int param_get_charp | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
int param_get_int | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
int param_get_invbool | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
int param_get_long | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
int param_get_short | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
int param_get_string | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
int param_get_uint | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
int param_get_ulong | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
int param_get_ushort | ( | char * | buffer, |
const struct kernel_param * | kp | ||
) |
struct kernel_param_ops param_array_ops |
struct kernel_param_ops param_ops_bint |
struct kernel_param_ops param_ops_bool |
struct kernel_param_ops param_ops_byte |
struct kernel_param_ops param_ops_charp |
struct kernel_param_ops param_ops_int |
struct kernel_param_ops param_ops_invbool |
struct kernel_param_ops param_ops_long |
struct kernel_param_ops param_ops_short |
struct kernel_param_ops param_ops_string |
struct kernel_param_ops param_ops_uint |
struct kernel_param_ops param_ops_ulong |
struct kernel_param_ops param_ops_ushort |