-
Notifications
You must be signed in to change notification settings - Fork 934
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
Support thread local storage - Partially Fixes #291 #1019
Open
alastairpatrick
wants to merge
8
commits into
raspberrypi:develop
Choose a base branch
from
alastairpatrick:thread-local-storage
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Support thread local storage - Partially Fixes #291 #1019
alastairpatrick
wants to merge
8
commits into
raspberrypi:develop
from
alastairpatrick:thread-local-storage
Conversation
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
Nice; just glanced at this so far. A couple o-things
|
Copyright comments added to tls.c and tls.S but not CMakeLists.txt, which I think is consistent with other sources. I removed pico_tls from pico_runtime's dependencies, which I think is what you want. |
Rename it to stores.
newlib/libc/stdlib/aligned_alloc.c:35: undefined reference to `posix_memalign' Maybe memalign() works.
moving to 1.7.0 so we can fix this on clang too |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds a pico_tls module, which adds support for GCC's __thread, C11's _Thread_local, and C++'s thread_local storage class specifiers. For example:
Different implementations of pico_tls may be selected by means of the pico_set_tls_implementation cmake macro, similar to some other SDK modules. For example, a different implementation could be selected if using an RTOS.
In this implementation, a thread corresponds to a core. No TLS storage is allocated for exceptions handlers. So there are two threads total.
Issue #291 has two parts: making C++ thread_local work and making C++ exceptions work. This patch adds support for thread_local but not C++ exceptions.
Tested by building SDK and running modified kitchen_sink in debug and release, stepping through tls_init and __wrap___emutls_get_address in GDB.