[coreboot-gerrit] New patch to review for coreboot: 8e4eb07 arm: Move libgcc assembly macros to arch/asm.h

Marc Jones (marc.jones@se-eng.com) gerrit at coreboot.org
Mon Nov 3 22:32:02 CET 2014


Marc Jones (marc.jones at se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7323

-gerrit

commit 8e4eb077d3bff4ab97f6ddffcba44ba9b5192ae6
Author: Julius Werner <jwerner at chromium.org>
Date:   Thu Dec 12 20:24:48 2013 -0800

    arm: Move libgcc assembly macros to arch/asm.h
    
    libgcc/macros.h contains some useful assembly macros that are common in
    Linux kernel code and facilitate things such as unified ARM/THUMB
    assembly. This patch moves it to a more general place where it can be
    used by other code as well.
    
    BUG=None
    TEST=Snow still boots.
    
    Original-Change-Id: If68e8930aaafa706c54cf9a156fac826b31bb193
    Original-Signed-off-by: Julius Werner <jwerner at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/182178
    Original-Reviewed-by: Vincent Palatin <vpalatin at chromium.org>
    (cherry picked from commit a780670def94a969829811fa8cf257f12b88f085)
    
    This is cherry-picked again to pick up the libgcc changes.
    Signed-off-by: Marc Jones <marc.jones at se-eng.com>
    
    Change-Id: I6098eb3c8032357d6f303f08e48054e6100aebe8
---
 payloads/libpayload/include/arm/arch/asm.h |  2 --
 src/arch/arm/libgcc/ashldi3.S              |  2 +-
 src/arch/arm/libgcc/bpabi_asm.S            |  2 +-
 src/arch/arm/libgcc/lib1funcs.S            |  2 +-
 src/arch/arm/libgcc/lshrdi3.S              |  2 +-
 src/arch/arm/libgcc/macros.h               | 47 ------------------------------
 src/arch/arm/libgcc/muldi3.S               |  2 +-
 src/arch/arm/libgcc/ucmpdi2.S              |  2 +-
 src/arch/arm/libgcc/uldivmod.S             | 10 +++----
 9 files changed, 10 insertions(+), 61 deletions(-)

diff --git a/payloads/libpayload/include/arm/arch/asm.h b/payloads/libpayload/include/arm/arch/asm.h
index 2f88599..1c3f7a2 100644
--- a/payloads/libpayload/include/arm/arch/asm.h
+++ b/payloads/libpayload/include/arm/arch/asm.h
@@ -23,11 +23,9 @@
 #if defined __arm__
 #  define ARM(x...)	x
 #  define THUMB(x...)
-#  define W(instr)	instr
 #elif defined __thumb__
 #  define ARM(x...)
 #  define THUMB(x...)	x
-#  define W(instr)	instr.w
 #else
 #  error Not in ARM or thumb mode!
 #endif
diff --git a/src/arch/arm/libgcc/ashldi3.S b/src/arch/arm/libgcc/ashldi3.S
index 4a9b97c..bf7e7e7 100644
--- a/src/arch/arm/libgcc/ashldi3.S
+++ b/src/arch/arm/libgcc/ashldi3.S
@@ -28,7 +28,7 @@ Boston, MA 02110-1301, USA.  */
 
 #if defined __GNUC__
 
-#include "macros.h"
+#include <arch/asm.h>
 
 #ifdef __ARMEB__
 #define al r1
diff --git a/src/arch/arm/libgcc/bpabi_asm.S b/src/arch/arm/libgcc/bpabi_asm.S
index a3942df..27b4a1c 100644
--- a/src/arch/arm/libgcc/bpabi_asm.S
+++ b/src/arch/arm/libgcc/bpabi_asm.S
@@ -28,7 +28,7 @@
    Boston, MA 02110-1301, USA.  */
 
 
-#include "macros.h"
+#include <arch/asm.h>
 
 #ifdef __ARMEB__
 #define xxh r0
diff --git a/src/arch/arm/libgcc/lib1funcs.S b/src/arch/arm/libgcc/lib1funcs.S
index bdef583..533c369 100644
--- a/src/arch/arm/libgcc/lib1funcs.S
+++ b/src/arch/arm/libgcc/lib1funcs.S
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA.  */
 
 #if defined __GNUC__
 
-#include "macros.h"
+#include <arch/asm.h>
 
 .macro ARM_DIV_BODY dividend, divisor, result, curbit
 
diff --git a/src/arch/arm/libgcc/lshrdi3.S b/src/arch/arm/libgcc/lshrdi3.S
index cdf9095..5a5809a 100644
--- a/src/arch/arm/libgcc/lshrdi3.S
+++ b/src/arch/arm/libgcc/lshrdi3.S
@@ -28,7 +28,7 @@ Boston, MA 02110-1301, USA.  */
 
 #if defined __GNUC__
 
-#include "macros.h"
+#include <arch/asm.h>
 
 #ifdef __ARMEB__
 #define al r1
diff --git a/src/arch/arm/libgcc/macros.h b/src/arch/arm/libgcc/macros.h
deleted file mode 100644
index 1e9e96c..0000000
--- a/src/arch/arm/libgcc/macros.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2013 Google Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef __ARCH_ARM_LIBGCC_H__
-#define __ARCH_ARM_LIBGCC_H__
-
-#if defined __arm__
-#  define ARM(x...)	x
-#  define THUMB(x...)
-#elif defined __thumb__
-#  define ARM(x...)
-#  define THUMB(x...)	x
-#else
-#  error Not in ARM or thumb mode!
-#endif
-
-#define ALIGN .align 0
-
-#define ENDPROC(name) \
-	.type name, %function; \
-	END(name)
-
-#define ENTRY(name) \
-	.globl name; \
-	ALIGN; \
-	name:
-
-#define END(name) \
-	.size name, .-name
-
-#endif	/* __ARCH_ARM_LIBGCC_H__ */
diff --git a/src/arch/arm/libgcc/muldi3.S b/src/arch/arm/libgcc/muldi3.S
index faa92b5..f6a40a8 100644
--- a/src/arch/arm/libgcc/muldi3.S
+++ b/src/arch/arm/libgcc/muldi3.S
@@ -12,7 +12,7 @@
 
 #if defined __GNUC__
 
-#include "macros.h"
+#include <arch/asm.h>
 
 #ifdef __ARMEB__
 #define xh r0
diff --git a/src/arch/arm/libgcc/ucmpdi2.S b/src/arch/arm/libgcc/ucmpdi2.S
index 7190b9f..01ce1b5 100644
--- a/src/arch/arm/libgcc/ucmpdi2.S
+++ b/src/arch/arm/libgcc/ucmpdi2.S
@@ -12,7 +12,7 @@
 
 #if defined __GNUC__
 
-#include "macros.h"
+#include <arch/asm.h>
 
 #ifdef __ARMEB__
 #define xh r0
diff --git a/src/arch/arm/libgcc/uldivmod.S b/src/arch/arm/libgcc/uldivmod.S
index e4704c2..ac267d0 100644
--- a/src/arch/arm/libgcc/uldivmod.S
+++ b/src/arch/arm/libgcc/uldivmod.S
@@ -33,17 +33,14 @@
  * Software Foundation.
  */
 
+#include <arch/asm.h>
+
 /*
  * A, Q = r0 + (r1 << 32)
  * B, R = r2 + (r3 << 32)
  * A / B = Q ... R
  */
 
-	.text
-	.global	__aeabi_uldivmod
-	.type	__aeabi_uldivmod, function
-	.align	0
-
 A_0	.req	r0
 A_1	.req	r1
 B_0	.req	r2
@@ -58,7 +55,7 @@ Q_1	.req	r1
 R_0	.req	r2
 R_1	.req	r3
 
-__aeabi_uldivmod:
+ENTRY(__aeabi_uldivmod)
 	stmfd	sp!, {r4, r5, r6, r7, lr}
 	@ Test if B == 0
 	orrs	ip, B_0, B_1		@ Z set -> B == 0
@@ -258,3 +255,4 @@ L_div_by_0:
 	mov	R_0, #0
 	mov	R_1, #0
 	ldmfd	sp!, {r4, r5, r6, r7, pc}
+ENDPROC(__aeabi_uldivmod)



More information about the coreboot-gerrit mailing list