相关疑难解决方法(0)

编译内核进行页表遍历时出现错误

我正在执行页表遍历。当我准备更新内核时出现错误:

\n\n
kernel/sys.c: In function \xe2\x80\x98__do_sys_get_page_info\xe2\x80\x99:\nkernel/sys.c:2745:23: error: passing argument 1 of \xe2\x80\x98pud_offset\xe2\x80\x99 from incompatible pointer type [-Werror=incompatible-pointer-types]\n      pud = pud_offset(pgd, vmpage);\n                       ^\nIn file included from ./include/linux/mm.h:99:0,\n                 from kernel/sys.c:19:\n./arch/x86/include/asm/pgtable.h:905:22: note: expected \xe2\x80\x98p4d_t * {aka struct <anonymous> *}\xe2\x80\x99 but argument is of type \xe2\x80\x98pgd_t * {aka struct <anonymous> *}\xe2\x80\x99\n static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)\n                      ^\n
Run Code Online (Sandbox Code Playgroud)\n\n

这是使用代码的地方:

\n\n
....\nint loc, ref, dirty;\nstruct vm_area_struct *vma;\nunsigned long vmpage;\nstruct mm_struct *task_mm = task->mm;\nif ((task_mm && task_mm->mmap))\n{\n    int i;\n    pgd_t *pgd;\n    pud_t *pud;\n …
Run Code Online (Sandbox Code Playgroud)

c virtual-memory linux-kernel page-tables

2
推荐指数
1
解决办法
2258
查看次数

标签 统计

c ×1

linux-kernel ×1

page-tables ×1

virtual-memory ×1