hypfs.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Hypervisor filesystem for Linux on s390.
  3. *
  4. * Copyright IBM Corp. 2006
  5. * Author(s): Michael Holzheu <holzheu@de.ibm.com>
  6. */
  7. #ifndef _HYPFS_H_
  8. #define _HYPFS_H_
  9. #include <linux/fs.h>
  10. #include <linux/types.h>
  11. #include <linux/debugfs.h>
  12. #include <linux/workqueue.h>
  13. #include <linux/kref.h>
  14. #include <asm/hypfs.h>
  15. #define REG_FILE_MODE 0440
  16. #define UPDATE_FILE_MODE 0220
  17. #define DIR_MODE 0550
  18. extern struct dentry *hypfs_mkdir(struct dentry *parent, const char *name);
  19. extern struct dentry *hypfs_create_u64(struct dentry *dir, const char *name,
  20. __u64 value);
  21. extern struct dentry *hypfs_create_str(struct dentry *dir, const char *name,
  22. char *string);
  23. /* LPAR Hypervisor */
  24. extern int hypfs_diag_init(void);
  25. extern void hypfs_diag_exit(void);
  26. extern int hypfs_diag_create_files(struct dentry *root);
  27. /* VM Hypervisor */
  28. extern int hypfs_vm_init(void);
  29. extern void hypfs_vm_exit(void);
  30. extern int hypfs_vm_create_files(struct dentry *root);
  31. /* VM diagnose 0c */
  32. int hypfs_diag0c_init(void);
  33. void hypfs_diag0c_exit(void);
  34. /* Set Partition-Resource Parameter */
  35. int hypfs_sprp_init(void);
  36. void hypfs_sprp_exit(void);
  37. /* debugfs interface */
  38. struct hypfs_dbfs_file;
  39. struct hypfs_dbfs_data {
  40. void *buf;
  41. void *buf_free_ptr;
  42. size_t size;
  43. struct hypfs_dbfs_file *dbfs_file;
  44. };
  45. struct hypfs_dbfs_file {
  46. const char *name;
  47. int (*data_create)(void **data, void **data_free_ptr,
  48. size_t *size);
  49. void (*data_free)(const void *buf_free_ptr);
  50. long (*unlocked_ioctl) (struct file *, unsigned int,
  51. unsigned long);
  52. /* Private data for hypfs_dbfs.c */
  53. struct mutex lock;
  54. struct dentry *dentry;
  55. };
  56. extern int hypfs_dbfs_init(void);
  57. extern void hypfs_dbfs_exit(void);
  58. extern int hypfs_dbfs_create_file(struct hypfs_dbfs_file *df);
  59. extern void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df);
  60. #endif /* _HYPFS_H_ */