mbgtools-lx  4.2.8
mbg_arch.h File Reference
#include <mbg_tgt.h>
#include <words.h>
#include <stdlib.h>
#include <asm/byteorder.h>

Go to the source code of this file.

Macros

#define MBG_ARCH_LITTLE_ENDIAN   1
 
#define _mbg_put_unaligned(_v, _p)   do { ((void)( *(_p) = (_v) )); } while ( 0 )
 
#define _mbg_get_unaligned(_p)   (*(_p))
 
#define __le16_to_cpu(_x)   (_x)
 
#define __le32_to_cpu(_x)   (_x)
 
#define __le64_to_cpu(_x)   (_x)
 
#define __cpu_to_le16(_x)   (_x)
 
#define __cpu_to_le32(_x)   (_x)
 
#define __cpu_to_le64(_x)   (_x)
 
#define _mbg8_to_cpu(_x)   ( _x )
 
#define _mbg16_to_cpu(_x)   __le16_to_cpu( _x )
 
#define _mbg32_to_cpu(_x)   __le32_to_cpu( _x )
 
#define _mbg64_to_cpu(_x)   __le64_to_cpu( _x )
 
#define _cpu_to_mbg8(_x)   ( _x )
 
#define _cpu_to_mbg16(_x)   __cpu_to_le16( _x )
 
#define _cpu_to_mbg32(_x)   __cpu_to_le32( _x )
 
#define _cpu_to_mbg64(_x)   __cpu_to_le64( _x )
 
#define _mbg_swab8(_p)   _nop_macro_fnc()
 
#define _mbg_swab16(_p)   _nop_macro_fnc()
 
#define _mbg_swab32(_p)   _nop_macro_fnc()
 
#define _mbg_swab64(_p)   _nop_macro_fnc()
 
#define _mbg_swab_double(_p)   _nop_macro_fnc()
 
#define _mbg_swab_doubles(_p, _n)   _nop_macro_fnc()
 
#define _mbg_swab_dummy(_x)   do { (void) _x; } while ( 0 )
 A placeholder for yet missing mbg_swab..() macros. More...
 

Functions

static __mbg_inline void mbg_swab_double (double *p)
 Swap a 'double' type variable bytewise e.g. to convert the endianess. More...
 

Macro Definition Documentation

◆ __cpu_to_le16

#define __cpu_to_le16 (   _x)    (_x)

Definition at line 102 of file mbg_arch.h.

◆ __cpu_to_le32

#define __cpu_to_le32 (   _x)    (_x)

Definition at line 106 of file mbg_arch.h.

◆ __cpu_to_le64

#define __cpu_to_le64 (   _x)    (_x)

Definition at line 110 of file mbg_arch.h.

◆ __le16_to_cpu

#define __le16_to_cpu (   _x)    (_x)

Definition at line 90 of file mbg_arch.h.

◆ __le32_to_cpu

#define __le32_to_cpu (   _x)    (_x)

Definition at line 94 of file mbg_arch.h.

◆ __le64_to_cpu

#define __le64_to_cpu (   _x)    (_x)

Definition at line 98 of file mbg_arch.h.

◆ _cpu_to_mbg16

#define _cpu_to_mbg16 (   _x)    __cpu_to_le16( _x )

Definition at line 124 of file mbg_arch.h.

◆ _cpu_to_mbg32

#define _cpu_to_mbg32 (   _x)    __cpu_to_le32( _x )

Definition at line 125 of file mbg_arch.h.

Referenced by report_io_cmd().

◆ _cpu_to_mbg64

#define _cpu_to_mbg64 (   _x)    __cpu_to_le64( _x )

Definition at line 126 of file mbg_arch.h.

◆ _cpu_to_mbg8

#define _cpu_to_mbg8 (   _x)    ( _x )

Definition at line 123 of file mbg_arch.h.

◆ _mbg16_to_cpu

#define _mbg16_to_cpu (   _x)    __le16_to_cpu( _x )

Definition at line 119 of file mbg_arch.h.

Referenced by pcps_init_gps_transfer().

◆ _mbg32_to_cpu

#define _mbg32_to_cpu (   _x)    __le32_to_cpu( _x )

Definition at line 120 of file mbg_arch.h.

◆ _mbg64_to_cpu

#define _mbg64_to_cpu (   _x)    __le64_to_cpu( _x )

Definition at line 121 of file mbg_arch.h.

◆ _mbg8_to_cpu

#define _mbg8_to_cpu (   _x)    ( _x )

Definition at line 118 of file mbg_arch.h.

◆ _mbg_get_unaligned

#define _mbg_get_unaligned (   _p)    (*(_p))

Definition at line 81 of file mbg_arch.h.

◆ _mbg_put_unaligned

#define _mbg_put_unaligned (   _v,
  _p 
)    do { ((void)( *(_p) = (_v) )); } while ( 0 )

Definition at line 77 of file mbg_arch.h.

Referenced by pcps_read_amcc_s5920(), and pcps_read_asic().

◆ _mbg_swab16

#define _mbg_swab16 (   _p)    _nop_macro_fnc()

Definition at line 173 of file mbg_arch.h.

Referenced by mbgextio_get_ignore_lock(), and mbgextio_set_ignore_lock().

◆ _mbg_swab32

#define _mbg_swab32 (   _p)    _nop_macro_fnc()

Definition at line 174 of file mbg_arch.h.

◆ _mbg_swab64

#define _mbg_swab64 (   _p)    _nop_macro_fnc()

Definition at line 175 of file mbg_arch.h.

◆ _mbg_swab8

#define _mbg_swab8 (   _p)    _nop_macro_fnc()

Definition at line 172 of file mbg_arch.h.

◆ _mbg_swab_double

#define _mbg_swab_double (   _p)    _nop_macro_fnc()

Definition at line 177 of file mbg_arch.h.

Referenced by mbg_set_gps_pos_lla(), mbg_set_gps_pos_xyz(), and mbgextio_set_pos_lla().

◆ _mbg_swab_doubles

#define _mbg_swab_doubles (   _p,
  _n 
)    _nop_macro_fnc()

Definition at line 179 of file mbg_arch.h.

◆ _mbg_swab_dummy

#define _mbg_swab_dummy (   _x)    do { (void) _x; } while ( 0 )

A placeholder for yet missing mbg_swab..() macros.

We don't just use the _nop_macro_fnc() macros here to avoid compiler warnings 'unused variable'.

Definition at line 192 of file mbg_arch.h.

Referenced by mbgextio_get_cfgh(), mbgextio_get_iono(), mbgextio_get_ptp_smpte_tlv_state(), and mbgextio_get_sv_alm().

◆ MBG_ARCH_LITTLE_ENDIAN

#define MBG_ARCH_LITTLE_ENDIAN   1

Definition at line 52 of file mbg_arch.h.

Function Documentation

◆ mbg_swab_double()

static __mbg_inline void mbg_swab_double ( double *  p)
static

Swap a 'double' type variable bytewise e.g. to convert the endianess.

Definition at line 134 of file mbg_arch.h.

References BYTE_OF.