函数逻辑报告 |
Source Code:mm\nommu.c |
Create Date:2022-07-27 16:03:45 |
Last Modify:2020-03-17 21:26:27 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:handle mapping creation for uClinux
函数原型: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 |
1115 | populate等于0 |
1119 | ret等于determine whether a mapping should be permitted and, if so, what sort of* mapping we're capable of supporting |
1125 | addr等于0 |
1130 | vm_flags或等于we've determined that we can make the mapping, now translate what we* now know into VMA flags |
1134 | 如果非region则转到:error_getting_region |
1137 | vma等于vm_area_alloc(mm) |
1138 | 如果非vma则转到:error_getting_vma |
1142 | VMA vm_flags 等于vm_flags |
1145 | Flags, see mm.h. 等于vm_flags |
1148 | 如果file则 |
1149 | he backing file or NULL 等于get_file(file) |
1153 | lock for writing |
1163 | 如果vm_flags按位与VM_MAYSHARE则 |
1167 | pglen等于len加PAGE_SIZE减1右移PAGE_SHIFT determines the page size 位 |
1173 | 如果非VMA vm_flags 按位与VM_MAYSHARE的值则继续下一循环 |
1177 | 如果file_inode(he backing file or NULL )不等于file_inode(file)则继续下一循环 |
1181 | 如果he offset in vm_file corresponding to vm_start 大于等于pgend则继续下一循环 |
1185 | rpglen等于rpglen加PAGE_SIZE减1右移PAGE_SHIFT determines the page size 位 |
1192 | 如果he offset in vm_file corresponding to vm_start 不等于pgoff或rpglen不等于pglen的值且非pgoff大于等于he offset in vm_file corresponding to vm_start 且pgend小于等于rpgend的值则 |
1195 | 如果非capabilities按位与NOMMU_MAP_DIRECT的值则转到:sharing_violation |
1197 | 继续下一循环 |
1203 | start等于start address of region |
1204 | start加等于pgoff减he offset in vm_file corresponding to vm_start 左移PAGE_SHIFT determines the page size 位 |
1208 | 如果VMA vm_flags 按位与VM_MAPPED_COPY则Flags, see mm.h. 或等于VM_MAPPED_COPY |
1210 | 否则 |
1211 | ret等于set up a shared mapping on a file (the driver or filesystem provides and* pins the storage) |
1212 | 如果ret小于0则 |
1213 | vm_region = NULL |
1214 | Our start address within vm_mm. 等于0 |
1217 | pregion = NULL |
1218 | 转到:error_just_free |
1221 | fput(he backing file or NULL ) |
1225 | 转到:share |
1232 | 如果capabilities按位与NOMMU_MAP_DIRECT则 |
1235 | 如果IS_ERR_VALUE(addr)则 |
1237 | 如果ret不等于负ENOSYS则转到:error_just_free |
1244 | 如果非capabilities按位与These flags let !MMU mmap() govern direct device mapping vs immediate* copying more easily for MAP_PRIVATE, especially for ROM filesystems的值则转到:error_just_free |
1247 | capabilities与等于NOMMU_MAP_DIRECT的反 |
1248 | 否则 |
1260 | 如果file且Flags, see mm.h. 按位与VM_SHARED则ret等于set up a shared mapping on a file (the driver or filesystem provides and* pins the storage) |
1264 | 如果ret小于0则转到:error_just_free |
1278 | total_vm加等于len右移PAGE_SHIFT determines the page size 位 |
1280 | share : |
1290 | lease a write lock |
1292 | 返回:result |
1294 | error_just_free : |
1295 | lease a write lock |
1296 | error : |
1302 | vm_area_free(vma) |
1303 | 返回:ret |
1305 | sharing_violation : |
1306 | lease a write lock |
1307 | 打印警告信息("Attempt to share mismatched mappings\n") |
1309 | 转到:error |
1311 | error_getting_vma : |
1316 | 返回:负ENOMEM |
1318 | error_getting_region : |
1322 | 返回:负ENOMEM |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |