RTEMS: Status Checks

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Status Checks
API

## 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. The return value variable rv will be set to a negative sc in this case.
#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. The status code variable sc will be set to RTEMS_IO_ERROR in this case.
#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.

## Detailed Description

## Macro Definition Documentation

## ◆ RTEMS_CHECK_RV

#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); \
}
msg
Definition: b1553brm.c:75

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

## ◆ RTEMS_CHECK_RV_SC

#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); \
}
RTEMS_IO_ERROR
@ RTEMS_IO_ERROR
Definition: status.h:168

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

## ◆ RTEMS_CHECK_RV_TASK

#define RTEMS_CHECK_RV_TASK | ( |  | rv,
|  |  | msg
| ) |  |

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

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

## ◆ RTEMS_CHECK_RV_VOID

#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.

## ◆ RTEMS_CHECK_SC

#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); \
}
rtems_status_code
rtems_status_code
Classic API Status.
Definition: status.h:43
RTEMS_SUCCESSFUL
@ RTEMS_SUCCESSFUL
Definition: status.h:47

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

## ◆ RTEMS_CHECK_SC_RV

#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.

## ◆ RTEMS_CHECK_SC_TASK

#define RTEMS_CHECK_SC_TASK | ( |  | sc,
|  |  | msg
| ) |  |

Value:
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
rtems_task_exit(); \
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.

## ◆ RTEMS_CHECK_SC_VOID

#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.

## ◆ RTEMS_CLEANUP_RV

#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.

## ◆ RTEMS_CLEANUP_RV_SC

#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.

## ◆ RTEMS_CLEANUP_SC

#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.

## ◆ RTEMS_CLEANUP_SC_RV

#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.

## ◆ RTEMS_DO_CLEANUP

#define RTEMS_DO_CLEANUP | ( |  | label,
|  |  | msg
| ) |  |

Value:
do { \
RTEMS_SYSLOG_ERROR( msg); \
goto label; \
} while (0)

Prints message msg and jumps to label.

## ◆ RTEMS_DO_CLEANUP_RV

#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.

## ◆ RTEMS_DO_CLEANUP_SC

#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.

## ◆ RTEMS_SYSLOG_ERROR_RV

#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.

## ◆ RTEMS_SYSLOG_ERROR_SC

#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.

## ◆ RTEMS_SYSLOG_WARNING_SC

#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.