]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/io/server/src/virt/vproxy_dev.cc
update
[l4.git] / l4 / pkg / io / server / src / virt / 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   d->add_client(this);
19   // suck features from real dev
20   for (Hw::Device::Feature_list::const_iterator i = d->features()->begin();
21        i != d->features()->end(); ++i)
22     {
23       Dev_feature *vf = Feature_factory::match(*i);
24       if (vf)
25         add_feature(vf);
26     }
27
28   // suck resources from our real dev
29   for (Resource_list::const_iterator i = d->resources()->begin();
30        i != d->resources()->end(); ++i)
31     {
32       if (!*i)
33         continue;
34
35       if ((*i)->disabled())
36         continue;
37
38       Resource *vr = Resource_factory::match(*i);
39       if (!vr)
40         vr = *i;
41
42       add_resource(vr);
43     }
44 }
45
46 namespace {
47   static Dev_factory_t<Proxy_dev, Hw::Device> __ghwdf;
48 }
49
50 }