#ifndef PARTITION_ALLOC_THREAD_ISOLATION_PKEY_H_
#define PARTITION_ALLOC_THREAD_ISOLATION_PKEY_H_
#include "partition_alloc/buildflags.h"
#if PA_BUILDFLAG(ENABLE_PKEYS)
#include <cstddef>
#include <cstdint>
#include "partition_alloc/buildflags.h"
#include "partition_alloc/partition_alloc_base/component_export.h"
#include "partition_alloc/thread_isolation/alignment.h"
namespace partition_alloc::internal {
constexpr int kDefaultPkey = …;
constexpr int kInvalidPkey = …;
bool CPUHasPkeySupport();
[[nodiscard]] int PkeyMprotect(void* addr, size_t len, int prot, int pkey);
void TagMemoryWithPkey(int pkey, void* address, size_t size);
int PkeyAlloc(int access_rights);
void PkeyFree(int pkey);
uint32_t Rdpkru();
void Wrpkru(uint32_t pkru);
#if PA_BUILDFLAG(DCHECKS_ARE_ON)
class PA_COMPONENT_EXPORT(PARTITION_ALLOC) LiftPkeyRestrictionsScope { … };
#endif
}
#endif
#endif