Ignore:
Timestamp:
Feb 12, 2013, 6:33:31 PM (11 years ago)
Author:
meunier
Message:

Added support for memspaces and const.
Added an interrupt masking to the "giet_context_switch" syscall
Corrected two bugs in boot/boot_init.c (one minor and one regarding barriers initialization)
Reformatted the code in all files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/libs/libsrl/srl_private_types.c

    r160 r228  
     1
    12#include "srl_private_types.h"
    23
     
    67// GCC requires this function. Taken from MutekH.
    78////////////////////////////////////////////////////////////////////////////////////////
    8 void *memcpy(void *_dst, const void *_src, unsigned int size)
    9 {
    10     unsigned int *dst = _dst;
    11     const unsigned int *src = _src;
    12     if ( ! ((unsigned int)dst & 3) && ! ((unsigned int)src & 3) )
     9void * memcpy(void *_dst, const void * _src, unsigned int size) {
     10    unsigned int * dst = _dst;
     11    const unsigned int * src = _src;
     12    if (!((unsigned int) dst & 3) && !((unsigned int) src & 3) )
    1313        while (size > 3) {
    1414            *dst++ = *src++;
     
    2525}
    2626
     27
    2728////////////////////////////////////////////////////////////////////////////////////////
    2829//  mempcy()
    2930// GCC requires this function. Taken from MutekH.
    3031////////////////////////////////////////////////////////////////////////////////////////
    31 inline void * memset(void *dst, int s, size_t count)
    32 {
    33 /*
    34   int8_t s = _s;
    35   const reg_t v = (uint8_t)s * (reg_t)0x0101010101010101LL;
    36   int8_t *a = dst;
    37   reg_t *r;
     32inline void * memset(void * dst, int s, size_t count) {
     33    char * a = (char *) dst;
     34    while (count--){
     35        *a++ = (char)s;
     36    }
     37    return dst;
     38}
    3839
    39   // align
    40   while ( ((uintptr_t *)a & reg_t_log2_m1) && count )
    41     count--, *a++ = s;
    4240
    43   size_t ucount = count & reg_t_log2_m1;
    44   count &= ~reg_t_log2_m1;
     41// Local Variables:
     42// tab-width: 4
     43// c-basic-offset: 4
     44// c-file-offsets:((innamespace . 0)(inline-open . 0))
     45// indent-tabs-mode: nil
     46// End:
     47// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
    4548
    46   for (r = (reg_t*)a; count; count -= sizeof(reg_t))
    47       *r++ = v;
    48 
    49   for (a = (int8_t*)r; ucount; ucount--)
    50       *a++ = s;
    51 
    52 */
    53         char *a = (char *) dst;
    54         while (count--){
    55                 *a++ = (char)s;
    56         }
    57 
    58         return dst;
    59 }
Note: See TracChangeset for help on using the changeset viewer.