Ignore:
Timestamp:
Jan 17, 2014, 11:49:27 PM (11 years ago)
Author:
cfuguet
Message:
  • Bugfix: The ISR_SWITCH index should be NB_PROCS_MAX + local_pid. This is because the first NB_PROCS_MAX indexes on the XICU in each cluster are used for the WAKEUP software interrupts.
  • Relocating the memcpy and memset functions into the giet_libs/stdlib.* files.
  • Modification of the sort application to used 8 threads instead of
    1. Modifying the mapping files to distribute the 8 threads on the available processors. (Ex. When using 4 processors, each one executes 2 threads)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_libs/stdlib.c

    r259 r271  
    55// Copyright (c) UPMC-LIP6
    66///////////////////////////////////////////////////////////////////////////////////
     7
     8#include <stdlib.h>
    79
    810///////////////////////////////////////////////////////////////////////////////////
     
    3133}
    3234       
     35////////////////////////////////////////////////////////////////////////////////////////
     36//  mempcy()
     37// GCC requires this function. Taken from MutekH.
     38////////////////////////////////////////////////////////////////////////////////////////
     39void * memcpy(void *_dst, const void * _src, unsigned int size) {
     40    unsigned int * dst = _dst;
     41    const unsigned int * src = _src;
     42    if (!((unsigned int) dst & 3) && !((unsigned int) src & 3) )
     43        while (size > 3) {
     44            *dst++ = *src++;
     45            size -= 4;
     46        }
     47
     48    unsigned char *cdst = (unsigned char*)dst;
     49    unsigned char *csrc = (unsigned char*)src;
     50
     51    while (size--) {
     52        *cdst++ = *csrc++;
     53    }
     54    return _dst;
     55}
     56
     57
     58////////////////////////////////////////////////////////////////////////////////////////
     59//  mempcy()
     60// GCC requires this function. Taken from MutekH.
     61////////////////////////////////////////////////////////////////////////////////////////
     62inline void * memset(void * dst, int s, unsigned int count) {
     63    char * a = (char *) dst;
     64    while (count--){
     65        *a++ = (char)s;
     66    }
     67    return dst;
     68}
     69
    3370// Local Variables:
    3471// tab-width: 4
Note: See TracChangeset for help on using the changeset viewer.