Some newer compiler (for instance MSVC 10 for x86_64 and itanium) do not support inline assembler. . Inlined assembler generates code bloating which his not welcome on embedded systems.
Boost.Context provides the low level API fcontext_t which is implemented in assembler to provide context swapping operations. fcontext_t is the part to port to new platforms.
Context switches do not preserve the signal mask on UNIX systems.
Because the assembler code uses the byte layout of fcontext_t to access its members fcontext_t must be a POD. This requires that fcontext_t has only a default constructor, no visibility keywords (e.g. private, public, protected), no virtual methods and all members and base classes are PODs too.
Because the stack's size is fixed -- there is no support for split stacks yet
-- it is important to protect against exceeding the stack's bounds. Otherwise,
in the best case, overrunning the stack's memory will result in a segmentation
fault or access violation and, in the worst case, the application's memory
will be overwritten.
appends a guard page to the stack to help detect overruns. The guard page consumes
no physical memory, but generates a segmentation fault or access violation
on access to the virtual memory addresses within it.