summaryrefslogtreecommitdiffstats
path: root/src/usr/module_init.C
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2015-11-24 20:27:09 -0600
committerPatrick Williams <iawillia@us.ibm.com>2015-12-11 15:30:27 -0600
commitd0edb877c861c146e97745604a2d1933a4844130 (patch)
tree91115d61a0d3faf8d131c49ac7a3b704ec3cb95c /src/usr/module_init.C
parent105660534e02cb3223dcba7d4f7d6a1ad0433317 (diff)
downloadtalos-hostboot-d0edb877c861c146e97745604a2d1933a4844130.tar.gz
talos-hostboot-d0edb877c861c146e97745604a2d1933a4844130.zip
libc support for thread-local storage
RTC: 124148 Change-Id: I055885bc7d7cfc4ebd7cf1a662f677bdf4e28c62 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22313 Tested-by: Jenkins Server Reviewed-by: Richard J. Knight <rjknight@us.ibm.com> Reviewed-by: Brian Silver <bsilver@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/module_init.C')
-rw-r--r--src/usr/module_init.C15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/usr/module_init.C b/src/usr/module_init.C
index b07ace0c2..3e9a25e58 100644
--- a/src/usr/module_init.C
+++ b/src/usr/module_init.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -21,6 +23,8 @@
/* */
/* IBM_PROLOG_END_TAG */
void call_dtors(void * i_dso_handle);
+void __tls_register(void * tls_start, void * tls_end);
+void __tls_unregister(void * tls_start, void * tls_end);
// This identifies the module
void* __dso_handle = (void*) &__dso_handle;
@@ -28,6 +32,11 @@ void* __dso_handle = (void*) &__dso_handle;
extern "C"
void _init(void*)
{
+ // Register thread-local storage.
+ extern void* tls_start_address;
+ extern void* tls_end_address;
+ __tls_register(&tls_start_address, &tls_end_address);
+
// Call default constructors for any static objects.
extern void (*ctor_start_address)();
extern void (*ctor_end_address)();
@@ -43,6 +52,10 @@ extern "C"
void _fini(void)
{
call_dtors(__dso_handle);
+
+ extern void* tls_start_address;
+ extern void* tls_end_address;
+ __tls_unregister(&tls_start_address, &tls_end_address);
}
OpenPOWER on IntegriCloud