From 445b66430df5d778e6a56c526d70cd1c28e46652 Mon Sep 17 00:00:00 2001 From: Matteo Golin Date: Wed, 18 Feb 2026 22:48:56 -0500 Subject: [PATCH] boards/x86_64: Replace board_app_initialize Replaced board_app_initialize logic with board_late_initialize. Signed-off-by: Matteo Golin --- .../qemu/qemu-intel64/src/CMakeLists.txt | 6 +-- boards/x86_64/qemu/qemu-intel64/src/Makefile | 6 +-- .../src/{qemu_appinit.c => qemu_boardinit.c} | 42 ++----------------- 3 files changed, 5 insertions(+), 49 deletions(-) rename boards/x86_64/qemu/qemu-intel64/src/{qemu_appinit.c => qemu_boardinit.c} (69%) diff --git a/boards/x86_64/qemu/qemu-intel64/src/CMakeLists.txt b/boards/x86_64/qemu/qemu-intel64/src/CMakeLists.txt index 32157581292..3ab2d5cd52a 100644 --- a/boards/x86_64/qemu/qemu-intel64/src/CMakeLists.txt +++ b/boards/x86_64/qemu/qemu-intel64/src/CMakeLists.txt @@ -20,11 +20,7 @@ # # ############################################################################## -set(SRCS qemu_boot.c qemu_bringup.c qemu_net.c) - -if(CONFIG_BOARDCTL) - list(APPEND SRCS qemu_appinit.c) -endif() +set(SRCS qemu_boot.c qemu_bringup.c qemu_net.c qemu_boardinit.c) if(CONFIG_BOARDCTL_RESET) list(APPEND SRCS qemu_reset.c) diff --git a/boards/x86_64/qemu/qemu-intel64/src/Makefile b/boards/x86_64/qemu/qemu-intel64/src/Makefile index 45f3f9f23b3..41518289d38 100644 --- a/boards/x86_64/qemu/qemu-intel64/src/Makefile +++ b/boards/x86_64/qemu/qemu-intel64/src/Makefile @@ -22,13 +22,9 @@ include $(TOPDIR)/Make.defs -CSRCS = qemu_boot.c qemu_bringup.c qemu_net.c +CSRCS = qemu_boot.c qemu_bringup.c qemu_net.c qemu_boardinit.c CSRCS += $(if $(wildcard romfs_boot.c), romfs_boot.c, romfs_stub.c) -ifeq ($(CONFIG_BOARDCTL),y) - CSRCS += qemu_appinit.c -endif - ifeq ($(CONFIG_BOARDCTL_RESET),y) CSRCS += qemu_reset.c endif diff --git a/boards/x86_64/qemu/qemu-intel64/src/qemu_appinit.c b/boards/x86_64/qemu/qemu-intel64/src/qemu_boardinit.c similarity index 69% rename from boards/x86_64/qemu/qemu-intel64/src/qemu_appinit.c rename to boards/x86_64/qemu/qemu-intel64/src/qemu_boardinit.c index 82c7ea250d3..550b80de568 100644 --- a/boards/x86_64/qemu/qemu-intel64/src/qemu_appinit.c +++ b/boards/x86_64/qemu/qemu-intel64/src/qemu_boardinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/x86_64/qemu/qemu-intel64/src/qemu_appinit.c + * boards/x86_64/qemu/qemu-intel64/src/qemu_boardinit.c * * SPDX-License-Identifier: Apache-2.0 * @@ -54,44 +54,6 @@ * Public Functions ****************************************************************************/ -/**************************************************************************** - * Name: board_app_initialize - * - * Description: - * Perform application specific initialization. This function is never - * called directly from application code, but only indirectly via the - * (non-standard) boardctl() interface using the command BOARDIOC_INIT. - * - * Input Parameters: - * arg - The boardctl() argument is passed to the board_app_initialize() - * implementation without modification. The argument has no - * meaning to NuttX; the meaning of the argument is a contract - * between the board-specific initialization logic and the - * matching application logic. The value could be such things as a - * mode enumeration value, a set of DIP switch switch settings, a - * pointer to configuration data read from a file or serial FLASH, - * or whatever you would like to do with it. Every implementation - * should accept zero/NULL as a default configuration. - * - * Returned Value: - * Zero (OK) is returned on success; a negated errno value is returned on - * any failure to indicate the nature of the failure. - * - ****************************************************************************/ - -int board_app_initialize(uintptr_t arg) -{ -#ifdef CONFIG_BOARD_LATE_INITIALIZE - /* Board initialization already performed by board_late_initialize() */ - - return OK; -#else - /* Perform board-specific initialization */ - - return qemu_bringup(); -#endif -} - /**************************************************************************** * Name: board_late_initialize * @@ -111,6 +73,7 @@ int board_app_initialize(uintptr_t arg) * ****************************************************************************/ +#ifdef CONFIG_BOARD_LATE_INITIALIZE void board_late_initialize(void) { int ret = OK; @@ -137,3 +100,4 @@ void board_late_initialize(void) } } } +#endif