]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox: Fix quiting when the LCD window is closed
authorSimon Glass <sjg@chromium.org>
Thu, 1 Jun 2023 16:22:28 +0000 (10:22 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 14 Jul 2023 16:54:50 +0000 (12:54 -0400)
With recent changes to how sandbox handles reset, closing the window
currently just restarts sandbox.

Use the correct sysreset type to tell it to shut down.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/sandbox/cpu/sdl.c

index 2c570ed8d1646fe810be12b3d74fa1c6c06dc4d2..590e406517bfe113506439cb7cecfae6704e0cf9 100644 (file)
@@ -6,6 +6,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <stdbool.h>
+#include <sysreset.h>
 #include <linux/input.h>
 #include <SDL2/SDL.h>
 #include <asm/state.h>
@@ -81,7 +82,7 @@ static void sandbox_sdl_poll_events(void)
                switch (event.type) {
                case SDL_QUIT:
                        puts("LCD window closed - quitting\n");
-                       reset_cpu();
+                       sysreset_walk(SYSRESET_POWER_OFF);
                        break;
                }
        }