Merge branch 'master' into merge-job
[deliverable/binutils-gdb.git] / bfd / libhppa.h
index 8ef8f53b3688d50a2ab0f5307b4f797af38c8c4d..632f5243d0b4befda8d438299b8ea0cbb7049f4d 100644 (file)
@@ -1,6 +1,5 @@
 /* HP PA-RISC SOM object file format:  definitions internal to BFD.
 /* HP PA-RISC SOM object file format:  definitions internal to BFD.
-   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 98, 99, 2000
-   Free Software Foundation, Inc.
+   Copyright (C) 1990-2019 Free Software Foundation, Inc.
 
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
 
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
@@ -9,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -19,7 +18,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
 #ifndef _LIBHPPA_H
 #define _LIBHPPA_H
 
 #ifndef _LIBHPPA_H
 #define _LIBHPPA_H
 #define BYTES_IN_WORD 4
 #define PA_PAGESIZE 0x1000
 
 #define BYTES_IN_WORD 4
 #define PA_PAGESIZE 0x1000
 
-#ifndef INLINE
-#ifdef __GNUC__
-#define INLINE inline
-#else
-#define INLINE
-#endif /* GNU C? */
-#endif /* INLINE */
-
 /* The PA instruction set variants.  */
 enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20, pa20w = 25};
 
 /* The PA instruction set variants.  */
 enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20, pa20w = 25};
 
@@ -156,7 +148,7 @@ enum hppa_reloc_expr_type_alt
 #define HPPA_R_ARG_RELOC(a)    \
   (((a) >> 22) & 0x3ff)
 #define HPPA_R_CONSTANT(a)     \
 #define HPPA_R_ARG_RELOC(a)    \
   (((a) >> 22) & 0x3ff)
 #define HPPA_R_CONSTANT(a)     \
-  ((((bfd_signed_vma)(a)) << (BFD_ARCH_SIZE-22)) >> (BFD_ARCH_SIZE-22))
+  ((((bfd_signed_vma) (a) & 0x3fffff) ^ 0x200000) - 0x200000)
 #define HPPA_R_ADDEND(r, c)    \
   (((r) << 22) + ((c) & 0x3fffff))
 
 #define HPPA_R_ADDEND(r, c)    \
   (((r) << 22) + ((c) & 0x3fffff))
 
@@ -164,40 +156,38 @@ enum hppa_reloc_expr_type_alt
 /* Some functions to manipulate PA instructions.  */
 
 /* Declare the functions with the unused attribute to avoid warnings.  */
 /* Some functions to manipulate PA instructions.  */
 
 /* Declare the functions with the unused attribute to avoid warnings.  */
-static INLINE int sign_extend PARAMS ((int, int)) ATTRIBUTE_UNUSED;
-static INLINE int low_sign_extend PARAMS ((int, int)) ATTRIBUTE_UNUSED;
-static INLINE int sign_unext PARAMS ((int, int)) ATTRIBUTE_UNUSED;
-static INLINE int low_sign_unext PARAMS ((int, int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_3 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_12 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_14 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_16 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_17 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_21 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_22 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE bfd_signed_vma hppa_field_adjust
-  PARAMS ((bfd_vma, bfd_signed_vma,
-          enum hppa_reloc_field_selector_type_alt)) ATTRIBUTE_UNUSED;
-static INLINE int bfd_hppa_insn2fmt PARAMS ((bfd *, int)) ATTRIBUTE_UNUSED;
-static INLINE int hppa_rebuild_insn PARAMS ((int, int, int)) ATTRIBUTE_UNUSED;
+static inline int sign_extend (int, int) ATTRIBUTE_UNUSED;
+static inline int low_sign_extend (int, int) ATTRIBUTE_UNUSED;
+static inline int sign_unext (int, int) ATTRIBUTE_UNUSED;
+static inline int low_sign_unext (int, int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_3 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_12 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_14 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_16 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_17 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_21 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_22 (int) ATTRIBUTE_UNUSED;
+static inline bfd_signed_vma hppa_field_adjust
+  (bfd_vma, bfd_signed_vma, enum hppa_reloc_field_selector_type_alt)
+  ATTRIBUTE_UNUSED;
+static inline int bfd_hppa_insn2fmt (bfd *, int) ATTRIBUTE_UNUSED;
+static inline int hppa_rebuild_insn (int, int, int) ATTRIBUTE_UNUSED;
 
 
 /* The *sign_extend functions are used to assemble various bitfields
    taken from an instruction and return the resulting immediate
    value.  */
 
 
 
 /* The *sign_extend functions are used to assemble various bitfields
    taken from an instruction and return the resulting immediate
    value.  */
 
-static INLINE int
-sign_extend (x, len)
-     int x, len;
+static inline int
+sign_extend (int x, int len)
 {
   int signbit = (1 << (len - 1));
   int mask = (signbit << 1) - 1;
   return ((x & mask) ^ signbit) - signbit;
 }
 
 {
   int signbit = (1 << (len - 1));
   int mask = (signbit << 1) - 1;
   return ((x & mask) ^ signbit) - signbit;
 }
 
-static INLINE int
-low_sign_extend (x, len)
-     int x, len;
+static inline int
+low_sign_extend (int x, int len)
 {
   return (x >> 1) - ((x & 1) << (len - 1));
 }
 {
   return (x >> 1) - ((x & 1) << (len - 1));
 }
@@ -207,9 +197,8 @@ low_sign_extend (x, len)
    insertion into an opcode. pa-risc uses all sorts of weird bitfields
    in the instruction to hold the value.  */
 
    insertion into an opcode. pa-risc uses all sorts of weird bitfields
    in the instruction to hold the value.  */
 
-static INLINE int
-sign_unext (x, len)
-     int x, len;
+static inline int
+sign_unext (int x, int len)
 {
   int len_ones;
 
 {
   int len_ones;
 
@@ -218,9 +207,8 @@ sign_unext (x, len)
   return x & len_ones;
 }
 
   return x & len_ones;
 }
 
-static INLINE int
-low_sign_unext (x, len)
-     int x, len;
+static inline int
+low_sign_unext (int x, int len)
 {
   int temp;
   int sign;
 {
   int temp;
   int sign;
@@ -232,34 +220,30 @@ low_sign_unext (x, len)
   return (temp << 1) | sign;
 }
 
   return (temp << 1) | sign;
 }
 
-static INLINE int
-re_assemble_3 (as3)
-     int as3;
+static inline int
+re_assemble_3 (int as3)
 {
   return ((  (as3 & 4) << (13-2))
          | ((as3 & 3) << (13+1)));
 }
 
 {
   return ((  (as3 & 4) << (13-2))
          | ((as3 & 3) << (13+1)));
 }
 
-static INLINE int
-re_assemble_12 (as12)
-     int as12;
+static inline int
+re_assemble_12 (int as12)
 {
   return ((  (as12 & 0x800) >> 11)
          | ((as12 & 0x400) >> (10 - 2))
          | ((as12 & 0x3ff) << (1 + 2)));
 }
 
 {
   return ((  (as12 & 0x800) >> 11)
          | ((as12 & 0x400) >> (10 - 2))
          | ((as12 & 0x3ff) << (1 + 2)));
 }
 
-static INLINE int
-re_assemble_14 (as14)
-     int as14;
+static inline int
+re_assemble_14 (int as14)
 {
   return ((  (as14 & 0x1fff) << 1)
          | ((as14 & 0x2000) >> 13));
 }
 
 {
   return ((  (as14 & 0x1fff) << 1)
          | ((as14 & 0x2000) >> 13));
 }
 
-static INLINE int
-re_assemble_16 (as16)
-     int as16;
+static inline int
+re_assemble_16 (int as16)
 {
   int s, t;
 
 {
   int s, t;
 
@@ -269,9 +253,8 @@ re_assemble_16 (as16)
   return (t ^ s ^ (s >> 1)) | (s >> 15);
 }
 
   return (t ^ s ^ (s >> 1)) | (s >> 15);
 }
 
-static INLINE int
-re_assemble_17 (as17)
-     int as17;
+static inline int
+re_assemble_17 (int as17)
 {
   return ((  (as17 & 0x10000) >> 16)
          | ((as17 & 0x0f800) << (16 - 11))
 {
   return ((  (as17 & 0x10000) >> 16)
          | ((as17 & 0x0f800) << (16 - 11))
@@ -279,9 +262,8 @@ re_assemble_17 (as17)
          | ((as17 & 0x003ff) << (1 + 2)));
 }
 
          | ((as17 & 0x003ff) << (1 + 2)));
 }
 
-static INLINE int
-re_assemble_21 (as21)
-     int as21;
+static inline int
+re_assemble_21 (int as21)
 {
   return ((  (as21 & 0x100000) >> 20)
          | ((as21 & 0x0ffe00) >> 8)
 {
   return ((  (as21 & 0x100000) >> 20)
          | ((as21 & 0x0ffe00) >> 8)
@@ -290,9 +272,8 @@ re_assemble_21 (as21)
          | ((as21 & 0x000003) << 12));
 }
 
          | ((as21 & 0x000003) << 12));
 }
 
-static INLINE int
-re_assemble_22 (as22)
-     int as22;
+static inline int
+re_assemble_22 (int as22)
 {
   return ((  (as22 & 0x200000) >> 21)
          | ((as22 & 0x1f0000) << (21 - 16))
 {
   return ((  (as22 & 0x200000) >> 21)
          | ((as22 & 0x1f0000) << (21 - 16))
@@ -312,11 +293,10 @@ re_assemble_22 (as22)
    This function returns sign extended values in all cases.
 */
 
    This function returns sign extended values in all cases.
 */
 
-static INLINE bfd_signed_vma
-hppa_field_adjust (sym_val, addend, r_field)
-     bfd_vma sym_val;
-     bfd_signed_vma addend;
-     enum hppa_reloc_field_selector_type_alt r_field;
+static inline bfd_signed_vma
+hppa_field_adjust (bfd_vma sym_val,
+                  bfd_signed_vma addend,
+                  enum hppa_reloc_field_selector_type_alt r_field)
 {
   bfd_signed_vma value;
 
 {
   bfd_signed_vma value;
 
@@ -479,12 +459,10 @@ enum hppa_opcode_type
 
 /* Given a machine instruction, return its format.  */
 
 
 /* Given a machine instruction, return its format.  */
 
-static INLINE int
-bfd_hppa_insn2fmt (abfd, insn)
-     bfd *abfd;
-     int insn;
+static inline int
+bfd_hppa_insn2fmt (bfd *abfd, int insn)
 {
 {
-  enum hppa_opcode_type op = get_opcode (insn);
+  enum hppa_opcode_type op = (enum hppa_opcode_type) get_opcode (insn);
 
   switch (op)
     {
 
   switch (op)
     {
@@ -563,11 +541,8 @@ bfd_hppa_insn2fmt (abfd, insn)
 /* Insert VALUE into INSN using R_FORMAT to determine exactly what
    bits to change.  */
 
 /* Insert VALUE into INSN using R_FORMAT to determine exactly what
    bits to change.  */
 
-static INLINE int
-hppa_rebuild_insn (insn, value, r_format)
-     int insn;
-     int value;
-     int r_format;
+static inline int
+hppa_rebuild_insn (int insn, int value, int r_format)
 {
   switch (r_format)
     {
 {
   switch (r_format)
     {
This page took 0.027492 seconds and 4 git commands to generate.