#include "src/base/platform/memory-protection-key.h"
#if V8_HAS_PKU_JIT_WRITE_PROTECT
#include <sys/mman.h>
#undef MAP_TYPE
#include "src/base/logging.h"
#include "src/base/macros.h"
int pkey_mprotect(void* addr, size_t len, int prot, int pkey) V8_WEAK;
int pkey_get(int key) V8_WEAK;
int pkey_set(int, unsigned) V8_WEAK;
int pkey_alloc(unsigned int, unsigned int) V8_WEAK;
namespace v8 {
namespace base {
namespace {
int GetProtectionFromMemoryPermission(PageAllocator::Permission permission) { … }
}
bool MemoryProtectionKey::HasMemoryProtectionKeySupport() { … }
int MemoryProtectionKey::AllocateKey() { … }
bool MemoryProtectionKey::SetPermissionsAndKey(
base::AddressRegion region, v8::PageAllocator::Permission page_permissions,
int key) { … }
void MemoryProtectionKey::SetPermissionsForKey(int key,
Permission permissions) { … }
MemoryProtectionKey::Permission MemoryProtectionKey::GetKeyPermission(int key) { … }
}
}
#endif