Lines Matching +full:5 +full:mm
52 #define mm_pkey_allocation_map(mm) (mm->context.pkey_allocation_map) argument
54 #define __mm_pkey_allocated(mm, pkey) { \ argument
55 mm_pkey_allocation_map(mm) |= pkey_alloc_mask(pkey); \
58 #define __mm_pkey_free(mm, pkey) { \ argument
59 mm_pkey_allocation_map(mm) &= ~pkey_alloc_mask(pkey); \
62 #define __mm_pkey_is_allocated(mm, pkey) \ argument
63 (mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey))
68 static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) in mm_pkey_is_allocated() argument
77 return __mm_pkey_is_allocated(mm, pkey); in mm_pkey_is_allocated()
81 * Returns a positive, 5-bit key on success, or -1 on failure.
85 static inline int mm_pkey_alloc(struct mm_struct *mm) in mm_pkey_alloc() argument
101 if (mm_pkey_allocation_map(mm) == all_pkeys_mask) in mm_pkey_alloc()
104 ret = ffz((u32)mm_pkey_allocation_map(mm)); in mm_pkey_alloc()
105 __mm_pkey_allocated(mm, ret); in mm_pkey_alloc()
110 static inline int mm_pkey_free(struct mm_struct *mm, int pkey) in mm_pkey_free() argument
115 if (!mm_pkey_is_allocated(mm, pkey)) in mm_pkey_free()
118 __mm_pkey_free(mm, pkey); in mm_pkey_free()
127 extern int execute_only_pkey(struct mm_struct *mm);
171 extern void pkey_mm_init(struct mm_struct *mm);