This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 5f1a2696b334b9bc5e1db617881314dd1f5ca387
Author: Yanfeng Liu <[email protected]>
AuthorDate: Mon Jan 6 15:19:48 2025 +0800

    board/qemu-armv7a: add board_power_off
    
    This allows to power off qemu-armv7a target via NSH `quit` command.
    
    Signed-off-by: Yanfeng Liu <[email protected]>
---
 boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c 
b/boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c
index b8d6872e30..4d0cc8efca 100644
--- a/boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c
+++ b/boards/arm/qemu/qemu-armv7a/src/qemu_boardinit.c
@@ -24,6 +24,7 @@
  * Included Files
  ****************************************************************************/
 
+#include <nuttx/arch.h>
 #include <nuttx/config.h>
 #include <stdint.h>
 #include <nuttx/board.h>
@@ -113,3 +114,13 @@ void board_late_initialize(void)
   qemu_bringup();
 }
 #endif /* CONFIG_BOARD_LATE_INITIALIZE */
+
+#if defined(CONFIG_BOARDCTL_POWEROFF) && defined(CONFIG_ARM_PSCI)
+int board_power_off(int status)
+{
+  UNUSED(status);
+
+  up_systempoweroff();
+  return 0;
+}
+#endif
\ No newline at end of file

Reply via email to