Hi,
Sorry for the delay in replying...
On 31/07/14 23:47, Antti Kantee wrote:
On 31/07/14 20:05, Robert Millan wrote:
Now, since your rumpuser_io_init() is really only used by pci-userspace code,
we don't have to make
>>> it part of the main rumpuser interface. You can add the interface to
pci_user.h and then implement
>>> the counterpart in the pci-userspace repository. Please stop to consider
at least for a few moments
>>> to make sure the interface is sufficiently, but not overly, generic. For
example, is something like:
rumpcomp_pci_init(int flags, int *caps)
But the init function itself it quite bus-agnostic. What happens if something
outside of PCI also wants it?
You're right, but ...
I think the same thing will happen as with bus_space/bus_dma being
bundled as part of PCI support. Luckily, we can cross that hurdle
when/if it pops up. In the hypothetical case where there is the need to
introduce a similar call with a similar implementation for another bus,
the worst thing that happens in code duplication, and not very many
lines of that.
Personally, I don't think the rumpuser interface should support I/O, and
we're investigating pushing the remaining I/O functions out into
driver-specific interfaces in hypercall rev 18:
https://github.com/rumpkernel/buildrump.sh/issues/59
Okay. I assume you'll want to make code dependencies time-consistent, so here's
my first patch to add
the rumpcomp_pci_init() interface in pci_user.h.
I'll send a followup for pci-userspace, then back to libpci.
--
Robert Millan
diff --git a/sys/rump/dev/lib/libpci/pci_user.h b/sys/rump/dev/lib/libpci/pci_user.h
index 62eb97b..c72e845 100644
--- a/sys/rump/dev/lib/libpci/pci_user.h
+++ b/sys/rump/dev/lib/libpci/pci_user.h
@@ -18,3 +18,5 @@ int rumpcomp_pci_dmamem_map(struct rumpcomp_pci_dmaseg *, size_t, size_t,
void **);
unsigned long rumpcomp_pci_virt_to_mach(void *);
+
+int rumpcomp_pci_init(int, int *);