[set,get,make,swap]context from glibc for amd64 implementation and question for Norman

Alexander Tormasov a.tormasov at innopolis.ru
Fri Mar 12 00:44:08 CET 2021


as a part of efforts related to golang port I make separate patch for 21.02 genode related to implementation of setcontext/getcontext/makecontext/swapcontext family in libc

as a base I borrow some code from glibc, and remove related files (mostly _ucontext.h/ucontext.h) from genode

related 2 patches are in https://github.com/tor-m6/genode.git in 21.02 repo
main one contains implementation to be applied to libc port
aux patch contains only simple test for these functions, you can run it as 

I  need also to add C support for alloc_secondary_stack/free_secondary_stack in dummies.cc to be able to use them during allocation of stack for makecontext/etc (it should work even in C files - current code do requires C++, I even can’t test patch without them). May be this is wrong place for the wrappers…

current problems with the patch: 
is support only x86_64 (while can be easily extended to arm64) on nova (while should work on other OSes), 
and it do not support signals save/restore (while seems that not many of them supported by genode currently). Also some removal of code from libc is not that clear and correct (implement it in patch).

Question for Norman (and may be other maintainers):
is it suitable for main genode code, or I should keep patch only in my fork?
Is it worth to make a pull request?

Sincerely,
	Alexander



More information about the users mailing list