--- zzzz-none-000/linux-3.10.107/include/linux/debugfs.h 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/include/linux/debugfs.h 2021-11-10 11:53:56.000000000 +0000 @@ -36,6 +36,11 @@ const struct debugfs_reg32 *regs; int nregs; void __iomem *base; +#if defined(CONFIG_AVM_ENHANCED) + uint32_t (*reg_read_fn)(void *, uint32_t); + uint32_t (*reg_write_fn)(void *, uint32_t, uint32_t); + void *rw_context; +#endif }; extern struct dentry *arch_debugfs_dir; @@ -99,6 +104,21 @@ bool debugfs_initialized(void); +#if defined(CONFIG_AVM_ENHANCED) + +#define SD_MAX_INPUT_BUF 8192 + +int add_simple_debugfs_file( const char* fname, struct dentry *parent, + int (*kernel_input)(char *, void *), + void (*kernel_output)(struct seq_file *, void *), + void *priv_data); + +void remove_simple_debugfs_file( struct dentry *this ); + +struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, + struct dentry *parent, atomic_t *value); + +#endif /* CONFIG_AVM_ENHANCED */ #else #include @@ -109,111 +129,141 @@ * want to duplicate the design decision mistakes of procfs and devfs again. */ -static inline struct dentry *debugfs_create_file(const char *name, umode_t mode, - struct dentry *parent, void *data, - const struct file_operations *fops) +static inline struct dentry *debugfs_create_file( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + void *data __maybe_unused, + const struct file_operations *fops __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_dir(const char *name, - struct dentry *parent) +static inline struct dentry *debugfs_create_dir( + const char *name __maybe_unused, + struct dentry *parent __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_symlink(const char *name, - struct dentry *parent, - const char *dest) +static inline struct dentry *debugfs_create_symlink( + const char *name __maybe_unused, + struct dentry *parent __maybe_unused, + const char *dest __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline void debugfs_remove(struct dentry *dentry) +static inline void debugfs_remove(struct dentry *dentry __maybe_unused) { } -static inline void debugfs_remove_recursive(struct dentry *dentry) +static inline void debugfs_remove_recursive(struct dentry *dentry __maybe_unused) { } -static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, - struct dentry *new_dir, char *new_name) +static inline struct dentry *debugfs_rename( + struct dentry *old_dir __maybe_unused, + struct dentry *old_dentry __maybe_unused, + struct dentry *new_dir __maybe_unused, + char *new_name __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_u8(const char *name, umode_t mode, - struct dentry *parent, - u8 *value) +static inline struct dentry *debugfs_create_u8( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u8 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode, - struct dentry *parent, - u16 *value) +static inline struct dentry *debugfs_create_u16( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u16 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode, - struct dentry *parent, - u32 *value) +static inline struct dentry *debugfs_create_u32( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u32 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode, - struct dentry *parent, - u64 *value) +static inline struct dentry *debugfs_create_u64( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u64 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_x8(const char *name, umode_t mode, - struct dentry *parent, - u8 *value) +static inline struct dentry *debugfs_create_x8( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u8 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_x16(const char *name, umode_t mode, - struct dentry *parent, - u16 *value) +static inline struct dentry *debugfs_create_x16( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u16 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode, - struct dentry *parent, - u32 *value) +static inline struct dentry *debugfs_create_x32( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u32 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode, - struct dentry *parent, - size_t *value) +static inline struct dentry *debugfs_create_size_t( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + size_t *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode, - struct dentry *parent, - u32 *value) +static inline struct dentry *debugfs_create_bool( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u32 *value __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_blob(const char *name, umode_t mode, - struct dentry *parent, - struct debugfs_blob_wrapper *blob) +static inline struct dentry *debugfs_create_blob( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + struct debugfs_blob_wrapper *blob __maybe_unused) { return ERR_PTR(-ENODEV); } -static inline struct dentry *debugfs_create_regset32(const char *name, - umode_t mode, struct dentry *parent, - struct debugfs_regset32 *regset) +static inline struct dentry *debugfs_create_regset32( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + struct debugfs_regset32 *regset __maybe_unused) { return ERR_PTR(-ENODEV); } @@ -223,13 +273,36 @@ return false; } -static inline struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, - struct dentry *parent, - u32 *array, u32 elements) +static inline struct dentry *debugfs_create_u32_array( + const char *name __maybe_unused, + umode_t mode __maybe_unused, + struct dentry *parent __maybe_unused, + u32 *array __maybe_unused, + u32 elements __maybe_unused) { return ERR_PTR(-ENODEV); } -#endif +#if defined(CONFIG_AVM_ENHANCED) -#endif +static inline int add_simple_debugfs_file( + const char *fname __maybe_unused, + struct dentry *parent __maybe_unused, + int (*kernel_input) (char *, void *) __maybe_unused, + void (*kernel_output) (struct seq_file *, void *) __maybe_unused, + void *priv_data __maybe_unused) +{ + return 0; +} + +static inline void remove_simple_debugfs_file( + struct dentry *this __maybe_unused) +{ + return; +} + +#endif /* CONFIG_AVM_ENHANCED */ + +#endif /* CONFIG_DEBUG_FS */ + +#endif /* _DEBUGFS_H_ */