bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hurd: Implement device memory mapping


From: Joan Lledó
Subject: Re: [PATCH] hurd: Implement device memory mapping
Date: Tue, 28 Dec 2021 17:48:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

Hi,

El 28/12/21 a les 13:55, Samuel Thibault ha escrit:

? The interface explicitly says they can be different.

Samuel


Sorry, I was confused. I meant the function pci_device_hurd_map_range at libpciaccess. If io_map returns different ports for robj and wobj, we can only assign one of them to the variable pager, which we send to vm_map. Since we can only pass one of them to vm_map, when io_map returns different values for robj and wobj we could return an error and don't map. Something like this:

case VM_PROT_READ|VM_PROT_WRITE:
    if (robj == wobj) {
        if (robj == MACH_PORT_NULL)
            return EPERM;

        pager = wobj;
        /* Remove extra reference.  */
        mach_port_deallocate (mach_task_self (), pager);
    }
    else {
        if (robj != MACH_PORT_NULL)
            mach_port_deallocate (mach_task_self (), robj);
        if (wobj != MACH_PORT_NULL)
            mach_port_deallocate (mach_task_self (), wobj);

        return EPERM;
    }
    break;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]