public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH/committed] sim: ppc: mark halt & restart funcs as noreturn
Date: Thu, 21 Dec 2023 01:21:03 -0500	[thread overview]
Message-ID: <20231221062103.29043-1-vapier@gentoo.org> (raw)

This helps the compiler with optimization and fixes fallthru warnings.
---
 sim/ppc/cpu.h  | 6 +++---
 sim/ppc/psim.c | 2 +-
 sim/ppc/psim.h | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sim/ppc/cpu.h b/sim/ppc/cpu.h
index c7a087112710..dfd2244766c1 100644
--- a/sim/ppc/cpu.h
+++ b/sim/ppc/cpu.h
@@ -100,21 +100,21 @@ INLINE_CPU\
 INLINE_CPU\
 (void) cpu_restart
 (cpu *processor,
- unsigned_word nia);
+ unsigned_word nia) ATTRIBUTE_NORETURN;
 
 INLINE_CPU\
 (void) cpu_halt
 (cpu *processor,
  unsigned_word nia,
  stop_reason reason,
- int signal);
+ int signal) ATTRIBUTE_NORETURN;
 
 EXTERN_CPU\
 (void) cpu_error
 (cpu *processor,
  unsigned_word cia,
  const char *fmt,
- ...) ATTRIBUTE_PRINTF_3;
+ ...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_3;
 
 
 /* The processors local concept of time */
diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c
index 2a823616faea..a08d38914eaf 100644
--- a/sim/ppc/psim.c
+++ b/sim/ppc/psim.c
@@ -578,7 +578,7 @@ psim_restart(psim *system,
 }
 
 
-static void
+static ATTRIBUTE_NORETURN void
 cntrl_c_simulation(void *data)
 {
   psim *system = data;
diff --git a/sim/ppc/psim.h b/sim/ppc/psim.h
index 2070cbf7b903..6ed91cd98363 100644
--- a/sim/ppc/psim.h
+++ b/sim/ppc/psim.h
@@ -93,7 +93,7 @@ extern void psim_run
 
 extern void psim_restart
 (psim *system,
- int cpu_nr);
+ int cpu_nr) ATTRIBUTE_NORETURN;
 
 extern void psim_set_halt_and_restart
 (psim *system,
@@ -110,7 +110,7 @@ extern void psim_halt
 (psim *system,
  int cpu_nr,
  stop_reason reason,
- int signal);
+ int signal) ATTRIBUTE_NORETURN;
 
 extern int psim_last_cpu
 (psim *system);
-- 
2.43.0


                 reply	other threads:[~2023-12-21  6:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231221062103.29043-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).