1/**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19#ifndef _LINUX_MODULE_PARAMS_H 20#define _LINUX_MODULE_PARAMS_H 21#include <linux/init.h> 22#include <linux/stringify.h> 23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24#include <linux/kernel.h> 25#ifdef MODULE 26#define MODULE_PARAM_PREFIX 27#else 28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29#define MODULE_PARAM_PREFIX KBUILD_MODNAME "." 30#endif 31#ifdef MODULE 32#define ___module_cat(a,b) __mod_ ## a ## b 33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34#define __module_cat(a,b) ___module_cat(a,b) 35#define __MODULE_INFO(tag, name, info) static const char __module_cat(name,__LINE__)[] __attribute_used__ __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info 36#else 37#define __MODULE_INFO(tag, name, info) 38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39#endif 40#define __MODULE_PARM_TYPE(name, _type) __MODULE_INFO(parmtype, name##type, #name ":" _type) 41struct kernel_param; 42typedef int (*param_set_fn)(const char *val, struct kernel_param *kp); 43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp); 45struct kernel_param { 46 const char *name; 47 unsigned int perm; 48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 param_set_fn set; 50 param_get_fn get; 51 void *arg; 52}; 53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54struct kparam_string { 55 unsigned int maxlen; 56 char *string; 57}; 58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59struct kparam_array 60{ 61 unsigned int max; 62 unsigned int *num; 63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 param_set_fn set; 65 param_get_fn get; 66 unsigned int elemsize; 67 void *elem; 68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69}; 70#define __module_param_call(prefix, name, set, get, arg, perm) static char __param_str_##name[] = prefix #name; static struct kernel_param const __param_##name __attribute_used__ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) = { __param_str_##name, perm, set, get, arg } 71#define module_param_call(name, set, get, arg, perm) __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm) 72#define module_param_named(name, value, type, perm) param_check_##type(name, &(value)); module_param_call(name, param_set_##type, param_get_##type, &value, perm); __MODULE_PARM_TYPE(name, #type) 73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74#define module_param(name, type, perm) module_param_named(name, name, type, perm) 75#define module_param_string(name, string, len, perm) static struct kparam_string __param_string_##name = { len, string }; module_param_call(name, param_set_copystring, param_get_string, &__param_string_##name, perm); __MODULE_PARM_TYPE(name, "string") 76#define __param_check(name, p, type) static inline type *__check_##name(void) { return(p); } 77#define param_check_byte(name, p) __param_check(name, p, unsigned char) 78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79#define param_check_short(name, p) __param_check(name, p, short) 80#define param_check_ushort(name, p) __param_check(name, p, unsigned short) 81#define param_check_int(name, p) __param_check(name, p, int) 82#define param_check_uint(name, p) __param_check(name, p, unsigned int) 83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84#define param_check_long(name, p) __param_check(name, p, long) 85#define param_check_ulong(name, p) __param_check(name, p, unsigned long) 86#define param_check_charp(name, p) __param_check(name, p, char *) 87#define param_check_bool(name, p) __param_check(name, p, int) 88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89#define param_check_invbool(name, p) __param_check(name, p, int) 90#define module_param_array_named(name, array, type, nump, perm) static struct kparam_array __param_arr_##name = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type, sizeof(array[0]), array }; module_param_call(name, param_array_set, param_array_get, &__param_arr_##name, perm); __MODULE_PARM_TYPE(name, "array of " #type) 91#define module_param_array(name, type, nump, perm) module_param_array_named(name, name, type, nump, perm) 92struct module; 93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94#endif 95