Skip to content

Commit

Permalink
lib: flb_libco: merged changes for aarch64 support (#228)
Browse files Browse the repository at this point in the history
This patch merge the following changes:

 - 534e405 armv8: on arm64 (aarch64) use sjlj backend
 - fdcb558 sjlj: include missing settings and adapt API
 - 9dab058 settings: tweak for Windows build

These changes needs further testing on a armv8 platform.

Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Apr 19, 2017
1 parent 8579c44 commit a9af19d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/flb_libco/libco.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "amd64.c"
#elif defined(__arm__)
#include "arm.c"
#elif defined(__aarch64__)
#include "sjlj.c"
#elif defined(_ARCH_PPC)
#include "ppc.c"
#elif defined(_WIN32)
Expand Down
5 changes: 4 additions & 1 deletion lib/flb_libco/sjlj.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <stdlib.h>
#include <signal.h>
#include <setjmp.h>
#include "settings.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -41,7 +42,8 @@ cothread_t co_active() {
return (cothread_t)co_running;
}

cothread_t co_create(unsigned int size, void (*coentry)(void)) {
cothread_t co_create(unsigned int size, void (*coentry)(void),
size_t *out_size) {
if(!co_running) co_running = &co_primary;

cothread_struct *thread = (cothread_struct*)malloc(sizeof(cothread_struct));
Expand Down Expand Up @@ -78,6 +80,7 @@ cothread_t co_create(unsigned int size, void (*coentry)(void)) {
}
}

*out_size = size;
return (cothread_t)thread;
}

Expand Down

0 comments on commit a9af19d

Please sign in to comment.