1226,1227c1226
<
< /// Target mmap() handler.
---
> /// Real mmap handler.
1230c1229,1230
< mmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
---
> mmapImpl(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc,
> bool is_mmap2)
1240,1242c1240,1241
< DPRINTF_SYSCALL(Verbose, "mmap(0x%x, len %d, prot %d, flags %d, fd %d, "
< "offs %d)\n", start, length, prot, tgt_flags, tgt_fd,
< offset);
---
> if (is_mmap2)
> offset *= TheISA::PageBytes;
1365a1365,1380
> /// Target mmap() handler.
> template <class OS>
> SyscallReturn
> mmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
> {
> return mmapImpl<OS>(desc, num, p, tc, false);
> }
>
> /// Target mmap2() handler.
> template <class OS>
> SyscallReturn
> mmap2Func(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
> {
> return mmapImpl<OS>(desc, num, p, tc, true);
> }
>