hv-gpci.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef LINUX_POWERPC_PERF_HV_GPCI_H_
  3. #define LINUX_POWERPC_PERF_HV_GPCI_H_
  4. #include <linux/types.h>
  5. /* From the document "H_GetPerformanceCounterInfo Interface" v1.07 */
  6. /* H_GET_PERF_COUNTER_INFO argument */
  7. struct hv_get_perf_counter_info_params {
  8. __be32 counter_request; /* I */
  9. __be32 starting_index; /* IO */
  10. __be16 secondary_index; /* IO */
  11. __be16 returned_values; /* O */
  12. __be32 detail_rc; /* O, only needed when called via *_norets() */
  13. /*
  14. * O, size each of counter_value element in bytes, only set for version
  15. * >= 0x3
  16. */
  17. __be16 cv_element_size;
  18. /* I, 0 (zero) for versions < 0x3 */
  19. __u8 counter_info_version_in;
  20. /* O, 0 (zero) if version < 0x3. Must be set to 0 when making hcall */
  21. __u8 counter_info_version_out;
  22. __u8 reserved[0xC];
  23. __u8 counter_value[];
  24. } __packed;
  25. /*
  26. * counter info version => fw version/reference (spec version)
  27. *
  28. * 8 => power8 (1.07)
  29. * [7 is skipped by spec 1.07]
  30. * 6 => TLBIE (1.07)
  31. * 5 => v7r7m0.phyp (1.05)
  32. * [4 skipped]
  33. * 3 => v7r6m0.phyp (?)
  34. * [1,2 skipped]
  35. * 0 => v7r{2,3,4}m0.phyp (?)
  36. */
  37. #define COUNTER_INFO_VERSION_CURRENT 0x8
  38. /* capability mask masks. */
  39. enum {
  40. HV_GPCI_CM_GA = (1 << 7),
  41. HV_GPCI_CM_EXPANDED = (1 << 6),
  42. HV_GPCI_CM_LAB = (1 << 5)
  43. };
  44. #define REQUEST_FILE "../hv-gpci-requests.h"
  45. #define NAME_LOWER hv_gpci
  46. #define NAME_UPPER HV_GPCI
  47. #include "req-gen/perf.h"
  48. #undef REQUEST_FILE
  49. #undef NAME_LOWER
  50. #undef NAME_UPPER
  51. #endif