From 8e3bcb2eef7f195a9cd61f5b79c1e67a0c3c28ff Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Sat, 17 Oct 2020 13:40:01 +0200 Subject: Tag target endian values to help guide conversion code --- fesvr/syscall.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fesvr/syscall.cc') diff --git a/fesvr/syscall.cc b/fesvr/syscall.cc index 6feb13b..18bdc13 100644 --- a/fesvr/syscall.cc +++ b/fesvr/syscall.cc @@ -299,10 +299,10 @@ reg_t syscall_t::sys_getcwd(reg_t pbuf, reg_t size, reg_t a2, reg_t a3, reg_t a4 reg_t syscall_t::sys_getmainvars(reg_t pbuf, reg_t limit, reg_t a2, reg_t a3, reg_t a4, reg_t a5, reg_t a6) { std::vector args = htif->target_args(); - std::vector words(args.size() + 3); + std::vector> words(args.size() + 3); words[0] = htif->to_target(args.size()); - words[args.size()+1] = 0; // argv[argc] = NULL - words[args.size()+2] = 0; // envp[0] = NULL + words[args.size()+1] = target_endian::zero; // argv[argc] = NULL + words[args.size()+2] = target_endian::zero; // envp[0] = NULL size_t sz = (args.size() + 3) * sizeof(words[0]); for (size_t i = 0; i < args.size(); i++) @@ -340,7 +340,7 @@ reg_t syscall_t::sys_chdir(reg_t path, reg_t a1, reg_t a2, reg_t a3, reg_t a4, r void syscall_t::dispatch(reg_t mm) { - reg_t magicmem[8]; + target_endian magicmem[8]; memif->read(mm, sizeof(magicmem), magicmem); reg_t n = htif->from_target(magicmem[0]); -- cgit v1.1