xil_assert.h File Reference


Defines

#define Xil_AssertVoid(Expression)
#define Xil_AssertNonvoid(Expression)
#define Xil_AssertVoidAlways()
#define Xil_AssertNonvoidAlways()

Typedefs

typedef void(* Xil_AssertCallback )(const char *File, int Line)

Functions

void Xil_Assert (const char *, int)
void XNullHandler (void *NullParameter)
void Xil_AssertSetCallback (Xil_AssertCallback Routine)

Variables

unsigned int Xil_AssertStatus

Detailed Description

This file contains assert related functions.

 MODIFICATION HISTORY:

 Ver   Who    Date   Changes
 ----- ---- -------- -------------------------------------------------------
 1.00a hbm  07/14/09 First release
 

Define Documentation

#define Xil_AssertNonvoid Expression   ) 
 

Value:

{                                                  \
    if (Expression) {                              \
        Xil_AssertStatus = XIL_ASSERT_NONE;       \
    } else {                                       \
        Xil_Assert(__FILE__, __LINE__);            \
        Xil_AssertStatus = XIL_ASSERT_OCCURRED;   \
        return 0;                                  \
    }                                              \
}
This assert macro is to be used for functions that do return a value. This in conjunction with the Xil_AssertWait boolean can be used to accomodate tests so that asserts which fail allow execution to continue.

Parameters:
expression is the expression to evaluate. If it evaluates to false, the assert occurs.
Returns:
Returns 0 unless the Xil_AssertWait variable is true, in which case no return is made and an infinite loop is entered.
Note:
None.

 
#define Xil_AssertNonvoidAlways  ) 
 

Value:

{                                                  \
   Xil_Assert(__FILE__, __LINE__);                 \
   Xil_AssertStatus = XIL_ASSERT_OCCURRED;        \
   return 0;                                       \
}
Always assert. This assert macro is to be used for functions that do return a value. Use for instances where an assert should always occur.

Returns:
Returns void unless the Xil_AssertWait variable is true, in which case no return is made and an infinite loop is entered.
Note:
None.

#define Xil_AssertVoid Expression   ) 
 

Value:

{                                                  \
    if (Expression) {                              \
        Xil_AssertStatus = XIL_ASSERT_NONE;       \
    } else {                                       \
        Xil_Assert(__FILE__, __LINE__);            \
        Xil_AssertStatus = XIL_ASSERT_OCCURRED;   \
        return;                                    \
    }                                              \
}
This assert macro is to be used for functions that do not return anything (void). This in conjunction with the Xil_AssertWait boolean can be used to accomodate tests so that asserts which fail allow execution to continue.

Parameters:
expression is the expression to evaluate. If it evaluates to false, the assert occurs.
Returns:
Returns void unless the Xil_AssertWait variable is true, in which case no return is made and an infinite loop is entered.
Note:
None.

 
#define Xil_AssertVoidAlways  ) 
 

Value:

{                                                  \
   Xil_Assert(__FILE__, __LINE__);                 \
   Xil_AssertStatus = XIL_ASSERT_OCCURRED;        \
   return;                                         \
}
Always assert. This assert macro is to be used for functions that do not return anything (void). Use for instances where an assert should always occur.

Returns:
Returns void unless the Xil_AssertWait variable is true, in which case no return is made and an infinite loop is entered.
Note:
None.


Typedef Documentation

typedef void(* Xil_AssertCallback)(const char *File, int Line)
 

This data type defines a callback to be invoked when an assert occurs. The callback is invoked only when asserts are enabled


Function Documentation

void Xil_Assert const char *  File,
int  Line
 

Implement assert. Currently, it calls a user-defined callback function if one has been set. Then, it potentially enters an infinite loop depending on the value of the Xil_AssertWait variable.

Parameters:
file is the name of the filename of the source
line is the linenumber within File
Returns:
None.
Note:
None.

void Xil_AssertSetCallback Xil_AssertCallback  Routine  ) 
 

Set up a callback function to be invoked when an assert occurs. If there was already a callback installed, then it is replaced.

Parameters:
routine is the callback to be invoked when an assert is taken
Returns:
None.
Note:
This function has no effect if NDEBUG is set

void XNullHandler void *  NullParameter  ) 
 

Null handler function. This follows the XInterruptHandler signature for interrupt handlers. It can be used to assign a null handler (a stub) to an interrupt controller vector table.

Parameters:
NullParameter is an arbitrary void pointer and not used.
Returns:
None.
Note:
None.


Variable Documentation

unsigned int Xil_AssertStatus
 

This variable allows testing to be done easier with asserts. An assert sets this variable such that a driver can evaluate this variable to determine if an assert occurred.


Generated on Thu Feb 13 14:48:12 2014 for 2014.1_doc by  doxygen 1.4.5