Changeset 655 for trunk/softs


Ignore:
Timestamp:
Mar 5, 2014, 1:13:22 AM (11 years ago)
Author:
cfuguet
Message:

Fixing bug introduced in last commit :

  • When using IO bridge, some header files were missing in the reset_utils.h file
Location:
trunk/softs/tsar_boot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/include/io.h

    r653 r655  
    6060}
    6161
    62 #undef in_reset
    63 
    6462#endif
  • trunk/softs/tsar_boot/include/reset_utils.h

    r653 r655  
    1010#include <elf-types.h>
    1111#include <reset_tty.h>
     12#include <defs_platform.h>
     13#include <mcc.h>
     14#include <io.h>
    1215
    1316extern unsigned int proctime();
  • trunk/softs/tsar_boot/src/reset_utils.c

    r653 r655  
    3535    unsigned int *dst = _dst;
    3636    const unsigned int *src = _src;
    37     if ( ! ((unsigned int)dst & 3) && ! ((unsigned int)src & 3) )
     37    if ( !((unsigned int)dst & 3) && !((unsigned int)src & 3) )
     38    {
    3839        while (size > 3)
    3940        {
     
    4142            size -= 4;
    4243        }
     44    }
    4345
    4446    unsigned char *cdst = (unsigned char*) dst;
     
    6466void * memset(void *_dst, const int value, unsigned int size)
    6567{
    66     char * dst = (char *) _dst;
     68    unsigned char val = (unsigned char) value;
     69    int word = (val << 24) || (val << 16) ||
     70               (val << 8 ) || (val      );
    6771
    68     while(size--) *dst++ = (char) value;
     72    /*
     73     * Write 4 bytes when destination buffer is aligned to 4 bytes
     74     * and size is greater or equal to 4
     75     */
     76    unsigned int *dst = _dst;
     77    if ( !((unsigned int)dst & 3) )
     78    {
     79        while (size > 3)
     80        {
     81            *dst++ = word;
     82            size -= 4;
     83        }
     84    }
     85
     86    /*
     87     * Write 1 byte when destination buffer is not aligned to 4 bytes
     88     * or size is smaller than 4
     89     */
     90    char* cdst = (char*) _dst;
     91    while(size--)
     92    {
     93        *cdst++ = (char) value;
     94    }
    6995
    7096    return _dst;
     
    158184    }
    159185
    160 #if USE_IOB 
    161     reset_mcc_invalidate(buffer, count * 512);
     186#if USE_IOB
     187    reset_mcc_invalidate(buffer, size);
    162188#endif
    163189}
Note: See TracChangeset for help on using the changeset viewer.