From 305ebed50b4e2e2346d211c5a65320fa45c7fbc4 Mon Sep 17 00:00:00 2001 From: Jean-Sébastien Pédron Date: Tue, 21 Apr 2026 02:14:41 +0200 Subject: linuxkpi: Define `system_state` This is a global variable used to track the state of the system, like booting, running, halting and so on. This variable is based on the `enum system_states` enumeration. For now, always set `system_state` to `SYSTEM_RUNNING`. The amdgpu DRM driver started to use this in Linux 6.12.x. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56575 --- sys/compat/linuxkpi/common/include/linux/kernel.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sys/compat/linuxkpi/common/include/linux') diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index e3ac4a05612c..5e94a5cee28c 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -384,4 +384,15 @@ might_fault(void) #define non_block_start() do { } while (0) #define non_block_end() do { } while (0) +extern enum system_states { + SYSTEM_BOOTING, + SYSTEM_SCHEDULING, + SYSTEM_FREEING_INITMEM, + SYSTEM_RUNNING, + SYSTEM_HALT, + SYSTEM_POWER_OFF, + SYSTEM_RESTART, + SYSTEM_SUSPEND, +} system_state; + #endif /* _LINUXKPI_LINUX_KERNEL_H_ */ -- cgit v1.3