[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200526145815.6415-2-mcgrof@kernel.org>
Date: Tue, 26 May 2020 14:58:08 +0000
From: Luis Chamberlain <mcgrof@...nel.org>
To: jeyu@...nel.org, davem@...emloft.net, kuba@...nel.org
Cc: michael.chan@...adcom.com, dchickles@...vell.com,
sburla@...vell.com, fmanlunas@...vell.com, aelior@...vell.com,
GR-everest-linux-l2@...vell.com, kvalo@...eaurora.org,
johannes@...solutions.net, akpm@...ux-foundation.org,
arnd@...db.de, rostedt@...dmis.org, mingo@...hat.com,
aquini@...hat.com, cai@....pw, dyoung@...hat.com, bhe@...hat.com,
peterz@...radead.org, tglx@...utronix.de, gpiccoli@...onical.com,
pmladek@...e.com, tiwai@...e.de, schlad@...e.de,
andriy.shevchenko@...ux.intel.com, derosier@...il.com,
keescook@...omium.org, daniel.vetter@...ll.ch, will@...nel.org,
mchehab+samsung@...nel.org, vkoul@...nel.org,
mchehab+huawei@...nel.org, robh@...nel.org, mhiramat@...nel.org,
sfr@...b.auug.org.au, linux@...inikbrodowski.net,
glider@...gle.com, paulmck@...nel.org, elver@...gle.com,
bauerman@...ux.ibm.com, yamada.masahiro@...ionext.com,
samitolvanen@...gle.com, yzaikin@...gle.com, dvyukov@...gle.com,
rdunlap@...radead.org, corbet@....net, dianders@...omium.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH v3 1/8] kernel.h: move taint and system state flags to uapi
The taint and system state flags will be used in a subsequent patch
exposing these to userspace, so move them to uapi. We keep the
TAINT_FLAGS_COUNT outside of uapi, as this value can change per release.
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
include/linux/kernel.h | 34 +---------------------------------
include/uapi/linux/kernel.h | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 82d91547d122..337634363d00 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -569,40 +569,8 @@ extern unsigned long get_taint(void);
extern int root_mountflags;
extern bool early_boot_irqs_disabled;
+extern enum system_states system_state;
-/*
- * Values used for system_state. Ordering of the states must not be changed
- * as code checks for <, <=, >, >= STATE.
- */
-extern enum system_states {
- SYSTEM_BOOTING,
- SYSTEM_SCHEDULING,
- SYSTEM_RUNNING,
- SYSTEM_HALT,
- SYSTEM_POWER_OFF,
- SYSTEM_RESTART,
- SYSTEM_SUSPEND,
-} system_state;
-
-/* This cannot be an enum because some may be used in assembly source. */
-#define TAINT_PROPRIETARY_MODULE 0
-#define TAINT_FORCED_MODULE 1
-#define TAINT_CPU_OUT_OF_SPEC 2
-#define TAINT_FORCED_RMMOD 3
-#define TAINT_MACHINE_CHECK 4
-#define TAINT_BAD_PAGE 5
-#define TAINT_USER 6
-#define TAINT_DIE 7
-#define TAINT_OVERRIDDEN_ACPI_TABLE 8
-#define TAINT_WARN 9
-#define TAINT_CRAP 10
-#define TAINT_FIRMWARE_WORKAROUND 11
-#define TAINT_OOT_MODULE 12
-#define TAINT_UNSIGNED_MODULE 13
-#define TAINT_SOFTLOCKUP 14
-#define TAINT_LIVEPATCH 15
-#define TAINT_AUX 16
-#define TAINT_RANDSTRUCT 17
#define TAINT_FLAGS_COUNT 18
#define TAINT_FLAGS_MAX ((1UL << TAINT_FLAGS_COUNT) - 1)
diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
index 0ff8f7477847..4bbd4093eb64 100644
--- a/include/uapi/linux/kernel.h
+++ b/include/uapi/linux/kernel.h
@@ -12,4 +12,39 @@
#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
+/*
+ * Values used for system_state. Ordering of the states must not be changed
+ * as code checks for <, <=, >, >= STATE.
+ */
+enum system_states {
+ SYSTEM_BOOTING,
+ SYSTEM_SCHEDULING,
+ SYSTEM_RUNNING,
+ SYSTEM_HALT,
+ SYSTEM_POWER_OFF,
+ SYSTEM_RESTART,
+ SYSTEM_SUSPEND,
+};
+
+/* This cannot be an enum because some may be used in assembly source. */
+#define TAINT_PROPRIETARY_MODULE 0
+#define TAINT_FORCED_MODULE 1
+#define TAINT_CPU_OUT_OF_SPEC 2
+#define TAINT_FORCED_RMMOD 3
+#define TAINT_MACHINE_CHECK 4
+#define TAINT_BAD_PAGE 5
+#define TAINT_USER 6
+#define TAINT_DIE 7
+#define TAINT_OVERRIDDEN_ACPI_TABLE 8
+#define TAINT_WARN 9
+#define TAINT_CRAP 10
+#define TAINT_FIRMWARE_WORKAROUND 11
+#define TAINT_OOT_MODULE 12
+#define TAINT_UNSIGNED_MODULE 13
+#define TAINT_SOFTLOCKUP 14
+#define TAINT_LIVEPATCH 15
+#define TAINT_AUX 16
+#define TAINT_RANDSTRUCT 17
+/* be sure to update TAINT_FLAGS_COUNT when extending this */
+
#endif /* _UAPI_LINUX_KERNEL_H */
--
2.26.2
Powered by blists - more mailing lists