L4Re - L4 Runtime Environment
vbus_interfaces.h
Go to the documentation of this file.
1 /*
2  * (c) 2014 Sarah Hoffmann <sarah.hoffmann@kernkonzept.com>
3  *
4  * This file is part of TUD:OS and distributed under the terms of the
5  * GNU General Public License 2.
6  * Please see the COPYING-GPL-2 file for details.
7  */
13 #pragma once
14 
15 #include <l4/sys/types.h>
16 
32  L4VBUS_INTERFACE_ICU = 0,
33  L4VBUS_INTERFACE_GPIO,
34  L4VBUS_INTERFACE_PCI,
35  L4VBUS_INTERFACE_PCIDEV,
36  L4VBUS_INTERFACE_PM,
37  L4VBUS_INTERFACE_BUS,
38  L4VBUS_INTERFACE_GENERIC = 0x20
39 };
40 
41 
42 enum {
51 };
52 
64 L4_INLINE unsigned l4vbus_subinterface(unsigned opcode)
65 {
66  return opcode >> L4VBUS_IFACE_SHIFT;
67 }
68 
80 L4_INLINE unsigned l4vbus_interface_opcode(unsigned opcode)
81 {
82  return opcode & ((1 << L4VBUS_IFACE_SHIFT) - 1);
83 }
84 
94  l4vbus_iface_type_t iface_type)
95 {
96  if (iface_type == L4VBUS_INTERFACE_GENERIC)
97  return 1;
98 
99  return (dev_type & (1 << iface_type)) ? 1 : 0;
100 }
Common L4 ABI Data Types.
Sub-interface ID shift.
unsigned l4vbus_interface_opcode(unsigned opcode)
Return the function opcode within the sub-interface of the vbus command.
l4vbus_iface_type_t
Different sub-interfaces a vbus device may support.
int l4vbus_subinterface_supported(l4_uint32_t dev_type, l4vbus_iface_type_t iface_type)
Check if a vbus device supports a given sub-interface.
unsigned l4vbus_subinterface(unsigned opcode)
Return the ID of the vbus sub-interface.
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition: l4int.h:40