Changeset 4768ae0f in rtems


Ignore:
Timestamp:
Sep 10, 2014, 9:10:04 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
12ab8d6
Parents:
0cd13bce
git-author:
Sebastian Huber <sebastian.huber@…> (09/10/14 09:10:04)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/10/14 09:29:54)
Message:

bsps/arm: Fix invalidate instruction cache

Do not invalidate the entire L2 cache since it is a uniform cache in
_CPU_cache_invalidate_entire_instruction(). For consitency do not touch
the L2 cache even for the range function
_CPU_cache_invalidate_instruction_range().

File:
1 edited

Legend:

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

    r0cd13bce r4768ae0f  
    14861486
    14871487static inline void
    1488 _CPU_cache_invalidate_instruction_range(
    1489   const void *i_addr,
    1490   size_t      n_bytes
    1491 )
    1492 {
    1493   if ( n_bytes != 0 ) {
    1494     uint32_t       adx       = (uint32_t) i_addr
    1495       & ~CACHE_L2C_310_DATA_LINE_MASK;
    1496     const uint32_t ADDR_LAST =
    1497     (uint32_t)( (size_t)i_addr + n_bytes - 1 );
    1498     uint32_t       block_end =
    1499       CACHE_MIN( ADDR_LAST, adx + CACHE_MAX_LOCKING_BYTES );
    1500 
    1501     /* Invalidate L2 cache lines */
    1502     for (;
    1503          adx      <= ADDR_LAST;
    1504          adx       = block_end + 1,
    1505          block_end = CACHE_MIN( ADDR_LAST, adx + CACHE_MAX_LOCKING_BYTES )) {
    1506       cache_l2c_310_invalidate_range(
    1507         adx,
    1508         block_end
    1509       );
    1510     }
    1511 
    1512     arm_cache_l1_invalidate_instruction_range(
    1513       i_addr,
    1514       n_bytes
    1515     );
    1516   }
     1488_CPU_cache_invalidate_instruction_range( const void *i_addr, size_t n_bytes)
     1489{
     1490  arm_cache_l1_invalidate_instruction_range( i_addr, n_bytes );
    15171491}
    15181492
     
    15201494_CPU_cache_invalidate_entire_instruction( void )
    15211495{
    1522   rtems_interrupt_lock_context lock_context;
    1523 
    1524   rtems_interrupt_lock_acquire( &l2c_310_cache_lock, &lock_context );
    1525   cache_l2c_310_invalidate_entire();
    1526   rtems_interrupt_lock_release( &l2c_310_cache_lock, &lock_context );
    15271496  arm_cache_l1_invalidate_entire_instruction();
    15281497}
Note: See TracChangeset for help on using the changeset viewer.