@@ -733,6 +733,21 @@ static int ioc_bb_free(struct file *filp, void __user *argp)
return 0;
}
+static int ioc_get_pe_info(struct file *filp, void __user *argp)
+{
+ struct fujitsu_hwb_ioc_pe_info pe_info = {0};
+ int cpu = smp_processor_id();
+
+ pe_info.cmg = _hwinfo.core_map[cpu].cmg;
+ pe_info.ppe = _hwinfo.core_map[cpu].ppe;
+
+ if (copy_to_user((struct fujitsu_hwb_ioc_pe_info __user *)argp, &pe_info,
+ sizeof(struct fujitsu_hwb_ioc_pe_info)))
+ return -EFAULT;
+
+ return 0;
+}
+
static long fujitsu_hwb_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
void __user *argp = (void __user *)arg;
@@ -751,6 +766,9 @@ static long fujitsu_hwb_dev_ioctl(struct file *filp, unsigned int cmd, unsigned
case FUJITSU_HWB_IOC_BB_FREE:
ret = ioc_bb_free(filp, argp);
break;
+ case FUJITSU_HWB_IOC_GET_PE_INFO:
+ ret = ioc_get_pe_info(filp, argp);
+ break;
default:
ret = -ENOTTY;
break;
@@ -22,6 +22,11 @@ struct fujitsu_hwb_ioc_bw_ctl {
__s8 window;
};
+struct fujitsu_hwb_ioc_pe_info {
+ __u8 cmg;
+ __u8 ppe;
+};
+
#define FUJITSU_HWB_IOC_BB_ALLOC _IOWR(__FUJITSU_IOCTL_MAGIC, \
0x00, struct fujitsu_hwb_ioc_bb_ctl)
#define FUJITSU_HWB_IOC_BW_ASSIGN _IOWR(__FUJITSU_IOCTL_MAGIC, \
@@ -30,5 +35,7 @@ struct fujitsu_hwb_ioc_bw_ctl {
0x02, struct fujitsu_hwb_ioc_bw_ctl)
#define FUJITSU_HWB_IOC_BB_FREE _IOW(__FUJITSU_IOCTL_MAGIC, \
0x03, struct fujitsu_hwb_ioc_bb_ctl)
+#define FUJITSU_HWB_IOC_GET_PE_INFO _IOR(__FUJITSU_IOCTL_MAGIC, \
+ 0x04, struct fujitsu_hwb_ioc_pe_info)
#endif /* _UAPI_LINUX_FUJITSU_HPC_IOC_H */
This is an infomative ioctl to tell users CMG/PE number of currently running PE. Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com> --- drivers/soc/fujitsu/fujitsu_hwb.c | 18 ++++++++++++++++++ include/uapi/linux/fujitsu_hpc_ioctl.h | 7 +++++++ 2 files changed, 25 insertions(+)