函数逻辑报告 |
Source Code:mm\mmap.c |
Create Date:2022-07-27 16:16:28 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:The caller must hold down_write(¤t->mm->mmap_sem).
函数原型:unsigned long do_mmap(struct file *file, unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, vm_flags_t vm_flags, unsigned long pgoff, unsigned long *populate, struct list_head *uf)
返回类型:unsigned long
参数:
类型 | 参数 | 名称 |
---|---|---|
struct file * | file | |
unsigned long | addr | |
unsigned long | len | |
unsigned long | prot | |
unsigned long | flags | |
vm_flags_t | vm_flags | |
unsigned long | pgoff | |
unsigned long * | populate | |
struct list_head * | uf |
1374 | pkey等于0 |
1376 | populate等于0 |
1387 | 如果prot按位与page can be read 且personality按位与READ_IMPLIES_EXEC则如果非file且path_noexec( & f_path)的值则 |
1389 | prot或等于page can be executed |
1395 | 如果非flags按位与Interpret addr exactly 的值则addr等于If a hint addr is less than mmap_min_addr change hint to be as* low as possible but still greater than mmap_min_addr |
1404 | 如果pgoff加len右移PAGE_SHIFT determines the page size 位的值小于pgoff则返回:负EOVERFLOW |
1408 | 如果 number of VMAs 大于sysctl_max_map_count则返回:负ENOMEM |
1415 | 如果IS_ERR_VALUE(addr)则返回:addr |
1421 | 如果vma且Our start address within vm_mm. 小于addr加len则返回:负EEXIST |
1425 | 如果prot恒等于page can be executed 则 |
1426 | pkey等于execute_only_pkey(mm) |
1438 | 如果flags按位与pages are locked 则如果非can_do_mlock()则 |
1440 | 返回:负EPERM |
1442 | 如果mlock_future_check(mm, vm_flags, len)则返回:负EAGAIN |
1445 | 如果file则 |
1446 | inode等于file_inode(file) |
1452 | flags_mask等于The historical set of flags that all mmap implementations implicitly* support when a ->mmap_validate() op is not provided in file_operations.按位或mmap_supported_flags |
1455 | 当: & == Share changes |
1465 | 当: & == share + validate extension flags |
1466 | 如果flags按位与flags_mask的反则返回:负EOPNOTSUPP |
1468 | 如果prot按位与page can be written 则 |
1469 | 如果非f_mode按位与le is open for writing 的值则返回:负EACCES |
1471 | 如果IS_SWAPFILE(host)则返回:负ETXTBSY |
1479 | 如果IS_APPEND(inode)且f_mode按位与le is open for writing 则返回:负EACCES |
1485 | 如果locks_verify_locked(file)则返回:负EAGAIN |
1488 | vm_flags或等于VM_SHARED按位或VM_MAYSHARE |
1489 | 如果非f_mode按位与le is open for writing 的值则vm_flags与等于VM_MAYWRITE按位或VM_SHARED的值的反 |
1493 | 当: & == Changes are private |
1494 | 如果非f_mode按位与le is open for reading 的值则返回:负EACCES |
1496 | 如果path_noexec( & f_path)则 |
1499 | vm_flags与等于VM_MAYEXEC的反 |
1504 | 如果vm_flags按位与general info on the segment 按位或VM_GROWSUP的值则返回:负EINVAL |
1506 | 退出 |
1508 | 默认 |
1509 | 返回:负EINVAL |
1511 | 否则 |
1513 | 当: & == Share changes |
1514 | 如果vm_flags按位与general info on the segment 按位或VM_GROWSUP的值则返回:负EINVAL |
1519 | pgoff等于0 |
1520 | vm_flags或等于VM_SHARED按位或VM_MAYSHARE |
1521 | 退出 |
1522 | 当: & == Changes are private |
1526 | pgoff等于addr右移PAGE_SHIFT determines the page size 位 |
1527 | 退出 |
1528 | 默认 |
1529 | 返回:负EINVAL |
1537 | 如果flags按位与don't check for reservations 则 |
1548 | 如果非IS_ERR_VALUE(addr)且vm_flags按位与VM_LOCKED或flags按位与populate (prefault) pagetables 按位或do not block on IO 的值的值恒等于populate (prefault) pagetables 的值则populate等于len |
1552 | 返回:addr |
名称 | 描述 |
---|---|
do_mmap_pgoff |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |