RTEMS CPU Kit with SuperCore  4.10.99.0
Status Checks

Print Macros

#define RTEMS_DEBUG_PRINT(fmt,...)
 General purpose debug print macro.
#define RTEMS_DEBUG_OK(msg)   RTEMS_DEBUG_PRINT( "Ok: %s\n", msg)
 Macro to print debug messages for successful operations.
#define RTEMS_SYSLOG_PRINT(fmt,...)   printf( fmt, ##__VA_ARGS__)
 General purpose system log print macro.
#define RTEMS_SYSLOG(fmt,...)   RTEMS_SYSLOG_PRINT( "%s: " fmt, __func__, ##__VA_ARGS__)
 General purpose system log macro.
#define RTEMS_SYSLOG_WARNING(fmt,...)   RTEMS_SYSLOG( "Warning: " fmt, ##__VA_ARGS__)
 General purpose system log macro for warnings.
#define RTEMS_SYSLOG_WARNING_SC(sc, msg)
 Macro to generate a system log warning message if the status code sc is not equal to RTEMS_SUCCESSFUL.
#define RTEMS_SYSLOG_ERROR(fmt,...)   RTEMS_SYSLOG( "Error: " fmt, ##__VA_ARGS__)
 General purpose system log macro for errors.
#define RTEMS_SYSLOG_ERROR_WITH_SC(sc, msg)   RTEMS_SYSLOG_ERROR( "SC = %i: %s\n", (int) sc, msg);
 Macro for system log error messages with status code.
#define RTEMS_SYSLOG_ERROR_WITH_RV(rv, msg)   RTEMS_SYSLOG_ERROR( "RV = %i: %s\n", (int) rv, msg);
 Macro for system log error messages with return value.
#define RTEMS_SYSLOG_ERROR_SC(sc, msg)
 Macro to generate a system log error message if the status code sc is not equal to RTEMS_SUCCESSFUL.
#define RTEMS_SYSLOG_ERROR_RV(rv, msg)
 Macro to generate a system log error message if the return value rv is less than zero.

Check Macros

#define RTEMS_CHECK_SC(sc, msg)
 Prints message msg and returns with status code sc if the status code sc is not equal to RTEMS_SUCCESSFUL.
#define RTEMS_CHECK_SC_RV(sc, msg)
 Prints message msg and returns with a return value of negative sc if the status code sc is not equal to RTEMS_SUCCESSFUL.
#define RTEMS_CHECK_SC_VOID(sc, msg)
 Prints message msg and returns if the status code sc is not equal to RTEMS_SUCCESSFUL.
#define RTEMS_CHECK_SC_TASK(sc, msg)
 Prints message msg and delete the current task if the status code sc is not equal to RTEMS_SUCCESSFUL.
#define RTEMS_CHECK_RV(rv, msg)
 Prints message msg and returns with a return value rv if the return value rv is less than zero.
#define RTEMS_CHECK_RV_SC(rv, msg)
 Prints message msg and returns with status code RTEMS_IO_ERROR if the return value rv is less than zero.
#define RTEMS_CHECK_RV_VOID(rv, msg)
 Prints message msg and returns if the return value rv is less than zero.
#define RTEMS_CHECK_RV_TASK(rv, msg)
 Prints message msg and delete the current task if the return value rv is less than zero.

Cleanup Macros

#define RTEMS_CLEANUP_SC(sc, label, msg)
 Prints message msg and jumps to label if the status code sc is not equal to RTEMS_SUCCESSFUL.
#define RTEMS_CLEANUP_SC_RV(sc, rv, label, msg)
 Prints message msg and jumps to label if the status code sc is not equal to RTEMS_SUCCESSFUL.
#define RTEMS_CLEANUP_RV(rv, label, msg)
 Prints message msg and jumps to label if the return value rv is less than zero.
#define RTEMS_CLEANUP_RV_SC(rv, sc, label, msg)
 Prints message msg and jumps to label if the return value rv is less than zero.
#define RTEMS_DO_CLEANUP(label, msg)
 Prints message msg and jumps to label.
#define RTEMS_DO_CLEANUP_SC(val, sc, label, msg)
 Prints message msg, sets the status code variable sc to val and jumps to label.
#define RTEMS_DO_CLEANUP_RV(val, rv, label, msg)
 Prints message msg, sets the return value variable rv to val and jumps to label.

Define Documentation

#define RTEMS_CHECK_RV (   rv,
  msg 
)
Value:
if ((int) (rv) < 0) { \
    RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
    return (int) rv; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and returns with a return value rv if the return value rv is less than zero.

#define RTEMS_CHECK_RV_SC (   rv,
  msg 
)
Value:
if ((int) (rv) < 0) { \
    RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
    return RTEMS_IO_ERROR; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and returns with status code RTEMS_IO_ERROR if the return value rv is less than zero.

#define RTEMS_CHECK_RV_TASK (   rv,
  msg 
)
Value:
if ((int) (rv) < 0) { \
    RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
    (void) rtems_task_delete( RTEMS_SELF); \
    return; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and delete the current task if the return value rv is less than zero.

#define RTEMS_CHECK_RV_VOID (   rv,
  msg 
)
Value:
if ((int) (rv) < 0) { \
    RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
    return; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and returns if the return value rv is less than zero.

#define RTEMS_CHECK_SC (   sc,
  msg 
)
Value:
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
    RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
    return (rtems_status_code) sc; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and returns with status code sc if the status code sc is not equal to RTEMS_SUCCESSFUL.

#define RTEMS_CHECK_SC_RV (   sc,
  msg 
)
Value:
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
    RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
    return -((int) (sc)); \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and returns with a return value of negative sc if the status code sc is not equal to RTEMS_SUCCESSFUL.

#define RTEMS_CHECK_SC_TASK (   sc,
  msg 
)
Value:
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
    RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
    (void) rtems_task_delete( RTEMS_SELF); \
    return; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and delete the current task if the status code sc is not equal to RTEMS_SUCCESSFUL.

#define RTEMS_CHECK_SC_VOID (   sc,
  msg 
)
Value:
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
    RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
    return; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and returns if the status code sc is not equal to RTEMS_SUCCESSFUL.

#define RTEMS_CLEANUP_RV (   rv,
  label,
  msg 
)
Value:
if ((int) (rv) < 0) { \
    RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
    goto label; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and jumps to label if the return value rv is less than zero.

#define RTEMS_CLEANUP_RV_SC (   rv,
  sc,
  label,
  msg 
)
Value:
if ((int) (rv) < 0) { \
    RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
    sc = RTEMS_IO_ERROR; \
    goto label; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and jumps to label if the return value rv is less than zero.

The status code variable sc will be set to RTEMS_IO_ERROR in this case.

#define RTEMS_CLEANUP_SC (   sc,
  label,
  msg 
)
Value:
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
    RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
    goto label; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and jumps to label if the status code sc is not equal to RTEMS_SUCCESSFUL.

#define RTEMS_CLEANUP_SC_RV (   sc,
  rv,
  label,
  msg 
)
Value:
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
    RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
    rv = -((int) (sc)); \
    goto label; \
  } else { \
    RTEMS_DEBUG_OK( msg); \
  }

Prints message msg and jumps to label if the status code sc is not equal to RTEMS_SUCCESSFUL.

The return value variable rv will be set to a negative sc in this case.

#define RTEMS_DO_CLEANUP (   label,
  msg 
)
Value:
do { \
    RTEMS_SYSLOG_ERROR( msg); \
    goto label; \
  } while (0)

Prints message msg and jumps to label.

#define RTEMS_DO_CLEANUP_RV (   val,
  rv,
  label,
  msg 
)
Value:
do { \
    rv = (int) val; \
    RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
    goto label; \
  } while (0)

Prints message msg, sets the return value variable rv to val and jumps to label.

#define RTEMS_DO_CLEANUP_SC (   val,
  sc,
  label,
  msg 
)
Value:
do { \
    sc = (rtems_status_code) val; \
    RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
    goto label; \
  } while (0)

Prints message msg, sets the status code variable sc to val and jumps to label.

#define RTEMS_SYSLOG_ERROR_RV (   rv,
  msg 
)
Value:
if ((int) (rv) < 0) { \
    RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
  }

Macro to generate a system log error message if the return value rv is less than zero.

#define RTEMS_SYSLOG_ERROR_SC (   sc,
  msg 
)
Value:
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
    RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
  }

Macro to generate a system log error message if the status code sc is not equal to RTEMS_SUCCESSFUL.

#define RTEMS_SYSLOG_WARNING_SC (   sc,
  msg 
)
Value:
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
    RTEMS_SYSLOG_WARNING( "SC = %i: %s\n", (int) sc, msg); \
  }

Macro to generate a system log warning message if the status code sc is not equal to RTEMS_SUCCESSFUL.