From 738d71f6a93e2da9ef5bb1490f2b94f9541735e3 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Thu, 26 Nov 2015 10:03:43 +0000 Subject: sim: Add support for notifying Drainable objects of a fork When forking a gem5 process, some objects need to clean up resources (mainly file descriptions) shared between the child and the parent of the fork. This changeset adds the notifyFork() method to Drainable, which is called in the child process. Signed-off-by: Andreas Sandberg [sascha.bischoff@arm.com: Rebased patches onto a newer gem5 version] Signed-off-by: Sascha Bischoff Signed-off-by: Andreas Sandberg --- src/python/m5/simulate.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/python/m5') diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py index 66344bc79..d89629d2d 100644 --- a/src/python/m5/simulate.py +++ b/src/python/m5/simulate.py @@ -308,4 +308,8 @@ def switchCpus(system, cpuList, verbose=True): for old_cpu, new_cpu in cpuList: new_cpu.takeOverFrom(old_cpu) +def notifyFork(root): + for obj in root.descendants(): + obj.notifyFork() + from internal.core import disableAllListeners -- cgit v1.2.3