Ignore:
Timestamp:
Jul 21, 2012, 10:20:47 AM (12 years ago)
Author:
karaoui
Message:

+ Adding the init attribute to the mwmr to specify the width of the mwmr channel
+ Fixing bugs in kernels_init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/libs/mwmr_channel.c

    r165 r175  
    3333#include <mwmr_channel.h>
    3434#include <stdio.h>
     35#include <common.h>
    3536
    3637//////////////////////////////////////////////////////////////////////////////
     
    8586    unsigned int    ptw;        // channel ptw
    8687
     88    if(nitems == 0)
     89        return;
     90
     91    assert(buffer && "mwmr write: Empty buffer");
     92
    8793    while(1)
    8894    {
     
    118124        else    // write as many items as possible, release lock and retry after delay
    119125        {
    120             nwords = (spaces/width) * width;  // integer nmber of items
     126            nwords = (spaces/width) * width;  // integer number of items
    121127            for ( x = 0 ; x < nwords ; x++ ) 
    122128            {
     
    157163    unsigned int    ptr;        // channel ptw
    158164
     165    if(nitems == 0)
     166        return;
     167
     168    assert(buffer && "mwmr read: Empty buffer");
     169
    159170    while(1)
    160171    {
Note: See TracChangeset for help on using the changeset viewer.