-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
improve FreeBSD / generic posix support #18063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4c91d4c9161555c911630b0a70ddec03 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| c53513a5aea84405bf302b084a23f24f54148aac90a2bd666219ce14879723baab959942934d0d801a4572fffd07e60a7d574ade8d7eb57b6da8216063c20a48 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| LIBUV_BRANCH=julia-uv1.9.0 | ||
| LIBUV_SHA1=28743d6091531340cfe316de2b2d385fe1778ff5 | ||
| LIBUV_SHA1=8d5131b6c1595920dd30644cd1435b4f344b46c8 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,12 +84,24 @@ static void jl_call_in_ctx(jl_ptls_t ptls, void (*fptr)(void), void *_ctx) | |
| *(void**)rsp = NULL; | ||
| ctx->uc_mcontext.gregs[REG_RSP] = rsp; | ||
| ctx->uc_mcontext.gregs[REG_RIP] = (uintptr_t)fptr; | ||
| #elif defined(_OS_FREEBSD_) && defined(_CPU_X86_64_) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change and the other 2 sections in
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this code doesn't exist here, there shouldn't be anything to fix |
||
| ucontext_t *ctx = (ucontext_t*)_ctx; | ||
| rsp -= sizeof(void*); | ||
| *(void**)rsp = NULL; | ||
| ctx->uc_mcontext.mc_rsp = rsp; | ||
| ctx->uc_mcontext.mc_rip = (uintptr_t)fptr; | ||
| #elif defined(_OS_LINUX_) && defined(_CPU_X86_) | ||
| ucontext_t *ctx = (ucontext_t*)_ctx; | ||
| rsp -= sizeof(void*); | ||
| *(void**)rsp = NULL; | ||
| ctx->uc_mcontext.gregs[REG_ESP] = rsp; | ||
| ctx->uc_mcontext.gregs[REG_EIP] = (uintptr_t)fptr; | ||
| #elif defined(_OS_FREEBSD_) && defined(_CPU_X86_) | ||
| ucontext_t *ctx = (ucontext_t*)_ctx; | ||
| rsp -= sizeof(void*); | ||
| *(void**)rsp = NULL; | ||
| ctx->uc_mcontext.mc_esp = rsp; | ||
| ctx->uc_mcontext.mc_eip = (uintptr_t)fptr; | ||
| #elif defined(_OS_LINUX_) && defined(_CPU_AARCH64_) | ||
| ucontext_t *ctx = (ucontext_t*)_ctx; | ||
| ctx->uc_mcontext.sp = rsp; | ||
|
|
@@ -112,7 +124,8 @@ static void jl_call_in_ctx(jl_ptls_t ptls, void (*fptr)(void), void *_ctx) | |
| ctx->uc_mcontext64->__ss.__rsp = rsp; | ||
| ctx->uc_mcontext64->__ss.__rip = (uintptr_t)fptr; | ||
| #else | ||
| // TODO Add support for FreeBSD and PowerPC(64)? | ||
| #warning "julia: throw-in-context not supported on this platform" | ||
| // TODO Add support for PowerPC(64)? | ||
| fptr(); | ||
| #endif | ||
| } | ||
|
|
@@ -436,7 +449,7 @@ static void *alloc_sigstack(size_t size) | |
| // Add one guard page to catch stack overflow in the signal handler | ||
| size = LLT_ALIGN(size, pagesz) + pagesz; | ||
| void *stackbuff = mmap(0, size, PROT_READ | PROT_WRITE, | ||
| MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); | ||
| MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); | ||
| if (stackbuff == MAP_FAILED) | ||
| jl_errorf("fatal error allocating signal stack: mmap: %s", | ||
| strerror(errno)); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sneaky 😉