Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOA arm64 编译报错 #9

Open
ken2008huang opened this issue Sep 11, 2021 · 2 comments
Open

TOA arm64 编译报错 #9

ken2008huang opened this issue Sep 11, 2021 · 2 comments

Comments

@ken2008huang
Copy link

TOA arm64 编译报错
+pte_t *lookup_address(unsigned long addr, unsigned int *level)
+{

  • pgd_t *pgd;
  • pud_t *pud;
  • pmd_t *pmd;
  • if (unlikely(level)) {
  •   WARN(1, "level unused on arm64\n");
    
  •   *level = 0;
    
  • }
  • pgd = pgd_offset_k(addr);
  • if (pgd_none(*pgd))
  •   return NULL;
    
  • pud = pud_offset(pgd, addr);
  • if (pud_none(*pud))
  •   return NULL;
    
  • pmd = pmd_offset(pud, addr);
  • if (pmd_none(*pmd))
  •   return NULL;
    
  • return pte_offset_kernel(pmd, addr);
    +}
@pxunl
Copy link

pxunl commented Sep 23, 2021

@ken2008huang
重新实现lookup_address还不行哦
报错:_PAGE_RW这个找不到定义。
求问最后解决了吗

@laurretang
Copy link

我也遇到类似的问题,请问最后解决了吗?
make -C /lib/modules/4.18.0-193.1.2.el8.aarch64/build M=/root/toa modules EXTRA_CFLAGS="-DTOA_DBG_MSG"
make[1]: Entering directory `/usr/src/kernels/linux-4.18.0-193.1.2.el8_2'

WARNING: Symbol version dump ./Module.symvers
is missing; modules will have no dependencies and modversions.

CC [M] /root/toa/toa.o
/root/toa/toa.c: In function ‘is_ro_addr’:
/root/toa/toa.c:104:5: error: implicit declaration of function ‘lookup_address’ [-Werror=implicit-function-declaration]
pte_t *pte = lookup_address(addr, &level);
^
/root/toa/toa.c:104:18: warning: initialization makes pointer from integer without a cast [enabled by default]
pte_t *pte = lookup_address(addr, &level);
^
/root/toa/toa.c:105:21: error: ‘_PAGE_RW’ undeclared (first use in this function)
if (pte->pte &~ _PAGE_RW)
^
/root/toa/toa.c:105:21: note: each undeclared identifier is reported only once for each function it appears in
/root/toa/toa.c: In function ‘set_addr_rw’:
/root/toa/toa.c:116:18: warning: initialization makes pointer from integer without a cast [enabled by default]
pte_t *pte = lookup_address(addr, &level);
^
/root/toa/toa.c:118:21: error: ‘_PAGE_RW’ undeclared (first use in this function)
if (pte->pte &~ _PAGE_RW) pte->pte |= _PAGE_RW;
^
/root/toa/toa.c: In function ‘set_addr_ro’:
/root/toa/toa.c:124:18: warning: initialization makes pointer from integer without a cast [enabled by default]
pte_t *pte = lookup_address(addr, &level);
^
/root/toa/toa.c:126:27: error: ‘_PAGE_RW’ undeclared (first use in this function)
pte->pte = pte->pte &~_PAGE_RW;
^
cc1: some warnings being treated as errors
make[2]: *** [/root/toa/toa.o] Error 1
make[1]: *** [module/root/toa] Error 2
make[1]: Leaving directory `/usr/src/kernels/linux-4.18.0-193.1.2.el8_2'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants