git: b33f61833b29 - main - stand/uboot: Move archsw init to compile time
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 26 May 2025 15:33:35 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b33f61833b29916190d9abf75b018576cd587b03 commit b33f61833b29916190d9abf75b018576cd587b03 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2025-05-26 03:37:16 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2025-05-26 15:30:37 +0000 stand/uboot: Move archsw init to compile time Sponsored by: Netflix --- stand/uboot/main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/stand/uboot/main.c b/stand/uboot/main.c index ab63b9a33a66..61b691f7edfa 100644 --- a/stand/uboot/main.c +++ b/stand/uboot/main.c @@ -40,7 +40,15 @@ #endif struct uboot_devdesc currdev; -struct arch_switch archsw; /* MI/MD interface boundary */ +struct arch_switch archsw = { /* MI/MD interface boundary */ + .arch_loadaddr = uboot_loadaddr, + .arch_getdev = uboot_getdev, + .arch_copyin = uboot_copyin, + .arch_copyout = uboot_copyout, + .arch_readin = uboot_readin, + .arch_autoload = uboot_autoload, +}; + int devs_no; uintptr_t uboot_heap_start; @@ -474,13 +482,6 @@ main(int argc, char **argv) meminfo(); - archsw.arch_loadaddr = uboot_loadaddr; - archsw.arch_getdev = uboot_getdev; - archsw.arch_copyin = uboot_copyin; - archsw.arch_copyout = uboot_copyout; - archsw.arch_readin = uboot_readin; - archsw.arch_autoload = uboot_autoload; - /* Set up currdev variable to have hooks in place. */ env_setenv("currdev", EV_VOLATILE, "", uboot_setcurrdev, env_nounset);