summaryrefslogtreecommitdiff
path: root/arch/s390/include/uapi
diff options
context:
space:
mode:
authorSumanth Korikkar <sumanthk@linux.ibm.com>2024-12-12 19:17:19 +0300
committerAlexander Gordeev <agordeev@linux.ibm.com>2024-12-17 14:46:14 +0300
commit90e6f191e1ee094d13faae5fc29af7b5baf9d1b8 (patch)
tree8ca0bcc21e649083b6617145bbdef62ad24ce06d /arch/s390/include/uapi
parent2478d43ed621c4d15549142c0cfe6fa4a05e5f10 (diff)
downloadlinux-90e6f191e1ee094d13faae5fc29af7b5baf9d1b8.tar.xz
s390/diag324: Retrieve power readings via diag 0x324
Retrieve electrical power readings for resources in a computing environment via diag 0x324. diag 0x324 stores the power readings in the power information block (pib). Provide power readings from pib via diag324 ioctl interface. diag324 ioctl provides new pib to the user only if the threshold time has passed since the last call. Otherwise, cache data is returned. When there are no active readers, cleanup of pib buffer is performed. Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/uapi')
-rw-r--r--arch/s390/include/uapi/asm/diag.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/s390/include/uapi/asm/diag.h b/arch/s390/include/uapi/asm/diag.h
new file mode 100644
index 000000000000..361c9ba9d4f5
--- /dev/null
+++ b/arch/s390/include/uapi/asm/diag.h
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/*
+ * Diag ioctls and its associated structures definitions.
+ *
+ * Copyright IBM Corp. 2024
+ */
+
+#ifndef __S390_UAPI_ASM_DIAG_H
+#define __S390_UAPI_ASM_DIAG_H
+
+#include <linux/types.h>
+
+#define DIAG_MAGIC_STR 'D'
+
+struct diag324_pib {
+ __u64 address;
+ __u64 sequence;
+};
+
+/* Diag ioctl definitions */
+#define DIAG324_GET_PIBBUF _IOWR(DIAG_MAGIC_STR, 0x77, struct diag324_pib)
+#define DIAG324_GET_PIBLEN _IOR(DIAG_MAGIC_STR, 0x78, size_t)
+
+#endif /* __S390_UAPI_ASM_DIAG_H */