arm_ucos/src/common/memtest.c
/**********************************************************************
 *
 * Function:    memTestDataBus()
 *
 * Description: Test the data bus wiring in a memory region by
 *              performing a walking 1's test at a fixed address
 *              within that region.  The address (and hence the
 *              memory region) is selected by the caller.
 *
 * Notes:       
 *
 * Returns:     0 if the test succeeds.  
 *              A non-zero result is the first pattern that failed.
 *
 **********************************************************************/


Test the data bus wiring in a memory region by
performing a walking 1's test at a fixed address
within that region.  The address (and hence the
memory region) is selected by the caller.



0 if the test succeeds.
A non-zero result is the first pattern that failed.
Test the data bus wiring in a memory region by performing a walking 1 ' s test at a fixed address within that region . The address ( and hence the memory region ) is selected by the caller . 0 if the test succeeds . A non - zero result is the first pattern that failed .
datum
memTestDataBus(volatile datum * address)
{
    datum pattern;
    for (pattern = 1; pattern != 0; pattern <<= 1)
    {
        *address = pattern;
        if (*address != pattern) 
        {
            return (pattern);
        }
    }
    return (0);
}
datum memTestDataBus ( volatile datum * address ) { datum pattern ; for ( pattern = 1 ; pattern != 0 ; pattern <<= 1 ) { * address = pattern ; if ( * address != pattern ) { return ( pattern ) ; } } return ( 0 ) ; }
Function:    memTestDataBus()
Function : memTestDataBus ()
/*
     * Perform a walking 1's test at the given address.
     */ /*
         * Write the test pattern.
         */ /*
         * Read it back (immediately is okay for this test).
         */