L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
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
48
49
50enum {
59};
60
72L4_INLINE unsigned l4vbus_subinterface(unsigned opcode)
73{
74 return opcode >> L4VBUS_IFACE_SHIFT;
75}
76
88L4_INLINE unsigned l4vbus_interface_opcode(unsigned opcode)
89{
90 return opcode & ((1 << L4VBUS_IFACE_SHIFT) - 1);
91}
92
102 l4vbus_iface_type_t iface_type)
103{
104 if (iface_type == L4VBUS_INTERFACE_GENERIC)
105 return 1;
106
107 return (dev_type & (1 << iface_type)) ? 1 : 0;
108}
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:40
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:62
Common L4 ABI Data Types.
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.
@ L4VBUS_IFACE_SHIFT
Sub-interface ID shift.
unsigned l4vbus_subinterface(unsigned opcode)
Return the ID of the vbus sub-interface.