]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/ppc/emul_generic.c
sim: unify -Werror build settings
[thirdparty/binutils-gdb.git] / sim / ppc / emul_generic.c
index 1d431750dda11964e5a5eaac45d00d2062268620..9d57bc6c01aec2b6c6ab6cb9e84ecd12e5930c24 100644 (file)
@@ -4,7 +4,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
-    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,
@@ -13,8 +13,7 @@
     GNU General Public License for more details.
 
     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.
+    along with this program; if not, see <http://www.gnu.org/licenses/>.
 
     */
 
@@ -65,7 +64,7 @@ emul_read_gpr64(cpu *processor,
 {
   unsigned32 hi;
   unsigned32 lo;
-  if (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN) {
+  if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) {
     hi = cpu_registers(processor)->gpr[g];
     lo = cpu_registers(processor)->gpr[g+1];
   }
@@ -84,7 +83,7 @@ emul_write_gpr64(cpu *processor,
 {
   unsigned32 hi = EXTRACTED64(val, 0, 31);
   unsigned32 lo = EXTRACTED64(val, 32, 63);
-  if (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN) {
+  if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) {
     cpu_registers(processor)->gpr[g] = hi;
     cpu_registers(processor)->gpr[g+1] = lo;
   }
@@ -121,10 +120,10 @@ emul_read_string(char *dest,
 INLINE_EMUL_GENERIC void
 emul_write_status(cpu *processor,
                  int status,
-                 int errno)
+                 int err)
 {
-  if (status == -1 && errno != 0) {
-    cpu_registers(processor)->gpr[3] = errno;
+  if (status == -1 && err != 0) {
+    cpu_registers(processor)->gpr[3] = err;
     CR_SET(0, cr_i_summary_overflow);
   }
   else {
@@ -138,10 +137,10 @@ INLINE_EMUL_GENERIC void
 emul_write2_status(cpu *processor,
                   int status1,
                   int status2,
-                  int errno)
+                  int err)
 {
-  if (status1 == -1 && errno != 0) {
-    cpu_registers(processor)->gpr[3] = errno;
+  if (status1 == -1 && err != 0) {
+    cpu_registers(processor)->gpr[3] = err;
     CR_SET(0, cr_i_summary_overflow);
   }
   else {
@@ -263,12 +262,7 @@ emul_add_tree_options(device *tree,
   if (tree_find_property(tree, "/options/little-endian?"))
     little_endian = tree_find_boolean_property(tree, "/options/little-endian?");
   else {
-#ifdef bfd_little_endian       /* new bfd */
     little_endian = (image != NULL && bfd_little_endian(image));
-#else
-    little_endian = (image != NULL &&
-                    !image->xvec->byteorder_big_p);
-#endif
     tree_parse(tree, "/options/little-endian? %s",
               little_endian ? "true" : "false");
   }