Changeset 4a02a74 in rtems


Ignore:
Timestamp:
Nov 28, 2015, 11:01:36 AM (4 years ago)
Author:
Pavel Pisa <pisa@…>
Branches:
master
Children:
a062014
Parents:
4b8184f0
git-author:
Pavel Pisa <pisa@…> (11/28/15 11:01:36)
git-committer:
Gedare Bloom <gedare@…> (12/02/15 02:09:41)
Message:

bsp/tms570: ensure that linker symbol comparison to NULL is not optimized out.

Signed-off-by: Pavel Pisa <pisa@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/tms570/startup/bspstart.c

    r4b8184f0 r4a02a74  
    3333void bsp_start( void )
    3434{
     35  void *need_remap_ptr;
     36  unsigned int need_remap_int;
     37
    3538  #if BYTE_ORDER == BIG_ENDIAN
    3639    /*
     
    6669   *
    6770   * So use of POM to replace jumps to vectors target
    68    * addresses seems to be the best option.
     71   * addresses seems to be the best option for now.
     72   *
     73   * The passing of linker symbol (represented as start address
     74   * of global array) through dummy asm block ensures that C compiler
     75   * cannot optimize comparison out on premise that reference cannot
     76   * evaluate to NULL definition in standard.
    6977   */
    70   if ( (uintptr_t)bsp_start_vector_table_begin != 0 ) {
     78  need_remap_ptr = bsp_start_vector_table_begin;
     79  asm volatile ("\n": "=r" (need_remap_int): "0" (need_remap_ptr));
     80  if ( need_remap_int != 0 ) {
    7181    tms570_pom_remap();
    7282  }
Note: See TracChangeset for help on using the changeset viewer.