AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ntv2macdriverinterface.cpp File Reference
#include "ntv2macdriverinterface.h"
#include "ntv2nubaccess.h"
#include "ntv2utils.h"
#include <time.h>
#include <syslog.h>
#include <iostream>
#include <sstream>
#include <string>
#include <map>
#include <iomanip>
#include "ntv2devicefeatures.h"
#include "ajabase/system/lock.h"
#include "ajabase/system/debug.h"
#include "ajabase/system/atomic.h"
#include "ajabase/system/systemtime.h"
#include <mach/mach.h>
Include dependency graph for ntv2macdriverinterface.cpp:

Go to the source code of this file.

Macros

#define HEX2(__x__)   xHEX0N(0xFF & uint8_t (__x__),2)
 
#define HEX4(__x__)   xHEX0N(0xFFFF & uint16_t(__x__),4)
 
#define HEX8(__x__)   xHEX0N(0xFFFFFFFF & uint32_t(__x__),8)
 
#define HEX16(__x__)   xHEX0N(uint64_t(__x__),16)
 
#define KR(_kr_)   "kernResult=" << HEX8(_kr_) << "(" << GetKernErrStr(_kr_) << ")"
 
#define INSTP(_p_)   HEX0N(uint64_t(_p_),16)
 
#define DIFAIL(__x__)   AJA_sERROR (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
 
#define DIWARN(__x__)   AJA_sWARNING(AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
 
#define DINOTE(__x__)   AJA_sNOTICE (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
 
#define DIINFO(__x__)   AJA_sINFO (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
 
#define DIDBG(__x__)   AJA_sDEBUG (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
 
#define MDIFAIL(__x__)   AJA_sERROR (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)
 
#define MDIWARN(__x__)   AJA_sWARNING(AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)
 
#define MDINOTE(__x__)   AJA_sNOTICE (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)
 
#define MDIINFO(__x__)   AJA_sINFO (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)
 
#define MDIDBG(__x__)   AJA_sDEBUG (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)
 
#define OS_IOMasterPort(_x_, _y_)   ::IOMasterPort ((_x_), (_y_))
 
#define OS_IOServiceOpen(_w_, _x_, _y_, _z_)   ::IOServiceOpen((_w_), (_x_), (_y_), (_z_))
 
#define OS_IOServiceClose(_x_)   ::IOServiceClose ((_x_))
 
#define OS_IOServiceMatching(_x_)   ::IOServiceMatching ((_x_))
 
#define OS_IOServiceNameMatching(_x_)   ::IOServiceNameMatching((_x_))
 
#define OS_IOServiceGetMatchingServices(_x_, _y_, _z_)   ::IOServiceGetMatchingServices ((_x_), (_y_), (_z_))
 
#define OS_IOIteratorNext(_x_)   ::IOIteratorNext ((_x_))
 
#define OS_IOObjectRelease(_x_)   ::IOObjectRelease ((_x_))
 
#define OS_IORegistryEntryCreateCFProperty(_w_, _x_, _y_, _z_)   ::IORegistryEntryCreateCFProperty ((_w_), (_x_), (_y_), (_z_))
 
#define OS_IOConnectCallMethod(_q_, _r_, _s_, _t_, _u_, _v_, _w_, _x_, _y_, _z_)   ::IOConnectCallMethod ((_q_), (_r_), (_s_), (_t_), (_u_), (_v_), (_w_), (_x_), (_y_), (_z_))
 
#define OS_IOConnectCallScalarMethod(_u_, _v_, _w_, _x_, _y_, _z_)   ::IOConnectCallScalarMethod ((_u_), (_v_), (_w_), (_x_), (_y_), (_z_))
 
#define OS_IOConnectCallStructMethod(_u_, _v_, _w_, _x_, _y_, _z_)   ::IOConnectCallStructMethod ((_u_), (_v_), (_w_), (_x_), (_y_), (_z_))
 
#define OS_IOConnectMapMemory(_u_, _v_, _w_, _x_, _y_, _z_)   ::IOConnectMapMemory ((_u_), (_v_), (_w_), (_x_), (_y_), (_z_))
 
#define OS_IOKitGetBusyState(_x_, _y_)   ::IOKitGetBusyState ((_x_), (_y_))
 
#define OS_IOKitWaitQuiet(_x_, _y_)   ::IOKitWaitQuiet ((_x_), (_y_))
 

Functions

static const char * GetKernErrStr (const kern_return_t inError)
 
static const string sNTV2PCIKEXTClassName ("com_aja_iokit_ntv2")
 
static const string sNTV2PCIDEXTName ("NTV2PCIe")
 

Variables

static AJALock gLegalDevIDsLock
 
static NTV2DeviceIDSet gLegalDeviceIDs
 
static const uint32_t sIntEnumToStatKeys []
 

Macro Definition Documentation

◆ DIDBG

#define DIDBG (   __x__)    AJA_sDEBUG (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)

Definition at line 54 of file ntv2macdriverinterface.cpp.

◆ DIFAIL

#define DIFAIL (   __x__)    AJA_sERROR (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)

Definition at line 50 of file ntv2macdriverinterface.cpp.

◆ DIINFO

#define DIINFO (   __x__)    AJA_sINFO (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)

Definition at line 53 of file ntv2macdriverinterface.cpp.

◆ DINOTE

#define DINOTE (   __x__)    AJA_sNOTICE (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)

Definition at line 52 of file ntv2macdriverinterface.cpp.

◆ DIWARN

#define DIWARN (   __x__)    AJA_sWARNING(AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)

Definition at line 51 of file ntv2macdriverinterface.cpp.

◆ HEX16

#define HEX16 (   __x__)    xHEX0N(uint64_t(__x__),16)

Definition at line 46 of file ntv2macdriverinterface.cpp.

◆ HEX2

#define HEX2 (   __x__)    xHEX0N(0xFF & uint8_t (__x__),2)

Definition at line 43 of file ntv2macdriverinterface.cpp.

◆ HEX4

#define HEX4 (   __x__)    xHEX0N(0xFFFF & uint16_t(__x__),4)

Definition at line 44 of file ntv2macdriverinterface.cpp.

◆ HEX8

#define HEX8 (   __x__)    xHEX0N(0xFFFFFFFF & uint32_t(__x__),8)

Definition at line 45 of file ntv2macdriverinterface.cpp.

◆ INSTP

#define INSTP (   _p_)    HEX0N(uint64_t(_p_),16)

Definition at line 48 of file ntv2macdriverinterface.cpp.

◆ KR

#define KR (   _kr_)    "kernResult=" << HEX8(_kr_) << "(" << GetKernErrStr(_kr_) << ")"

Definition at line 47 of file ntv2macdriverinterface.cpp.

◆ MDIDBG

#define MDIDBG (   __x__)    AJA_sDEBUG (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)

Definition at line 60 of file ntv2macdriverinterface.cpp.

◆ MDIFAIL

#define MDIFAIL (   __x__)    AJA_sERROR (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)

Definition at line 56 of file ntv2macdriverinterface.cpp.

◆ MDIINFO

#define MDIINFO (   __x__)    AJA_sINFO (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)

Definition at line 59 of file ntv2macdriverinterface.cpp.

◆ MDINOTE

#define MDINOTE (   __x__)    AJA_sNOTICE (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)

Definition at line 58 of file ntv2macdriverinterface.cpp.

◆ MDIWARN

#define MDIWARN (   __x__)    AJA_sWARNING(AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)

Definition at line 57 of file ntv2macdriverinterface.cpp.

◆ OS_IOConnectCallMethod

#define OS_IOConnectCallMethod (   _q_,
  _r_,
  _s_,
  _t_,
  _u_,
  _v_,
  _w_,
  _x_,
  _y_,
  _z_ 
)    ::IOConnectCallMethod ((_q_), (_r_), (_s_), (_t_), (_u_), (_v_), (_w_), (_x_), (_y_), (_z_))

Definition at line 74 of file ntv2macdriverinterface.cpp.

◆ OS_IOConnectCallScalarMethod

#define OS_IOConnectCallScalarMethod (   _u_,
  _v_,
  _w_,
  _x_,
  _y_,
  _z_ 
)    ::IOConnectCallScalarMethod ((_u_), (_v_), (_w_), (_x_), (_y_), (_z_))

Definition at line 75 of file ntv2macdriverinterface.cpp.

◆ OS_IOConnectCallStructMethod

#define OS_IOConnectCallStructMethod (   _u_,
  _v_,
  _w_,
  _x_,
  _y_,
  _z_ 
)    ::IOConnectCallStructMethod ((_u_), (_v_), (_w_), (_x_), (_y_), (_z_))

Definition at line 76 of file ntv2macdriverinterface.cpp.

◆ OS_IOConnectMapMemory

#define OS_IOConnectMapMemory (   _u_,
  _v_,
  _w_,
  _x_,
  _y_,
  _z_ 
)    ::IOConnectMapMemory ((_u_), (_v_), (_w_), (_x_), (_y_), (_z_))

Definition at line 77 of file ntv2macdriverinterface.cpp.

◆ OS_IOIteratorNext

#define OS_IOIteratorNext (   _x_)    ::IOIteratorNext ((_x_))

Definition at line 71 of file ntv2macdriverinterface.cpp.

◆ OS_IOKitGetBusyState

#define OS_IOKitGetBusyState (   _x_,
  _y_ 
)    ::IOKitGetBusyState ((_x_), (_y_))

Definition at line 78 of file ntv2macdriverinterface.cpp.

◆ OS_IOKitWaitQuiet

#define OS_IOKitWaitQuiet (   _x_,
  _y_ 
)    ::IOKitWaitQuiet ((_x_), (_y_))

Definition at line 79 of file ntv2macdriverinterface.cpp.

◆ OS_IOMasterPort

#define OS_IOMasterPort (   _x_,
  _y_ 
)    ::IOMasterPort ((_x_), (_y_))

Definition at line 65 of file ntv2macdriverinterface.cpp.

◆ OS_IOObjectRelease

#define OS_IOObjectRelease (   _x_)    ::IOObjectRelease ((_x_))

Definition at line 72 of file ntv2macdriverinterface.cpp.

◆ OS_IORegistryEntryCreateCFProperty

#define OS_IORegistryEntryCreateCFProperty (   _w_,
  _x_,
  _y_,
  _z_ 
)    ::IORegistryEntryCreateCFProperty ((_w_), (_x_), (_y_), (_z_))

Definition at line 73 of file ntv2macdriverinterface.cpp.

◆ OS_IOServiceClose

#define OS_IOServiceClose (   _x_)    ::IOServiceClose ((_x_))

Definition at line 67 of file ntv2macdriverinterface.cpp.

◆ OS_IOServiceGetMatchingServices

#define OS_IOServiceGetMatchingServices (   _x_,
  _y_,
  _z_ 
)    ::IOServiceGetMatchingServices ((_x_), (_y_), (_z_))

Definition at line 70 of file ntv2macdriverinterface.cpp.

◆ OS_IOServiceMatching

#define OS_IOServiceMatching (   _x_)    ::IOServiceMatching ((_x_))

Definition at line 68 of file ntv2macdriverinterface.cpp.

◆ OS_IOServiceNameMatching

#define OS_IOServiceNameMatching (   _x_)    ::IOServiceNameMatching((_x_))

Definition at line 69 of file ntv2macdriverinterface.cpp.

◆ OS_IOServiceOpen

#define OS_IOServiceOpen (   _w_,
  _x_,
  _y_,
  _z_ 
)    ::IOServiceOpen((_w_), (_x_), (_y_), (_z_))

Definition at line 66 of file ntv2macdriverinterface.cpp.

Function Documentation

◆ GetKernErrStr()

static const char * GetKernErrStr ( const kern_return_t  inError)
static

Definition at line 1718 of file ntv2macdriverinterface.cpp.

◆ sNTV2PCIDEXTName()

static const string sNTV2PCIDEXTName ( "NTV2PCIe"  )
static

◆ sNTV2PCIKEXTClassName()

static const string sNTV2PCIKEXTClassName ( "com_aja_iokit_ntv2"  )
static

Variable Documentation

◆ gLegalDeviceIDs

NTV2DeviceIDSet gLegalDeviceIDs
static

Definition at line 36 of file ntv2macdriverinterface.cpp.

◆ gLegalDevIDsLock

AJALock gLegalDevIDsLock
static

Definition at line 35 of file ntv2macdriverinterface.cpp.

◆ sIntEnumToStatKeys

const uint32_t sIntEnumToStatKeys[]
static
Initial value:

Definition at line 989 of file ntv2macdriverinterface.cpp.

AJA_DebugStat_WaitForInterruptOthers
@ AJA_DebugStat_WaitForInterruptOthers
Definition: debugshare.h:239
AJA_DebugStat_WaitForInterruptIn2
@ AJA_DebugStat_WaitForInterruptIn2
Definition: debugshare.h:227
AJA_DebugStat_WaitForInterruptIn8
@ AJA_DebugStat_WaitForInterruptIn8
Definition: debugshare.h:233
AJA_DebugStat_WaitForInterruptUartTx1
@ AJA_DebugStat_WaitForInterruptUartTx1
Definition: debugshare.h:236
AJA_DebugStat_WaitForInterruptUartTx2
@ AJA_DebugStat_WaitForInterruptUartTx2
Definition: debugshare.h:238
AJA_DebugStat_WaitForInterruptUartRx2
@ AJA_DebugStat_WaitForInterruptUartRx2
Definition: debugshare.h:237
AJA_DebugStat_WaitForInterruptIn7
@ AJA_DebugStat_WaitForInterruptIn7
Definition: debugshare.h:232
AJA_DebugStat_WaitForInterruptIn6
@ AJA_DebugStat_WaitForInterruptIn6
Definition: debugshare.h:231
AJA_DebugStat_WaitForInterruptUartRx1
@ AJA_DebugStat_WaitForInterruptUartRx1
Definition: debugshare.h:235
AJA_DebugStat_WaitForInterruptOut1
@ AJA_DebugStat_WaitForInterruptOut1
Definition: debugshare.h:234
AJA_DebugStat_WaitForInterruptIn1
@ AJA_DebugStat_WaitForInterruptIn1
Definition: debugshare.h:226
AJA_DebugStat_WaitForInterruptIn3
@ AJA_DebugStat_WaitForInterruptIn3
Definition: debugshare.h:228
AJA_DebugStat_WaitForInterruptIn4
@ AJA_DebugStat_WaitForInterruptIn4
Definition: debugshare.h:229
AJA_DebugStat_WaitForInterruptIn5
@ AJA_DebugStat_WaitForInterruptIn5
Definition: debugshare.h:230