]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libio-io/include/types.h
update
[l4.git] / l4 / pkg / libio-io / include / types.h
1 /*
2  * (c) 2008-2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
3  *     economic rights: Technische Universität Dresden (Germany)
4  * This file is part of TUD:OS and distributed under the terms of the
5  * GNU Lesser General Public License 2.1.
6  * Please see the COPYING-LGPL-2.1 file for details.
7  */
8 #pragma once
9
10 #include <l4/vbus/vbus_types.h>
11
12 /**
13  * \brief Flags for IO memory.
14  * \ingroup api_l4io
15  */
16 enum l4io_iomem_flags_t
17 {
18     L4IO_MEM_NONCACHED = 0, /**< Non-cache memory */
19     L4IO_MEM_CACHED    = 1, /**< Cache memory */
20     L4IO_MEM_USE_MTRR  = 2, /**< Use MTRR */
21     L4IO_MEM_ATTR_MASK = 0xf,
22
23     /** Use reserved area for mapping I/O memory. Flag only valid
24      *  for l4io_request_iomem_region() */
25     L4IO_MEM_USE_RESERVED_AREA = 0x10,
26
27     // combinations
28     L4IO_MEM_WRITE_COMBINED = L4IO_MEM_USE_MTRR | L4IO_MEM_CACHED,
29 };
30
31 /**
32  * \brief Device types.
33  * \ingroup api_l4io
34  */
35 enum l4io_device_types_t {
36   L4IO_DEVICE_INVALID = 0, /**< Invalid type */
37   L4IO_DEVICE_PCI,         /**< PCI device */
38   L4IO_DEVICE_USB,         /**< USB device */
39   L4IO_DEVICE_OTHER,       /**< Any other device without unique IDs */
40   L4IO_DEVICE_ANY = ~0     /**< any type */
41 };
42
43 /**
44  * \brief Resource types
45  * \ingroup api_l4io
46  */
47 enum l4io_resource_types_t {
48   L4IO_RESOURCE_INVALID = L4VBUS_RESOURCE_INVALID, /**< Invalid type */
49   L4IO_RESOURCE_IRQ     = L4VBUS_RESOURCE_IRQ,         /**< Interrupt resource */
50   L4IO_RESOURCE_MEM     = L4VBUS_RESOURCE_MEM,         /**< I/O memory resource */
51   L4IO_RESOURCE_PORT    = L4VBUS_RESOURCE_PORT,        /**< I/O port resource (x86 only) */
52   L4IO_RESOURCE_ANY = ~0     /**< any type */
53 };
54
55
56 typedef l4vbus_device_handle_t l4io_device_handle_t;
57 typedef int l4io_resource_handle_t;
58
59 /**
60  * \brief Resource descriptor.
61  * \ingroup api_l4io
62  *
63  * For IRQ types, the end field is not used, i.e. only a single
64  * interrupt can be described with a l4io_resource_t
65  */
66 typedef l4vbus_resource_t l4io_resource_t;
67
68 /** Device descriptor.
69  * \ingroup api_l4io
70  */
71 typedef l4vbus_device_t l4io_device_t;