[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH libpciaccess] hurd: Don't read from _SERVERS_BUS_PCI necessar
From: |
Samuel Thibault |
Subject: |
Re: [PATCH libpciaccess] hurd: Don't read from _SERVERS_BUS_PCI necessarily |
Date: |
Mon, 14 Feb 2022 20:02:06 +0100 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Damien Zammit, le lun. 14 févr. 2022 09:23:33 +0000, a ecrit:
> This allows the fallback mechanism in the hurd create method to be
> used in the map range method by reusing the mach port that
> corresponds to the root of the pci filesystem.
> @@ -168,11 +178,11 @@ pci_device_hurd_map_range(struct pci_device *dev,
> flags = O_RDWR;
> }
>
> - snprintf(server, NAME_MAX, "%s/%04x/%02x/%02x/%01u/%s%01u",
> - _SERVERS_BUS_PCI, dev->domain, dev->bus, dev->dev, dev->func,
> - FILE_REGION_NAME, map->region);
> + snprintf(server, NAME_MAX, "./%04x/%02x/%02x/%01u/%s%01u",
Does "%04x/%02x/%02x/%01u/%s%01u" not work?
> Also, the offset parameter to vm_map was not needed as the
> whole range is always mapped from the beginning.
Please avoid stuffing (hiding?) together unrelated concerns.
> return EINVAL;
> }
>
> - offset = map->base - region->base_addr;
> err = vm_map (mach_task_self (), (vm_address_t *)&map->memory, map->size,
> 0, 1,
> pager, /* a memory object proxy containing only the region
> */
> - offset, /* offset from region start */
> + 0, /* offset is beginning of region */
This looks odd, can't map->base be different from region->base_addr?
Applications can call pci_device_map_legacy any way they'd like.
Samuel