Hi All, I have no idea about the MIPS ABI (or which one I am actually using). I try to run Qt/Embedded using the linux-user target and have some issues with the code.
For semctl qemu enters through the do_ipc method, it appears to be that the 'variable' ptr is really a ptr (to the stack) and needs to be dereferenced. The below snippet seems to fix that issue for me. My next problem is with do_shmctl, somehow third is NULL but it should point to the out parameter (and the application is doing this correctly as well). While trying to understand the issue it looks like target_to_host_shmid_ds will not properly unlock the struct on all paths. Is the IPC emulation supposed to work? Is this an 'obvious' API issue for MIPS? @@ -2873,7 +2886,13 @@ static abi_long do_ipc( break; case IPCOP_semctl: - ret = do_semctl(first, second, third, (union \n target_semun)(abi_ulong) ptr); + if (!lock_user_struct(VERIFY_READ, semun, ptr, 1)) + ret = -TARGET_EFAULT; + else { + __get_user(t_semun.buf, &semun->buf); + ret = do_semctl(first, second, third, t_semun); + unlock_user_struct(semun, ptr, 0); + } break;