aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-13 12:35:33 +0000
committerPeter Maydell <peter.maydell@linaro.org>2025-01-13 12:35:33 +0000
commitafd757e46166afe86a6df4407b64203e53ea44f4 (patch)
treea6ac8d65db1346a2fcac2b629b560bb00c3a3069
parent16e8c947bd6f741d328bb1521f62f69dccaa3fe1 (diff)
downloadqemu-afd757e46166afe86a6df4407b64203e53ea44f4.zip
qemu-afd757e46166afe86a6df4407b64203e53ea44f4.tar.gz
qemu-afd757e46166afe86a6df4407b64203e53ea44f4.tar.bz2
tests/qtest/boot-serial-test: Reduce for() loop in PL011 tests
Since registers are not modified, we don't need to refill their values. Directly jump to the previous store instruction to keep filling the TXDAT register. The equivalent C code remains: while (true) { *UART_DATA = 'T'; } Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--tests/qtest/boot-serial-test.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c
index a71d285..553575c 100644
--- a/tests/qtest/boot-serial-test.c
+++ b/tests/qtest/boot-serial-test.c
@@ -70,18 +70,18 @@ static const uint8_t kernel_plml605[] = {
};
static const uint8_t bios_raspi2[] = {
- 0x08, 0x30, 0x9f, 0xe5, /* loop: ldr r3, [pc, #8] Get &UART0 */
+ 0x08, 0x30, 0x9f, 0xe5, /* ldr r3, [pc, #8] Get &UART0 */
0x54, 0x20, 0xa0, 0xe3, /* mov r2, #'T' */
- 0x00, 0x20, 0xc3, 0xe5, /* strb r2, [r3] *TXDAT = 'T' */
- 0xfb, 0xff, 0xff, 0xea, /* b -12 (loop) */
+ 0x00, 0x20, 0xc3, 0xe5, /* loop: strb r2, [r3] *TXDAT = 'T' */
+ 0xff, 0xff, 0xff, 0xea, /* b -4 (loop) */
0x00, 0x10, 0x20, 0x3f, /* UART0: 0x3f201000 */
};
static const uint8_t kernel_aarch64[] = {
- 0x81, 0x0a, 0x80, 0x52, /* loop: mov w1, #'T' */
+ 0x81, 0x0a, 0x80, 0x52, /* mov w1, #'T' */
0x02, 0x20, 0xa1, 0xd2, /* mov x2, #0x9000000 Load UART0 */
- 0x41, 0x00, 0x00, 0x39, /* strb w1, [x2] *TXDAT = 'T' */
- 0xfd, 0xff, 0xff, 0x17, /* b -12 (loop) */
+ 0x41, 0x00, 0x00, 0x39, /* loop: strb w1, [x2] *TXDAT = 'T' */
+ 0xff, 0xff, 0xff, 0x17, /* b -4 (loop) */
};
static const uint8_t kernel_nrf51[] = {