Date: Wed, 29 Apr 2026 21:43:04 +0000 From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron <dumbbell@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 5c015138fa83 - stable/15 - linuxkpi: Define `system_state` Message-ID: <69f27b68.1902d.20b76a1c@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=5c015138fa838d5896796467f900aa2fa7a7b8cc commit 5c015138fa838d5896796467f900aa2fa7a7b8cc Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> AuthorDate: 2026-04-21 00:14:41 +0000 Commit: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> CommitDate: 2026-04-29 21:04:02 +0000 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 (cherry picked from commit 305ebed50b4e2e2346d211c5a65320fa45c7fbc4) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 11 +++++++++++ sys/compat/linuxkpi/common/src/linux_compat.c | 2 ++ 2 files changed, 13 insertions(+) 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_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 0c7032fa6e23..2fd502990eb3 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -167,6 +167,8 @@ wait_queue_head_t linux_var_waitq; const guid_t guid_null; +enum system_states system_state = SYSTEM_RUNNING; + int panic_cmp(struct rb_node *one, struct rb_node *two) {home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f27b68.1902d.20b76a1c>
