dxd - dynax driver framework  2675
cross platform open source driver development framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

class  clock
 
class  in
 kernel stream mapped client reference counted in channel buffers More...
 
class  umap
 stream user mapping More...
 

Public Member Functions

os_result attach (unsigned int iosize, const uint64_t *channel_map)
 create stream local in channels More...
 
os_result attach (unsigned int iosize, channel_t **channel[2])
 attach user client owned out channels More...
 
void detach (const uint64_t *channel_map)
 
void detach (channel_t **channel[2])
 
void free ()
 
void free ()
 kernel map free More...
 
os_result initialize (const void *data, size_t size)
 IOKit memory initializer. More...
 
os_result initialize (const void *data, size_t size)
 IOKit memory initializer. More...
 
os_result initialize (const ::MDL *mdl)
 
os_result initialize (const ::MDL *mdl)
 
os_result initialize (void *data, size_t size)
 IOKit memory initializer. More...
 
os_result initialize (void *data, size_t size)
 IOKit memory initializer. More...
 
os_result initialize (const ::MDL *mdl, size_t offset, size_t size)
 
os_result initialize (const ::MDL *mdl, size_t offset, size_t size)
 
os_result initialize (::IOMemoryDescriptor *iokit_memory_descriptor)
 IOKit memory initializer. More...
 
os_result initialize (::IOMemoryDescriptor *iokit_memory_descriptor)
 IOKit memory initializer. More...
 
os_result initialize (::IOMemoryDescriptor *iokit_memory_descriptor, size_t offset, size_t size)
 IOKit memory initializer. More...
 
os_result initialize (::IOMemoryDescriptor *iokit_memory_descriptor, size_t offset, size_t size)
 IOKit memory initializer. More...
 
os_result initialize (size_t size, unsigned int limit=limit_t, unsigned int alignment=alignment_t, bool contigous=contigous_t)
 
os_result initialize (::IOMemoryDescriptor *iokit_memory_descriptor, size_t offset=0)
 IOKit kernel map initializer. More...
 
os_result initialize (size_t size, unsigned int limit=limit_t, unsigned int alignment=alignment_t, bool contigous=contigous_t)
 IOKit buffer initializer. More...
 
 operator const ::IOMemoryDescriptor * () const
 IOKit IOMemoryDescriptor* implicit cast. More...
 
 operator const ::IOMemoryDescriptor * () const
 IOKit IOMemoryDescriptor* implicit cast. More...
 
 operator const ::IOMemoryMap * () const
 
 operator const dx::circular * () const
 
 operator dx::circular * () const
 
 operator uint64_t () const
 IOKit physical address (only relevant for contigous memory) More...
 
 operator uint64_t () const
 IOKit physical address (only relevant for contigous memory) More...
 
const dx::circularoperator-> () const
 operator to use mapping like pointer More...
 
dx::circularoperator-> ()
 
 operator::IOMemoryDescriptor * ()
 
 operator::IOMemoryDescriptor * ()
 
 operator::IOMemoryMap * ()
 
 operator::MDL * () const
 
 operator::MDL * () const
 
template<typename reference_t >
int release (reference_t &reference)
 
void retain ()
 
void rx (int64_t timestamp)
 
size_t size () const
 IOKit memory size. More...
 
size_t size () const
 IOKit memory size. More...
 
size_t size () const
 kernel mapping size More...
 
virtual os_result start (bool force=false)=0
 
virtual os_result stop (bool force=false)=0
 
void tx (int64_t timestamp)
 

Public Attributes

struct {
   uint64_t   advance =0
 
   dxd::buffer< dx::user >   buffer {sizeof(dx::stream::channel::control)}
 
   bool   in
 
   unsigned int   iosize =0
 
   dxd::map< dx::kernel,
dx::stream::channel::control >   map {buffer}
 
control
 
os_result status
 IOKit memory status. More...
 
os_result status
 IOKit memory status. More...
 
os_result status
 status of mapping object More...
 
channel_t ** in [2]
 in channel array [switch] [channels] More...
 
channel_t *const *const *volatile out [2]
 client out channel array [switch] [client] -> umap out channels [channels] More...
 

Protected Member Functions

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

Protected Attributes

dx::circular_vm
 kernel virtual address mapping More...
 
union {
   channel_t **   in [2]
 in channel array [switch] [channels] More...
 
   channel_t *const *const *volatile   out [2]
 client out channel array [switch] [client] -> umap out channels [channels] More...
 
cache
 
unsigned int channels =0
 stream channels More...
 
dxd::multichannel::stream::inin [2]
 
::IOMemoryMap * iokit_memory_map
 
atomic< int > out =0
 client outs atached More...
 
os_result status =not_initialized
 

Detailed Description

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

generic kernel multichannel stream

Constructor & Destructor Documentation

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

Member Function Documentation

void dxd::spinlock::__lock ( )
inlineprotectedinherited
void dxd::spinlock::__lock ( )
inlineprotectedinherited
bool dxd::spinlock::__trylock ( )
inlineprotectedinherited
void dxd::spinlock::__unlock ( )
inlineprotectedinherited
void dxd::spinlock::__unlock ( )
inlineprotectedinherited
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

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

template<typename channel_t = int>
void dxd::multichannel::stream< channel_t >::detach ( const uint64_t channel_map)
inline
template<typename channel_t = int>
void dxd::multichannel::stream< channel_t >::detach ( channel_t **  channel[2])
inline
void dxd::buffer< scope_t, limit_t, alignment_t, contigous_t >::free ( )
inlineinherited
void dxd::map< scope_t, dx::circular >::free ( )
inlineinherited

kernel map free

Checks if kernel 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.

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

IOKit memory initializer.

Parameters
datavirtual base address of range to create memory descriptor from
sizesize of range to create memory descriptor from
os_result dxd::memory< scope_t >::initialize ( const void *  data,
size_t  size 
)
inherited

IOKit memory initializer.

Parameters
datavirtual base address of range to create memory descriptor from
sizesize of range to create memory descriptor from
os_result dxd::memory< scope_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!

+ Here is the call graph for this function:

os_result dxd::memory< scope_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!

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

IOKit memory initializer.

Parameters
datavirtual base address of range to create memory descriptor from
sizesize of range to create memory descriptor from
os_result dxd::memory< scope_t >::initialize ( void *  data,
size_t  size 
)
inherited

IOKit memory initializer.

Parameters
datavirtual base address of range to create memory descriptor from
sizesize of range to create memory descriptor from
os_result dxd::memory< scope_t >::initialize ( const ::MDL *  mdl,
size_t  offset,
size_t  size 
)
inlineinherited
os_result dxd::memory< scope_t >::initialize ( const ::MDL *  mdl,
size_t  offset,
size_t  size 
)
inlineinherited

+ Here is the call graph for this function:

os_result dxd::memory< scope_t >::initialize ( ::IOMemoryDescriptor *  iokit_memory_descriptor)
inlineinherited

IOKit memory initializer.

+ Here is the call graph for this function:

os_result dxd::memory< scope_t >::initialize ( ::IOMemoryDescriptor *  iokit_memory_descriptor)
inlineinherited

IOKit memory initializer.

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

IOKit memory initializer.

+ Here is the call graph for this function:

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

IOKit memory initializer.

os_result dxd::buffer< scope_t, limit_t, alignment_t, contigous_t >::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
os_result dxd::map< scope_t, dx::circular >::initialize ( ::IOMemoryDescriptor *  iokit_memory_descriptor,
size_t  offset = 0 
)
inlineinherited

IOKit kernel map initializer.

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

https://developer.apple.com/library/content/qa/qa1197/_index.html

Allows re-initialization.

Checks buffer object,

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

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

Parameters
iokit_memory_descriptorIOMemoryDescriptor to be mapped into the kernel address space
offsetoffset into memory descriptor to create mapping
os_result dxd::buffer< scope_t, limit_t, alignment_t, contigous_t >::initialize ( size_t  size,
unsigned int  limit = limit_t,
unsigned int  alignment = alignment_t,
bool  contigous = contigous_t 
)
inlineinherited

IOKit buffer initializer.

Allows re-initialization.

Creates a buffer and associated memory descriptor.

Wires down the backing store memory.

Parameters
sizesize to be alloced by buffer object
limitlimit physical memory address space
alignmentenforce physical memory alignment
contigousenforce contiguos physical memory
dxd::memory< scope_t >::operator const ::IOMemoryDescriptor * ( ) const
inlineinherited

IOKit IOMemoryDescriptor* implicit cast.

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

IOKit IOMemoryDescriptor* implicit cast.

dxd::map< scope_t, dx::circular >::operator const ::IOMemoryMap * ( ) const
inlineinherited
dxd::spinlock::operator const ::KSPIN_LOCK & ( ) const
inlineinherited
dxd::spinlock::operator const ::KSPIN_LOCK * ( ) const
inlineinherited
dxd::map< scope_t, dx::circular >::operator const dx::circular * ( ) const
inlineinherited
dxd::map< scope_t, dx::circular >::operator dx::circular * ( ) const
inlineinherited
dxd::memory< scope_t >::operator uint64_t ( ) const
inlineinherited

IOKit physical address (only relevant for contigous memory)

dxd::memory< scope_t >::operator uint64_t ( ) const
inlineinherited

IOKit physical address (only relevant for contigous memory)

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

operator to use mapping like pointer

dx::circular * dxd::map< scope_t, dx::circular >::operator-> ( )
inlineinherited
dxd::memory< scope_t >::operator::IOMemoryDescriptor * ( )
inlineinherited
dxd::memory< scope_t >::operator::IOMemoryDescriptor * ( )
inlineinherited
dxd::map< scope_t, dx::circular >::operator::IOMemoryMap * ( )
inlineinherited
dxd::spinlock::operator::KSPIN_LOCK & ( )
inlineinherited
dxd::spinlock::operator::KSPIN_LOCK * ( )
inlineinherited
dxd::memory< scope_t >::operator::MDL * ( ) const
inlineinherited
dxd::memory< scope_t >::operator::MDL * ( ) const
inlineinherited
template<typename reference_t >
int dxd::referenced::release ( reference_t &  reference)
inlineinherited
void dxd::referenced::retain ( )
inlineinherited

+ Here is the caller graph for this function:

template<typename channel_t = int>
void dxd::multichannel::stream< channel_t >::rx ( int64_t  timestamp)
inline

+ Here is the call graph for this function:

size_t dxd::memory< scope_t >::size ( ) const
inlineinherited

IOKit memory size.

size_t dxd::memory< scope_t >::size ( ) const
inlineinherited

IOKit memory size.

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

kernel mapping size

+ Here is the caller graph for this function:

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

Implemented in dxd::usb_stream::stream.

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

Implemented in dxd::usb_stream::stream.

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

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

kernel virtual address mapping

template<typename channel_t = int>
uint64_t dxd::multichannel::stream< channel_t >::advance =0
template<typename channel_t = int>
dxd::buffer<dx::user> dxd::multichannel::stream< channel_t >::buffer {sizeof(dx::stream::channel::control)}
union { ... } dxd::multichannel::stream< channel_t >::cache
template<typename channel_t = int>
unsigned int dxd::multichannel::stream< channel_t >::channels =0
protected

stream channels

struct { ... } dxd::multichannel::stream< channel_t >::control
template<typename channel_t = int>
dxd::multichannel::stream::in* dxd::multichannel::stream< channel_t >::in[2]
protected
template<typename channel_t = int>
channel_t** dxd::multichannel::stream< channel_t >::in[2]

in channel array [switch] [channels]

template<typename channel_t = int>
bool dxd::multichannel::stream< channel_t >::in
::IOMemoryMap* dxd::map< scope_t, dx::circular >::iokit_memory_map
protectedinherited
template<typename channel_t = int>
unsigned int dxd::multichannel::stream< channel_t >::iosize =0
template<typename channel_t = int>
dxd::map<dx::kernel,dx::stream::channel::control> dxd::multichannel::stream< channel_t >::map {buffer}
template<typename channel_t = int>
atomic<int> dxd::multichannel::stream< channel_t >::out =0
protected

client outs atached

template<typename channel_t = int>
channel_t* const* const* volatile dxd::multichannel::stream< channel_t >::out[2]

client out channel array [switch] [client] -> umap out channels [channels]

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

IOKit memory status.

status of memory object

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

IOKit memory status.

status of memory object

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

status of mapping object


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

(c) copyright 2009 dynamic acoustics e.U. generated on Tue Dec 4 2018

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.