Changeset bef6dfc5 in rtems for cpukit

Timestamp:
11/19/18 05:36:15 (5 years ago)
Author:
David Gibson <david@…>
Branches:
5, master
Children:
ab3efcc
Parents:
8bd3915
git-author:
David Gibson <david@…> (11/19/18 05:36:15)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/02/20 06:52:19)
Message:

libfdt: Don't use memcpy to handle unaligned reads on ARM

6dcb8ba4 "libfdt: Add helpers for accessing unaligned words" introduced
the fdt32_ld() and fdt64_ld() helpers for loading values from the FDT blob
which might not be naturally aligned. This matters for ARM, where
attempting a plain unaligned load will often cause an exception.

However, it seems the memcpy() we used here was surprisingly expensive,
making libfdt nearly 6x slower on at least some ARM platforms.

This patch takes an alternative approach, using a bunch of 1-byte loads
and shifts to implement the helpers.

Signed-off-by: David Gibson <david@…>

(No files)

Note: See TracChangeset for help on using the changeset viewer.