git: cc7b630cec83 - main - stand/kboot: Add note about why we use MACHINE_ARCH here

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sun, 04 Sep 2022 15:39:10 UTC
The branch main has been updated by imp:

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

commit cc7b630cec8320ad979af6b29cb67027f6a95456
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-09-04 15:31:51 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-09-04 15:37:42 +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
---
 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}/fdt.mk"
 
+# 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.
 .PATH:	${.CURDIR}/arch/${MACHINE_ARCH}
 .include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc"