Add an utility class that provides a service for another process
query and get the fd of the corresponding region in gem5's physmem.
Basically, the service works in this way:
1. client connect to the unix socket created by a SharedMemoryServer
2. client send a request {start, end} to gem5
3. the server locates the corresponding shared memory
4. gem5 response {offset} and pass {fd} in ancillary data
mmap fd at offset will provide the client the view into the physical
memory of the request range.
Change-Id: I9d42fd8a41fc28dcfebb45dec10bc9ebb8e21d11
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57729
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
16 lines
486 B
Python
16 lines
486 B
Python
from m5.SimObject import SimObject
|
|
from m5.params import Param
|
|
from m5.proxy import Parent
|
|
|
|
|
|
class SharedMemoryServer(SimObject):
|
|
type = "SharedMemoryServer"
|
|
cxx_header = "mem/shared_memory_server.hh"
|
|
cxx_class = "gem5::memory::SharedMemoryServer"
|
|
|
|
system = Param.System(
|
|
Parent.any,
|
|
"The system where the target shared memory is actually stored.")
|
|
server_path = Param.String(
|
|
"The unix socket path where the server should be running upon.")
|