summaryrefslogtreecommitdiffstats
path: root/src/libc++/builtins.C
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-08-22 17:33:44 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-08-24 12:53:03 -0500
commit5d30abd488109fafecdfb3119449aefa5dd685b2 (patch)
tree8ef9d0d49b15507b8d1f3d82a52ce27d8af242d7 /src/libc++/builtins.C
parent0977c6da14b8fc1623043daa429041863498aeae (diff)
downloadtalos-hostboot-5d30abd488109fafecdfb3119449aefa5dd685b2.tar.gz
talos-hostboot-5d30abd488109fafecdfb3119449aefa5dd685b2.zip
Add environment var to remove debug messages.
- Add printkd function. - Create HOSTBOOT_DEBUG env var for printk. - Update trace interfaces to utilize HOSTBOOT_DEBUG. - Fix compile errors due to unused variables. Change-Id: Ib18c3ecd51ca333e0118949bf35476e9c5aa46a7 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/273 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/libc++/builtins.C')
-rwxr-xr-xsrc/libc++/builtins.C16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/libc++/builtins.C b/src/libc++/builtins.C
index 0306556cf..e65d1d967 100755
--- a/src/libc++/builtins.C
+++ b/src/libc++/builtins.C
@@ -25,7 +25,6 @@
#include <arch/ppc.H>
#include <util/locked/list.H>
-//#include <kernel/console.H>
void* operator new(size_t s)
{
@@ -63,19 +62,19 @@ extern "C" int __cxa_guard_acquire(volatile uint64_t* gv)
// 0 -> uninitialized
// 1 -> locked
// 2 -> unlocked and initialized
-
+
uint32_t v = __sync_val_compare_and_swap((volatile uint32_t*)gv, 0, 1);
if (v == 0)
return 1;
if (v == 2)
return 0;
-
+
// Wait for peer thread to perform initialization (state 2).
while(2 != *(volatile uint32_t*)gv);
-
+
// Instruction barrier to ensure value is set before later loads execute.
- isync();
-
+ isync();
+
return 0;
}
@@ -127,7 +126,7 @@ Util::Locked::List<DtorEntry_t, DtorEntry_t::key_type> g_dtorRegistry;
void call_dtors(void * i_dso_handle)
{
DtorEntry_t * entry = NULL;
- // A module is never exited by different threads so
+ // A module is never exited by different threads so
// assume no locking needed here.
while( NULL != (entry = g_dtorRegistry.find(i_dso_handle)) )
{
@@ -142,12 +141,11 @@ extern "C" int __cxa_atexit(void (*i_dtor)(void*),
void* i_arg,
void* i_dso_handle)
{
- // Base kernel code may try to call this before mem heap is
+ // Base kernel code may try to call this before mem heap is
// available - so don't add it.
// TODO - Only need dtors for extended image modules
if(i_dso_handle != __dso_handle)
{
- // printk("Register dtor for %p\n",i_dso_handle);
DtorEntry_t * entry = new DtorEntry_t;
entry->key = i_dso_handle;
entry->dtor = i_dtor;
OpenPOWER on IntegriCloud