/************************************************************************************ * checkMemBound.c * * synopsis: Checks that memory allocation in IDRAM and SDRAMs does not exceed the * size of the memory. * * related files: * memoryPartitions.h: defines the sizes and base addresses of each memory block * * Damon Fasching, UW Madison fasching@wisconsin.cern.ch ************************************************************************************/ #include "resources.h" #include "memoryPartitions.h" #pragma CODE_SECTION(checkMemBound, "xcode"); INT32 checkMemBound(void) { INT32 returnCode= SUCCESS; /* check that partitioned addresses do not exceed the SDRAM address spaces */ if (IDRAM_ALLOCATED > IDRAM_SZ) { newError(&returnCode, MEMORY_EXCEEDED, FATAL_ERR, "checkMemBound", "IDRAM bound exceeded: check memoryPartitions.h.\n", __FILE__,__LINE__); } if (SDRAM0_ALLOCATED > SDRAM0_SZ) { newError(&returnCode, MEMORY_EXCEEDED, FATAL_ERR, "checkMemBound", "SDRAM0 bound exceeded: check memoryPartitions.h.\n", __FILE__,__LINE__); } if (SDRAM1_ALLOCATED > SDRAM1_SZ) { newError(&returnCode, MEMORY_EXCEEDED, FATAL_ERR, "checkMemBound", "SDRAM1 bound exceeded: check memoryPartitions.h.\n", __FILE__,__LINE__); } return returnCode; }