[coreboot-gerrit] Patch merged into coreboot/master: dbadb1d libpayload: Reorder default memcpy, speed up memset and memcmp
gerrit at coreboot.org
gerrit at coreboot.org
Fri Jan 9 07:08:46 CET 2015
the following patch was just integrated into master:
commit dbadb1dd634c8c9419215ade0666a7fb69a4447b
Author: Julius Werner <jwerner at chromium.org>
Date: Thu Jun 12 10:28:57 2014 -0700
libpayload: Reorder default memcpy, speed up memset and memcmp
The current default memcpy first copies single bytes to align the
amount, then copies the rest as full words. In practice, the start of a
buffer is much more likely to be word-aligned then the end, and aligned
word access are usually more efficient. This patch reorders those
accesses to first copy as many full words as possible and then finish
the rest with byte accesses to optimize this common case.
This fixes a data abort when using USB on ARM without CONFIG_GPL. Due to
some limitations of how DMA memory is set up in coreboot on ARM, it
currently does not support unaligned accesses. (This could be fixed with
a more complicated patch, but it's usually not an issue... unless, of
course, your memcpy happens to be braindead).
Also add word-aligned accesses to memset and memcmp while I'm at it, and
make memcmp's return value standard's compliant.
BUG=chrome-os-partner:24957
TEST=Manual
Original-Change-Id: I2a7bcb35626a05a9a43fcfd99eb958b485d7622a
Original-Signed-off-by: Julius Werner <jwerner at chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/203547
Original-Reviewed-by: Stefan Reinauer <reinauer at chromium.org>
Original-Reviewed-by: David Hendricks <dhendrix at chromium.org>
(cherry picked from commit 05a64d2e107e1675cc3442e6dabe14a341e55673)
Signed-off-by: Marc Jones <marc.jones at se-eng.com>
Change-Id: I0030ca8a203c97587b0da31a0a5e9e11b0be050f
Reviewed-on: http://review.coreboot.org/8126
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
See http://review.coreboot.org/8126 for details.
-gerrit
More information about the coreboot-gerrit
mailing list