X-Git-Url: https://rtime.felk.cvut.cz/gitweb/l4.git/blobdiff_plain/013297c0d65e3dab85bb75c5a104babaebedd230..56a09572268504317eb2885b827f9c4378071a7c:/l4/pkg/io/server/src/vbus.h diff --git a/l4/pkg/io/server/src/vbus.h b/l4/pkg/io/server/src/vbus.h index 03344ea60..1bb40bd47 100644 --- a/l4/pkg/io/server/src/vbus.h +++ b/l4/pkg/io/server/src/vbus.h @@ -10,6 +10,7 @@ #include #include +#include #include @@ -22,6 +23,27 @@ class Sw_icu; class System_bus : public Device, public Dev_feature, public L4::Server_object { public: + class Root_resource_factory : public cxx::H_list_item + { + public: + virtual Root_resource *create(System_bus *bus) const = 0; + Root_resource_factory() + { _factories.push_front(this); } + + typedef cxx::H_list Factory_list; + static Factory_list _factories; + }; + + template< unsigned TYPE, typename RS > + class Root_resource_factory_t : public Root_resource_factory + { + public: + Root_resource *create(System_bus *bus) const + { + return new Root_resource(TYPE, new RS(bus)); + } + }; + System_bus(); ~System_bus(); @@ -45,7 +67,7 @@ private: bool operator () (Resource const *a, Resource const *b) const { if (a->type() == b->type()) - return a->end() < b->start(); + return a->lt_compare(b); return a->type() < b->type(); } }; @@ -67,6 +89,7 @@ private: Resource_set _resources; Device *_host; Sw_icu *_sw_icu; + }; }