]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/m68hc11/emulos.c
sim: formally assume unistd.h always exists (via gnulib)
[thirdparty/binutils-gdb.git] / sim / m68hc11 / emulos.c
index d7436f79b3648ef14e16f0284ac23fbd1a80b6de..fcf9cc1b5e57daa9942d98f023e1a7637f96e5ac 100644 (file)
@@ -1,5 +1,5 @@
 /* emulos.c -- Small OS emulation
-   Copyright 1999-2021 Free Software Foundation, Inc.
+   Copyright 1999-2023 Free Software Foundation, Inc.
    Written by Stephane Carrez (stcarrez@worldnet.fr)
 
 This file is part of GDB, GAS, and the GNU binutils.
@@ -21,9 +21,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "defs.h"
 
 #include "sim-main.h"
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
+
+#include "m68hc11-sim.h"
 
 #ifndef WIN32
 #include <errno.h>
@@ -104,10 +104,10 @@ emul_write (sim_cpu *cpu)
   if (addr + size > 0x0FFFF) {
     size = 0x0FFFF - addr;
   }
-  cpu->cpu_running = 0;
+  M68HC11_SIM_CPU (cpu)->cpu_running = 0;
   while (size)
     {
-      uint8 val = memory_read8 (cpu, addr);
+      uint8_t val = memory_read8 (cpu, addr);
 
       if (write (0, &val, 1) != 1)
        printf ("write failed: %s\n", strerror (errno));
@@ -132,7 +132,7 @@ emul_exit (sim_cpu *cpu)
 void
 emul_os (int code, sim_cpu *cpu)
 {
-  cpu->cpu_current_cycle = 8;
+  M68HC11_SIM_CPU (cpu)->cpu_current_cycle = 8;
   switch (code)
     {
     case 0x0: