git: ae04175ec32d - stable/13 - stand/kboot: Add note about why we use MACHINE_ARCH here

From: Warner Losh <>
Date: Tue, 24 Jan 2023 22:12:26 UTC
The branch stable/13 has been updated by imp:


commit ae04175ec32d2ae43cfbd49ea143a29c887c7287
Author:     Warner Losh <>
AuthorDate: 2022-09-04 15:31:51 +0000
Commit:     Warner Losh <>
CommitDate: 2023-01-24 21:49:33 +0000

    stand/kboot: Add note about why we use MACHINE_ARCH here
    Normally in the boot loader, we key off of MACHINE since that specifies
    the kernel and the loader is very tuned to each type of MACHINE in
    general. In this case, however, we're producing a Linux binary, with
    Linux system calls encoded in it. These align better along the
    MACHINE_ARCH axis of FreeBSD. For PowerPC the system calls are radically
    different for each of our MACHINE_ARCHes, with only powerpc64 and
    powerpc64le sharing the same numbers and memory layout. The same was
    true about mips when it was in the tree. 32-bit arm uses the same
    layout, however, for both armv6 and armv7 ports: that can be easily
    shared in the unlikely event we support that in the future.
    Sponsored by:           Netflix
    (cherry picked from commit cc7b630cec8320ad979af6b29cb67027f6a95456)
 stand/kboot/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/stand/kboot/Makefile b/stand/kboot/Makefile
index c204af8b17e7..518e945a596e 100644
--- a/stand/kboot/Makefile
+++ b/stand/kboot/Makefile
@@ -35,6 +35,9 @@ CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken
 .include	"${BOOTSRC}/"
+# Note: Since we're producing a userland binary, we key off of MACHINE_ARCH
+# instead of the more normal MACHINE since the changes between different flavors
+# of MACHINE_ARCH are large enough in Linux that it's easier that way.
 .include "${.CURDIR}/arch/${MACHINE_ARCH}/"