Function report |
Source Code:mm\madvise.c |
Create Date:2022-07-28 15:12:58 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:The madvise(2) system call
Proto:SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
Type:
Parameter:Nothing
1051 | unmapped_error = 0 |
1059 | If Not madvise_behavior_valid(behavior) Then Return error |
1062 | If Not st whether an address (unsigned long or pointer) is aligned to PAGE_SIZE (start) Then Return error |
1074 | error = 0 |
1079 | If (behavior == poison a page for testing || behavior == soft offline page for testing ) Then Return Error injection support for memory error handling. |
1083 | write = Any behaviour which results in changes to the vma->vm_flags needs to* take mmap_sem for writing. Others, which simply traverse vmas, need* to only take it for reading. |
1084 | If write Then |
1085 | If lock for writing Then Return -EINTR |
1087 | Else |
1088 | lock for reading |
1097 | If vma && start > Our start address within vm_mm. Then prev = vma |
1100 | blk_start_plug( & plug) |
1101 | cycle |
1108 | If start < Our start address within vm_mm. Then |
1109 | unmapped_error = -ENOMEM |
1125 | If prev && start < The first byte after our end addresswithin vm_mm. Then start = The first byte after our end addresswithin vm_mm. |
1127 | error = unmapped_error |
1130 | If prev Then vma = linked list of VM areas per task, sorted by address |
1135 | out : |
1136 | blk_finish_plug( & plug) |
1137 | If write Then lease a write lock |
1139 | Else lease a read lock |
1142 | Return error |
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 |