-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from ehmry/genode
Libco Genode support
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
libco.genode_secondary_stack (2018-09-15) | ||
author: Emery Hemingway | ||
license: public domain | ||
*/ | ||
|
||
/* Genode include */ | ||
#include <base/thread.h> | ||
|
||
/* Libco include */ | ||
#include <libco.h> | ||
|
||
extern "C" | ||
void *genode_alloc_secondary_stack(unsigned long stack_size) | ||
{ | ||
try { | ||
return Genode::Thread::myself()->alloc_secondary_stack("libco", stack_size); } | ||
catch (...) { | ||
Genode::error("libco: failed to allocate ", stack_size, " byte secondary stack"); | ||
return nullptr; | ||
} | ||
|
||
} | ||
|
||
extern "C" | ||
void genode_free_secondary_stack(void *stack) | ||
{ | ||
Genode::Thread::myself()->free_secondary_stack(stack); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters