RE: Mapping physical memory into Application space
- From: viddec <viddec@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 29 Jun 2005 07:09:04 -0700
This code runs in a device driver (as part of device.exe), i have tried to
make the code more understandable below:
pout is a ptr to a struct that has an embedded pointer called buffer.
ioctl(instance, pin, size, pout, size, unused)
{
paddr = MmapIoSpace(physical_address)
// trying to map paddr from device.exe to the calling application
pnewaddr = MapPtrProcess(paddr, GetCallerProcess())
pout->buffer = pnewaddr
}
In the application:
buffer_struct some_buf;
ioctl(fd, IOCTL, NULL, 0, &some_buf, sizeof(some_buf))
memcpy(some_buf.buffer, my_buf, some_length);
"viddec" wrote:
> Hi,
>
> I want to return to the user application a mapping to a physical buffer.
>
> Suppose the virtual address in the address space of device.exe is paddr
> does
>
> ioctl(instance, pin, size, pout, size, unused)
> {
> pnewaddr = MapPtrProcess(paddr, GetCallerProcess())
> pout = pnewaddr //should this be *pout = pnewaddr
> }
>
> return the new mapping in pout ?
>
>
.
- Follow-Ups:
- Re: Mapping physical memory into Application space
- From: Steve Maillet \(eMVP\)
- Re: Mapping physical memory into Application space
- References:
- Mapping physical memory into Application space
- From: viddec
- Mapping physical memory into Application space
- Prev by Date: Re: Create bootable CF with application
- Next by Date: Re: Mapping physical memory into Application space
- Previous by thread: Re: Mapping physical memory into Application space
- Next by thread: Re: Mapping physical memory into Application space
- Index(es):