| 1 |
|
| 2 |
|
| 3 |
#include <assert.h> |
| 4 |
#include <intelblocks/msr.h> |
| 5 |
#include <program_loading.h> |
| 6 |
#include <soc/cpu.h> |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
static inline int is_car_addr(uintptr_t addr) |
| 14 |
{ |
| 15 |
return ((addr >= CONFIG_DCACHE_RAM_BASE) && |
| 16 |
(addr < (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE))); |
| 17 |
} |
| 18 |
|
| 19 |
void platform_segment_loaded(uintptr_t start, size_t size, int flags) |
| 20 |
{ |
| 21 |
|
| 22 |
if (!(flags & SEG_FINAL)) |
| 23 |
return; |
| 24 |
|
| 25 |
char start_car_check = is_car_addr(start); |
| 26 |
char end_car_check = is_car_addr(start + size - 1); |
| 27 |
|
| 28 |
|
| 29 |
if (!start_car_check && !end_car_check) |
| 30 |
return; |
| 31 |
|
| 32 |
|
| 33 |
assert(start_car_check && end_car_check); |
| 34 |
|
| 35 |
flush_l1d_to_l2(); |
| 36 |
} |