arm-trusted-firmware/lib
Masahiro Yamada 3cde15fade xlat_tables_v2: use get_current_el_maybe_constant() in is_dcache_enabled()
Using get_current_el_maybe_constant() produces more optimized code
because in most cases, we know the exception level at build-time.
For example, BL31 runs at EL3, so unneeded code will be trimmed.

[before]

0000000000000000 <is_dcache_enabled>:
   0:   d5384240        mrs     x0, currentel
   4:   53020c00        ubfx    w0, w0, #2, #2
   8:   7100041f        cmp     w0, #0x1
   c:   54000081        b.ne    1c <is_dcache_enabled+0x1c>  // b.any
  10:   d5381000        mrs     x0, sctlr_el1
  14:   53020800        ubfx    w0, w0, #2, #1
  18:   d65f03c0        ret
  1c:   7100081f        cmp     w0, #0x2
  20:   54000061        b.ne    2c <is_dcache_enabled+0x2c>  // b.any
  24:   d53c1000        mrs     x0, sctlr_el2
  28:   17fffffb        b       14 <is_dcache_enabled+0x14>
  2c:   d53e1000        mrs     x0, sctlr_el3
  30:   17fffff9        b       14 <is_dcache_enabled+0x14>

[after]

0000000000000000 <is_dcache_enabled>:
   0:   d53e1000        mrs     x0, sctlr_el3
   4:   53020800        ubfx    w0, w0, #2, #1
   8:   d65f03c0        ret

Change-Id: I3698fae9b517022ff9fbfd4cad3a320c6e137e10
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2020-04-03 11:56:51 +09:00
..
aarch32 Fix Coverity #261967, Infinite loop 2019-08-06 13:06:03 +01:00
aarch64 Read-only xlat tables for BL31 memory 2020-02-24 16:52:56 +00:00
bl_aux_params Introduce lightweight BL platform parameter library 2019-07-18 16:42:40 -07:00
compiler-rt compiler_rt: Import popcountdi2.c and popcountsi2.c files 2020-01-20 11:32:59 +01:00
coreboot coreboot: Use generic base address 2020-02-25 09:34:38 +00:00
cpus cpus: denver: fixup register used to store return address 2020-03-09 15:25:15 -07:00
debugfs coverity: debugfs devfip remove comparisons to LONG_MAX 2020-02-04 13:40:30 +00:00
el3_runtime context: TPIDR_EL2 register not saved/restored 2020-03-20 16:15:28 +00:00
extensions TF-A: Add support for ARMv8.3-PAuth in BL1 SMC calls and BL2U 2019-10-03 14:43:55 +01:00
fconf fconf: exclude fconf_dyn_cfg_getter.c from BL1_SOURCES 2020-03-31 16:08:21 +09:00
libc libc: add memrchr 2019-12-11 08:51:26 +01:00
libfdt libfdt: Downgrade to version 1.4.6-9 2018-10-30 13:42:13 +00:00
locks locks: bakery: add a DMB to the 'read_cache_op' macro 2020-03-06 08:53:33 -08:00
optee Coverity: remove unnecessary header file includes 2020-02-04 10:23:51 -06:00
pmf Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
psci coverity: fix MISRA violations 2020-02-18 10:47:46 -06:00
romlib FDT wrappers: add functions for read/write bytes 2020-02-03 11:41:27 +00:00
semihosting qemu: Implement qemu_system_off via semihosting. 2020-01-23 10:53:45 +00:00
stack_protector Disable stack protection explicitly 2019-10-20 14:59:09 -04:00
utils coverity: Fix MISRA null pointer violations 2020-02-05 14:53:02 -06:00
xlat_tables Coding guideline suggest not to use unsigned long 2019-11-12 11:14:18 -06:00
xlat_tables_v2 xlat_tables_v2: use get_current_el_maybe_constant() in is_dcache_enabled() 2020-04-03 11:56:51 +09:00
zlib Sanitise includes across codebase 2019-01-04 10:43:17 +00:00