Re: [PATCH libpciaccess] hurd: device_open the pre-existing pci server

2021-03-06 Thread Samuel Thibault
Samuel Thibault, le sam. 06 mars 2021 11:31:59 +0100, a ecrit: > Damien Zammit, le sam. 06 mars 2021 15:00:00 +1100, a ecrit: > > +static int > > +sort_devices(void) > > +{ [...] > > +} > > That probably needs to be discussed with upgrade? (I meant "upstream") Samuel

Re: [PATCH libpciaccess] hurd: device_open the pre-existing pci server

2021-03-06 Thread Samuel Thibault
Damien Zammit, le dim. 07 mars 2021 09:36:26 +1100, a ecrit: > devices = realloc(pci_sys->devices, (pci_sys->num_devices + 1) >* sizeof(struct pci_device_private)); > if (!devices) { > -if (closedir(dir) < 0) > -

[PATCH libpciaccess] hurd: device_open the pre-existing pci server

2021-03-06 Thread Damien Zammit
This is a revised version of previous patch. When there is no pci "device" present in the system, the fallback mechanism to use /servers/bus/pci works. It also boots from a static arbiter. --- src/common_init.c | 37 + src/hurd_pci.c| 138 ++---

Re: [PATCH libpciaccess] hurd: device_open the pre-existing pci server

2021-03-06 Thread Samuel Thibault
Hello, Damien Zammit, le sam. 06 mars 2021 15:00:00 +1100, a ecrit: > +static int > +sort_devices(void) > +{ > +int bus, dev, func; > +struct pci_device_private *sorted; > +struct pci_device_private *device; > +struct pci_device_private *tmpdev; > + > +sorted = calloc(pci_sys->

[PATCH libpciaccess] hurd: device_open the pre-existing pci server

2021-03-05 Thread Damien Zammit
This is a cleaned up version of my previous patch. It fixes a bug by sorting the device array by B/D/F for all backends. (It assumes only domain exists and I think that assumption is also made elsewhere). --- src/common_init.c | 37 src/hurd_pci.c| 108

Re: [PATCH libpciaccess] hurd: device_open the pre-existing pci server and use dir_readdir RPC

2021-03-02 Thread Samuel Thibault
Hello, It seems I wasn't clear :) Damien Zammit, le mar. 02 mars 2021 22:44:01 +1100, a ecrit: > +if (pci_port == MACH_PORT_NULL) { > +dir = opendir(parent); > +if (!dir) > +return errno; > +} else { > +if (lev > LEVEL_FUNC + 1) { > + return 0;

[PATCH libpciaccess] hurd: device_open the pre-existing pci server and use dir_readdir RPC

2021-03-02 Thread Damien Zammit
This patch for libpciaccess goes in lockstep with the previous patches I sent for hurd. --- src/hurd_pci.c | 125 ++--- 1 file changed, 98 insertions(+), 27 deletions(-) diff --git a/src/hurd_pci.c b/src/hurd_pci.c index ada7af8..ff14285 100644 --- a/