summaryrefslogtreecommitdiffstats
path: root/src/libc++/builtins.C
blob: ed373c8ccabe3fdb7348eb2e5a2119ca1df58fae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdint.h>

extern "C" int __cxa_guard_acquire(volatile uint64_t* gv)
{
    // 0 .. uninitialized
    // 1 .. locked
    // 2 .. unlocked, initialized
    if (0 == *gv)
    {
	*gv = 1;
	return 1;
    }
    else if (1 == *gv)
    {
	while(1 == *gv);
    }
    
    return 0;
}

extern "C" void __cxa_guard_release(volatile uint64_t* gv)
{
    *gv = 2;
    return;
}


extern "C" int __cxa_atexit(void (*)(void*), void*, void*)
{
    return 0;
}

void*   __dso_handle = (void*) &__dso_handle;
OpenPOWER on IntegriCloud