L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
vbus_interfaces.h
Go to the documentation of this file.
1/*
2 * (c) 2014 Sarah Hoffmann <sarah.hoffmann@kernkonzept.com>
3 *
4 * License: see LICENSE.spdx (in this directory or the directories above)
5 */
11#pragma once
12
13#include <l4/sys/types.h>
14
46
47
48enum {
57};
58
70L4_INLINE unsigned l4vbus_subinterface(unsigned opcode)
71{
72 return opcode >> L4VBUS_IFACE_SHIFT;
73}
74
86L4_INLINE unsigned l4vbus_interface_opcode(unsigned opcode)
87{
88 return opcode & ((1 << L4VBUS_IFACE_SHIFT) - 1);
89}
90
100 l4vbus_iface_type_t iface_type)
101{
102 if (iface_type == L4VBUS_INTERFACE_GENERIC)
103 return 1;
104
105 return (dev_type & (1 << iface_type)) ? 1 : 0;
106}
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:29
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
Common L4 ABI Data Types.
@ L4VBUS_IFACE_SHIFT
Sub-interface ID shift.
l4vbus_iface_type_t
Different sub-interfaces a vbus device may support.
@ L4VBUS_INTERFACE_BUS
VBus.
@ L4VBUS_INTERFACE_GENERIC
No specific sub interface.
@ L4VBUS_INTERFACE_GPIO
GPIO.
@ L4VBUS_INTERFACE_ICU
Interrupt Controller.
@ L4VBUS_INTERFACE_PCI
PCI.
@ L4VBUS_INTERFACE_PCIDEV
PCI Device.
@ L4VBUS_INTERFACE_PM
Power Management.
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_interface_opcode(unsigned opcode)
Return the function opcode within the sub-interface of the vbus command.
unsigned l4vbus_subinterface(unsigned opcode)
Return the ID of the vbus sub-interface.