From 86606eb51e81b4189579e2b429f1c8f26f5c804c Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Fri, 1 Sep 2017 10:22:20 +0200 Subject: cpu log buffer size depends on cache line size Platform may use specific cache line sizes. Since CACHE_WRITEBACK_GRANULE defines the platform specific cache line size, it is used to define the size of the cpu data structure CPU_DATA_SIZE aligned on cache line size. Introduce assembly macro 'mov_imm' for AArch32 to simplify implementation of function '_cpu_data_by_index'. Change-Id: Ic2d49ffe0c3e51649425fd9c8c99559c582ac5a1 Signed-off-by: Etienne Carriere --- include/common/aarch32/asm_macros.S | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/common') diff --git a/include/common/aarch32/asm_macros.S b/include/common/aarch32/asm_macros.S index 3adcbf51..f5737449 100644 --- a/include/common/aarch32/asm_macros.S +++ b/include/common/aarch32/asm_macros.S @@ -79,6 +79,19 @@ ldr r0, =(\_name + \_size) .endm + /* + * Helper macro to generate the best mov/movw/movt combinations + * according to the value to be moved. + */ + .macro mov_imm _reg, _val + .if ((\_val) & 0xffff0000) == 0 + mov \_reg, #(\_val) + .else + movw \_reg, #((\_val) & 0xffff) + movt \_reg, #((\_val) >> 16) + .endif + .endm + /* * Macro to mark instances where we're jumping to a function and don't * expect a return. To provide the function being jumped to with -- cgit v1.2.3