diff options
author | Julius Werner <jwerner@chromium.org> | 2018-08-06 13:50:38 -0700 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2018-08-10 04:16:46 +0000 |
commit | e819c857607bb4a1c2911e2073aa588f74789ee1 (patch) | |
tree | 6344dcc7f78397ad89bcc0ae59cdfc0e139cc5c5 /src/lib/libgcc.c | |
parent | 0c5f61a01c3ebaa1c19f9a20d20d4b1353648d7c (diff) |
arm64: Turn architectural register accessors into inline functions
Accesses to architectural registers should be really fast -- they're
just registers, after all. In fact, the arm64 architecture uses them for
some timing-senstive uses like the architectural timer. A read should be:
one instruction, no data dependencies, done.
However, our current coreboot framework wraps each of these accesses
into a separate function. Suddenly you have to spill registers on a
stack, make a function call, move your stack pointer, etc. When running
without MMU this adds a significant enough delay to cause timing
problems when bitbanging a UART on SDM845.
This patch replaces all those existing functions with static inline
definitions in the header so they will get reduced to a single
instruction as they should be. Also use some macros to condense the code
a little since they're all so regular, which should make it easier to
add more in the future. This patch also expands all the data types to
uint64_t since that's what the actual assembly instruction accesses,
even if the register itself only has 32 bits (the others will be ignored
by the processor and set to 0 on read). Arm regularly expands registers
as they add new bit fields to them with newer iterations of the
architecture anyway, so this just prepares us for the inevitable.
Change-Id: I2c41cc3ce49ee26bf12cd34e3d0509d8e61ffc63
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/27881
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/lib/libgcc.c')
0 files changed, 0 insertions, 0 deletions