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

[UNIKRAFT PATCH RFCv4 10/35] lib/ukbus: Adjust default bus register priority



On arm64, platform bus should be probed before pci bus since the pci
controller is considered as a platform device. Thus set the default
priority from 1 to 2, then platform bus priority will be 1, higher
than pci bus.

Signed-off-by: Jia He <justin.he@xxxxxxx>
---
 lib/ukbus/include/uk/bus.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lib/ukbus/include/uk/bus.h b/lib/ukbus/include/uk/bus.h
index fcb6842..5fbe325 100644
--- a/lib/ukbus/include/uk/bus.h
+++ b/lib/ukbus/include/uk/bus.h
@@ -68,22 +68,26 @@ void _uk_bus_register(struct uk_bus *b);
 /* Do not use this function directly: */
 void _uk_bus_unregister(struct uk_bus *b);
 
-/* registers a bus driver to the bus system */
+/* registers a bus driver to the bus system
+ * By default, the priority is 2 */
 #define UK_BUS_REGISTER(b) \
-       _UK_BUS_REGISTER(__LIBNAME__, b)
+       _UK_BUS_REGISTER(__LIBNAME__, b, 2)
+
+#define        UK_BUS_REGISTER_PRIORITY(b, prio) \
+       _UK_BUS_REGISTER(__LIBNAME__, b, prio)
 
 #define _UK_BUS_REGFNNAME(x, y)      x##y
 
-#define _UK_BUS_REGISTER_CTOR(ctor)  \
-       UK_CTOR_PRIO(ctor, UK_BUS_REGISTER_PRIO)
+#define _UK_BUS_REGISTER_CTOR(CTOR, prio)  \
+       UK_CTOR_FUNC(prio, CTOR)
 
-#define _UK_BUS_REGISTER(libname, b)                           \
+#define _UK_BUS_REGISTER(libname, b, prio)                     \
        static void                                             \
        _UK_BUS_REGFNNAME(libname, _uk_bus_register)(void)      \
        {                                                       \
                _uk_bus_register((b));                          \
        }                                                       \
-       _UK_BUS_REGISTER_CTOR(_UK_BUS_REGFNNAME(libname, _uk_bus_register))
+       _UK_BUS_REGISTER_CTOR(_UK_BUS_REGFNNAME(libname, _uk_bus_register), 
prio)
 
 #ifdef __cplusplus
 }
-- 
2.17.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.