Patchwork linux-user: use arm features based on cpu model

login
register
mail settings
Submitter Lars Munch
Date March 15, 2010, 12:17 p.m.
Message ID <20100315121732.GA8895@firewall>
Download mbox | patch
Permalink /patch/47756/
State New
Headers show

Comments

Lars Munch - March 15, 2010, 12:17 p.m.
Use arm features based on cpu model. The hardcoded feature list gave
problems in the setjmp/longjmp functions of glibc since it tried to use
VFP instructions even though I specified a pxa270 as cpu model.

Signed-off-by: Lars Munch <lars@segv.dk>
---
 linux-user/elfload.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
Paul Brook - March 15, 2010, 12:26 p.m.
> +static uint32_t get_elf_hwcap(void)
> +{
> +    return thread_env->features;
> +}

No.  These values are not the same.

Paul

Patch

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 91eea62..79af51d 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -333,10 +333,12 @@  enum
   ARM_HWCAP_ARM_VFPv3D16  = 1 << 13,
 };
 
-#define ELF_HWCAP (ARM_HWCAP_ARM_SWP | ARM_HWCAP_ARM_HALF              \
-                    | ARM_HWCAP_ARM_THUMB | ARM_HWCAP_ARM_FAST_MULT     \
-                    | ARM_HWCAP_ARM_FPA | ARM_HWCAP_ARM_VFP \
-                    | ARM_HWCAP_ARM_NEON | ARM_HWCAP_ARM_VFPv3 )
+#define ELF_HWCAP get_elf_hwcap()
+
+static uint32_t get_elf_hwcap(void)
+{
+    return thread_env->features;
+}
 
 #endif