Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2023 22:11:04 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 067fa78a99d6 - stable/13 - kboot: Use #defines for magic reboot constants
Message-ID:  <202301242211.30OMB4ej083415@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by imp:

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

commit 067fa78a99d61f099a0f522798b1b0fe0e121915
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-06-28 14:44:16 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:24 +0000

    kboot: Use #defines for magic reboot constants
    
    Sponsored by:           Netflix
    
    (cherry picked from commit 8fa9263f67eb78c8ded9bd3d94c9c841cd0b6ba3)
---
 stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c | 4 ++--
 stand/kboot/host_syscall.h                     | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c b/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
index 7de963d4e211..94f27d13f1b9 100644
--- a/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
+++ b/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
@@ -157,8 +157,8 @@ ppc64_elf_exec(struct preloaded_file *fp)
 	if (error != 0)
 		panic("kexec_load returned error: %d", error);
 
-	error = host_reboot(0xfee1dead, 672274793,
-	    0x45584543 /* LINUX_REBOOT_CMD_KEXEC */, (uintptr_t)NULL);
+	error = host_reboot(HOST_REBOOT_MAGIC1, HOST_REBOOT_MAGIC2, HOST_REBOOT_CMD_KEXEC,
+	    (uintptr_t)NULL);
 	if (error != 0)
 		panic("reboot returned error: %d", error);
 
diff --git a/stand/kboot/host_syscall.h b/stand/kboot/host_syscall.h
index 1ce74d3f393d..1b12ffc3d4e6 100644
--- a/stand/kboot/host_syscall.h
+++ b/stand/kboot/host_syscall.h
@@ -91,6 +91,10 @@ struct host_timeval {
 /* Mount flags from uapi */
 #define MS_RELATIME (1 << 21)
 
+#define HOST_REBOOT_MAGIC1	0xfee1dead
+#define HOST_REBOOT_MAGIC2	672274793
+#define HOST_REBOOT_CMD_KEXEC	0x45584543
+
 /*
  * System Calls
  */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202301242211.30OMB4ej083415>