From 224b2d4e4e5813f3494c5439dcff68f49c87f0d5 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Sun, 10 Mar 2019 20:12:14 +0100 Subject: Correct computation of size in mmap2 stub implementation. Signed-off-by: Pavel Pisa --- qtmips_osemu/ossyscall.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qtmips_osemu') diff --git a/qtmips_osemu/ossyscall.cpp b/qtmips_osemu/ossyscall.cpp index 724717b..84b0870 100644 --- a/qtmips_osemu/ossyscall.cpp +++ b/qtmips_osemu/ossyscall.cpp @@ -1507,9 +1507,9 @@ int OsSyscallExceptionHandler::do_sys_mmap2(std::uint32_t &result, Core *core, (unsigned long)addr, (unsigned long)lenght, (unsigned long)prot, (unsigned long)flags, (int)fd, (unsigned long long) offset); - lenght = (lenght + TARGET_MAP_ANONYMOUS - 1) & ~(TARGET_MAP_ANONYMOUS - 1); - anonymous_last = (anonymous_last + TARGET_MAP_ANONYMOUS - 1) & - ~(TARGET_MAP_ANONYMOUS - 1); + lenght = (lenght + TARGET_SYSCALL_MMAP2_UNIT - 1) & ~(TARGET_SYSCALL_MMAP2_UNIT - 1); + anonymous_last = (anonymous_last + TARGET_SYSCALL_MMAP2_UNIT - 1) & + ~(TARGET_SYSCALL_MMAP2_UNIT - 1); result = anonymous_last; anonymous_last += lenght; -- cgit v1.2.3