Skip to content

Commit 8905770

Browse files
committed
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 <[email protected]> Reviewed-by: Daniel P. Berrangé <[email protected]> Reviewed-by: Warner Losh <[email protected]> Message-Id: <[email protected]>
1 parent 94ae6b5 commit 8905770

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+214
-191
lines changed

accel/stubs/tcg-stub.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ void *probe_access(CPUArchState *env, target_ulong addr, int size,
2828
g_assert_not_reached();
2929
}
3030

31-
void QEMU_NORETURN cpu_loop_exit(CPUState *cpu)
31+
G_NORETURN void cpu_loop_exit(CPUState *cpu)
3232
{
3333
g_assert_not_reached();
3434
}
3535

36-
void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
36+
G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
3737
{
3838
g_assert_not_reached();
3939
}

accel/tcg/internal.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
TranslationBlock *tb_gen_code(CPUState *cpu, target_ulong pc,
1515
target_ulong cs_base, uint32_t flags,
1616
int cflags);
17-
18-
void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
17+
G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
1918
void page_init(void);
2019
void tb_htable_init(void);
2120

bsd-user/signal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ static int core_dump_signal(int sig)
347347
}
348348

349349
/* Abort execution with signal. */
350-
static void QEMU_NORETURN dump_core_and_abort(int target_sig)
350+
static G_NORETURN
351+
void dump_core_and_abort(int target_sig)
351352
{
352353
CPUArchState *env = thread_cpu->env_ptr;
353354
CPUState *cpu = env_cpu(env);

hw/misc/mips_itu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ static void wake_blocked_threads(ITCStorageCell *c)
189189
c->blocked_threads = 0;
190190
}
191191

192-
static void QEMU_NORETURN block_thread_and_exit(ITCStorageCell *c)
192+
static G_NORETURN
193+
void block_thread_and_exit(ITCStorageCell *c)
193194
{
194195
c->blocked_threads |= 1ULL << current_cpu->cpu_index;
195196
current_cpu->halted = 1;

include/exec/exec-all.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb,
5858
*/
5959
bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exit);
6060

61-
void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu);
62-
void QEMU_NORETURN cpu_loop_exit(CPUState *cpu);
63-
void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
64-
void QEMU_NORETURN cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
61+
G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu);
62+
G_NORETURN void cpu_loop_exit(CPUState *cpu);
63+
G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
64+
G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
6565

6666
/**
6767
* cpu_loop_exit_requested:
@@ -669,9 +669,9 @@ bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set,
669669
* Use the TCGCPUOps hook to record cpu state, do guest operating system
670670
* specific things to raise SIGSEGV, and jump to the main cpu loop.
671671
*/
672-
void QEMU_NORETURN cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr,
673-
MMUAccessType access_type,
674-
bool maperr, uintptr_t ra);
672+
G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr,
673+
MMUAccessType access_type,
674+
bool maperr, uintptr_t ra);
675675

676676
/**
677677
* cpu_loop_exit_sigbus:
@@ -683,9 +683,9 @@ void QEMU_NORETURN cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr,
683683
* Use the TCGCPUOps hook to record cpu state, do guest operating system
684684
* specific things to raise SIGBUS, and jump to the main cpu loop.
685685
*/
686-
void QEMU_NORETURN cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr,
687-
MMUAccessType access_type,
688-
uintptr_t ra);
686+
G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr,
687+
MMUAccessType access_type,
688+
uintptr_t ra);
689689

690690
#else
691691
static inline void mmap_lock(void) {}

include/exec/helper-head.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#define dh_ctype_ptr void *
4747
#define dh_ctype_cptr const void *
4848
#define dh_ctype_void void
49-
#define dh_ctype_noreturn void QEMU_NORETURN
49+
#define dh_ctype_noreturn G_NORETURN void
5050
#define dh_ctype(t) dh_ctype_##t
5151

5252
#ifdef NEED_CPU_H

include/glib-compat.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,8 @@ qemu_g_test_slow(void)
147147

148148
#pragma GCC diagnostic pop
149149

150+
#ifndef G_NORETURN
151+
#define G_NORETURN G_GNUC_NORETURN
152+
#endif
153+
150154
#endif

include/hw/core/cpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ int cpu_watchpoint_address_matches(CPUState *cpu, vaddr addr, vaddr len);
10151015
*/
10161016
AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx);
10171017

1018-
void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...)
1018+
G_NORETURN void cpu_abort(CPUState *cpu, const char *fmt, ...)
10191019
G_GNUC_PRINTF(2, 3);
10201020

10211021
/* $(top_srcdir)/cpu.c */

include/hw/core/tcg-cpu-ops.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ struct TCGCPUOps {
7878
* @do_unaligned_access: Callback for unaligned access handling
7979
* The callback must exit via raising an exception.
8080
*/
81-
void (*do_unaligned_access)(CPUState *cpu, vaddr addr,
82-
MMUAccessType access_type,
83-
int mmu_idx, uintptr_t retaddr) QEMU_NORETURN;
81+
G_NORETURN void (*do_unaligned_access)(CPUState *cpu, vaddr addr,
82+
MMUAccessType access_type,
83+
int mmu_idx, uintptr_t retaddr);
8484

8585
/**
8686
* @adjust_watchpoint_address: hack for cpu_check_watchpoint used by ARM

include/hw/hw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
#error Cannot include hw/hw.h from user emulation
66
#endif
77

8-
void QEMU_NORETURN hw_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
8+
G_NORETURN void hw_error(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
99

1010
#endif

0 commit comments

Comments
 (0)