-7fd845bd9414c348bfa30bd24aa0bb8e4eebf83a
+b03c5dc36d6d0c0d3bef434936e8b924d253595b
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Load64 (uint64_t *ptr)
{
if (((uintptr_t) ptr & 7) != 0)
- ptr = NULL;
+ panicmem ();
return __atomic_load_n (ptr, __ATOMIC_ACQUIRE);
}
Loadint64 (int64_t *ptr)
{
if (((uintptr_t) ptr & 7) != 0)
- ptr = NULL;
+ panicmem ();
return __atomic_load_n (ptr, __ATOMIC_ACQUIRE);
}
Xadd64 (uint64_t *ptr, int64_t delta)
{
if (((uintptr_t) ptr & 7) != 0)
- ptr = NULL;
+ panicmem ();
return __atomic_add_fetch (ptr, (uint64_t) delta, __ATOMIC_SEQ_CST);
}
Xaddint64 (int64_t *ptr, int64_t delta)
{
if (((uintptr_t) ptr & 7) != 0)
- ptr = NULL;
+ panicmem ();
return __atomic_add_fetch (ptr, delta, __ATOMIC_SEQ_CST);
}
Xchg64 (uint64_t *ptr, uint64_t new)
{
if (((uintptr_t) ptr & 7) != 0)
- ptr = NULL;
+ panicmem ();
return __atomic_exchange_n (ptr, new, __ATOMIC_SEQ_CST);
}
Cas64 (uint64_t *ptr, uint64_t old, uint64_t new)
{
if (((uintptr_t) ptr & 7) != 0)
- ptr = NULL;
+ panicmem ();
return __atomic_compare_exchange_n (ptr, &old, new, false, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);
}
Store64 (uint64_t *ptr, uint64_t val)
{
if (((uintptr_t) ptr & 7) != 0)
- ptr = NULL;
+ panicmem ();
__atomic_store_n (ptr, val, __ATOMIC_SEQ_CST);
}
//go:linkname makefuncreturning runtime.makefuncreturning
//go:linkname gorecover runtime.gorecover
//go:linkname deferredrecover runtime.deferredrecover
+//go:linkname panicmem runtime.panicmem
// Temporary for C code to call:
//go:linkname throw runtime.throw
SwapInt64 (int64_t *addr, int64_t new)
{
if (((uintptr_t) addr & 7) != 0)
- addr = NULL;
+ panicmem ();
return __atomic_exchange_n (addr, new, __ATOMIC_SEQ_CST);
}
SwapUint64 (uint64_t *addr, uint64_t new)
{
if (((uintptr_t) addr & 7) != 0)
- addr = NULL;
+ panicmem ();
return __atomic_exchange_n (addr, new, __ATOMIC_SEQ_CST);
}
int64_t v;
if (((uintptr_t) addr & 7) != 0)
- addr = NULL;
+ panicmem ();
v = *addr;
while (! __sync_bool_compare_and_swap (addr, v, v))
v = *addr;
uint64_t v;
if (((uintptr_t) addr & 7) != 0)
- addr = NULL;
+ panicmem ();
v = *addr;
while (! __sync_bool_compare_and_swap (addr, v, v))
v = *addr;
int64_t v;
if (((uintptr_t) addr & 7) != 0)
- addr = NULL;
+ panicmem ();
v = *addr;
while (! __sync_bool_compare_and_swap (addr, v, val))
v = *addr;
uint64_t v;
if (((uintptr_t) addr & 7) != 0)
- addr = NULL;
+ panicmem ();
v = *addr;
while (! __sync_bool_compare_and_swap (addr, v, val))
v = *addr;
extern bool runtime_isstarted;
extern bool runtime_isarchive;
+extern void panicmem(void) __asm__ (GOSYM_PREFIX "runtime.panicmem");
+
/*
* common functions and data
*/