--- zzzz-none-000/linux-4.4.271/include/linux/debugfs.h 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/include/linux/debugfs.h 2023-04-19 10:22:30.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; @@ -45,6 +50,8 @@ /* declared over in file.c */ extern const struct file_operations debugfs_file_operations; +struct dentry *debugfs_lookup(const char *name, struct dentry *parent); + struct dentry *debugfs_create_file(const char *name, umode_t mode, struct dentry *parent, void *data, @@ -124,6 +131,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 @@ -134,6 +156,12 @@ * want to duplicate the design decision mistakes of procfs and devfs again. */ +static inline struct dentry *debugfs_lookup(const char *name, + struct dentry *parent) +{ + return ERR_PTR(-ENODEV); +} + static inline struct dentry *debugfs_create_file(const char *name, umode_t mode, struct dentry *parent, void *data, const struct file_operations *fops) @@ -304,6 +332,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_ */