[Info-vax] Device Driver Kernel-User Buffer Mapping

Luigi Thirty luigi30 at gmail.com
Wed May 12 11:26:30 EDT 2021


Okay, cool. I'm close now, but I'm running into an issue passing the return values to sys$crmpsc_pfn64.

    VOID_PQ mapped_addr_base;
    uint64 mapped_addr_length;
    r0_status = sys$crmpsc_pfn_64(
        VA$C_P0,
        buf/8192,
        (1048576*16) / 8192,
        PSL$C_USER,
        SEC$M_EXPREG|SEC$M_WRT,
        &mapped_addr_base,
        &mapped_addr_length
    );

This fails with an SS$_ACCVIO, meaning VMS can't write to mapped_addr_base or mapped_addr_length according to the system service docs. I'm not sure why that's the case, since I'm just passing it these two variables by reference. buf is the 64-bit physical address to the card. I saw someone else have this problem in another older post but the solution didn't end up on here.

On Tuesday, May 11, 2021 at 8:00:55 AM UTC-5, Roger Ivie wrote:
> On Sunday, May 9, 2021 at 6:44:32 PM UTC-7, lui... at gmail.com wrote: 
> > Specifically, the problem is that IOC$MAP_IO returns a handle value which I can't figure 
> > out how to resolve to a virtual address, so I don't know where in system memory my PCI 
> > device is mapped. Unless the "magic number" it returns happens to be a pointer to an 
> > IOHANDLE or something.
> the iohandle holds the *physical* address at which your device is mapped. you use that to create the page frame number you need to hand to the appropriate flavor of $crmpsc to create a pfn-mapped section. $crmpsc gives you the virtual address. 
> -- 
> roger ivie 
> roger... at gmail.com



More information about the Info-vax mailing list