2 * (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3 * Alexander Warg <warg@os.inf.tu-dresden.de>,
4 * Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
5 * economic rights: Technische Universität Dresden (Germany)
7 * This file is part of TUD:OS and distributed under the terms of the
8 * GNU General Public License 2.
9 * Please see the COPYING-GPL-2 file for details.
13 #include <l4/sys/compiler.h>
14 #include <l4/vbus/vbus_types.h>
15 #include <l4/sys/types.h>
25 * \brief Find a device by the HID ACPI conforming or L4Io static name.
27 * \param vbus Capability of the system bus
28 * \param parent Handle to the parent to start the search
29 * \retval child Handle to the found device
30 * \param hid HID name of the device
31 * \param depth Depth to look for
32 * \retval devinfo Device information structure (might be NULL)
34 * \return 0 on succes, else failure
37 l4vbus_get_device_by_hid(l4_cap_idx_t vbus, l4vbus_device_handle_t parent,
38 l4vbus_device_handle_t *child, char const *hid,
39 int depth, l4vbus_device_t *devinfo);
42 * \brief Find next child following \a child.
44 * \param vbus Capability of the system bus
45 * \param parent Handle to the parent device (use 0 for the system bus)
46 * \param child Handle to the child device (use 0 to get the first
48 * \param depth Depth to look for
49 * \retval devinfo device information (might be NULL)
51 * \return 0 on succes, else failure
54 l4vbus_get_next_device(l4_cap_idx_t vbus, l4vbus_device_handle_t parent,
55 l4vbus_device_handle_t *child, int depth,
56 l4vbus_device_t *devinfo);
59 * \brief Iterate over the resources of a device
61 * \param vbus Capability of the system bus
62 * \param dev Handle of the device
63 * \retval res_idx Index of the resource, the number of resources is
64 * available in the devinfo from get device functions.
65 * \retval res Descriptor of the resource
67 * \return 0 on succes, else failure
70 l4vbus_get_resource(l4_cap_idx_t vbus, l4vbus_device_handle_t dev,
71 int res_idx, l4vbus_resource_t *res);
74 * \brief Request a resource of a specific type
76 * \param vbus Capability of the system bus
77 * \param res Descriptor of the resource
78 * \param flags Optional flags
80 * \return 0 on succes, else failure
82 * If any resource is found that contains the requested
83 * type and addresses this resource is returned.
85 * Flags are only relevant to control the memory caching.
86 * If io-memory is requested.
88 * \return 0 on succes, else failure
91 l4vbus_request_resource(l4_cap_idx_t vbus, l4vbus_resource_t *res,
95 * \brief Release a previously requested resource
97 * \param vbus Capability of the system bus.
98 * \param res Descriptor of the resource.
100 * \return 0 on succes, else failure
103 l4vbus_release_resource(l4_cap_idx_t vbus, l4vbus_resource_t *res);
106 * \brief Get capability of ICU.
108 * \param vbus Capability of the system bus.
109 * \param icu ICU device handle.
110 * \param cap Capability slot for the capability.
112 * \return 0 on succes, else failure
115 l4vbus_vicu_get_cap(l4_cap_idx_t vbus, l4vbus_device_handle_t icu,