Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\mman.h Create Date:2022-07-28 06:29:10
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Combine the mmap "prot" argument into "vm_flags" used internally.

Proto:static inline unsigned long calc_vm_prot_bits(unsigned long prot, unsigned long pkey)

Type:unsigned long

Parameter:

TypeParameterName
unsigned longprot
unsigned longpkey
119  Return Optimisation macro. It is equivalent to:* (x & bit1) ? bit2 : 0* but this version is faster.* ("bit1" and "bit2" must be single bits)(prot, page can be read , currently active flags ) | Optimisation macro. It is equivalent to:* (x & bit1) ? bit2 : 0* but this version is faster.* ("bit1" and "bit2" must be single bits)(prot, page can be written , VM_WRITE) | Optimisation macro. It is equivalent to:* (x & bit1) ? bit2 : 0* but this version is faster.* ("bit1" and "bit2" must be single bits)(prot, page can be executed , VM_EXEC) | Allow architectures to handle additional protection bits(prot, pkey)
Caller
NameDescribe
determine_vm_flagswe've determined that we can make the mapping, now translate what we* now know into VMA flags
do_mmapThe caller must hold down_write(¤t->mm->mmap_sem).
do_mprotect_pkeypkey==-1 when doing a legacy mprotect()