diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2012-04-07 11:45:25 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2012-04-07 11:45:25 +0000 |
commit | adcd61f7fcd5a24e65b2ec087bfae2356805993b (patch) | |
tree | a74ea7fff914a0237e5190d5c97866bef1b3d21b /linux-user/elfload.c | |
parent | 6375e09e79964fa6eac3e8426d25c8b759185482 (diff) | |
parent | d8fd2954996255ba6ad610917e7849832d0120b7 (diff) |
Merge branch 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu
* 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu:
Userspace ARM BE8 support
elf.h: Update EF_ARM_ constants to newer ABI versions
arm-linux-user: fix elfload.c's AT_HWCAP to reflect cpu features.
linux-user/arm/syscall_nr.h: Add syscall number for ppoll
linux-user: Add support for prctl PR_GET_NAME and PR_SET_NAME
linux-user/syscall.c: Fix indentation in prctl handling
linux-user: reserve 4GB of vmem for 32-on-64
linux-user: resolve reserved_va vma downwards
linux-user: take RESERVED_VA into account for g2h_valid()
linux-user: fix fallocate
linux-user: Add ioctl for BLKBSZGET
linux-user: add BLKSSZGET ioctl wrapper
linux-user: fix BLK ioctl arguments
linux-user: add struct old_dev_t compat
linux-user: implement device mapper ioctls
linux-user: target_argv is placed on ts->bprm->argv and can't be freed()
linux-user: improve fake /proc/self/stat making `ps` not segfault.
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r-- | linux-user/elfload.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e502b39007..f3b1552e9e 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -375,10 +375,33 @@ bool guest_validate_base(unsigned long guest_base) return 1; /* All good */ } -#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) +{ + CPUARMState *e = thread_env; + uint32_t hwcaps = 0; + + hwcaps |= ARM_HWCAP_ARM_SWP; + hwcaps |= ARM_HWCAP_ARM_HALF; + hwcaps |= ARM_HWCAP_ARM_THUMB; + hwcaps |= ARM_HWCAP_ARM_FAST_MULT; + hwcaps |= ARM_HWCAP_ARM_FPA; + + /* probe for the extra features */ +#define GET_FEATURE(feat, hwcap) \ + do {if (arm_feature(e, feat)) { hwcaps |= hwcap; } } while (0) + GET_FEATURE(ARM_FEATURE_VFP, ARM_HWCAP_ARM_VFP); + GET_FEATURE(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT); + GET_FEATURE(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE); + GET_FEATURE(ARM_FEATURE_NEON, ARM_HWCAP_ARM_NEON); + GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPv3); + GET_FEATURE(ARM_FEATURE_VFP_FP16, ARM_HWCAP_ARM_VFPv3D16); +#undef GET_FEATURE + + return hwcaps; +} #endif @@ -1553,6 +1576,7 @@ static void load_elf_image(const char *image_name, int image_fd, info->start_data = -1; info->end_data = 0; info->brk = 0; + info->elf_flags = ehdr->e_flags; for (i = 0; i < ehdr->e_phnum; i++) { struct elf_phdr *eppnt = phdr + i; |