X-Git-Url: https://rtime.felk.cvut.cz/gitweb/l4.git/blobdiff_plain/5a0e6ead0fbfbb912cd817abad695c078e82481c..8d9e85aaae867f39cdd610261e3a4181c25add2d:/l4/pkg/io/server/src/vbus_factory.h diff --git a/l4/pkg/io/server/src/vbus_factory.h b/l4/pkg/io/server/src/vbus_factory.h index 79e1943ef..2f7e440c7 100644 --- a/l4/pkg/io/server/src/vbus_factory.h +++ b/l4/pkg/io/server/src/vbus_factory.h @@ -10,10 +10,10 @@ #pragma once #include "main.h" +#include "debug.h" #include #include -#include #include #include "hw_device.h" @@ -38,10 +38,11 @@ protected: } public: - static VI *create(HW *f); + static VI *create(HW *f, bool warn = true); }; typedef Generic_type_factory Feature_factory; +typedef Generic_type_factory Resource_factory; class Dev_factory : public Generic_type_factory @@ -97,6 +98,11 @@ class Feature_factory_t : public Generic_factory_t {}; +template< typename VI, typename HW > +class Resource_factory_t +: public Generic_factory_t +{}; + template< typename V_DEV, typename HW_DEV = void > class Dev_factory_t : public Dev_factory { @@ -153,7 +159,7 @@ public: template< typename VI, typename HW > VI * -Generic_type_factory::create(HW *f) +Generic_type_factory::create(HW *f, bool warn) { if (!f) return 0; @@ -162,8 +168,9 @@ Generic_type_factory::create(HW *f) typename Type_map::const_iterator i = tm.find(&typeid(*f)); if (i == tm.end()) { - printf("WARNING: cannot fabricate buddy object for '%s'\n", - typeid(*f).name()); + if (warn) + d_printf(DBG_WARN, "WARNING: cannot fabricate buddy object for '%s'\n", + typeid(*f).name()); return 0; }