函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\nommu.c Create Date:2022-07-27 16:03:17
Last Modify:2020-03-17 21:26:27 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:determine whether a mapping should be permitted and, if so, what sort of* mapping we're capable of supporting

函数原型:static int validate_mmap_request(struct file *file, unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long pgoff, unsigned long *_capabilities)

返回类型:int

参数:

类型参数名称
struct file *file
unsigned longaddr
unsigned longlen
unsigned longprot
unsigned longflags
unsigned longpgoff
unsigned long *_capabilities
797  如果flags按位与Interpret addr exactly 则返回:负EINVAL
800  如果flags按位与Mask for type of mapping 的值不等于Changes are private flags按位与Mask for type of mapping 的值不等于Share changes 则返回:负EINVAL
804  如果非len则返回:负EINVAL
808  rlen等于 align the pointer to the (next) page boundary (len)
809  如果非rlenrlen大于TASK_SIZE则返回:负ENOMEM
813  如果pgoffrlen右移PAGE_SHIFT determines the page size 位的值小于pgoff则返回:负EOVERFLOW
816  如果file
818  如果非mmap则返回:负ENODEV
825  如果mmap_capabilities
827  否则
831  : & == S_IFREG
832  : & == S_IFBLK
836  : & == S_IFCHR
843  默认
844  返回:负EINVAL
850  如果非get_unmapped_areacapabilities与等于NOMMU_MAP_DIRECT的反
852  如果非f_mode按位与Has read method(s) 的值则capabilities与等于These flags let !MMU mmap() govern direct device mapping vs immediate* copying more easily for MAP_PRIVATE, especially for ROM filesystems的反
856  如果非f_mode按位与le is open for reading 的值则返回:负EACCES
859  如果flags按位与Share changes
861  如果prot按位与page can be written 且非f_mode按位与le is open for writing 的值则返回:负EACCES
865  如果IS_APPEND(file_inode(file))且f_mode按位与le is open for writing 则返回:负EACCES
869  如果locks_verify_locked(file)则返回:负EAGAIN
872  如果非capabilities按位与NOMMU_MAP_DIRECT的值则返回:负ENODEV
877  否则
885  如果prot按位与page can be written capabilities与等于NOMMU_MAP_DIRECT的反
889  如果capabilities按位与NOMMU_MAP_DIRECT
890  如果prot按位与page can be read 且非capabilities按位与NOMMU_MAP_READ的值或prot按位与page can be written 且非capabilities按位与NOMMU_MAP_WRITE的值或prot按位与page can be executed 且非capabilities按位与NOMMU_MAP_EXEC的值则
894  capabilities与等于NOMMU_MAP_DIRECT的反
895  如果flags按位与Share changes
896  打印警告信息("MAP_SHARED not completely supported on !MMU\n")
897  返回:负EINVAL
904  如果path_noexec( & f_path)则
905  如果prot按位与page can be executed 则返回:负EPERM
907  否则如果prot按位与page can be read 且非prot按位与page can be executed 的值则
909  如果personality按位与READ_IMPLIES_EXEC
910  如果capabilities按位与NOMMU_MAP_EXECprot或等于page can be executed
913  否则如果prot按位与page can be read prot按位与page can be executed 且非capabilities按位与NOMMU_MAP_EXEC的值则
918  capabilities与等于NOMMU_MAP_DIRECT的反
920  否则
924  capabilities等于These flags let !MMU mmap() govern direct device mapping vs immediate* copying more easily for MAP_PRIVATE, especially for ROM filesystems
927  如果prot按位与page can be read personality按位与READ_IMPLIES_EXECprot或等于page can be executed
933  ret等于security_mmap_addr(addr)
934  如果ret小于0则返回:ret
938  _capabilities等于capabilities
939  返回:0
调用者
名称描述
do_mmaphandle mapping creation for uClinux