Kernel: Fix cxxabi for function static variable guards

This commit is contained in:
Bananymous 2024-07-13 00:40:27 +03:00
parent a97a574718
commit 749be67df3
1 changed files with 3 additions and 3 deletions

View File

@ -42,20 +42,20 @@ namespace __cxxabiv1
{
using __guard = uint64_t;
int __cxa_guard_acquire (__guard* g)
extern "C" int __cxa_guard_acquire (__guard* g)
{
uint8_t* byte = reinterpret_cast<uint8_t*>(g);
uint8_t zero = 0;
return __atomic_compare_exchange_n(byte, &zero, 1, false, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE);
}
void __cxa_guard_release (__guard* g)
extern "C" void __cxa_guard_release (__guard* g)
{
uint8_t* byte = reinterpret_cast<uint8_t*>(g);
__atomic_store_n(byte, 0, __ATOMIC_RELEASE);
}
void __cxa_guard_abort (__guard*)
extern "C" void __cxa_guard_abort (__guard*)
{
Kernel::panic("__cxa_guard_abort");
}