Changeset 02c9eb85 in rtems


Ignore:
Timestamp:
Jul 20, 2020, 5:46:53 AM (3 weeks ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
master
Children:
c60942ea
Parents:
29a73d8
git-author:
Christian Mauderer <christian.mauderer@…> (07/20/20 05:46:53)
git-committer:
Christian Mauderer <christian.mauderer@…> (07/31/20 06:26:14)
Message:

bsps/fdt: Make sure data is cache aligned

The cache of the fdt blob is flushed after copy. Therefore it should be
aligned.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsps/shared/start/bsp-fdt.c

    r29a73d8 r02c9eb85  
    3030#ifdef BSP_FDT_BLOB_READ_ONLY
    3131static const uint32_t
    32 bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] = { 0xdeadbeef };
     32bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] CPU_STRUCTURE_ALIGNMENT =
     33  { 0xdeadbeef };
    3334#else
    3435static uint32_t
    35 bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)];
     36bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] CPU_STRUCTURE_ALIGNMENT;
    3637#endif
    3738
     
    4950  if (s != d) {
    5051    size_t m = MIN(sizeof(bsp_fdt_blob), fdt_totalsize(src));
     52    size_t aligned_size = roundup2(m, CPU_CACHE_LINE_BYTES);
    5153    size_t n = (m + sizeof(*d) - 1) / sizeof(*d);
    5254    size_t i;
     
    5658    }
    5759
    58     rtems_cache_flush_multiple_data_lines(d, m);
     60    rtems_cache_flush_multiple_data_lines(d, aligned_size);
    5961  }
    6062}
Note: See TracChangeset for help on using the changeset viewer.