git: 06cfd1047da6 - main - linuxkpi: Add `register_pm_notifier()` and `unregister_pm_notifier()`
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 22 Apr 2026 18:10:25 UTC
The branch main has been updated by dumbbell:
URL: https://cgit.FreeBSD.org/src/commit/?id=06cfd1047da6f3cdba80da371592980a7143a7b6
commit 06cfd1047da6f3cdba80da371592980a7143a7b6
Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2026-04-20 22:04:27 +0000
Commit: Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2026-04-22 18:09:55 +0000
linuxkpi: Add `register_pm_notifier()` and `unregister_pm_notifier()`
They are empty stub returning success for now, like the previously
defined stubs in this header.
Several constant are also defined in the process.
The amdgpu DRM driver started to use them in Linux 6.12.x.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56572
---
sys/compat/linuxkpi/common/include/linux/suspend.h | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/sys/compat/linuxkpi/common/include/linux/suspend.h b/sys/compat/linuxkpi/common/include/linux/suspend.h
index 3d5d5d594127..3a8bec392437 100644
--- a/sys/compat/linuxkpi/common/include/linux/suspend.h
+++ b/sys/compat/linuxkpi/common/include/linux/suspend.h
@@ -20,10 +20,29 @@ extern suspend_state_t pm_suspend_target_state;
#define PM_SUSPEND_MIN PM_SUSPEND_TO_IDLE
#define PM_SUSPEND_MAX 4
+#define PM_HIBERNATION_PREPARE 0x0001
+#define PM_POST_HIBERNATION 0x0002
+#define PM_SUSPEND_PREPARE 0x0003
+#define PM_POST_SUSPEND 0x0004
+#define PM_RESTORE_PREPARE 0x0005
+#define PM_POST_RESTORE 0x0006
+
static inline int
pm_suspend_via_firmware(void)
{
- return 0;
+ return (0);
+}
+
+static inline int
+register_pm_notifier(struct notifier_block *nb)
+{
+ return (0);
+}
+
+static inline int
+unregister_pm_notifier(struct notifier_block *nb)
+{
+ return (0);
}
#endif /* _LINUXKPI_LINUX_SUSPEND_H_ */