Changeset fb61b0fe in rtems


Ignore:
Timestamp:
Sep 7, 2007, 11:32:58 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
46ba602
Parents:
1f49f77
Message:

2007-09-07 Joel Sherrill <joel.sherrill@…>

  • startup/bspstart.c: If we cannot find enough memory to run the program, generate a fatal error and print a message.
Location:
c/src/lib/libbsp/i386/pc386
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/ChangeLog

    r1f49f77 rfb61b0fe  
     12007-09-07      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * startup/bspstart.c: If we cannot find enough memory to run the
     4        program, generate a fatal error and print a message.
     5
    162007-06-20      Joel Sherrill <joel.sherrill@OARcorp.com>
    27
  • c/src/lib/libbsp/i386/pc386/startup/bspstart.c

    r1f49f77 rfb61b0fe  
    6060 * Can easily be overridden by application.
    6161 */
    62 extern uint32_t bsp_mem_size __attribute__ ((weak, alias("bsp_mem_size_default")));
     62extern uint32_t bsp_mem_size
     63  __attribute__ ((weak, alias("bsp_mem_size_default")));
    6364uint32_t bsp_mem_size_default = 0;
    6465
     
    9899void bsp_pretasking_hook(void)
    99100{
    100   uint32_t         topAddr, val;
    101   int i, lowest;
     101  uint32_t topAddr, val;
     102  int      i, lowest;
    102103
    103104  if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1))  /* not aligned => align it */
     
    112113   * to use multiboot info, if possible (set from start.S)
    113114   */
    114   if (   bsp_mem_size == 0
    115       && (_boot_multiboot_info.flags & 1)
    116       && _boot_multiboot_info.mem_upper ) {
     115  if ( bsp_mem_size == 0 &&
     116       (_boot_multiboot_info.flags & 1) &&
     117      _boot_multiboot_info.mem_upper ) {
    117118    bsp_mem_size = _boot_multiboot_info.mem_upper * 1024;
    118119  }
    119120
    120   if (_heap_size == 0) {
    121 
     121  if ( _heap_size == 0 ) {
    122122    if ( bsp_mem_size == 0 ) {
    123123        /*
     
    140140     
    141141        topAddr = (i-1)*1024*1024 - 4;
    142 
    143142      } else {
    144 
    145143        topAddr = bsp_mem_size;
    146 
    147144      }
    148145
     146    if ( rtemsFreeMemStart > topAddr ) {
     147      printk( "Out of memory -- unable to initialize BSP\n" );
     148      rtems_fatal_error_occurred( 0x85858585 );
     149    }
     150 
    149151    _heap_size = topAddr - rtemsFreeMemStart;
    150152  }
     
    154156
    155157#ifdef RTEMS_DEBUG
    156 
    157158  rtems_debug_enable(RTEMS_DEBUG_ALL_MASK);
    158 
    159159#endif /* RTEMS_DEBUG */
     160
    160161} /* bsp_pretasking_hook */
    161162
Note: See TracChangeset for help on using the changeset viewer.