-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix threading API headers cthreads.h is renamed to threads.h and not included by default. This also makes time.h not included by default which allows the symbol time to be used again. * Add basic TLS Support * Properly test thread local variables * Improve TLS DSO error message * Specifiy specific context * Invalidate TP value in interrupt callbacks * Add error reporting for Invalid TLS Accesses * Update exception.c * Restore interrupt control to manual TLS * Disallow TLS access without kernel Error message formatting needs to be improved * Shorten error message * Only copy tdata once * Fix tabs Also fix interrupts without kernel * Fix kernel_internal tabs * Fix linker script tabs * Call __kernel_tls_init as a constructor Also readds the tls structure * Add documentation * Verify maximum TLS alignment of 8 * Improve TLS alignment error * Remove test_kernel test
- Loading branch information
1 parent
b088eb8
commit b2322fe
Showing
10 changed files
with
163 additions
and
26 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,22 @@ | ||
#ifndef LIBDRAGON_KERNEL_TLS_H | ||
#define LIBDRAGON_KERNEL_TLS_H | ||
|
||
#define KERNEL_TP_INVALID ((void *)0x5FFF8001) | ||
|
||
#ifdef N64_DSO | ||
__asm__ ( | ||
".macro rdhwr rt, rd" "\n" | ||
" .error \" Usage of thread-local variables is not supported in DSOs. \"" "\n" | ||
".endm" "\n" | ||
); | ||
#else | ||
__asm__ ( | ||
".macro rdhwr rt, rd" "\n" | ||
" lw \\rt, %gprel(th_cur_tp)($gp)" "\n" | ||
".endm" "\n" | ||
); | ||
#endif | ||
|
||
extern void *th_cur_tp; | ||
|
||
#endif |
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
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
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
Oops, something went wrong.