On 14/06/15 17:07, Antti Kantee wrote:
As long as init$whatever means "initialize io space and return error
code", you can just #define foo 0 in features.

Except you can't, since you need to take the prototype into account, and that messes up scheme. As usual, I shouldn't have tried to be too clever in allowing rumpcomp_userfeatures_pci.h to define the interfaces as macros. I'll use your (Robert's) patch, but at the same time I'll replace the

#define rumpcomp_pci_foo rumpcomp_pci_foo

smartypantsdance with

#define RUMPCOMP_USERFEATURE_PCI_FOO

Then the code can be:

#ifdef RUMPCOMP_USERFEATURE_PCI_IOSPACE
        rumpcomp_pci_initio();
#endif

I think that scheme makes more sense to someone reading any of 1) userfeatures.h 2) kernel-side pci code 3) hypercall side.

I realize this breaks the existing implementations of PCI again, but I don't know if any beyond the ones in repo.rumpkernel.org. At any rate, I think the PCI hypercalls need to be completely redone properly at some point, so they shouldn't be currently considered stable anyway.

Reply via email to