]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/io/server/src/vproxy_dev.cc
update
[l4.git] / l4 / pkg / io / server / src / vproxy_dev.cc
1 /*
2  * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
3  *     economic rights: Technische Universität Dresden (Germany)
4  *
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.
8  */
9
10 #include "vproxy_dev.h"
11 #include "vbus_factory.h"
12
13 namespace Vi {
14
15 Proxy_dev::Proxy_dev(Hw::Device *d)
16 : _hwd(d)
17 {
18   // suck features from real dev
19   for (Hw::Device::Feature_list::const_iterator i = d->features()->begin();
20        i != d->features()->end(); ++i)
21     {
22       Dev_feature *vf = Feature_factory::create(*i);
23       if (vf)
24         add_feature(vf);
25     }
26
27   // suck resources from our real dev
28   for (Resource_list::iterator i = d->resources()->begin();
29        i != d->resources()->end(); ++i)
30     {
31       if (!*i)
32         continue;
33
34       if (i->disabled())
35         continue;
36
37       Resource *vr = Resource_factory::create(*i, false);
38       if (!vr)
39         vr = *i;
40
41       add_resource(vr);
42     }
43 }
44
45 namespace {
46   static Dev_factory_t<Proxy_dev, Hw::Device> __ghwdf;
47 }
48
49 }