2 * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
3 * economic rights: Technische Universität Dresden (Germany)
5 * This file is part of TUD:OS and distributed under the terms of the
6 * GNU General Public License 2.
7 * Please see the COPYING-GPL-2 file for details.
11 #include <l4/cxx/avl_set>
12 #include <l4/cxx/ipc_server>
14 #include <l4/vbus/vbus_types.h>
22 class System_bus : public Device, public Dev_feature, public L4::Server_object
28 // dispatch for the server object
29 int dispatch(l4_umword_t obj, L4::Ipc::Iostream &ios);
30 int dispatch(l4_umword_t, l4_uint32_t func, L4::Ipc::Iostream &ios);
31 bool match_hw_feature(Hw::Dev_feature const *) const { return false; }
34 int request_resource(L4::Ipc::Iostream &ios);
35 int request_iomem(L4::Ipc::Iostream &ios);
38 bool resource_allocated(Resource const *) const;
40 void dump_resources() const;
45 bool operator () (Resource const *a, Resource const *b) const
47 if (a->type() == b->type())
48 return a->end() < b->start();
49 return a->type() < b->type();
52 //typedef std::set<Resource*, Res_cmp> Resource_set;
55 typedef cxx::Avl_set<Resource*, Res_cmp> Resource_set;
57 Resource_set const *resource_set() const { return &_resources; }
58 Resource_set *resource_set() { return &_resources; }
60 void set_host(Device *d) { _host = d; }
61 Device *host() const { return _host; }
62 Sw_icu *sw_icu() const { return _sw_icu; }
64 void sw_icu(Sw_icu *icu) { _sw_icu = icu; }
67 Resource_set _resources;