#pragma once
#if defined(__arch64__)
# define SNMALLOC_VA_BITS_64
#else
# define SNMALLOC_VA_BITS_32
#endif
namespace snmalloc
{
class AAL_Sparc
{
public:
static constexpr uint64_t aal_features = IntegerPointers;
static constexpr enum AalName aal_name = Sparc;
#ifdef SNMALLOC_VA_BITS_64
static constexpr size_t smallest_page_size = 0x2000;
#else
static constexpr size_t smallest_page_size = 0x1000;
#endif
static inline void pause()
{
__asm__ volatile("rd %%ccr, %%g0" ::: "memory");
}
static inline void prefetch(void* ptr)
{
#ifdef SNMALLOC_VA_BITS_64
__asm__ volatile("prefetch [%0], 0" ::"r"(ptr));
#else
UNUSED(ptr);
#endif
}
static inline uint64_t tick()
{
uint64_t tick;
__asm__ volatile("rd %%asr4, %0" : "=r"(tick));
return tick;
}
};
using AAL_Arch = AAL_Sparc;
}