[PATCH 04/40] sandbox: Fix quiting when the LCD window is closed

Simon Glass sjg at chromium.org
Thu Jun 1 18:22:28 CEST 2023


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 at chromium.org>
---

 arch/sandbox/cpu/sdl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c
index 2c570ed8d164..590e406517bf 100644
--- a/arch/sandbox/cpu/sdl.c
+++ b/arch/sandbox/cpu/sdl.c
@@ -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;
 		}
 	}
-- 
2.41.0.rc0.172.g3f132b7071-goog



More information about the U-Boot mailing list