Refactor to patch

This commit is contained in:
Zhengyi Chen 2024-01-25 21:37:16 +00:00
parent 3d1f979266
commit 20891fd58e
2 changed files with 48 additions and 3 deletions

View file

@ -1,6 +1,5 @@
// [TODO] Clean up headers...
// #include <asm/cacheflush.h>
#include <asm/cacheflush.h>
#include "linux/atomic/atomic-long.h"
#include <linux/device.h>
#include "linux/gfp.h"
@ -20,6 +19,8 @@
#include <linux/kernel.h>
#include <linux/version.h>
#include <asm/cacheflush_extra.h>
MODULE_AUTHOR("Zk.");
MODULE_DESCRIPTION("4.2.W1: mmap for point of coherency");
MODULE_LICENSE("GPL");
@ -59,7 +60,7 @@ static void my_shmem_vmops_close(struct vm_area_struct *vma)
__func__, page_address(pg), *(ulong *)(page_address(pg)),
sizeof(ulong));
// [!!] `dcache_clean_poc` seems not exported.
dcache_clean_poc(vaddr_start, vaddr_start + PAGE_SIZE);
__dcache_clean_poc(vaddr_start, vaddr_start + PAGE_SIZE);
pr_info("[%s] After flush: 0x%px has 0x%lx [+%ld].\n",
__func__, page_address(pg), *(ulong *)(page_address(pg)),
sizeof(ulong));
@ -282,4 +283,4 @@ static void __exit my_shmem_exit(void)
}
module_init(my_shmem_init);
module_exit(my_shmem_exit);
module_exit(my_shmem_exit);