[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v10 42/65] mips_malta: Fix semihosting argument pass
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [PATCH v10 42/65] mips_malta: Fix semihosting argument passing for nanoMIPS bare metal |
Date: |
Fri, 17 Aug 2018 16:03:30 +0200 |
From: Stefan Markovic <address@hidden>
Fix passing argument for nanoMIPS bare metal related to the
semihosting regime.
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Aleksandar Markovic <address@hidden>
Signed-off-by: Yongbok Kim <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
Signed-off-by: Stefan Markovic <address@hidden>
---
hw/mips/mips_malta.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index f261dd6..40041d5 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -630,8 +630,14 @@ static void write_bootloader_nanomips(uint8_t *base,
int64_t run_addr,
/* nop */
/* to_here: */
- stw_p(p++, 0x0080); stw_p(p++, 0x0002);
+ if (semihosting_get_argc()) {
+ /* Preserve a0 content as arguments have been passed */
+ stw_p(p++, 0x8000); stw_p(p++, 0xc000);
+ /* nop */
+ } else {
+ stw_p(p++, 0x0080); stw_p(p++, 0x0002);
/* li a0,2 */
+ }
stw_p(p++, 0xe3a0 | NM_HI1(ENVP_ADDR - 64));
--
2.7.4
- [Qemu-devel] [PATCH v10 22/65] target/mips: Add emulation of nanoMIPS 32-bit load and store instructions, (continued)
- [Qemu-devel] [PATCH v10 22/65] target/mips: Add emulation of nanoMIPS 32-bit load and store instructions, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 32/65] target/mips: Add emulation of DSP ASE for nanoMIPS - part 6, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 61/65] linux-user: Add nanoMIPS linux user mode configuration support, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 41/65] mips_malta: Add setting up GT64120 BARs to the nanoMIPS bootloader, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 47/65] linux-user: Add termbits.h header for nanoMIPS, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 40/65] mips_malta: Add basic nanoMIPS boot code for Malta board, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 54/65] linux-user: Add target_elf.h header for nanoMIPS, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 45/65] linux-user: Add syscall numbers for nanoMIPS, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 59/65] linux-user: Add support for statx() syscall for all platforms, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 44/65] elf: Add nanoMIPS specific variations in ELF header fields, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 42/65] mips_malta: Fix semihosting argument passing for nanoMIPS bare metal,
Aleksandar Markovic <=
- [Qemu-devel] [PATCH v10 36/65] elf: Add EM_NANOMIPS value as a valid one for e_machine field, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 65/65] qemu-doc: Add nanoMIPS-related items, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 57/65] linux-user: Add cpu_loop.c for nanoMIPS, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 64/65] gdbstub: Add XML support for GDB for nanoMIPS, Aleksandar Markovic, 2018/08/17
- [Qemu-devel] [PATCH v10 33/65] disas: Add support for nanoMIPS platform, Aleksandar Markovic, 2018/08/17