hypfs.h 1.9 KB

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