summaryrefslogtreecommitdiff
path: root/src/base/SConscript
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-06-07 21:37:18 -0700
committerGabe Black <gabeblack@google.com>2018-06-21 19:13:43 +0000
commit3ed0c3c0bef2eefddcf2033e6ab9d22cf45c486d (patch)
treeb5317c650eac63fcf28ed088adc937b61eb23e3c /src/base/SConscript
parent7ad7ea26b5b11d4fa392282c2e6159d0089d0342 (diff)
downloadgem5-3ed0c3c0bef2eefddcf2033e6ab9d22cf45c486d.tar.xz
base: Add a class which encapsulates Fibers.
This class encapsulates the idea of a Fiber in such a way that other implementations can be substituted in in the future. This implementation uses the ucontext family of functions. This change also adds a new unit test which exercises the new class. It creates three new fibers which accept a sequence of other fibers to switch to, one after the other. The main test function switches to the these fibers which switch with each other and occasionally back to the main fiber. Each time a test fiber is activated, it checks against a list which shows the correct order for the fibers to run in. When the main fiber gets control, it makes sure that list has been progressed through by the correct amount. Change-Id: I1fc2afa414b51baaa91e350a4ebc791d989f0b8a Reviewed-on: https://gem5-review.googlesource.com/10935 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/base/SConscript')
-rw-r--r--src/base/SConscript2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/base/SConscript b/src/base/SConscript
index a90b78486..b3205a6bb 100644
--- a/src/base/SConscript
+++ b/src/base/SConscript
@@ -46,6 +46,8 @@ if env['USE_FENV']:
Source('fenv.c')
if env['USE_PNG']:
Source('pngwriter.cc')
+Source('fiber.cc')
+GTest('fibertest', 'fibertest.cc', 'fiber.cc')
Source('framebuffer.cc')
Source('hostinfo.cc')
Source('inet.cc')