Commit 27abb210 authored by Andrey Filippov's avatar Andrey Filippov

trying to analyze struct vm_area_struct

parent 1c5e28a8
......@@ -1238,12 +1238,15 @@ ssize_t iov_iter_get_pages_elphel(struct iov_iter *i,
const struct page * circbuf0_page0 = phys_to_page(circbuf_pa[0]);
size_t len;
const struct iovec *iov = i->iov; // only use first in array - supposed to be a single-element
unsigned long addr = (unsigned long) iov->iov_base;
unsigned long addr;
unsigned long faddr = (unsigned long) iov->iov_base;
struct vm_area_struct *vm_area;
// *** Putting temporary address here
struct page * cur_page = (struct page * ) circbuf0_page0;
pr_debug("circbuf0_page0 = 0x%08x, circbuf0_page0->compound_head=0x%08lx, faddr=0x%08lx, mapcount=%u", \
(int) circbuf0_page0, circbuf0_page0->compound_head, faddr ,page_mapcount((struct page *) circbuf0_page0));
addr = 0;
pr_debug("circbuf0_page0 = 0x%08x, circbuf0_page0->compound_head=0x%08lx", (int) circbuf0_page0, circbuf0_page0->compound_head );
len = iov->iov_len + (*start = addr & (PAGE_SIZE - 1)); // to inlude beginning of the page - for now 0;
if (maxsize > i->count)
maxsize = i->count;
......@@ -1259,7 +1262,15 @@ ssize_t iov_iter_get_pages_elphel(struct iov_iter *i,
pages[indx] = cur_page++;
}
len -= *start;
pr_debug("iov_iter_get_pages_elphel()->0x%08x, n=%u, current->mm->map_count=%u", len, n, current->mm->map_count);
pr_debug("iov_iter_get_pages_elphel()->0x%08x, n=%u, current->mm->map_count=%u",\
len, n, current->mm->map_count);
pr_debug("sizeof(struct vm_area_struct)=%d", sizeof(struct vm_area_struct));
for (vm_area = current->mm->mmap; vm_area; vm_area = vm_area-> vm_next) {
if ((faddr >= vm_area->vm_start) && (faddr < vm_area->vm_end)) {
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, vm_area, sizeof(struct vm_area_struct));
}
}
return len;
}
EXPORT_SYMBOL(iov_iter_get_pages_elphel);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment