linux/arch/x86/include/asm/pkeys.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_X86_PKEYS_H
#define _ASM_X86_PKEYS_H

/*
 * If more than 16 keys are ever supported, a thorough audit
 * will be necessary to ensure that the types that store key
 * numbers and masks have sufficient capacity.
 */
#define arch_max_pkey()

extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
		unsigned long init_val);

static inline bool arch_pkeys_enabled(void)
{}

/*
 * Try to dedicate one of the protection keys to be used as an
 * execute-only protection key.
 */
extern int __execute_only_pkey(struct mm_struct *mm);
static inline int execute_only_pkey(struct mm_struct *mm)
{}

extern int __arch_override_mprotect_pkey(struct vm_area_struct *vma,
		int prot, int pkey);
static inline int arch_override_mprotect_pkey(struct vm_area_struct *vma,
		int prot, int pkey)
{}

#define ARCH_VM_PKEY_FLAGS

#define mm_pkey_allocation_map(mm)
#define mm_set_pkey_allocated(mm, pkey)
#define mm_set_pkey_free(mm, pkey)

static inline
bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey)
{}

/*
 * Returns a positive, 4-bit key on success, or -1 on failure.
 */
static inline
int mm_pkey_alloc(struct mm_struct *mm)
{}

static inline
int mm_pkey_free(struct mm_struct *mm, int pkey)
{}

static inline int vma_pkey(struct vm_area_struct *vma)
{}

#endif /*_ASM_X86_PKEYS_H */