From 82ef8ada82bd63ea7ce61843189fd4ee5de45cb5 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Fri, 17 Jun 2016 09:49:24 -0700 Subject: src/commonlib/lz4_wrapper: Correct inline asm for unaligned 64-bit copy Rewrite inline assembly for ARMv7+ to correctly annotate inputs and outputs. On ARM GCC 6.1.1, this causes assembly output to change from the incorrect @ r0 is allocated to hold dst and x0 @ r1 is allocated to hold src and x1 ldr r0, [r1] @ clobbers dst! ldr r1, [r1, #4] str r0, [r0] str r1, [r0, #4] to the correct @ r0 is allocated to hold dst @ r1 is allocated to hold src and x1 @ r3 is allocated to hold x0 ldr r3, [r1] ldr r1, [r1, #4] str r3, [r0] str r1, [r0, #4] Also modify checkpatch.pl to ignore spaces before opening brackets when used in inline assembly. Change-Id: I255995f5e0a7b1a95375258755a93972c51d79b8 Signed-off-by: Benjamin Barenblat Reviewed-on: https://review.coreboot.org/15216 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner Reviewed-by: Paul Menzel --- util/lint/checkpatch.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index 3a4b8be455..45445043e7 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -3,6 +3,7 @@ # (c) 2005, Joel Schopp (the ugly bit) # (c) 2007,2008, Andy Whitcroft (new conditions, test suite) # (c) 2008-2010 Andy Whitcroft +# (c) 2016 Google Inc. # Licensed under the terms of the GNU GPL License version 2 use strict; @@ -3377,11 +3378,12 @@ sub process { # 1. with a type on the left -- int [] a; # 2. at the beginning of a line for slice initialisers -- [0...10] = 5, # 3. inside a curly brace -- = { [0...10] = 5 } +# 4. in an extended asm instruction -- : [r0]"r"(r0) while ($line =~ /(.*?\s)\[/g) { my ($where, $prefix) = ($-[1], $1); if ($prefix !~ /$Type\s+$/ && ($where != 0 || $prefix !~ /^.\s+$/) && - $prefix !~ /[{,]\s+$/) { + $prefix !~ /[{,:]\s+$/) { if (ERROR("BRACKET_SPACE", "space prohibited before open square bracket '['\n" . $herecurr) && $fix) { -- cgit v1.2.3