summaryrefslogtreecommitdiff
path: root/src/base/fiber.cc
AgeCommit message (Collapse)Author
2018-08-24base: If valgrind is available, tell it about Fiber stacks.Gabe Black
Valgrind can get confused when switching stacks between different Fibers. If valgrind (and its headers) are available, this change adds calls to some hooks so valgrind knows where the new stacks are and doesn't report a bunch of false positives. Change-Id: I00aefe60372be6de7371dec29427d7182dbee7b6 Reviewed-on: https://gem5-review.googlesource.com/12227 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Gabe Black <gabeblack@google.com>
2018-06-21base: Add a class which encapsulates Fibers.Gabe Black
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>