Hi Navin,

I would look at Process::allocateMem in src/sim/process.cc and brkFunc() in
src/sim/syscall_emul.cc. brkFunc is called every time the process exectute
the sbrk system call which increases the size of the heap. You could
probably modify Process::allocateMem to specify which virtual addresses you
want to allocate.

You may be able to leverage the mmap implementation to achieve your goal.
For the most part it is implemented in gem5's syscall emulation mode.

Cheers,
Jason

On Sun, Feb 19, 2017 at 8:11 PM Naveen Kashyap <navin.kashyap...@gmail.com>
wrote:

> Hi All,
>  I am implementing a technique, where depending on the thread ID, I would
> like to reserve a certain range of virtual addresses (when the thread calls
> a malloc).
> I am using SE mode.
> I see that mmap needs to be changed to take into this info? How do I go
> about it?
> Adding a pseudo instruction is also fine with me, i.e., in my benchmark
> code, I will use a new pseudo instruction to allocate virtual address range
> depending on the thread ID.
> Any pointers would be of great help.
>
> Thank you,
> Navin
>
> _______________________________________________
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to