aboutsummaryrefslogtreecommitdiff
path: root/qtmips_osemu
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-10 20:12:14 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-10 20:12:14 +0100
commit224b2d4e4e5813f3494c5439dcff68f49c87f0d5 (patch)
tree616b19176eb68d5339f4cef53236463d06d4f824 /qtmips_osemu
parent41efcb26a3c01e5ad4feee889bbb4bf731a33550 (diff)
downloadqtmips-224b2d4e4e5813f3494c5439dcff68f49c87f0d5.tar.gz
qtmips-224b2d4e4e5813f3494c5439dcff68f49c87f0d5.tar.bz2
qtmips-224b2d4e4e5813f3494c5439dcff68f49c87f0d5.zip
Correct computation of size in mmap2 stub implementation.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_osemu')
-rw-r--r--qtmips_osemu/ossyscall.cpp6
1 files changed, 3 insertions, 3 deletions
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;