Ignore:
Timestamp:
Aug 15, 2012, 10:22:29 AM (12 years ago)
Author:
karaoui
Message:

adding the possibilité of having 0 DMA.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/sys/drivers.c

    r204 r205  
    7272
    7373#if !defined(NB_DMAS_MAX)
    74 # error: You must define NB_DMAS_MAX in 'giet_config.h' file
    75 #endif
    76 
    77 #if (NB_DMAS_MAX < 1)
    78 # error: NB_DMAS_MAX cannot be 0!
     74#define NB_DMAS_MAX 0
    7975#endif
    8076
    8177#if !defined(NB_TIMERS_MAX)
    82 # error: You must define NB_TIMERS_MAX in 'giet_config.h' file
     78#define NB_TIMERS_MAX 0
    8379#endif
    8480
     
    718714//////////////////////////////////////////////////////////////////////////////////
    719715
    720 #if  (NB_DMAS_MAX > 0)
    721 in_unckdata unsigned int                        _dma_lock[NB_DMAS_MAX * NB_CLUSTERS]
    722                                        = { [0 ... (NB_DMAS_MAX * NB_CLUSTERS)-1] = 0 };
    723 
    724 in_unckdata volatile unsigned int       _dma_done[NB_DMAS_MAX * NB_CLUSTERS]
    725                                        = { [0 ... (NB_DMAS_MAX * NB_CLUSTERS)-1] = 0 };
    726 
    727 in_unckdata volatile unsigned int       _dma_status[NB_DMAS_MAX * NB_CLUSTERS];
     716//+1: for the case where the NB_DMAS_MAX == 0
     717in_unckdata unsigned int                        _dma_lock[(NB_DMAS_MAX+1) * NB_CLUSTERS]
     718                                       = { [0 ... ((NB_DMAS_MAX+1) * NB_CLUSTERS)-1] = 0 };
     719
     720in_unckdata volatile unsigned int       _dma_done[(NB_DMAS_MAX+1) * NB_CLUSTERS]
     721                                       = { [0 ... ((NB_DMAS_MAX+1) * NB_CLUSTERS)-1] = 0 };
     722
     723in_unckdata volatile unsigned int       _dma_status[(NB_DMAS_MAX+1) * NB_CLUSTERS];
    728724
    729725in_unckdata unsigned int                        _dma_iommu_ix1 = 1;
    730726
    731 in_unckdata unsigned int            _dma_iommu_npages[NB_DMAS_MAX * NB_CLUSTERS];
    732 #endif
     727in_unckdata unsigned int            _dma_iommu_npages[(NB_DMAS_MAX+1) * NB_CLUSTERS];
    733728
    734729//////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.