efivars: Refactor sanity checking code into separate function
[linux/fpc-iii.git] / arch / powerpc / perf / hv-gpci.h
blobb25f460c9cce47f7dadbcf1b7f6fa077e229e9a7
1 #ifndef LINUX_POWERPC_PERF_HV_GPCI_H_
2 #define LINUX_POWERPC_PERF_HV_GPCI_H_
4 #include <linux/types.h>
6 /* From the document "H_GetPerformanceCounterInfo Interface" v1.07 */
8 /* H_GET_PERF_COUNTER_INFO argument */
9 struct hv_get_perf_counter_info_params {
10 __be32 counter_request; /* I */
11 __be32 starting_index; /* IO */
12 __be16 secondary_index; /* IO */
13 __be16 returned_values; /* O */
14 __be32 detail_rc; /* O, only needed when called via *_norets() */
17 * O, size each of counter_value element in bytes, only set for version
18 * >= 0x3
20 __be16 cv_element_size;
22 /* I, 0 (zero) for versions < 0x3 */
23 __u8 counter_info_version_in;
25 /* O, 0 (zero) if version < 0x3. Must be set to 0 when making hcall */
26 __u8 counter_info_version_out;
27 __u8 reserved[0xC];
28 __u8 counter_value[];
29 } __packed;
32 * counter info version => fw version/reference (spec version)
34 * 8 => power8 (1.07)
35 * [7 is skipped by spec 1.07]
36 * 6 => TLBIE (1.07)
37 * 5 => v7r7m0.phyp (1.05)
38 * [4 skipped]
39 * 3 => v7r6m0.phyp (?)
40 * [1,2 skipped]
41 * 0 => v7r{2,3,4}m0.phyp (?)
43 #define COUNTER_INFO_VERSION_CURRENT 0x8
46 * These determine the counter_value[] layout and the meaning of starting_index
47 * and secondary_index.
49 * Unless otherwise noted, @secondary_index is unused and ignored.
51 enum counter_info_requests {
53 /* GENERAL */
55 /* @starting_index: must be -1 (to refer to the current partition)
57 CIR_SYSTEM_PERFORMANCE_CAPABILITIES = 0X40,
60 struct cv_system_performance_capabilities {
61 /* If != 0, allowed to collect data from other partitions */
62 __u8 perf_collect_privileged;
64 /* These following are only valid if counter_info_version >= 0x3 */
65 #define CV_CM_GA (1 << 7)
66 #define CV_CM_EXPANDED (1 << 6)
67 #define CV_CM_LAB (1 << 5)
68 /* remaining bits are reserved */
69 __u8 capability_mask;
70 __u8 reserved[0xE];
71 } __packed;
73 #endif