summaryrefslogtreecommitdiff
path: root/src/base/fiber.cc
AgeCommit message (Collapse)Author
2018-12-04base: Fix fiber compilation issue for Mac OSNikos Nikoleris
Mac OS has deprecated the use of ucontext and at the moment we are using a workaround to enable it. A side-effect is that the code is marked as _POSIX_C_SOURCE and consequently <sys/mman.h> requires the code to be also marked as _DARWIN_C_SOURCE to include the definition of MAP_ANONYMOUS. Change-Id: I65550d11a0a21cd36d832a7de6320e7e3f332a9d Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/14817 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-18base: Set up a guard page for fiber stacks.Gabe Black
This will help detect stack overflow for fibers. Change-Id: Iff2b102120ec351709e495291d6bead597f8d10c Reviewed-on: https://gem5-review.googlesource.com/c/14395 Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Gabe Black <gabeblack@google.com>
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>