mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-13 15:16:48 +00:00
增加vma的page_offset计算
This commit is contained in:
parent
a296b79dbc
commit
cec44c1fd7
@ -41,6 +41,8 @@ typedef uint64_t fsfilcnt_t;
|
|||||||
#define __socklen_t uint32_t
|
#define __socklen_t uint32_t
|
||||||
typedef __socklen_t socklen_t;
|
typedef __socklen_t socklen_t;
|
||||||
|
|
||||||
|
#define pgoff_t unsigned long
|
||||||
|
|
||||||
struct utimbuf
|
struct utimbuf
|
||||||
{
|
{
|
||||||
time_t actime;
|
time_t actime;
|
||||||
|
@ -131,6 +131,7 @@ struct vm_area_struct
|
|||||||
|
|
||||||
struct vm_operations_t *vm_ops; // 操作方法
|
struct vm_operations_t *vm_ops; // 操作方法
|
||||||
atomic_t ref_count; // 引用计数
|
atomic_t ref_count; // 引用计数
|
||||||
|
pgoff_t page_offset; // 起始地址在当前VMA所占的2M物理页中的偏移量
|
||||||
void *private_data;
|
void *private_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -400,7 +400,8 @@ int mm_map_vma(struct vm_area_struct *vma, uint64_t paddr)
|
|||||||
if (unlikely(retval != 0))
|
if (unlikely(retval != 0))
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
// 计算当前vma的起始地址在对应的物理页中的偏移量
|
||||||
|
vma->page_offset = paddr - (paddr & PAGE_2M_MASK);
|
||||||
flush_tlb();
|
flush_tlb();
|
||||||
return 0;
|
return 0;
|
||||||
failed:;
|
failed:;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user