dxd - dynax driver framework 3.0.1d223
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd::multichannel::stream< channel_t > Class Template Referenceabstract

generic kernel multichannel stream More...

#include <dxd_stream.h>

Inheritance diagram for dxd::multichannel::stream< channel_t >:
Collaboration diagram for dxd::multichannel::stream< channel_t >:

Classes

struct  [struct].control
class  clock
 a clock domain in the kernel: its sample rate in a buffer the clients map, and the broadcast every registered client is signalled through. references counts the starts, so the domain runs while any client holds it More...
class  in
 kernel stream mapped client reference counted in channel buffers More...
class  umap
 stream user mapping More...

Public Types

enum  direction
 direction of memory operation More...
enum  direction
 direction of memory operation More...

Public Member Functions

os_result attach (unsigned int iosize, channel_t **channel[2])
 attach user client owned out channels
os_result attach (unsigned int iosize, const uint64_t *channel_map)
 create stream local in channels
bool claim (dx::stream::direction::direction directiondirection)
 taken while there is none
void detach (channel_t **channel[2])
void detach (const uint64_t *channel_map)
void free ()
void free ()
 DriverKit map free.
os_result initialize (::IOMemoryDescriptor *io_memory_descriptor)
 DriverKit memory initializer.
os_result initialize (::IOMemoryDescriptor *io_memory_descriptor, size_t offset, size_t size, directiondirection directiondirection)
 DriverKit memory initializer.
os_result initialize (const ::MDL *mdl)
os_result initialize (const ::MDL *mdl, size_t offset, size_t size)
os_result initialize (const void *data, size_t size)
os_result initialize (const void *data, size_t size)
os_result initialize (size_t size, unsigned int limit=64, unsigned int alignment=0, bool contigous=false)
os_result initialize (size_t size, unsigned int=64, unsigned int alignment=0, bool=false)
 DriverKit buffer initializer.
os_result initialize (::IOMemoryDescriptor *io_memory_descriptor, size_t offset=0, size_t size=0, uint64_t alignment=0, void *address=nullptr)
 DriverKit map initializer.
os_result initialize (::IOMemoryDescriptor *io_memory_descriptor, size_t offset, size_t size, directiondirection directiondirection)
 DriverKit memory initializer.
 operator const ::IOMemoryDescriptor * () const
 DriverKit IOMemoryDescriptor* implicit cast.
 operator const ::IOMemoryDescriptor * () const
 DriverKit IOMemoryDescriptor* implicit cast.
 operator const dx::circular * () const
 operator const::IOMemoryMap * () const
 operator dx::circular * () const
 operator void * () const
 the allocation's kernel address
const dx::circular * operator-> () const
 operator to use mapping like pointer
 operator::IOMemoryDescriptor * ()
 operator::IOMemoryDescriptor * ()
 operator::IOMemoryMap * ()
 operator::MDL * () const
 operator::MDL * () const
void pop (abstract::event &event)
 a participant's event leaves: no tick signals it once this returns
void push (abstract::event &event)
 a participant's event joins the ring's signal
template<typename reference_t>
int release (reference_t &reference)
::IOMemoryDescriptor * retain ()
::IOMemoryDescriptor * retain ()
void retain ()
void rx (int64_t timestamp)
void signal ()
uint64_t size () const
 DriverKit memory size.
uint64_t size () const
 DriverKit memory size.
size_t size () const
 DriverKit mapping size.
virtual os_result start (bool force=false)=0
virtual os_result stop (bool force=false)=0
 stream ()=default
 stream (size_t size, unsigned int limit=64, unsigned int align=0, bool contigous=false)
void tx (int64_t timestamp)

Public Attributes

struct  control
atomic< int > references {}
os_result status
 DriverKit memory status.
os_result status
 DriverKit memory status.
os_result status
 status of mapping object
volatile int64_t transport {dx::stream::direction::none}

Protected Member Functions

void __lock ()
void __unlock ()
 operator const ::KSPIN_LOCK & () const
 operator const ::KSPIN_LOCK * () const
 operator::KSPIN_LOCK & ()
 operator::KSPIN_LOCK * ()
 ~stream ()

Protected Attributes

dx::circular * _vm
 DriverKit virtual address mapping.
union dxd::multichannel::stream:: { ... }  cache
unsigned int channels {}
 stream channels
dxd::multichannel::stream::in * in [2]
::IOMemoryMap * io_memory_map
atomic< int > out {}
 client outs atached
os_result status {ok}

Detailed Description

template<typename channel_t = int>
class dxd::multichannel::stream< channel_t >

generic kernel multichannel stream

Member Enumeration Documentation

◆ direction [1/2]

enum dxd::memory::direction : uint64_t
inherited

direction of memory operation

◆ direction [2/2]

enum dxd::memory::direction : uint64_t
inherited

direction of memory operation

Constructor & Destructor Documentation

◆ ~stream()

template<typename channel_t = int>
dxd::multichannel::stream< channel_t >::~stream ( )
inlineprotectedvirtual

Reimplemented from dxd::stream.

◆ stream() [1/2]

template<typename channel_t = int>
dxd::stream::stream ( )
default

◆ stream() [2/2]

template<typename channel_t = int>
dxd::stream::stream ( size_t size,
unsigned int limit = 64,
unsigned int align = 0,
bool contigous = false )
inline

Member Function Documentation

◆ __lock()

void dxd::spinlock::__lock ( )
inlineprotectedinherited

◆ __unlock()

void dxd::spinlock::__unlock ( )
inlineprotectedinherited

◆ attach() [1/2]

template<typename channel_t = int>
os_result dxd::multichannel::stream< channel_t >::attach ( unsigned int iosize,
channel_t ** channel[2] )
inline

attach user client owned out channels

Here is the call graph for this function:

◆ attach() [2/2]

template<typename channel_t = int>
os_result dxd::multichannel::stream< channel_t >::attach ( unsigned int iosize,
const uint64_t * channel_map )
inline

create stream local in channels

◆ claim()

bool dxd::stream::claim ( dx::stream::direction::direction direction)
inlineinherited

taken while there is none

Here is the call graph for this function:

◆ detach() [1/2]

template<typename channel_t = int>
void dxd::multichannel::stream< channel_t >::detach ( channel_t ** channel[2])
inline
Here is the call graph for this function:

◆ detach() [2/2]

template<typename channel_t = int>
void dxd::multichannel::stream< channel_t >::detach ( const uint64_t * channel_map)
inline
Here is the call graph for this function:

◆ free() [1/2]

void dxd::buffer< scope_t, 64, 0, false >::free ( )
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free() [2/2]

void dxd::map< scope_t, dx::circular >::free ( )
inlineinherited

DriverKit map free.

Checks if DriverKit mapping already exists and

does not call unmap(): IOMemoryMap instances will unmap themselves upon free, ie. when the last client with a reference calls release. unmap() forces the IOMemoryMap to destroy the mapping it represents, regardless of the number of clients. releases the map object.

◆ initialize() [1/10]

os_result dxd::memory< scope_t, io_memory_descriptor_t >::initialize ( ::IOMemoryDescriptor * io_memory_descriptor)
inlineinherited

DriverKit memory initializer.

◆ initialize() [2/10]

os_result dxd::memory< scope_t, io_memory_descriptor_t >::initialize ( ::IOMemoryDescriptor * io_memory_descriptor,
size_t offset,
size_t size,
direction direction )
inlineinherited

DriverKit memory initializer.

◆ initialize() [3/10]

os_result dxd::memory< scope_t, io_memory_descriptor_t >::initialize ( const ::MDL * mdl)
inlineinherited

in contrast to an IOKit MemoryDescriptor MDLs do not support reference counting. take care when creating a dxd::memory from a dxd::buffer: although the dxd::memory holds an MDL to the buffer the buffer itself is not retained after the dxd::buffer is released!

◆ initialize() [4/10]

os_result dxd::memory< scope_t, io_memory_descriptor_t >::initialize ( const ::MDL * mdl,
size_t offset,
size_t size )
inlineinherited

◆ initialize() [5/10]

os_result dxd::memory< dx::kernel >::initialize ( const void * data,
size_t size )
inherited

Allows re-initialization

Parameters
datavirtual read only kernel base address of range to create memory descriptor from
sizesize of range to create memory descriptor from

◆ initialize() [6/10]

os_result dxd::memory< scope_t, io_memory_descriptor_t >::initialize ( const void * data,
size_t size )
inherited

◆ initialize() [7/10]

os_result dxd::buffer< scope_t, 64, 0, false >::initialize ( size_t size,
unsigned int limit = limit_t,
unsigned int alignment = alignment_t,
bool contigous = contigous_t )
inlineinherited

Allows re-initialization

Parameters
sizesize to be alloced by buffer object
limitlimit physical memory address space
alignmentenforce physical memory alignment
contigousenforce contiguos physical memory
Here is the call graph for this function:

◆ initialize() [8/10]

os_result dxd::buffer< scope_t, 64, 0, false >::initialize ( size_t size,
unsigned int = limit_t,
unsigned int alignment = alignment_t,
bool = contigous_t )
inlineinherited

DriverKit buffer initializer.

Allows re-initialization.

Creates a buffer and associated memory descriptor.

Parameters
sizesize to be alloced by buffer object
-limit physical memory address space
alignmentenforce physical memory alignment
-enforce contiguos physical memory
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize() [9/10]

os_result dxd::map< scope_t, dx::circular >::initialize ( ::IOMemoryDescriptor * io_memory_descriptor,
size_t offset = 0,
size_t size = 0,
uint64_t alignment = 0,
void * address = nullptr )
inlineinherited

DriverKit map initializer.

map<kernel> maps an IOMemoryDescriptor (typically cast of a dxd::memory or buffer class) into the DriverKit address space.

            kIOMemoryMapFixedAddress map at the address requested
            kIOMemoryMapReadOnly create a read only mapping
            kIOMemoryMapCacheModeDefault default cache mode
            kIOMemoryMapCacheModeInhibit inhibited cache mode
            kIOMemoryMapCacheModeCopyback copyback cache mode
            kIOMemoryMapCacheModeWriteThrough write through cache mode

Allows re-initialization.

Checks buffer object,

maps the buffer into the DriverKit (will fail if offset is given)

and obtains a DriverKit virtual address (apply offset here instead).

Parameters
io_memory_descriptorIOMemoryDescriptor to be mapped into the DriverKit address space
offsetoffset into memory descriptor to create mapping
sizesize of mapping

◆ initialize() [10/10]

template<dx::scope scope_t = dx::kernel, typename io_memory_descriptor_t = ::IOMemoryDescriptor>
os_result dxd::memory< scope_t, io_memory_descriptor_t >::initialize ( ::IOMemoryDescriptor * io_memory_descriptor,
size_t offset,
size_t size,
direction direction )
inlineinherited

DriverKit memory initializer.

Here is the call graph for this function:

◆ operator const ::IOMemoryDescriptor *() [1/2]

dxd::memory< scope_t, ::IOBufferMemoryDescriptor >::operator const ::IOMemoryDescriptor * ( ) const
inlineinherited

DriverKit IOMemoryDescriptor* implicit cast.

◆ operator const ::IOMemoryDescriptor *() [2/2]

dxd::memory< scope_t, io_memory_descriptor_t >::operator const ::IOMemoryDescriptor * ( ) const
inlineinherited

DriverKit IOMemoryDescriptor* implicit cast.

◆ operator const ::KSPIN_LOCK &()

dxd::spinlock::operator const ::KSPIN_LOCK & ( ) const
inlineinherited

◆ operator const ::KSPIN_LOCK *()

dxd::spinlock::operator const ::KSPIN_LOCK * ( ) const
inlineinherited

◆ operator const dx::circular *()

dxd::map< scope_t, dx::circular >::operator const dx::circular * ( ) const
inlineinherited

◆ operator const::IOMemoryMap *()

dxd::map< scope_t, dx::circular >::operator const::IOMemoryMap * ( ) const
inlineinherited

◆ operator dx::circular *()

dxd::map< scope_t, dx::circular >::operator dx::circular * ( ) const
inlineinherited

◆ operator void *()

dxd::buffer< scope_t, 64, 0, false >::operator void * ( ) const
inlineinherited

the allocation's kernel address

◆ operator->()

const dx::circular * dxd::map< scope_t, dx::circular >::operator-> ( ) const
inlineinherited

operator to use mapping like pointer

◆ operator::IOMemoryDescriptor *() [1/2]

dxd::memory< scope_t, ::IOBufferMemoryDescriptor >::operator::IOMemoryDescriptor * ( )
inlineinherited

◆ operator::IOMemoryDescriptor *() [2/2]

dxd::memory< scope_t, io_memory_descriptor_t >::operator::IOMemoryDescriptor * ( )
inlineinherited

◆ operator::IOMemoryMap *()

dxd::map< scope_t, dx::circular >::operator::IOMemoryMap * ( )
inlineinherited

◆ operator::KSPIN_LOCK &()

dxd::spinlock::operator::KSPIN_LOCK & ( )
inlineinherited

◆ operator::KSPIN_LOCK *()

dxd::spinlock::operator::KSPIN_LOCK * ( )
inlineinherited

◆ operator::MDL *() [1/2]

dxd::memory< scope_t, ::IOBufferMemoryDescriptor >::operator::MDL * ( ) const
inlineinherited

◆ operator::MDL *() [2/2]

dxd::memory< scope_t, io_memory_descriptor_t >::operator::MDL * ( ) const
inlineinherited

◆ pop()

void dxd::stream::pop ( abstract::event & event)
inlineinherited

a participant's event leaves: no tick signals it once this returns

◆ push()

void dxd::stream::push ( abstract::event & event)
inlineinherited

a participant's event joins the ring's signal

◆ release()

template<typename reference_t>
int dxd::referenced::release ( reference_t & reference)
inlineinherited

◆ retain() [1/3]

::IOMemoryDescriptor * dxd::memory< scope_t, ::IOBufferMemoryDescriptor >::retain ( )
inlineinherited

◆ retain() [2/3]

::IOMemoryDescriptor * dxd::memory< scope_t, io_memory_descriptor_t >::retain ( )
inlineinherited

◆ retain() [3/3]

void dxd::referenced::retain ( )
inlineinherited

◆ rx()

template<typename channel_t = int>
void dxd::multichannel::stream< channel_t >::rx ( int64_t timestamp)
inline
Here is the call graph for this function:

◆ signal()

void dxd::stream::signal ( )
inlineinherited

◆ size() [1/3]

uint64_t dxd::memory< scope_t, ::IOBufferMemoryDescriptor >::size ( ) const
inlineinherited

DriverKit memory size.

Here is the caller graph for this function:

◆ size() [2/3]

uint64_t dxd::memory< scope_t, io_memory_descriptor_t >::size ( ) const
inlineinherited

DriverKit memory size.

◆ size() [3/3]

size_t dxd::map< scope_t, dx::circular >::size ( ) const
inlineinherited

DriverKit mapping size.

Here is the caller graph for this function:

◆ start()

virtual os_result dxd::stream::start ( bool force = false)
pure virtualinherited

◆ stop()

virtual os_result dxd::stream::stop ( bool force = false)
pure virtualinherited

◆ tx()

template<typename channel_t = int>
void dxd::multichannel::stream< channel_t >::tx ( int64_t timestamp)
inline
Here is the call graph for this function:

Member Data Documentation

◆ _vm

dx::circular* dxd::map< scope_t, dx::circular >::_vm
protectedinherited

DriverKit virtual address mapping.

◆ cache

union { ... } dxd::multichannel::stream< channel_t >::cache

◆ channels

template<typename channel_t = int>
unsigned int dxd::multichannel::stream< channel_t >::channels {}
protected

stream channels

◆ control

◆ in

template<typename channel_t = int>
dxd::multichannel::stream::in* dxd::multichannel::stream< channel_t >::in[2]
protected

◆ io_memory_map

::IOMemoryMap* dxd::map< scope_t, dx::circular >::io_memory_map
protectedinherited

◆ out

template<typename channel_t = int>
atomic<int> dxd::multichannel::stream< channel_t >::out {}
protected

client outs atached

◆ references

atomic<int> dxd::referenced::references {}
inherited

◆ status [1/4]

os_result dxd::memory< scope_t, ::IOBufferMemoryDescriptor >::status
inherited

DriverKit memory status.

status of memory object

◆ status [2/4]

os_result dxd::memory< scope_t, io_memory_descriptor_t >::status
inherited

DriverKit memory status.

status of memory object

◆ status [3/4]

os_result dxd::map< scope_t, dx::circular >::status
inherited

status of mapping object

◆ status [4/4]

os_result dxd::spinlock::status {ok}
inherited

◆ transport

volatile int64_t dxd::stream::transport {dx::stream::direction::none}
inherited

the ring's one transport, of its stream's direction: the kernel's participants meet here, its holder and the host's session start set it none


The documentation for this class was generated from the following file:

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.