Patchwork [meta-fsl-arm] libdrm: Add ite instruction to mx6 ARM patch

login
register
mail settings
Submitter Thomas Elste
Date June 13, 2014, 1:46 p.m.
Message ID <1402667186-25510-1-git-send-email-thomas.elste@imms.de>
Download mbox | patch
Permalink /patch/73769/
State Accepted
Delegated to: Otavio Salvador
Headers show

Comments

Thomas Elste - June 13, 2014, 1:46 p.m.
Building with Angstrom toolchain fails on inline assembler added by
drm-update-arm.patch because of missing ite instruction. Insert
instruction to make the inline assembler block Thumb2 compatible.

Signed-off-by: Thomas Elste <thomas.elste@imms.de>
---
 recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Otavio Salvador - June 13, 2014, 7:48 p.m.
Hello Thomas,

On Fri, Jun 13, 2014 at 10:46 AM, Thomas Elste <thomas.elste@imms.de> wrote:
> Building with Angstrom toolchain fails on inline assembler added by
> drm-update-arm.patch because of missing ite instruction. Insert
> instruction to make the inline assembler block Thumb2 compatible.
>
> Signed-off-by: Thomas Elste <thomas.elste@imms.de>

For me, the patch is fine.

Lauren, can you confirm internally?
Lauren Post - June 14, 2014, 6:26 p.m.
I am waiting on a response from the developer who did the original drm patch.

On Fri, Jun 13, 2014 at 10:46 AM, Thomas Elste <thomas.elste@imms.de> wrote:
> Building with Angstrom toolchain fails on inline assembler added by 
> drm-update-arm.patch because of missing ite instruction. Insert 
> instruction to make the inline assembler block Thumb2 compatible.
>
> Signed-off-by: Thomas Elste <thomas.elste@imms.de>

Lauren, can you confirm internally?
Lauren Post - June 16, 2014, 12:21 p.m.
On Fri, Jun 13, 2014 at 10:46 AM, Thomas Elste <thomas.elste@imms.de> wrote:
> Building with Angstrom toolchain fails on inline assembler added by 
> drm-update-arm.patch because of missing ite instruction. Insert 
> instruction to make the inline assembler block Thumb2 compatible.
>
> Signed-off-by: Thomas Elste <thomas.elste@imms.de>

>> For me, the patch is fine.
>> Lauren, can you confirm internally?

Patch is fine

For those interested
Thumb cannot execute conditional instructions like Arm. It has to use conditional branch. So ite (if-then-else) is used here.   Compiled in ARM it will be ignored.   So patch should be okay and not break arm compilation.

Patch

diff --git a/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch b/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch
index 4389fe4..1160cd1 100644
--- a/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch
+++ b/recipes-graphics/drm/libdrm/mx6/drm-update-arm.patch
@@ -9,7 +9,7 @@  Signed-off-by: Evan Kotara <evan.kotara@freescale.com>
 diff --git a/xf86drm.h b/xf86drm.h
 --- a/xf86drm.h
 +++ b/xf86drm.h
-@@ -455,6 +455,22 @@ do {	register unsigned int __old __asm("o0");		\
+@@ -461,6 +461,23 @@ do {	register unsigned int __old __asm("
  		: "cr0", "memory");			\
  	} while (0)
  
@@ -22,6 +22,7 @@  diff --git a/xf86drm.h b/xf86drm.h
 +               __asm__ __volatile__ (                  \
 +                       "1: ldrex %0, [%1]\n"           \
 +                       "   teq %0, %2\n"               \
++                       "   ite eq\n"                   \
 +                       "   strexeq %0, %3, [%1]\n"     \
 +                       "   movne   %0, #1\n"           \
 +               : "=&r" (__ret)                         \