X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fproc_fs.h;h=adc7b24ccd3cd7903a51e28aac37eade11d34c39;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=2d439a8390c063403a277f7878579f6850d4d1a7;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 2d439a839..adc7b24cc 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -1,9 +1,10 @@ #ifndef _LINUX_PROC_FS_H #define _LINUX_PROC_FS_H -#include #include #include +#include +#include #include /* @@ -24,8 +25,6 @@ enum { PROC_ROOT_INO = 1, }; -#define PROC_SUPER_MAGIC 0x9fa0 - /* * This is not completely implemented yet. The idea is to * create an in-memory tree (like the actual /proc filesystem @@ -55,9 +54,10 @@ struct proc_dir_entry { nlink_t nlink; uid_t uid; gid_t gid; - unsigned long size; + int vx_flags; + loff_t size; struct inode_operations * proc_iops; - struct file_operations * proc_fops; + const struct file_operations * proc_fops; get_info_t *get_info; struct module *owner; struct proc_dir_entry *next, *parent, *subdir; @@ -66,6 +66,7 @@ struct proc_dir_entry { write_proc_t *write_proc; atomic_t count; /* use count */ int deleted; /* delete flag */ + void *set; }; struct kcore_list { @@ -74,22 +75,36 @@ struct kcore_list { size_t size; }; +struct vmcore { + struct list_head list; + unsigned long long paddr; + unsigned long long size; + loff_t offset; +}; + #ifdef CONFIG_PROC_FS extern struct proc_dir_entry proc_root; extern struct proc_dir_entry *proc_root_fs; extern struct proc_dir_entry *proc_net; +extern struct proc_dir_entry *proc_net_stat; extern struct proc_dir_entry *proc_bus; extern struct proc_dir_entry *proc_root_driver; extern struct proc_dir_entry *proc_root_kcore; +extern spinlock_t proc_subdir_lock; + extern void proc_root_init(void); extern void proc_misc_init(void); +struct mm_struct; + +void proc_flush_task(struct task_struct *task); struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *); -struct dentry *proc_pid_unhash(struct task_struct *p); -void proc_pid_flush(struct dentry *proc_dentry); int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); +unsigned long task_vsize(struct mm_struct *); +int task_statm(struct mm_struct *, int *, int *, int *, int *); +char *task_mem(struct mm_struct *, char *); extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent); @@ -111,9 +126,9 @@ extern int proc_match(int, const char *,struct proc_dir_entry *); extern int proc_readdir(struct file *, void *, filldir_t); extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); -extern struct file_operations proc_kcore_operations; -extern struct file_operations proc_kmsg_operations; -extern struct file_operations ppc_htab_operations; +extern const struct file_operations proc_kcore_operations; +extern const struct file_operations proc_kmsg_operations; +extern const struct file_operations ppc_htab_operations; /* * proc_tty.c @@ -126,15 +141,17 @@ extern void proc_tty_unregister_driver(struct tty_driver *driver); /* * proc_devtree.c */ +#ifdef CONFIG_PROC_DEVICETREE struct device_node; +struct property; extern void proc_device_tree_init(void); -#ifdef CONFIG_PROC_DEVICETREE extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); -#else /* !CONFIG_PROC_DEVICETREE */ -static inline void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *pde) -{ - return; -} +extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); +extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde, + struct property *prop); +extern void proc_device_tree_update_prop(struct proc_dir_entry *pde, + struct property *newprop, + struct property *oldprop); #endif /* CONFIG_PROC_DEVICETREE */ extern struct proc_dir_entry *proc_symlink(const char *, @@ -170,7 +187,7 @@ static inline struct proc_dir_entry *proc_net_create(const char *name, } static inline struct proc_dir_entry *proc_net_fops_create(const char *name, - mode_t mode, struct file_operations *fops) + mode_t mode, const struct file_operations *fops) { struct proc_dir_entry *res = create_proc_entry(name, mode, proc_net); if (res) @@ -187,13 +204,13 @@ static inline void proc_net_remove(const char *name) #define proc_root_driver NULL #define proc_net NULL +#define proc_bus NULL #define proc_net_fops_create(name, mode, fops) ({ (void)(mode), NULL; }) #define proc_net_create(name, mode, info) ({ (void)(mode), NULL; }) static inline void proc_net_remove(const char *name) {} -static inline struct dentry *proc_pid_unhash(struct task_struct *p) { return NULL; } -static inline void proc_pid_flush(struct dentry *proc_dentry) { } +static inline void proc_flush_task(struct task_struct *task) { } static inline struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent) { return NULL; } @@ -201,14 +218,13 @@ static inline struct proc_dir_entry *create_proc_entry(const char *name, #define remove_proc_entry(name, parent) do {} while (0) static inline struct proc_dir_entry *proc_symlink(const char *name, - struct proc_dir_entry *parent,char *dest) {return NULL;} + struct proc_dir_entry *parent,const char *dest) {return NULL;} static inline struct proc_dir_entry *proc_mkdir(const char *name, struct proc_dir_entry *parent) {return NULL;} static inline struct proc_dir_entry *create_proc_read_entry(const char *name, mode_t mode, struct proc_dir_entry *base, - int (*read_proc)(char *, char **, off_t, int, int *, void *), - void * data) { return NULL; } + read_proc_t *read_proc, void * data) { return NULL; } static inline struct proc_dir_entry *create_proc_info_entry(const char *name, mode_t mode, struct proc_dir_entry *base, get_info_t *get_info) { return NULL; } @@ -221,26 +237,30 @@ extern struct proc_dir_entry proc_root; #endif /* CONFIG_PROC_FS */ -#if !defined(CONFIG_PROC_FS) +#if !defined(CONFIG_PROC_KCORE) static inline void kclist_add(struct kcore_list *new, void *addr, size_t size) { } -static inline struct kcore_list * kclist_del(void *addr) -{ - return NULL; -} #else extern void kclist_add(struct kcore_list *, void *, size_t); -extern struct kcore_list *kclist_del(void *); #endif +struct vx_info; +struct nx_info; + +union proc_op { + int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); + int (*proc_read)(struct task_struct *task, char *page); + int (*proc_vs_read)(char *page); + int (*proc_vxi_read)(struct vx_info *vxi, char *page); + int (*proc_nxi_read)(struct nx_info *nxi, char *page); +}; + struct proc_inode { - struct task_struct *task; - int type; - union { - int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); - int (*proc_read)(struct task_struct *task, char *page); - } op; + struct pid *pid; + int vx_flags; + int fd; + union proc_op op; struct proc_dir_entry *pde; struct inode vfs_inode; }; @@ -255,4 +275,12 @@ static inline struct proc_dir_entry *PDE(const struct inode *inode) return PROC_I(inode)->pde; } +struct proc_maps_private { + struct pid *pid; + struct task_struct *task; +#ifdef CONFIG_MMU + struct vm_area_struct *tail_vma; +#endif +}; + #endif /* _LINUX_PROC_FS_H */