Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *    Hypervisor filesystem for Linux on s390.
0004  *
0005  *    Copyright IBM Corp. 2006
0006  *    Author(s): Michael Holzheu <holzheu@de.ibm.com>
0007  */
0008 
0009 #ifndef _HYPFS_H_
0010 #define _HYPFS_H_
0011 
0012 #include <linux/fs.h>
0013 #include <linux/types.h>
0014 #include <linux/debugfs.h>
0015 #include <linux/workqueue.h>
0016 #include <linux/kref.h>
0017 #include <asm/hypfs.h>
0018 
0019 #define REG_FILE_MODE    0440
0020 #define UPDATE_FILE_MODE 0220
0021 #define DIR_MODE         0550
0022 
0023 extern struct dentry *hypfs_mkdir(struct dentry *parent, const char *name);
0024 
0025 extern struct dentry *hypfs_create_u64(struct dentry *dir, const char *name,
0026                        __u64 value);
0027 
0028 extern struct dentry *hypfs_create_str(struct dentry *dir, const char *name,
0029                        char *string);
0030 
0031 /* LPAR Hypervisor */
0032 extern int hypfs_diag_init(void);
0033 extern void hypfs_diag_exit(void);
0034 extern int hypfs_diag_create_files(struct dentry *root);
0035 
0036 /* VM Hypervisor */
0037 extern int hypfs_vm_init(void);
0038 extern void hypfs_vm_exit(void);
0039 extern int hypfs_vm_create_files(struct dentry *root);
0040 
0041 /* VM diagnose 0c */
0042 int hypfs_diag0c_init(void);
0043 void hypfs_diag0c_exit(void);
0044 
0045 /* Set Partition-Resource Parameter */
0046 void hypfs_sprp_init(void);
0047 void hypfs_sprp_exit(void);
0048 
0049 /* debugfs interface */
0050 struct hypfs_dbfs_file;
0051 
0052 struct hypfs_dbfs_data {
0053     void            *buf;
0054     void            *buf_free_ptr;
0055     size_t          size;
0056     struct hypfs_dbfs_file  *dbfs_file;
0057 };
0058 
0059 struct hypfs_dbfs_file {
0060     const char  *name;
0061     int     (*data_create)(void **data, void **data_free_ptr,
0062                        size_t *size);
0063     void        (*data_free)(const void *buf_free_ptr);
0064     long        (*unlocked_ioctl) (struct file *, unsigned int,
0065                        unsigned long);
0066 
0067     /* Private data for hypfs_dbfs.c */
0068     struct mutex        lock;
0069     struct dentry       *dentry;
0070 };
0071 
0072 extern void hypfs_dbfs_init(void);
0073 extern void hypfs_dbfs_exit(void);
0074 extern void hypfs_dbfs_create_file(struct hypfs_dbfs_file *df);
0075 extern void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df);
0076 
0077 #endif /* _HYPFS_H_ */