In the driver is:
static int S_Mmap(struct file * flip, struct vm_area_struct *vma)
{
<snip>
unsigned long size = (unsigned long)vma->vm_end - vma->vm_start;
<------size = 2000 for this case
unsigned long start = (unsigned long)vma->vm_start;
vma->vm_flags |= VM_LOCKED;
vaddy = kmalloc(size , GFP_KERNEL);
strcpy((char*)vaddy, "testing\0");
mem_map_reserve(virt_to_page(vaddy));
result = remap_page_range(start, virt_to_phys(vaddy), size,
vma->vm_page_prot);
if (result)
return -EAGAIN;
return 0;
in user space is:
<snip>
pdma->dwBytes = 2000;
pdma->pUserAddr = mmap(0, pdma->dwBytes, PROT_READ | PROT_WRITE,
MAP_SHARED, hWd, 0);
str = (char*)pdma->pUserAddr;
<snip)
when I try to view the memory that I just mmap()ed using gdb I see:
$12 = 0x40018000 <Address 0x40018000 out of bounds>
If I don't do the mem_map_reserve() command I can view the memory but it
is all zeros.
What am I missing?
TIA
-- Best regards, David Stroupe Keyed-Up Software- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Tue May 14 2002 - 12:00:10 EST