Changeset fd10817 in rtems


Ignore:
Timestamp:
May 11, 2017, 1:33:10 PM (2 years ago)
Author:
Alexei Pososin <m09123874@…>
Branches:
master
Children:
7741545b
Parents:
3dd67dd1
git-author:
Alexei Pososin <m09123874@…> (05/11/17 13:33:10)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/14/17 13:37:58)
Message:

Remove excessive locking from cache operations.

According to manual, the used operations (Clean Line by PA, Clean and
Invalidate Line by PA, Cache Sync) are atomic and do not require
locking.

Update #3007.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/shared/arm-l2c-310/cache_.h

    r3dd67dd1 rfd10817  
    883883  const uint32_t ADDR_LAST         =
    884884    (uint32_t)( (size_t)d_addr + n_bytes - 1 );
    885   uint32_t       block_end         =
    886     L2C_310_MIN( ADDR_LAST, adx + L2C_310_MAX_LOCKING_BYTES );
    887885  volatile L2CC *l2cc = (volatile L2CC *) BSP_ARM_L2C_310_BASE;
    888886
     
    891889  }
    892890
    893   for (;
    894        adx      <= ADDR_LAST;
    895        adx       = block_end + 1,
    896        block_end = L2C_310_MIN( ADDR_LAST, adx + L2C_310_MAX_LOCKING_BYTES )) {
    897     rtems_interrupt_lock_context lock_context;
    898 
    899     rtems_interrupt_lock_acquire( &l2c_310_lock, &lock_context );
    900 
    901     for (; adx <= block_end; adx += CPU_DATA_CACHE_ALIGNMENT ) {
    902       l2c_310_flush_1_line( l2cc, adx );
    903     }
    904 
    905     l2c_310_sync( l2cc );
    906 
    907     rtems_interrupt_lock_release( &l2c_310_lock, &lock_context );
    908   }
     891  for (; adx <= ADDR_LAST; adx += CPU_DATA_CACHE_ALIGNMENT ) {
     892    l2c_310_flush_1_line( l2cc, adx );
     893  }
     894
     895  l2c_310_sync( l2cc );
    909896}
    910897
     
    951938  const uint32_t ADDR_LAST         =
    952939    (uint32_t)( (size_t)d_addr + n_bytes - 1 );
    953   uint32_t       block_end         =
    954     L2C_310_MIN( ADDR_LAST, adx + L2C_310_MAX_LOCKING_BYTES );
    955940  volatile L2CC *l2cc = (volatile L2CC *) BSP_ARM_L2C_310_BASE;
    956941
     
    959944  }
    960945
    961   for (;
    962        adx      <= ADDR_LAST;
    963        adx       = block_end + 1,
    964        block_end = L2C_310_MIN( ADDR_LAST, adx + L2C_310_MAX_LOCKING_BYTES )) {
    965     rtems_interrupt_lock_context lock_context;
    966 
    967     rtems_interrupt_lock_acquire( &l2c_310_lock, &lock_context );
    968 
    969     for (; adx <= block_end; adx += CPU_DATA_CACHE_ALIGNMENT ) {
    970       /* Invalidate L2 cache line */
    971       l2cc->inv_pa = adx;
    972     }
    973 
    974     l2c_310_sync( l2cc );
    975 
    976     rtems_interrupt_lock_release( &l2c_310_lock, &lock_context );
    977   }
     946  for (; adx <= ADDR_LAST; adx += CPU_DATA_CACHE_ALIGNMENT ) {
     947    /* Invalidate L2 cache line */
     948    l2cc->inv_pa = adx;
     949  }
     950
     951  l2c_310_sync( l2cc );
    978952}
    979953
Note: See TracChangeset for help on using the changeset viewer.