sclp.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Copyright IBM Corp. 2007
  3. * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
  4. */
  5. #ifndef _ASM_S390_SCLP_H
  6. #define _ASM_S390_SCLP_H
  7. #include <linux/types.h>
  8. #include <asm/chpid.h>
  9. #include <asm/cpu.h>
  10. #define SCLP_CHP_INFO_MASK_SIZE 32
  11. #define SCLP_MAX_CORES 256
  12. struct sclp_chp_info {
  13. u8 recognized[SCLP_CHP_INFO_MASK_SIZE];
  14. u8 standby[SCLP_CHP_INFO_MASK_SIZE];
  15. u8 configured[SCLP_CHP_INFO_MASK_SIZE];
  16. };
  17. #define LOADPARM_LEN 8
  18. struct sclp_ipl_info {
  19. int is_valid;
  20. int has_dump;
  21. char loadparm[LOADPARM_LEN];
  22. };
  23. struct sclp_core_entry {
  24. u8 core_id;
  25. u8 reserved0;
  26. u8 : 4;
  27. u8 sief2 : 1;
  28. u8 : 3;
  29. u8 : 3;
  30. u8 siif : 1;
  31. u8 sigpif : 1;
  32. u8 : 3;
  33. u8 reserved2[10];
  34. u8 type;
  35. u8 reserved1;
  36. } __attribute__((packed));
  37. struct sclp_core_info {
  38. unsigned int configured;
  39. unsigned int standby;
  40. unsigned int combined;
  41. struct sclp_core_entry core[SCLP_MAX_CORES];
  42. };
  43. struct sclp_info {
  44. unsigned char has_linemode : 1;
  45. unsigned char has_vt220 : 1;
  46. unsigned char has_siif : 1;
  47. unsigned char has_sigpif : 1;
  48. unsigned char has_core_type : 1;
  49. unsigned char has_sprp : 1;
  50. unsigned char has_hvs : 1;
  51. unsigned char has_esca : 1;
  52. unsigned char has_sief2 : 1;
  53. unsigned int ibc;
  54. unsigned int mtid;
  55. unsigned int mtid_cp;
  56. unsigned int mtid_prev;
  57. unsigned long rzm;
  58. unsigned long rnmax;
  59. unsigned long hamax;
  60. unsigned int max_cores;
  61. unsigned long hsa_size;
  62. unsigned long facilities;
  63. unsigned int hmfai;
  64. };
  65. extern struct sclp_info sclp;
  66. struct zpci_report_error_header {
  67. u8 version; /* Interface version byte */
  68. u8 action; /* Action qualifier byte
  69. * 1: Deconfigure and repair action requested
  70. * (OpenCrypto Problem Call Home)
  71. * 2: Informational Report
  72. * (OpenCrypto Successful Diagnostics Execution)
  73. */
  74. u16 length; /* Length of Subsequent Data (up to 4K – SCLP header */
  75. u8 data[0]; /* Subsequent Data passed verbatim to SCLP ET 24 */
  76. } __packed;
  77. int sclp_get_core_info(struct sclp_core_info *info);
  78. int sclp_core_configure(u8 core);
  79. int sclp_core_deconfigure(u8 core);
  80. int sclp_sdias_blk_count(void);
  81. int sclp_sdias_copy(void *dest, int blk_num, int nr_blks);
  82. int sclp_chp_configure(struct chp_id chpid);
  83. int sclp_chp_deconfigure(struct chp_id chpid);
  84. int sclp_chp_read_info(struct sclp_chp_info *info);
  85. void sclp_get_ipl_info(struct sclp_ipl_info *info);
  86. int sclp_pci_configure(u32 fid);
  87. int sclp_pci_deconfigure(u32 fid);
  88. int sclp_pci_report(struct zpci_report_error_header *report, u32 fh, u32 fid);
  89. int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count);
  90. int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count);
  91. void sclp_early_detect(void);
  92. void _sclp_print_early(const char *);
  93. #endif /* _ASM_S390_SCLP_H */