public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: iq2000: fix some missing prototypes warnings
@ 2021-11-16  5:50 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-11-16  5:50 UTC (permalink / raw)
  To: gdb-patches

Turns out some of these were hiding real bugs like not passing the
pc variable down.
---
 sim/iq2000/Makefile.in  | 2 +-
 sim/iq2000/sem-switch.c | 4 ++--
 sim/iq2000/sem.c        | 4 ++--
 sim/iq2000/sim-main.h   | 5 +++++
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/sim/iq2000/Makefile.in b/sim/iq2000/Makefile.in
index c98fb78e7ff5..64068acac30a 100644
--- a/sim/iq2000/Makefile.in
+++ b/sim/iq2000/Makefile.in
@@ -38,7 +38,7 @@ ALL_CPU_CFLAGS = -DHAVE_CPU_IQ2000BF -DHAVE_CPU_IQ10BF
 SIM_EXTRA_CLEAN = iq2000-clean
 
 # Some modules don't build cleanly yet.
-cpu.o iq2000.o mloop.o sem.o: SIM_WERROR_CFLAGS =
+iq2000.o mloop.o: SIM_WERROR_CFLAGS =
 
 ## COMMON_POST_CONFIG_FRAG
 
diff --git a/sim/iq2000/sem-switch.c b/sim/iq2000/sem-switch.c
index fb3f232c108d..4a5c8f91d004 100644
--- a/sim/iq2000/sem-switch.c
+++ b/sim/iq2000/sem-switch.c
@@ -1809,10 +1809,10 @@ do_break (current_cpu, pc);
   ARGBUF *abuf = SEM_ARGBUF (sem_arg);
 #define FLD(f) abuf->fields.sfmt_empty.f
   int UNUSED written = 0;
-  IADDR UNUSED pc = abuf->addr;
+  IADDR pc = abuf->addr;
   vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
 
-do_syscall (current_cpu);
+  do_syscall (current_cpu, pc);
 
 #undef FLD
 }
diff --git a/sim/iq2000/sem.c b/sim/iq2000/sem.c
index 53b275397535..36bab6022822 100644
--- a/sim/iq2000/sem.c
+++ b/sim/iq2000/sem.c
@@ -1747,10 +1747,10 @@ SEM_FN_NAME (iq2000bf,syscall) (SIM_CPU *current_cpu, SEM_ARG sem_arg)
 #define FLD(f) abuf->fields.sfmt_empty.f
   ARGBUF *abuf = SEM_ARGBUF (sem_arg);
   int UNUSED written = 0;
-  IADDR UNUSED pc = abuf->addr;
+  IADDR pc = abuf->addr;
   SEM_PC vpc = SEM_NEXT_VPC (sem_arg, pc, 4);
 
-do_syscall (current_cpu);
+  do_syscall (current_cpu, pc);
 
   return vpc;
 #undef FLD
diff --git a/sim/iq2000/sim-main.h b/sim/iq2000/sim-main.h
index 3615a712b065..bf0608290884 100644
--- a/sim/iq2000/sim-main.h
+++ b/sim/iq2000/sim-main.h
@@ -59,4 +59,9 @@ iq2000_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
 #define IQ2000_INSN_MEM_SIZE (CPU2INSN(0x800000) - CPU2INSN(0x0000))
 #define IQ2000_DATA_MEM_SIZE (CPU2DATA(0x800000) - CPU2DATA(0x0000))
 
+PCADDR get_h_pc (SIM_CPU *);
+void set_h_pc (SIM_CPU *, PCADDR);
+void do_syscall (SIM_CPU *, PCADDR);
+void do_break (SIM_CPU *, PCADDR);
+
 #endif /* SIM_MAIN_H */
-- 
2.33.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-16  5:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16  5:50 [PATCH] sim: iq2000: fix some missing prototypes warnings Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).