mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
compiler.h: replace QEMU_NORETURN with G_NORETURN
G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in glib-compat. Note that this attribute must be placed before the function declaration (bringing a bit of consistency in qemu codebase usage). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Warner Losh <imp@bsdimp.com> Message-Id: <20220420132624.2439741-20-marcandre.lureau@redhat.com>
This commit is contained in:
@@ -28,12 +28,12 @@ void *probe_access(CPUArchState *env, target_ulong addr, int size,
|
||||
g_assert_not_reached();
|
||||
}
|
||||
|
||||
void QEMU_NORETURN cpu_loop_exit(CPUState *cpu)
|
||||
G_NORETURN void cpu_loop_exit(CPUState *cpu)
|
||||
{
|
||||
g_assert_not_reached();
|
||||
}
|
||||
|
||||
void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
|
||||
G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
|
||||
{
|
||||
g_assert_not_reached();
|
||||
}
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
TranslationBlock *tb_gen_code(CPUState *cpu, target_ulong pc,
|
||||
target_ulong cs_base, uint32_t flags,
|
||||
int cflags);
|
||||
|
||||
void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
|
||||
G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
|
||||
void page_init(void);
|
||||
void tb_htable_init(void);
|
||||
|
||||
|
||||
+2
-1
@@ -347,7 +347,8 @@ static int core_dump_signal(int sig)
|
||||
}
|
||||
|
||||
/* Abort execution with signal. */
|
||||
static void QEMU_NORETURN dump_core_and_abort(int target_sig)
|
||||
static G_NORETURN
|
||||
void dump_core_and_abort(int target_sig)
|
||||
{
|
||||
CPUArchState *env = thread_cpu->env_ptr;
|
||||
CPUState *cpu = env_cpu(env);
|
||||
|
||||
+2
-1
@@ -189,7 +189,8 @@ static void wake_blocked_threads(ITCStorageCell *c)
|
||||
c->blocked_threads = 0;
|
||||
}
|
||||
|
||||
static void QEMU_NORETURN block_thread_and_exit(ITCStorageCell *c)
|
||||
static G_NORETURN
|
||||
void block_thread_and_exit(ITCStorageCell *c)
|
||||
{
|
||||
c->blocked_threads |= 1ULL << current_cpu->cpu_index;
|
||||
current_cpu->halted = 1;
|
||||
|
||||
+10
-10
@@ -58,10 +58,10 @@ void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb,
|
||||
*/
|
||||
bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exit);
|
||||
|
||||
void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu);
|
||||
void QEMU_NORETURN cpu_loop_exit(CPUState *cpu);
|
||||
void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
|
||||
void QEMU_NORETURN cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
|
||||
G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu);
|
||||
G_NORETURN void cpu_loop_exit(CPUState *cpu);
|
||||
G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
|
||||
G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
|
||||
|
||||
/**
|
||||
* cpu_loop_exit_requested:
|
||||
@@ -669,9 +669,9 @@ bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set,
|
||||
* Use the TCGCPUOps hook to record cpu state, do guest operating system
|
||||
* specific things to raise SIGSEGV, and jump to the main cpu loop.
|
||||
*/
|
||||
void QEMU_NORETURN cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr,
|
||||
MMUAccessType access_type,
|
||||
bool maperr, uintptr_t ra);
|
||||
G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr,
|
||||
MMUAccessType access_type,
|
||||
bool maperr, uintptr_t ra);
|
||||
|
||||
/**
|
||||
* cpu_loop_exit_sigbus:
|
||||
@@ -683,9 +683,9 @@ void QEMU_NORETURN cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr,
|
||||
* Use the TCGCPUOps hook to record cpu state, do guest operating system
|
||||
* specific things to raise SIGBUS, and jump to the main cpu loop.
|
||||
*/
|
||||
void QEMU_NORETURN cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr,
|
||||
MMUAccessType access_type,
|
||||
uintptr_t ra);
|
||||
G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr,
|
||||
MMUAccessType access_type,
|
||||
uintptr_t ra);
|
||||
|
||||
#else
|
||||
static inline void mmap_lock(void) {}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#define dh_ctype_ptr void *
|
||||
#define dh_ctype_cptr const void *
|
||||
#define dh_ctype_void void
|
||||
#define dh_ctype_noreturn void QEMU_NORETURN
|
||||
#define dh_ctype_noreturn G_NORETURN void
|
||||
#define dh_ctype(t) dh_ctype_##t
|
||||
|
||||
#ifdef NEED_CPU_H
|
||||
|
||||
@@ -147,4 +147,8 @@ qemu_g_test_slow(void)
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#ifndef G_NORETURN
|
||||
#define G_NORETURN G_GNUC_NORETURN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1015,7 +1015,7 @@ int cpu_watchpoint_address_matches(CPUState *cpu, vaddr addr, vaddr len);
|
||||
*/
|
||||
AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx);
|
||||
|
||||
void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...)
|
||||
G_NORETURN void cpu_abort(CPUState *cpu, const char *fmt, ...)
|
||||
G_GNUC_PRINTF(2, 3);
|
||||
|
||||
/* $(top_srcdir)/cpu.c */
|
||||
|
||||
@@ -78,9 +78,9 @@ struct TCGCPUOps {
|
||||
* @do_unaligned_access: Callback for unaligned access handling
|
||||
* The callback must exit via raising an exception.
|
||||
*/
|
||||
void (*do_unaligned_access)(CPUState *cpu, vaddr addr,
|
||||
MMUAccessType access_type,
|
||||
int mmu_idx, uintptr_t retaddr) QEMU_NORETURN;
|
||||
G_NORETURN void (*do_unaligned_access)(CPUState *cpu, vaddr addr,
|
||||
MMUAccessType access_type,
|
||||
int mmu_idx, uintptr_t retaddr);
|
||||
|
||||
/**
|
||||
* @adjust_watchpoint_address: hack for cpu_check_watchpoint used by ARM
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@
|
||||
#error Cannot include hw/hw.h from user emulation
|
||||
#endif
|
||||
|
||||
void QEMU_NORETURN hw_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
|
||||
G_NORETURN void hw_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#define QEMU_EXTERN_C extern
|
||||
#endif
|
||||
|
||||
#define QEMU_NORETURN __attribute__ ((__noreturn__))
|
||||
|
||||
#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
|
||||
# define QEMU_PACKED __attribute__((gcc_struct, packed))
|
||||
#else
|
||||
|
||||
@@ -177,7 +177,8 @@ extern "C" {
|
||||
* supports QEMU_ERROR, this will be reported at compile time; otherwise
|
||||
* this will be reported at link time due to the missing symbol.
|
||||
*/
|
||||
extern void QEMU_NORETURN QEMU_ERROR("code path is reachable")
|
||||
extern G_NORETURN
|
||||
void QEMU_ERROR("code path is reachable")
|
||||
qemu_build_not_reached_always(void);
|
||||
#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
|
||||
#define qemu_build_not_reached() qemu_build_not_reached_always()
|
||||
|
||||
@@ -188,7 +188,7 @@ void qemu_thread_create(QemuThread *thread, const char *name,
|
||||
void *qemu_thread_join(QemuThread *thread);
|
||||
void qemu_thread_get_self(QemuThread *thread);
|
||||
bool qemu_thread_is_self(QemuThread *thread);
|
||||
void qemu_thread_exit(void *retval) QEMU_NORETURN;
|
||||
G_NORETURN void qemu_thread_exit(void *retval);
|
||||
void qemu_thread_naming(bool enable);
|
||||
|
||||
struct Notifier;
|
||||
|
||||
@@ -72,8 +72,8 @@ void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val,
|
||||
|
||||
#else
|
||||
|
||||
void QEMU_NORETURN helper_unaligned_ld(CPUArchState *env, target_ulong addr);
|
||||
void QEMU_NORETURN helper_unaligned_st(CPUArchState *env, target_ulong addr);
|
||||
G_NORETURN void helper_unaligned_ld(CPUArchState *env, target_ulong addr);
|
||||
G_NORETURN void helper_unaligned_st(CPUArchState *env, target_ulong addr);
|
||||
|
||||
#endif /* CONFIG_SOFTMMU */
|
||||
#endif /* TCG_LDST_H */
|
||||
|
||||
+1
-1
@@ -398,7 +398,7 @@ typedef TCGv_ptr TCGv_env;
|
||||
#define TCG_CALL_NO_WRITE_GLOBALS 0x0002
|
||||
/* Helper can be safely suppressed if the return value is not used. */
|
||||
#define TCG_CALL_NO_SIDE_EFFECTS 0x0004
|
||||
/* Helper is QEMU_NORETURN. */
|
||||
/* Helper is G_NORETURN. */
|
||||
#define TCG_CALL_NO_RETURN 0x0008
|
||||
|
||||
/* convenience version of most used call flags */
|
||||
|
||||
+2
-1
@@ -725,7 +725,8 @@ void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr,
|
||||
}
|
||||
|
||||
/* abort execution with signal */
|
||||
static void QEMU_NORETURN dump_core_and_abort(int target_sig)
|
||||
static G_NORETURN
|
||||
void dump_core_and_abort(int target_sig)
|
||||
{
|
||||
CPUState *cpu = thread_cpu;
|
||||
CPUArchState *env = cpu->env_ptr;
|
||||
|
||||
@@ -64,7 +64,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
|
||||
abi_long arg5, abi_long arg6, abi_long arg7,
|
||||
abi_long arg8);
|
||||
extern __thread CPUState *thread_cpu;
|
||||
void QEMU_NORETURN cpu_loop(CPUArchState *env);
|
||||
G_NORETURN void cpu_loop(CPUArchState *env);
|
||||
const char *target_strerror(int err);
|
||||
int get_osversion(void);
|
||||
void init_qemu_uname_release(void);
|
||||
|
||||
+2
-2
@@ -308,8 +308,8 @@ void help_cmd(Monitor *mon, const char *name)
|
||||
static const char *pch;
|
||||
static sigjmp_buf expr_env;
|
||||
|
||||
static void G_GNUC_PRINTF(2, 3) QEMU_NORETURN
|
||||
expr_error(Monitor *mon, const char *fmt, ...)
|
||||
static G_NORETURN G_GNUC_PRINTF(2, 3)
|
||||
void expr_error(Monitor *mon, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
|
||||
+8
-4
@@ -100,7 +100,8 @@ static void format_print(void *opaque, const char *name)
|
||||
printf(" %s", name);
|
||||
}
|
||||
|
||||
static void QEMU_NORETURN G_GNUC_PRINTF(1, 2) error_exit(const char *fmt, ...)
|
||||
static G_NORETURN G_GNUC_PRINTF(1, 2)
|
||||
void error_exit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@@ -112,18 +113,21 @@ static void QEMU_NORETURN G_GNUC_PRINTF(1, 2) error_exit(const char *fmt, ...)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
static void QEMU_NORETURN missing_argument(const char *option)
|
||||
static G_NORETURN
|
||||
void missing_argument(const char *option)
|
||||
{
|
||||
error_exit("missing argument for option '%s'", option);
|
||||
}
|
||||
|
||||
static void QEMU_NORETURN unrecognized_option(const char *option)
|
||||
static G_NORETURN
|
||||
void unrecognized_option(const char *option)
|
||||
{
|
||||
error_exit("unrecognized option '%s'", option);
|
||||
}
|
||||
|
||||
/* Please keep in synch with docs/tools/qemu-img.rst */
|
||||
static void QEMU_NORETURN help(void)
|
||||
static G_NORETURN
|
||||
void help(void)
|
||||
{
|
||||
const char *help_msg =
|
||||
QEMU_IMG_VERSION
|
||||
|
||||
@@ -223,7 +223,7 @@ our $Sparse = qr{
|
||||
our $Attribute = qr{
|
||||
const|
|
||||
volatile|
|
||||
QEMU_NORETURN|
|
||||
G_NORETURN|
|
||||
G_GNUC_WARN_UNUSED_RESULT|
|
||||
G_GNUC_NULL_TERMINATED|
|
||||
QEMU_PACKED|
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user