History

platform/x86: ISST: Add IOCTL to Translate Linux logical CPU to PUNIT CPU number

Add processing for IOCTL command ISST_IF_GET_PHY_ID. This converts from the Linux logical CPU to PUNIT CPU numbering scheme.

Srinivas Pandruvada committed 7 years ago

Commit fb5b36a1 parent 8fbfb6f2 files · +102 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/isst_if.h+28−0
@@ -36,6 +36,34 @@ struct isst_if_platform_info { · 35 unmodified lines
3636 __u8 mmio_supported;
3737 };
3838
39+/**
40+ * struct isst_if_cpu_map - CPU mapping between logical and physical CPU
41+ * @logical_cpu: Linux logical CPU number
42+ * @physical_cpu: PUNIT CPU number
43+ *
44+ * Used to convert from Linux logical CPU to PUNIT CPU numbering scheme.
45+ * The PUNIT CPU number is different than APIC ID based CPU numbering.
46+ */
47+struct isst_if_cpu_map {
48+ __u32 logical_cpu;
49+ __u32 physical_cpu;
50+};
51+
52+/**
53+ * struct isst_if_cpu_maps - structure for CPU map IOCTL
54+ * @cmd_count: Number of CPU mapping command in cpu_map[]
55+ * @cpu_map[]: Holds one or more CPU map data structure
56+ *
57+ * This structure used with ioctl ISST_IF_GET_PHY_ID to send
58+ * one or more CPU mapping commands. Here IOCTL return value indicates
59+ * number of commands sent or error number if no commands have been sent.
60+ */
61+struct isst_if_cpu_maps {
62+ __u32 cmd_count;
63+ struct isst_if_cpu_map cpu_map[1];
64+};
65+
3966 #define ISST_IF_MAGIC 0xFE
4067 #define ISST_IF_GET_PLATFORM_INFO _IOR(ISST_IF_MAGIC, 0, struct isst_if_platform_info *)
68+#define ISST_IF_GET_PHY_ID _IOWR(ISST_IF_MAGIC, 1, struct isst_if_cpu_map *)
4169 #endif