git: 41582f28ddf7 - main - sys: Add a deprecation warning for 32-bit kernels.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 16 Aug 2023 16:53:32 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=41582f28ddf7b42b713b270d41e8da80160b69a3

commit 41582f28ddf7b42b713b270d41e8da80160b69a3
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-08-16 16:48:51 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-08-16 16:48:51 +0000

    sys: Add a deprecation warning for 32-bit kernels.
    
    Per recent discussions on arch@ and at the BSDCan developer summit, we
    are considering removing support for 32-bit platforms (in some form)
    for 15.0 (at the earliest).  A final decision on what will ship in
    15.0 will be made closer to the release of 15.0.  However, we should
    communicate the potential deprecation in 14.0 to provide notice to
    users.
    
    This commit adds a warning during boot on 32-bit kernels that they are
    deprecated and may be removed in 15.0.  More details will be included
    in a followup commit to RELNOTES.
    
    Reviewed by:    brooks, imp, emaste
    Differential Revision:  https://reviews.freebsd.org/D41163
---
 sys/kern/init_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index abc6b3f6e2f2..78377d5d7ce7 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -395,6 +395,15 @@ SYSINIT(diagwarn2, SI_SUB_LAST, SI_ORDER_FIFTH,
     print_caddr_t, diag_warn);
 #endif
 
+#if __SIZEOF_LONG__ == 4
+static char ilp32_warn[] =
+    "WARNING: 32-bit kernels are deprecated and may be removed in FreeBSD 15.0.\n";
+SYSINIT(ilp32warn, SI_SUB_COPYRIGHT, SI_ORDER_FIFTH,
+    print_caddr_t, ilp32_warn);
+SYSINIT(ilp32warn2, SI_SUB_LAST, SI_ORDER_FIFTH,
+    print_caddr_t, ilp32_warn);
+#endif
+
 static int
 null_fetch_syscall_args(struct thread *td __unused)
 {