Make function fixed_point_scaling_factor a method of struct type
[deliverable/binutils-gdb.git] / gdb / s390-linux-tdep.c
index 64fe7abd80e519a2229b0cd3e6b646e2928c85ef..8020832d97821b8c5228068c9985ad4d036378e6 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for GNU/Linux on s390.
 
-   Copyright (C) 2001-2019 Free Software Foundation, Inc.
+   Copyright (C) 2001-2020 Free Software Foundation, Inc.
 
    Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
    for IBM Deutschland Entwicklung GmbH, IBM Corporation.
@@ -332,10 +332,9 @@ s390_core_read_description (struct gdbarch *gdbarch,
                            struct target_ops *target, bfd *abfd)
 {
   asection *section = bfd_get_section_by_name (abfd, ".reg");
-  CORE_ADDR hwcap = 0;
+  CORE_ADDR hwcap = linux_get_hwcap (target);
   bool high_gprs, v1, v2, te, vx, gs;
 
-  target_auxv_search (target, AT_HWCAP, &hwcap);
   if (!section)
     return NULL;
 
@@ -347,7 +346,7 @@ s390_core_read_description (struct gdbarch *gdbarch,
   te = (hwcap & HWCAP_S390_TE);
   gs = (hwcap & HWCAP_S390_GS);
 
-  switch (bfd_section_size (abfd, section))
+  switch (bfd_section_size (section))
     {
     case s390_sizeof_gregset:
       if (high_gprs)
@@ -600,21 +599,21 @@ s390_all_but_pc_registers_record (struct regcache *regcache)
   for (i = 0; i < 16; i++)
     {
       if (record_full_arch_list_add_reg (regcache, S390_R0_REGNUM + i))
-        return -1;
+       return -1;
       if (record_full_arch_list_add_reg (regcache, S390_A0_REGNUM + i))
-        return -1;
+       return -1;
       if (record_full_arch_list_add_reg (regcache, S390_F0_REGNUM + i))
-        return -1;
+       return -1;
       if (tdep->gpr_full_regnum != -1)
-        if (record_full_arch_list_add_reg (regcache, S390_R0_UPPER_REGNUM + i))
-          return -1;
+       if (record_full_arch_list_add_reg (regcache, S390_R0_UPPER_REGNUM + i))
+         return -1;
       if (tdep->v0_full_regnum != -1)
-        {
-          if (record_full_arch_list_add_reg (regcache, S390_V0_LOWER_REGNUM + i))
-            return -1;
-          if (record_full_arch_list_add_reg (regcache, S390_V16_REGNUM + i))
-            return -1;
-        }
+       {
+         if (record_full_arch_list_add_reg (regcache, S390_V0_LOWER_REGNUM + i))
+           return -1;
+         if (record_full_arch_list_add_reg (regcache, S390_V16_REGNUM + i))
+           return -1;
+       }
     }
   if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM))
     return -1;
@@ -671,7 +670,7 @@ s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi)
     case 197: /* fstat64 */
     case 221: /* fcntl64 */
       if (abi == ABI_LINUX_S390)
-        return (enum gdb_syscall) syscall;
+       return (enum gdb_syscall) syscall;
       return gdb_sys_no_syscall;
     /* These syscalls don't exist on s390.  */
     case 17: /* break */
@@ -702,7 +701,7 @@ s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi)
       return gdb_sys_readahead;
     case 223:
       if (abi == ABI_LINUX_S390)
-        return gdb_sys_sendfile64;
+       return gdb_sys_sendfile64;
       return gdb_sys_no_syscall;
     /* 224-235 handled below */
     case 236:
@@ -744,7 +743,7 @@ s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi)
     /* 263 reserved */
     case 264:
       if (abi == ABI_LINUX_S390)
-        return gdb_sys_fadvise64_64;
+       return gdb_sys_fadvise64_64;
       return gdb_sys_no_syscall;
     case 265:
       return gdb_sys_statfs64;
@@ -765,7 +764,7 @@ s390_canonicalize_syscall (int syscall, enum s390_abi_kind abi)
     /* 282-312 handled below */
     case 293:
       if (abi == ABI_LINUX_S390)
-        return gdb_sys_fstatat64;
+       return gdb_sys_fstatat64;
       return gdb_sys_newfstatat;
     /* 313+ not yet supported */
     default:
@@ -816,8 +815,8 @@ s390_linux_syscall_record (struct regcache *regcache, LONGEST syscall_native)
   if (syscall_gdb < 0)
     {
       printf_unfiltered (_("Process record and replay target doesn't "
-                           "support syscall number %s\n"),
-                         plongest (syscall_native));
+                          "support syscall number %s\n"),
+                        plongest (syscall_native));
       return -1;
     }
 
@@ -825,16 +824,16 @@ s390_linux_syscall_record (struct regcache *regcache, LONGEST syscall_native)
       || syscall_gdb == gdb_sys_rt_sigreturn)
     {
       if (s390_all_but_pc_registers_record (regcache))
-        return -1;
+       return -1;
       return 0;
     }
 
   if (tdep->abi == ABI_LINUX_ZSERIES)
     ret = record_linux_system_call (syscall_gdb, regcache,
-                                    &s390x_linux_record_tdep);
+                                   &s390x_linux_record_tdep);
   else
     ret = record_linux_system_call (syscall_gdb, regcache,
-                                    &s390_linux_record_tdep);
+                                   &s390_linux_record_tdep);
 
   if (ret)
     return ret;
@@ -850,23 +849,23 @@ s390_linux_syscall_record (struct regcache *regcache, LONGEST syscall_native)
 
 static int
 s390_linux_record_signal (struct gdbarch *gdbarch, struct regcache *regcache,
-                          enum gdb_signal signal)
+                         enum gdb_signal signal)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   /* There are two kinds of signal frames on s390. rt_sigframe is always
      the larger one, so don't even bother with sigframe.  */
   const int sizeof_rt_sigframe = (tdep->abi == ABI_LINUX_ZSERIES ?
-                                  160 + 8 + 128 + 1024 : 96 + 8 + 128 + 1000);
+                                 160 + 8 + 128 + 1024 : 96 + 8 + 128 + 1000);
   ULONGEST sp;
   int i;
 
   for (i = 0; i < 16; i++)
     {
       if (record_full_arch_list_add_reg (regcache, S390_R0_REGNUM + i))
-        return -1;
+       return -1;
       if (tdep->gpr_full_regnum != -1)
-        if (record_full_arch_list_add_reg (regcache, S390_R0_UPPER_REGNUM + i))
-          return -1;
+       if (record_full_arch_list_add_reg (regcache, S390_R0_UPPER_REGNUM + i))
+         return -1;
     }
   if (record_full_arch_list_add_reg (regcache, S390_PSWA_REGNUM))
     return -1;
@@ -891,7 +890,7 @@ s390_linux_record_signal (struct gdbarch *gdbarch, struct regcache *regcache,
 
 static void
 s390_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
-                             enum s390_abi_kind abi)
+                            enum s390_abi_kind abi)
 {
   /* These values are the size of the type that will be used in a system
      call.  They are obtained from Linux Kernel source.  */
@@ -1178,8 +1177,9 @@ s390_linux_init_abi_64 (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_S390X);
 }
 
+void _initialize_s390_linux_tdep ();
 void
-_initialize_s390_linux_tdep (void)
+_initialize_s390_linux_tdep ()
 {
   /* Hook us into the OSABI mechanism.  */
   gdbarch_register_osabi (bfd_arch_s390, bfd_mach_s390_31, GDB_OSABI_LINUX,
This page took 0.033498 seconds and 4 git commands to generate.