diff options
Diffstat (limited to 'include/linux/debugfs.h')
| -rw-r--r-- | include/linux/debugfs.h | 72 |
1 files changed, 49 insertions, 23 deletions
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index e7d9b20ddc5b..6169c26fd8c8 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #define _DEBUGFS_H_ | 16 | #define _DEBUGFS_H_ |
| 17 | 17 | ||
| 18 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
| 19 | #include <linux/seq_file.h> | ||
| 19 | 20 | ||
| 20 | #include <linux/types.h> | 21 | #include <linux/types.h> |
| 21 | 22 | ||
| @@ -26,6 +27,17 @@ struct debugfs_blob_wrapper { | |||
| 26 | unsigned long size; | 27 | unsigned long size; |
| 27 | }; | 28 | }; |
| 28 | 29 | ||
| 30 | struct debugfs_reg32 { | ||
| 31 | char *name; | ||
| 32 | unsigned long offset; | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct debugfs_regset32 { | ||
| 36 | struct debugfs_reg32 *regs; | ||
| 37 | int nregs; | ||
| 38 | void __iomem *base; | ||
| 39 | }; | ||
| 40 | |||
| 29 | extern struct dentry *arch_debugfs_dir; | 41 | extern struct dentry *arch_debugfs_dir; |
| 30 | 42 | ||
| 31 | #if defined(CONFIG_DEBUG_FS) | 43 | #if defined(CONFIG_DEBUG_FS) |
| @@ -34,7 +46,7 @@ extern struct dentry *arch_debugfs_dir; | |||
| 34 | extern const struct file_operations debugfs_file_operations; | 46 | extern const struct file_operations debugfs_file_operations; |
| 35 | extern const struct inode_operations debugfs_link_operations; | 47 | extern const struct inode_operations debugfs_link_operations; |
| 36 | 48 | ||
| 37 | struct dentry *debugfs_create_file(const char *name, mode_t mode, | 49 | struct dentry *debugfs_create_file(const char *name, umode_t mode, |
| 38 | struct dentry *parent, void *data, | 50 | struct dentry *parent, void *data, |
| 39 | const struct file_operations *fops); | 51 | const struct file_operations *fops); |
| 40 | 52 | ||
| @@ -49,31 +61,38 @@ void debugfs_remove_recursive(struct dentry *dentry); | |||
| 49 | struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, | 61 | struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, |
| 50 | struct dentry *new_dir, const char *new_name); | 62 | struct dentry *new_dir, const char *new_name); |
| 51 | 63 | ||
| 52 | struct dentry *debugfs_create_u8(const char *name, mode_t mode, | 64 | struct dentry *debugfs_create_u8(const char *name, umode_t mode, |
| 53 | struct dentry *parent, u8 *value); | 65 | struct dentry *parent, u8 *value); |
| 54 | struct dentry *debugfs_create_u16(const char *name, mode_t mode, | 66 | struct dentry *debugfs_create_u16(const char *name, umode_t mode, |
| 55 | struct dentry *parent, u16 *value); | 67 | struct dentry *parent, u16 *value); |
| 56 | struct dentry *debugfs_create_u32(const char *name, mode_t mode, | 68 | struct dentry *debugfs_create_u32(const char *name, umode_t mode, |
| 57 | struct dentry *parent, u32 *value); | 69 | struct dentry *parent, u32 *value); |
| 58 | struct dentry *debugfs_create_u64(const char *name, mode_t mode, | 70 | struct dentry *debugfs_create_u64(const char *name, umode_t mode, |
| 59 | struct dentry *parent, u64 *value); | 71 | struct dentry *parent, u64 *value); |
| 60 | struct dentry *debugfs_create_x8(const char *name, mode_t mode, | 72 | struct dentry *debugfs_create_x8(const char *name, umode_t mode, |
| 61 | struct dentry *parent, u8 *value); | 73 | struct dentry *parent, u8 *value); |
| 62 | struct dentry *debugfs_create_x16(const char *name, mode_t mode, | 74 | struct dentry *debugfs_create_x16(const char *name, umode_t mode, |
| 63 | struct dentry *parent, u16 *value); | 75 | struct dentry *parent, u16 *value); |
| 64 | struct dentry *debugfs_create_x32(const char *name, mode_t mode, | 76 | struct dentry *debugfs_create_x32(const char *name, umode_t mode, |
| 65 | struct dentry *parent, u32 *value); | 77 | struct dentry *parent, u32 *value); |
| 66 | struct dentry *debugfs_create_x64(const char *name, mode_t mode, | 78 | struct dentry *debugfs_create_x64(const char *name, umode_t mode, |
| 67 | struct dentry *parent, u64 *value); | 79 | struct dentry *parent, u64 *value); |
| 68 | struct dentry *debugfs_create_size_t(const char *name, mode_t mode, | 80 | struct dentry *debugfs_create_size_t(const char *name, umode_t mode, |
| 69 | struct dentry *parent, size_t *value); | 81 | struct dentry *parent, size_t *value); |
| 70 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 82 | struct dentry *debugfs_create_bool(const char *name, umode_t mode, |
| 71 | struct dentry *parent, u32 *value); | 83 | struct dentry *parent, u32 *value); |
| 72 | 84 | ||
| 73 | struct dentry *debugfs_create_blob(const char *name, mode_t mode, | 85 | struct dentry *debugfs_create_blob(const char *name, umode_t mode, |
| 74 | struct dentry *parent, | 86 | struct dentry *parent, |
| 75 | struct debugfs_blob_wrapper *blob); | 87 | struct debugfs_blob_wrapper *blob); |
| 76 | 88 | ||
| 89 | struct dentry *debugfs_create_regset32(const char *name, mode_t mode, | ||
| 90 | struct dentry *parent, | ||
| 91 | struct debugfs_regset32 *regset); | ||
| 92 | |||
| 93 | int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, | ||
| 94 | int nregs, void __iomem *base, char *prefix); | ||
| 95 | |||
| 77 | bool debugfs_initialized(void); | 96 | bool debugfs_initialized(void); |
| 78 | 97 | ||
| 79 | #else | 98 | #else |
| @@ -86,7 +105,7 @@ bool debugfs_initialized(void); | |||
| 86 | * want to duplicate the design decision mistakes of procfs and devfs again. | 105 | * want to duplicate the design decision mistakes of procfs and devfs again. |
| 87 | */ | 106 | */ |
| 88 | 107 | ||
| 89 | static inline struct dentry *debugfs_create_file(const char *name, mode_t mode, | 108 | static inline struct dentry *debugfs_create_file(const char *name, umode_t mode, |
| 90 | struct dentry *parent, void *data, | 109 | struct dentry *parent, void *data, |
| 91 | const struct file_operations *fops) | 110 | const struct file_operations *fops) |
| 92 | { | 111 | { |
| @@ -118,76 +137,83 @@ static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentr | |||
| 118 | return ERR_PTR(-ENODEV); | 137 | return ERR_PTR(-ENODEV); |
| 119 | } | 138 | } |
| 120 | 139 | ||
| 121 | static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode, | 140 | static inline struct dentry *debugfs_create_u8(const char *name, umode_t mode, |
| 122 | struct dentry *parent, | 141 | struct dentry *parent, |
| 123 | u8 *value) | 142 | u8 *value) |
| 124 | { | 143 | { |
| 125 | return ERR_PTR(-ENODEV); | 144 | return ERR_PTR(-ENODEV); |
| 126 | } | 145 | } |
| 127 | 146 | ||
| 128 | static inline struct dentry *debugfs_create_u16(const char *name, mode_t mode, | 147 | static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode, |
| 129 | struct dentry *parent, | 148 | struct dentry *parent, |
| 130 | u16 *value) | 149 | u16 *value) |
| 131 | { | 150 | { |
| 132 | return ERR_PTR(-ENODEV); | 151 | return ERR_PTR(-ENODEV); |
| 133 | } | 152 | } |
| 134 | 153 | ||
| 135 | static inline struct dentry *debugfs_create_u32(const char *name, mode_t mode, | 154 | static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode, |
| 136 | struct dentry *parent, | 155 | struct dentry *parent, |
| 137 | u32 *value) | 156 | u32 *value) |
| 138 | { | 157 | { |
| 139 | return ERR_PTR(-ENODEV); | 158 | return ERR_PTR(-ENODEV); |
| 140 | } | 159 | } |
| 141 | 160 | ||
| 142 | static inline struct dentry *debugfs_create_u64(const char *name, mode_t mode, | 161 | static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode, |
| 143 | struct dentry *parent, | 162 | struct dentry *parent, |
| 144 | u64 *value) | 163 | u64 *value) |
| 145 | { | 164 | { |
| 146 | return ERR_PTR(-ENODEV); | 165 | return ERR_PTR(-ENODEV); |
| 147 | } | 166 | } |
| 148 | 167 | ||
| 149 | static inline struct dentry *debugfs_create_x8(const char *name, mode_t mode, | 168 | static inline struct dentry *debugfs_create_x8(const char *name, umode_t mode, |
| 150 | struct dentry *parent, | 169 | struct dentry *parent, |
| 151 | u8 *value) | 170 | u8 *value) |
| 152 | { | 171 | { |
| 153 | return ERR_PTR(-ENODEV); | 172 | return ERR_PTR(-ENODEV); |
| 154 | } | 173 | } |
| 155 | 174 | ||
| 156 | static inline struct dentry *debugfs_create_x16(const char *name, mode_t mode, | 175 | static inline struct dentry *debugfs_create_x16(const char *name, umode_t mode, |
| 157 | struct dentry *parent, | 176 | struct dentry *parent, |
| 158 | u16 *value) | 177 | u16 *value) |
| 159 | { | 178 | { |
| 160 | return ERR_PTR(-ENODEV); | 179 | return ERR_PTR(-ENODEV); |
| 161 | } | 180 | } |
| 162 | 181 | ||
| 163 | static inline struct dentry *debugfs_create_x32(const char *name, mode_t mode, | 182 | static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode, |
| 164 | struct dentry *parent, | 183 | struct dentry *parent, |
| 165 | u32 *value) | 184 | u32 *value) |
| 166 | { | 185 | { |
| 167 | return ERR_PTR(-ENODEV); | 186 | return ERR_PTR(-ENODEV); |
| 168 | } | 187 | } |
| 169 | 188 | ||
| 170 | static inline struct dentry *debugfs_create_size_t(const char *name, mode_t mode, | 189 | static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode, |
| 171 | struct dentry *parent, | 190 | struct dentry *parent, |
| 172 | size_t *value) | 191 | size_t *value) |
| 173 | { | 192 | { |
| 174 | return ERR_PTR(-ENODEV); | 193 | return ERR_PTR(-ENODEV); |
| 175 | } | 194 | } |
| 176 | 195 | ||
| 177 | static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 196 | static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode, |
| 178 | struct dentry *parent, | 197 | struct dentry *parent, |
| 179 | u32 *value) | 198 | u32 *value) |
| 180 | { | 199 | { |
| 181 | return ERR_PTR(-ENODEV); | 200 | return ERR_PTR(-ENODEV); |
| 182 | } | 201 | } |
| 183 | 202 | ||
| 184 | static inline struct dentry *debugfs_create_blob(const char *name, mode_t mode, | 203 | static inline struct dentry *debugfs_create_blob(const char *name, umode_t mode, |
| 185 | struct dentry *parent, | 204 | struct dentry *parent, |
| 186 | struct debugfs_blob_wrapper *blob) | 205 | struct debugfs_blob_wrapper *blob) |
| 187 | { | 206 | { |
| 188 | return ERR_PTR(-ENODEV); | 207 | return ERR_PTR(-ENODEV); |
| 189 | } | 208 | } |
| 190 | 209 | ||
| 210 | static inline struct dentry *debugfs_create_regset32(const char *name, | ||
| 211 | mode_t mode, struct dentry *parent, | ||
| 212 | struct debugfs_regset32 *regset) | ||
| 213 | { | ||
| 214 | return ERR_PTR(-ENODEV); | ||
| 215 | } | ||
| 216 | |||
| 191 | static inline bool debugfs_initialized(void) | 217 | static inline bool debugfs_initialized(void) |
| 192 | { | 218 | { |
| 193 | return false; | 219 | return false; |
