#include "Unix.h"
#include "llvm/Config/config.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Valgrind.h"
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef __APPLE__
#include <mach/mach.h>
#endif
#ifdef __Fuchsia__
#include <zircon/syscalls.h>
#endif
#if defined(__APPLE__)
extern "C" void sys_icache_invalidate(const void *Addr, size_t len);
#else
extern "C" void __clear_cache(void *, void *);
#endif
static int getPosixProtectionFlags(unsigned Flags) { … }
namespace llvm {
namespace sys {
MemoryBlock Memory::allocateMappedMemory(size_t NumBytes,
const MemoryBlock *const NearBlock,
unsigned PFlags, std::error_code &EC) { … }
std::error_code Memory::releaseMappedMemory(MemoryBlock &M) { … }
std::error_code Memory::protectMappedMemory(const MemoryBlock &M,
unsigned Flags) { … }
void Memory::InvalidateInstructionCache(const void *Addr, size_t Len) { … }
}
}