qemu_mode: make building warning free

This commit is contained in:
hexcoder-
2020-05-09 20:02:32 +02:00
parent 102067d43d
commit 20392878f1
4 changed files with 19 additions and 15 deletions

View File

@ -154,15 +154,19 @@ typedef int64_t s64;
#define MEM_BARRIER() __asm__ volatile("" ::: "memory") #define MEM_BARRIER() __asm__ volatile("" ::: "memory")
#if __GNUC__ < 6 #if __GNUC__ < 6
#define likely(_x) (_x) # ifndef likely
#define unlikely(_x) (_x) # define likely(_x) (_x)
# endif
# ifndef unlikely
# define unlikely(_x) (_x)
# endif
#else #else
#ifndef likely # ifndef likely
#define likely(_x) __builtin_expect(!!(_x), 1) # define likely(_x) __builtin_expect(!!(_x), 1)
#endif # endif
#ifndef unlikely # ifndef unlikely
#define unlikely(_x) __builtin_expect(!!(_x), 0) # define unlikely(_x) __builtin_expect(!!(_x), 0)
#endif # endif
#endif #endif
#endif /* ! _HAVE_TYPES_H */ #endif /* ! _HAVE_TYPES_H */

View File

@ -123,12 +123,11 @@ struct afl_chain {
/* Some forward decls: */ /* Some forward decls: */
TranslationBlock *tb_htable_lookup(CPUState *, target_ulong, target_ulong,
uint32_t, uint32_t);
static inline TranslationBlock *tb_find(CPUState *, TranslationBlock *, int, static inline TranslationBlock *tb_find(CPUState *, TranslationBlock *, int,
uint32_t); uint32_t);
static inline void tb_add_jump(TranslationBlock *tb, int n, static inline void tb_add_jump(TranslationBlock *tb, int n,
TranslationBlock *tb_next); TranslationBlock *tb_next);
int open_self_maps(void *cpu_env, int fd);
/************************* /*************************
* ACTUAL IMPLEMENTATION * * ACTUAL IMPLEMENTATION *

View File

@ -35,7 +35,7 @@
#include "tcg.h" #include "tcg.h"
#include "tcg-op.h" #include "tcg-op.h"
#if TCG_TARGET_LONG_BITS == 64 #if TCG_TARGET_REG_BITS == 64
#define _DEFAULT_MO MO_64 #define _DEFAULT_MO MO_64
#else #else
#define _DEFAULT_MO MO_32 #define _DEFAULT_MO MO_32

View File

@ -43,16 +43,17 @@ index b13a170e..3f5cc902 100644
ts = (TaskState *)cpu->opaque; ts = (TaskState *)cpu->opaque;
if (flags & CLONE_SETTLS) if (flags & CLONE_SETTLS)
cpu_set_tls (env, newtls); cpu_set_tls (env, newtls);
@@ -6554,7 +6558,7 @@ static int open_self_cmdline(void *cpu_env, int fd) @@ -6554,7 +6558,8 @@ static int open_self_cmdline(void *cpu_env, int fd)
return 0; return 0;
} }
-static int open_self_maps(void *cpu_env, int fd) -static int open_self_maps(void *cpu_env, int fd)
+int open_self_maps(void *cpu_env, int fd);
+int open_self_maps(void *cpu_env, int fd) +int open_self_maps(void *cpu_env, int fd)
{ {
CPUState *cpu = ENV_GET_CPU((CPUArchState *)cpu_env); CPUState *cpu = ENV_GET_CPU((CPUArchState *)cpu_env);
TaskState *ts = cpu->opaque; TaskState *ts = cpu->opaque;
@@ -7324,10 +7328,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, @@ -7324,10 +7329,12 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
#ifdef TARGET_NR_stime /* not on alpha */ #ifdef TARGET_NR_stime /* not on alpha */
case TARGET_NR_stime: case TARGET_NR_stime:
{ {
@ -68,7 +69,7 @@ index b13a170e..3f5cc902 100644
} }
#endif #endif
#ifdef TARGET_NR_alarm /* not on alpha */ #ifdef TARGET_NR_alarm /* not on alpha */
@@ -10529,7 +10535,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, @@ -10529,7 +10536,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
return TARGET_PAGE_SIZE; return TARGET_PAGE_SIZE;
#endif #endif
case TARGET_NR_gettid: case TARGET_NR_gettid:
@ -77,7 +78,7 @@ index b13a170e..3f5cc902 100644
#ifdef TARGET_NR_readahead #ifdef TARGET_NR_readahead
case TARGET_NR_readahead: case TARGET_NR_readahead:
#if TARGET_ABI_BITS == 32 #if TARGET_ABI_BITS == 32
@@ -10813,8 +10819,19 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, @@ -10813,8 +10820,19 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
return get_errno(safe_tkill((int)arg1, target_to_host_signal(arg2))); return get_errno(safe_tkill((int)arg1, target_to_host_signal(arg2)));
case TARGET_NR_tgkill: case TARGET_NR_tgkill: