Function report |
Source Code:mm\mmap.c |
Create Date:2022-07-28 14:50:05 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:his is really a simplified "do_mmap". it only handles* anonymous maps. eventually we may be able to do some* brk-specific accounting here.
Proto:static int do_brk_flags(unsigned long addr, unsigned long len, unsigned long flags, struct list_head *uf)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| unsigned long | addr | |
| unsigned long | len | |
| unsigned long | flags | |
| struct list_head * | uf |
| 2975 | pgoff = addr >> PAGE_SHIFT determines the page size |
| 2982 | flags |= VM_DATA_DEFAULT_FLAGS | Is a VM accounted object | def_flags |
| 2984 | mapped_addr = get_unmapped_area(NULL, addr, len, 0, Interpret addr exactly ) |
| 2985 | If IS_ERR_VALUE(mapped_addr) Then Return mapped_addr |
| 2988 | error = mlock_future_check(mm, def_flags, len) |
| 3002 | If Not Return true if the calling process may expand its vm space by the passed* number of pages Then Return -ENOMEM |
| 3005 | If number of VMAs > sysctl_max_map_count Then Return -ENOMEM |
| 3008 | If security_vm_enough_memory_mm(mm, len >> PAGE_SHIFT determines the page size ) Then Return -ENOMEM |
| 3012 | vma = Given a mapping request (addr,end,vm_flags,file,pgoff), figure out* whether that can be merged with its predecessor or its successor |
| 3020 | vma = vm_area_alloc(mm) |
| 3021 | If Not vma Then |
| 3023 | Return -ENOMEM |
| 3026 | vma_set_anonymous(vma) |
| 3030 | Flags, see mm.h. = flags |
| 3033 | out : |
| 3034 | perf_event_mmap(vma) |
| 3037 | If flags & VM_LOCKED Then Pages that have PG_mlocked set += len >> PAGE_SHIFT determines the page size |
| 3039 | Flags, see mm.h. |= VM_SOFTDIRTY |
| 3040 | Return 0 |
| Name | Describe |
|---|---|
| SYSCALL_DEFINE1 | |
| vm_brk_flags |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |