老版vma
两种结构的双生儿
单个vma的内容
vm_area_struct
+--------------------------------+
|vm_rb | vma rb tree node
| (struct rb_node) |
|vm_prev, vm_next | vma list in order
| (struct vm_area_struct*) | * no overlap to each other
| |
+--------------------------------+
|vm_start, vm_end | the range we cover
| (unsigned long) |
| |
|vm_file |
| (struct file*) |
|vm_pgoff | offset in PAGE_SIZE
| (unsigned long) |
+--------------------------------+
|rb_subtree_gap | http://tinylab.org/rbtree-part1/
| (unsigned long) |
+--------------------------------+
|vm_flags | VM_READ/WRITE/EXEC
| (unsigned long) |
|vm_page_prot | access PTE permission of this VMA calculated from vm_flags
| (pgprot_t) | _PAGE_PRESENT/RW/ACCESSED/DIRTY
| |
+--------------------------------+
|vm_ops |
| (struct vm_operations_struct*)|
+--------------------------------+常用的API
分配/释放
查找
插入/删除
拆分/整合
vma_adjust
split_vma
vma_merge
vma对物理地址的影响
测试程序
Last updated