diff mbox series

[2/4] linux-user/elfload: Expose get_elf_hwcap() on s390x

Message ID 20230601162541.689621-3-iii@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series linux-user: Emulate /proc/cpuinfo on s390x | expand

Commit Message

Ilya Leoshkevich June 1, 2023, 4:25 p.m. UTC
It is required for implementing /proc/cpuinfo emulation.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 linux-user/elfload.c | 2 +-
 linux-user/loader.h  | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

David Hildenbrand June 2, 2023, 12:27 p.m. UTC | #1
On 01.06.23 18:25, Ilya Leoshkevich wrote:
> It is required for implementing /proc/cpuinfo emulation.
> 
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>   linux-user/elfload.c | 2 +-
>   linux-user/loader.h  | 4 ++++
>   2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index 418ad92598c..49ec9ccc944 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -1583,7 +1583,7 @@ static inline void init_thread(struct target_pt_regs *regs,
>   #define GET_FEATURE(_feat, _hwcap) \
>       do { if (s390_has_feat(_feat)) { hwcap |= _hwcap; } } while (0)
>   
> -static uint32_t get_elf_hwcap(void)
> +uint32_t get_elf_hwcap(void)
>   {
>       /*
>        * Let's assume we always have esan3 and zarch.
> diff --git a/linux-user/loader.h b/linux-user/loader.h
> index f375ee0679b..ad6ca9dbe35 100644
> --- a/linux-user/loader.h
> +++ b/linux-user/loader.h
> @@ -56,4 +56,8 @@ abi_long memcpy_to_target(abi_ulong dest, const void *src,
>   
>   extern unsigned long guest_stack_size;
>   
> +#ifdef TARGET_S390X
> +uint32_t get_elf_hwcap(void);
> +#endif
> +
>   #endif /* LINUX_USER_LOADER_H */

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 418ad92598c..49ec9ccc944 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1583,7 +1583,7 @@  static inline void init_thread(struct target_pt_regs *regs,
 #define GET_FEATURE(_feat, _hwcap) \
     do { if (s390_has_feat(_feat)) { hwcap |= _hwcap; } } while (0)
 
-static uint32_t get_elf_hwcap(void)
+uint32_t get_elf_hwcap(void)
 {
     /*
      * Let's assume we always have esan3 and zarch.
diff --git a/linux-user/loader.h b/linux-user/loader.h
index f375ee0679b..ad6ca9dbe35 100644
--- a/linux-user/loader.h
+++ b/linux-user/loader.h
@@ -56,4 +56,8 @@  abi_long memcpy_to_target(abi_ulong dest, const void *src,
 
 extern unsigned long guest_stack_size;
 
+#ifdef TARGET_S390X
+uint32_t get_elf_hwcap(void);
+#endif
+
 #endif /* LINUX_USER_LOADER_H */