mbgtools-lx  4.2.8
mbgddmsg.h File Reference
#include <mbg_tgt.h>
#include <linux/module.h>
#include <linux/version.h>
#include <str_util.h>

Go to the source code of this file.

Macros

#define _ext   extern
 
#define DEBUG_MSG_SLEEP   0
 
#define USE_MBG_KDD_MSG   1
 
#define _mbg_kdd_msg_0(_lvl, _fmt)   mbg_kdd_msg( _lvl, _fmt )
 
#define _mbg_kdd_msg_1(_lvl, _fmt, _p1)   mbg_kdd_msg( _lvl, _fmt, (_p1) )
 
#define _mbg_kdd_msg_2(_lvl, _fmt, _p1, _p2)   mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2) )
 
#define _mbg_kdd_msg_3(_lvl, _fmt, _p1, _p2, _p3)   mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3) )
 
#define _mbg_kdd_msg_4(_lvl, _fmt, _p1, _p2, _p3, _p4)   mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4) )
 
#define _mbg_kdd_msg_5(_lvl, _fmt, _p1, _p2, _p3, _p4, _p5)   mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5) )
 
#define _mbg_kdd_msg_6(_lvl, _fmt, _p1, _p2, _p3, _p4, _p5, _p6)   mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5), (_p6) )
 
#define _mbg_kdd_msg_7(_lvl, _fmt, _p1, _p2, _p3, _p4, _p5, _p6, _p7)   mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5), (_p6), (_p7) )
 
#define _mbg_kdd_msg_8(_lvl, _fmt, _p1, _p2, _p3, _p4, _p5, _p6, _p7, _p8)   mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5), (_p6), (_p7), (_p8) )
 
#define _mbgddmsg_0(_f, _lvl, _fmt)
 
#define _mbgddmsg_1(_f, _lvl, _fmt, _p1)
 
#define _mbgddmsg_2(_f, _lvl, _fmt, _p1, _p2)
 
#define _mbgddmsg_3(_f, _lvl, _fmt, _p1, _p2, _p3)
 
#define _mbgddmsg_4(_f, _lvl, _fmt, _p1, _p2, _p3, _p4)
 
#define _mbgddmsg_5(_f, _lvl, _fmt, _p1, _p2, _p3, _p4, _p5)
 
#define _mbgddmsg_6(_f, _lvl, _fmt, _p1, _p2, _p3, _p4, _p5, _p6)
 
#define _mbgddmsg_7(_f, _lvl, _fmt, _p1, _p2, _p3, _p4, _p5, _p6, _p7)
 
#define _mbgddmsg_8(_f, _lvl, _fmt, _p1, _p2, _p3, _p4, _p5, _p6, _p7, _p8)
 
#define MBG_LOG_FMT_ENTERING   "Entering \"%s\""
 
#define MBG_LOG_FMT_ENTERING_STR   MBG_LOG_FMT_ENTERING " %s"
 
#define MBG_LOG_FMT_LEAVING   "Leaving \"%s\""
 
#define MBG_LOG_FMT_LEAVING_STR   MBG_LOG_FMT_LEAVING " %s"
 
#define MBG_LOG_FMT_LEAVING_SUCCESS   MBG_LOG_FMT_LEAVING " success"
 
#define MBG_LOG_FMT_LEAVING_ERR   MBG_LOG_FMT_LEAVING " err"
 
#define MBG_LOG_FMT_LEAVING_ERR_MBG   MBG_LOG_FMT_LEAVING " err %i: %s"
 
#define MBG_LOG_FMT_LEAVING_ERR_DEC   MBG_LOG_FMT_LEAVING " err %li"
 
#define MBG_LOG_FMT_LEAVING_ERR_HEX   MBG_LOG_FMT_LEAVING " err 0x%08lX"
 
#define _mbgddmsg_fnc_entry()
 
#define _mbgddmsg_fnc_entry_str(_s)
 
#define _mbgddmsg_fnc_exit()
 
#define _mbgddmsg_fnc_exit_str(_s)
 
#define _mbgddmsg_fnc_exit_success()
 
#define _mbgddmsg_fnc_exit_err()
 
#define _mbgddmsg_fnc_exit_err_mbg(_mbg_errno)
 
#define _mbgddmsg_fnc_exit_err_dec(_errnum)
 
#define _mbgddmsg_fnc_exit_err_hex(_errnum)
 
#define _mbgddmsg_fnc_exit_chk_mbg_rc(_rc)
 
#define _mbgddmsg_fnc_exit_chk_rc(_rc)
 

Enumerations

enum  MBG_LOG_LEVELS {
  MBG_LOG_ERR, MBG_LOG_WARN, MBG_LOG_NOTICE, MBG_LOG_INFO,
  MBG_LOG_DEBUG, N_MBG_LOG_LVL
}
 

Functions

static __mbg_inline int mbg_kdd_vsnprintf (char *s, size_t max_len, const char *fmt, va_list args)
 
int mbg_kdd_snprintf (char *buf, size_t size, const char *fmt,...)
 
void mbg_kdd_msg (int lvl, const char *fmt,...)
 

Macro Definition Documentation

◆ _ext

#define _ext   extern

Definition at line 109 of file mbgddmsg.h.

◆ _mbg_kdd_msg_0

#define _mbg_kdd_msg_0 (   _lvl,
  _fmt 
)    mbg_kdd_msg( _lvl, _fmt )

◆ _mbg_kdd_msg_1

◆ _mbg_kdd_msg_2

◆ _mbg_kdd_msg_3

◆ _mbg_kdd_msg_4

#define _mbg_kdd_msg_4 (   _lvl,
  _fmt,
  _p1,
  _p2,
  _p3,
  _p4 
)    mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4) )

◆ _mbg_kdd_msg_5

#define _mbg_kdd_msg_5 (   _lvl,
  _fmt,
  _p1,
  _p2,
  _p3,
  _p4,
  _p5 
)    mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5) )

◆ _mbg_kdd_msg_6

#define _mbg_kdd_msg_6 (   _lvl,
  _fmt,
  _p1,
  _p2,
  _p3,
  _p4,
  _p5,
  _p6 
)    mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5), (_p6) )

Definition at line 251 of file mbgddmsg.h.

◆ _mbg_kdd_msg_7

#define _mbg_kdd_msg_7 (   _lvl,
  _fmt,
  _p1,
  _p2,
  _p3,
  _p4,
  _p5,
  _p6,
  _p7 
)    mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5), (_p6), (_p7) )

Definition at line 254 of file mbgddmsg.h.

Referenced by report_io_cmd().

◆ _mbg_kdd_msg_8

#define _mbg_kdd_msg_8 (   _lvl,
  _fmt,
  _p1,
  _p2,
  _p3,
  _p4,
  _p5,
  _p6,
  _p7,
  _p8 
)    mbg_kdd_msg( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5), (_p6), (_p7), (_p8) )

Definition at line 257 of file mbgddmsg.h.

◆ _mbgddmsg_0

#define _mbgddmsg_0 (   _f,
  _lvl,
  _fmt 
)
Value:
do { \
if ( (_f) ) \
{ _mbg_kdd_msg_0( _lvl, _fmt ); } \
} while ( 0 )
#define _mbg_kdd_msg_0(_lvl, _fmt)
Definition: mbgddmsg.h:233

Definition at line 312 of file mbgddmsg.h.

Referenced by ddev_list_free(), ioctl_switch(), mbgdrvr_disable_cyclic(), and pcps_alloc_ddev_struc().

◆ _mbgddmsg_1

#define _mbgddmsg_1 (   _f,
  _lvl,
  _fmt,
  _p1 
)

◆ _mbgddmsg_2

#define _mbgddmsg_2 (   _f,
  _lvl,
  _fmt,
  _p1,
  _p2 
)

◆ _mbgddmsg_3

#define _mbgddmsg_3 (   _f,
  _lvl,
  _fmt,
  _p1,
  _p2,
  _p3 
)
Value:
do { \
if ( (_f) ) \
{ _mbg_kdd_msg_3( _lvl, _fmt, (_p1), (_p2), (_p3) ); } \
} while ( 0 )
#define _mbg_kdd_msg_3(_lvl, _fmt, _p1, _p2, _p3)
Definition: mbgddmsg.h:242

Definition at line 330 of file mbgddmsg.h.

Referenced by ddev_list_locate_device(), ioctl_switch(), mbgclock_mmap(), mbgclock_open(), mbgclock_read(), pcps_probe_device(), report_ret_val(), rsrc_alloc_mem(), rsrc_alloc_ports(), and set_dev_connected().

◆ _mbgddmsg_4

#define _mbgddmsg_4 (   _f,
  _lvl,
  _fmt,
  _p1,
  _p2,
  _p3,
  _p4 
)
Value:
do { \
if ( (_f) ) \
{ _mbg_kdd_msg_4( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4) ); } \
} while ( 0 )
#define _mbg_kdd_msg_4(_lvl, _fmt, _p1, _p2, _p3, _p4)
Definition: mbgddmsg.h:245

Definition at line 336 of file mbgddmsg.h.

Referenced by ioctl_switch(), mbgclock_default_get_ucap_entries(), mbgclock_default_get_ucap_event(), mbgclock_mmap(), mbgclock_read(), mbgclock_release(), mbgdrvr_enable_cyclic(), mbgdrvr_get_pddev(), pcps_chk_dev_feat(), and release_cyclic_lock().

◆ _mbgddmsg_5

#define _mbgddmsg_5 (   _f,
  _lvl,
  _fmt,
  _p1,
  _p2,
  _p3,
  _p4,
  _p5 
)
Value:
do { \
if ( (_f) ) \
{ _mbg_kdd_msg_5( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5) ); } \
} while ( 0 )
#define _mbg_kdd_msg_5(_lvl, _fmt, _p1, _p2, _p3, _p4, _p5)
Definition: mbgddmsg.h:248

Definition at line 342 of file mbgddmsg.h.

Referenced by mbgclock_release(), mbgclock_unlocked_ioctl(), mbgdrvr_ioctl_emu_serial(), and pcps_chk_dev_feat().

◆ _mbgddmsg_6

#define _mbgddmsg_6 (   _f,
  _lvl,
  _fmt,
  _p1,
  _p2,
  _p3,
  _p4,
  _p5,
  _p6 
)
Value:
do { \
if ( (_f) ) \
{ _mbg_kdd_msg_6( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5), (_p6) ); } \
} while ( 0 )
#define _mbg_kdd_msg_6(_lvl, _fmt, _p1, _p2, _p3, _p4, _p5, _p6)
Definition: mbgddmsg.h:251

Definition at line 348 of file mbgddmsg.h.

Referenced by ioctl_switch(), and release_cyclic_lock().

◆ _mbgddmsg_7

#define _mbgddmsg_7 (   _f,
  _lvl,
  _fmt,
  _p1,
  _p2,
  _p3,
  _p4,
  _p5,
  _p6,
  _p7 
)
Value:
do { \
if ( (_f) ) \
{ _mbg_kdd_msg_7( _f, _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5), (_p6), (_p7) ); } \
} while ( 0 )
#define _mbg_kdd_msg_7(_lvl, _fmt, _p1, _p2, _p3, _p4, _p5, _p6, _p7)
Definition: mbgddmsg.h:254

Definition at line 354 of file mbgddmsg.h.

◆ _mbgddmsg_8

#define _mbgddmsg_8 (   _f,
  _lvl,
  _fmt,
  _p1,
  _p2,
  _p3,
  _p4,
  _p5,
  _p6,
  _p7,
  _p8 
)
Value:
do { \
if ( (_f) ) \
{ _mbg_kdd_msg_8( _lvl, _fmt, (_p1), (_p2), (_p3), (_p4), (_p5), (_p6), (_p7), (_p8) ); } \
} while ( 0 )
#define _mbg_kdd_msg_8(_lvl, _fmt, _p1, _p2, _p3, _p4, _p5, _p6, _p7, _p8)
Definition: mbgddmsg.h:257

Definition at line 360 of file mbgddmsg.h.

◆ _mbgddmsg_fnc_entry

◆ _mbgddmsg_fnc_entry_str

#define _mbgddmsg_fnc_entry_str (   _s)
Value:
__func__, (_s) )
void mbg_kdd_msg(int lvl, const char *fmt,...)
#define MBG_LOG_FMT_ENTERING_STR
Definition: mbgddmsg.h:385

Definition at line 403 of file mbgddmsg.h.

◆ _mbgddmsg_fnc_exit

#define _mbgddmsg_fnc_exit ( )

◆ _mbgddmsg_fnc_exit_chk_mbg_rc

#define _mbgddmsg_fnc_exit_chk_mbg_rc (   _rc)
Value:
do \
{ \
if ( mbg_rc_is_success( _rc ) ) \
_mbgddmsg_fnc_exit_success(); \
} while ( 0 )
#define mbg_rc_is_success(_rc)
Definition: mbgerror.h:618
#define _mbgddmsg_fnc_exit_err_mbg(_mbg_errno)
Definition: mbgddmsg.h:424

Definition at line 437 of file mbgddmsg.h.

Referenced by pcps_alloc_ddev_struc(), and pcps_init_ddev().

◆ _mbgddmsg_fnc_exit_chk_rc

#define _mbgddmsg_fnc_exit_chk_rc (   _rc)
Value:
do \
{ \
if ( mbg_rc_is_success( _rc ) ) \
_mbgddmsg_fnc_exit_success(); \
} while ( 0 )
#define mbg_rc_is_success(_rc)
Definition: mbgerror.h:618
#define _mbgddmsg_fnc_exit_err_dec(_errnum)
Definition: mbgddmsg.h:428

Definition at line 446 of file mbgddmsg.h.

◆ _mbgddmsg_fnc_exit_err

#define _mbgddmsg_fnc_exit_err ( )
Value:
__func__ )
void mbg_kdd_msg(int lvl, const char *fmt,...)
#define MBG_LOG_FMT_LEAVING_ERR
Definition: mbgddmsg.h:390

Definition at line 419 of file mbgddmsg.h.

Referenced by pcps_add_rsrc_irq().

◆ _mbgddmsg_fnc_exit_err_dec

#define _mbgddmsg_fnc_exit_err_dec (   _errnum)
Value:
__func__, (long) (_errnum) )
void mbg_kdd_msg(int lvl, const char *fmt,...)
#define MBG_LOG_FMT_LEAVING_ERR_DEC
Definition: mbgddmsg.h:392

Definition at line 428 of file mbgddmsg.h.

Referenced by mbgclock_default_clr_ucap_buff(), mbgclock_default_get_ucap_entries(), mbgclock_default_get_ucap_event(), and mbgclock_init_module().

◆ _mbgddmsg_fnc_exit_err_hex

#define _mbgddmsg_fnc_exit_err_hex (   _errnum)
Value:
__func__, (ulong) (_errnum) )
#define MBG_LOG_FMT_LEAVING_ERR_HEX
Definition: mbgddmsg.h:393
void mbg_kdd_msg(int lvl, const char *fmt,...)
unsigned long ulong
Definition: words.h:292

Definition at line 432 of file mbgddmsg.h.

◆ _mbgddmsg_fnc_exit_err_mbg

#define _mbgddmsg_fnc_exit_err_mbg (   _mbg_errno)
Value:
__func__, _mbg_errno, mbg_strerror( _mbg_errno ) )
void mbg_kdd_msg(int lvl, const char *fmt,...)
#define MBG_LOG_FMT_LEAVING_ERR_MBG
Definition: mbgddmsg.h:391
const char * mbg_strerror(int mbg_errno)
Return an error string associated with the MBG_ERROR_CODES.
Definition: mbgerror.c:685

Definition at line 424 of file mbgddmsg.h.

◆ _mbgddmsg_fnc_exit_str

#define _mbgddmsg_fnc_exit_str (   _s)
Value:
__func__, (_s) )
#define MBG_LOG_FMT_LEAVING_STR
Definition: mbgddmsg.h:388
void mbg_kdd_msg(int lvl, const char *fmt,...)

Definition at line 411 of file mbgddmsg.h.

◆ _mbgddmsg_fnc_exit_success

#define _mbgddmsg_fnc_exit_success ( )
Value:
__func__ )
#define MBG_LOG_FMT_LEAVING_SUCCESS
Definition: mbgddmsg.h:389
void mbg_kdd_msg(int lvl, const char *fmt,...)

Definition at line 415 of file mbgddmsg.h.

Referenced by mbgclock_init_module(), and pcps_add_rsrc_irq().

◆ DEBUG_MSG_SLEEP

#define DEBUG_MSG_SLEEP   0

Definition at line 125 of file mbgddmsg.h.

◆ MBG_LOG_FMT_ENTERING

#define MBG_LOG_FMT_ENTERING   "Entering \"%s\""

Definition at line 384 of file mbgddmsg.h.

◆ MBG_LOG_FMT_ENTERING_STR

#define MBG_LOG_FMT_ENTERING_STR   MBG_LOG_FMT_ENTERING " %s"

Definition at line 385 of file mbgddmsg.h.

◆ MBG_LOG_FMT_LEAVING

#define MBG_LOG_FMT_LEAVING   "Leaving \"%s\""

◆ MBG_LOG_FMT_LEAVING_ERR

#define MBG_LOG_FMT_LEAVING_ERR   MBG_LOG_FMT_LEAVING " err"

Definition at line 390 of file mbgddmsg.h.

◆ MBG_LOG_FMT_LEAVING_ERR_DEC

#define MBG_LOG_FMT_LEAVING_ERR_DEC   MBG_LOG_FMT_LEAVING " err %li"

Definition at line 392 of file mbgddmsg.h.

◆ MBG_LOG_FMT_LEAVING_ERR_HEX

#define MBG_LOG_FMT_LEAVING_ERR_HEX   MBG_LOG_FMT_LEAVING " err 0x%08lX"

Definition at line 393 of file mbgddmsg.h.

◆ MBG_LOG_FMT_LEAVING_ERR_MBG

#define MBG_LOG_FMT_LEAVING_ERR_MBG   MBG_LOG_FMT_LEAVING " err %i: %s"

Definition at line 391 of file mbgddmsg.h.

◆ MBG_LOG_FMT_LEAVING_STR

#define MBG_LOG_FMT_LEAVING_STR   MBG_LOG_FMT_LEAVING " %s"

Definition at line 388 of file mbgddmsg.h.

◆ MBG_LOG_FMT_LEAVING_SUCCESS

#define MBG_LOG_FMT_LEAVING_SUCCESS   MBG_LOG_FMT_LEAVING " success"

Definition at line 389 of file mbgddmsg.h.

◆ USE_MBG_KDD_MSG

#define USE_MBG_KDD_MSG   1

Definition at line 143 of file mbgddmsg.h.

Enumeration Type Documentation

◆ MBG_LOG_LEVELS

Enumerator
MBG_LOG_ERR 
MBG_LOG_WARN 
MBG_LOG_NOTICE 
MBG_LOG_INFO 
MBG_LOG_DEBUG 
N_MBG_LOG_LVL 

Definition at line 220 of file mbgddmsg.h.

Function Documentation

◆ mbg_kdd_msg()

◆ mbg_kdd_snprintf()

int mbg_kdd_snprintf ( char *  buf,
size_t  size,
const char *  fmt,
  ... 
)

◆ mbg_kdd_vsnprintf()

static __mbg_inline int mbg_kdd_vsnprintf ( char *  s,
size_t  max_len,
const char *  fmt,
va_list  args 
)
static