Function report |
Source Code:mm\nommu.c |
Create Date:2022-07-28 14:37:16 |
Last Modify:2020-03-17 21:26:27 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:set up a private mapping or an anonymous shared mapping
Proto:static int do_mmap_private(struct vm_area_struct *vma, struct vm_region *region, unsigned long len, unsigned long capabilities)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct vm_area_struct * | vma | |
struct vm_region * | region | |
unsigned long | len | |
unsigned long | capabilities |
1018 | If capabilities & Can be mapped directly (MAP_SHARED) Then |
1019 | ret = call_mmap(File we map to (can be NULL). , vma) |
1020 | If ret == 0 Then |
1039 | order = get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory |
1041 | point = len >> PAGE_SHIFT determines the page size |
1044 | If sysctl_nr_trim_pages && total - point >= sysctl_nr_trim_pages Then total = point |
1051 | atomic_long_add(total, & mmap_pages_allocated) |
1053 | VMA vm_flags = Flags, see mm.h. |= VM_MAPPED_COPY |
1054 | start address of region = base |
1056 | gion allocated to here = start address of region + (total << PAGE_SHIFT determines the page size ) |
1061 | If File we map to (can be NULL). Then |
1066 | fpos <<= PAGE_SHIFT determines the page size |
1068 | ret = kernel_read(File we map to (can be NULL). , base, len, & fpos) |
1069 | If ret < 0 Then Go to error_free |
1076 | Else |
1077 | vma_set_anonymous(vma) |
1080 | Return 0 |
1082 | error_free : |
1086 | gion allocated to here = 0 |
1087 | Return ret |
1089 | enomem : |
1093 | Return -ENOMEM |
Name | Describe |
---|---|
do_mmap | handle mapping creation for uClinux |
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 |