--- zzzz-none-000/linux-4.4.60/include/linux/debugfs.h 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-1750e-727/linux-4.4.60/include/linux/debugfs.h 2021-02-04 17:41:59.000000000 +0000 @@ -37,6 +37,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; @@ -124,6 +129,21 @@ ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos); +#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 @@ -304,6 +324,26 @@ return -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_ */