Index: qemu/block.c
===================================================================
--- qemu.orig/block.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/block.c	2008-08-23 13:19:38.000000000 +0000
@@ -56,7 +56,6 @@
 static int bdrv_write_em(BlockDriverState *bs, int64_t sector_num,
                          const uint8_t *buf, int nb_sectors);
 
-BlockDriverState *bdrv_first;
 static BlockDriver *first_drv;
 
 int path_is_absolute(const char *path)
Index: qemu/hw/usb.h
===================================================================
--- qemu.orig/hw/usb.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/hw/usb.h	2008-08-23 13:19:38.000000000 +0000
@@ -235,8 +235,6 @@
 int set_usb_string(uint8_t *buf, const char *str);
 void usb_send_msg(USBDevice *dev, int msg);
 
-void usb_packet_complete(USBPacket *p);
-
 /* usb hub */
 USBDevice *usb_hub_init(int nb_ports);
 
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/linux-user/syscall.c	2008-08-23 13:19:38.000000000 +0000
@@ -267,10 +267,6 @@
 extern int flock(int, int);
 extern int setfsuid(int);
 extern int setfsgid(int);
-extern int setresuid(uid_t, uid_t, uid_t);
-extern int getresuid(uid_t *, uid_t *, uid_t *);
-extern int setresgid(gid_t, gid_t, gid_t);
-extern int getresgid(gid_t *, gid_t *, gid_t *);
 extern int setgroups(int, gid_t *);
 
 #define ERRNO_TABLE_SIZE 1200
Index: qemu/monitor.c
===================================================================
--- qemu.orig/monitor.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/monitor.c	2008-08-23 13:19:38.000000000 +0000
@@ -2687,8 +2687,6 @@
         readline_handle_byte(buf[i]);
 }
 
-static void monitor_start_input(void);
-
 static void monitor_handle_command1(void *opaque, const char *cmdline)
 {
     monitor_handle_command(cmdline);
Index: qemu/slirp/debug.c
===================================================================
--- qemu.orig/slirp/debug.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/slirp/debug.c	2008-08-23 13:19:38.000000000 +0000
@@ -16,8 +16,6 @@
 #endif
 int slirp_debug = 0;
 
-extern char *strerror _P((int));
-
 /* Carry over one item from main.c so that the tty's restored.
  * Only done when the tty being used is /dev/tty --RedWolf */
 #ifndef CONFIG_QEMU
Index: qemu/slirp/misc.h
===================================================================
--- qemu.orig/slirp/misc.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/slirp/misc.h	2008-08-23 13:19:38.000000000 +0000
@@ -17,7 +17,7 @@
 };
 
 extern struct ex_list *exec_list;
-extern u_int curtime, time_fasttimo, last_slowtimo;
+extern u_int time_fasttimo, last_slowtimo;
 
 extern int (*lprint_print) _P((void *, const char *, va_list));
 extern char *lprint_ptr, *lprint_ptr2, **lprint_arg;
Index: qemu/slirp/slirp_config.h
===================================================================
--- qemu.orig/slirp/slirp_config.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/slirp/slirp_config.h	2008-08-23 13:19:38.000000000 +0000
@@ -128,10 +128,10 @@
 #undef HAVE_SYS_STROPTS_H
 
 /* Define to whatever your compiler thinks inline should be */
-#define inline inline
+//#define inline inline
 
 /* Define to whatever your compiler thinks const should be */
-#define const const
+//#define const const
 
 /* Define if your compiler doesn't like prototypes */
 #undef NO_PROTOTYPES
@@ -170,7 +170,7 @@
 #undef HAVE_SETENV
 
 /* Define if you have index() */
-#undef HAVE_INDEX
+#define HAVE_INDEX
 
 /* Define if you have bcmp() */
 #undef HAVE_BCMP
@@ -182,7 +182,7 @@
 #define HAVE_MEMMOVE
 
 /* Define if you have gethostid */
-#undef HAVE_GETHOSTID
+#define HAVE_GETHOSTID
 
 /* Define if you DON'T have unix-domain sockets */
 #undef NO_UNIX_SOCKETS
Index: qemu/slirp/socket.c
===================================================================
--- qemu.orig/slirp/socket.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/slirp/socket.c	2008-08-23 13:19:38.000000000 +0000
@@ -8,7 +8,6 @@
 #define WANT_SYS_IOCTL_H
 #include <slirp.h>
 #include "ip_icmp.h"
-#include "main.h"
 #ifdef __sun__
 #include <sys/filio.h>
 #endif
Index: qemu/target-sparc/helper.h
===================================================================
--- qemu.orig/target-sparc/helper.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/target-sparc/helper.h	2008-08-23 13:19:38.000000000 +0000
@@ -1,3 +1,6 @@
+#ifndef TARGET_SPARC_HELPER_H
+#define TARGET_SPARC_HELPER_H
+
 #ifndef DEF_HELPER
 #define DEF_HELPER(ret, name, params) ret name params;
 #endif
@@ -188,3 +191,5 @@
 void memcpy32(target_ulong *dst, const target_ulong *src);
 target_ulong mmu_probe(CPUState *env, target_ulong address, int mmulev);
 void dump_mmu(CPUState *env);
+
+#endif
Index: qemu/exec-all.h
===================================================================
--- qemu.orig/exec-all.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/exec-all.h	2008-08-23 13:19:38.000000000 +0000
@@ -57,8 +57,7 @@
 typedef void (GenOpFunc2)(long, long);
 typedef void (GenOpFunc3)(long, long, long);
 
-extern FILE *logfile;
-extern int loglevel;
+#include "qemu-log.h"
 
 void gen_intermediate_code(CPUState *env, struct TranslationBlock *tb);
 void gen_intermediate_code_pc(CPUState *env, struct TranslationBlock *tb);
@@ -290,6 +289,8 @@
 void tlb_fill(target_ulong addr, int is_write, int mmu_idx,
               void *retaddr);
 
+#include "softmmu_defs.h"
+
 #define ACCESS_TYPE (NB_MMU_MODES + 1)
 #define MEMSUFFIX _code
 #define env cpu_single_env
Index: qemu/linux-user/qemu.h
===================================================================
--- qemu.orig/linux-user/qemu.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/linux-user/qemu.h	2008-08-23 13:19:38.000000000 +0000
@@ -199,8 +199,7 @@
 void fork_start(void);
 void fork_end(int child);
 
-extern int loglevel;
-extern FILE *logfile;
+#include "qemu-log.h"
 
 /* strace.c */
 void print_syscall(int num,
Index: qemu/qemu-log.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/qemu-log.h	2008-08-23 15:23:07.000000000 +0000
@@ -0,0 +1,7 @@
+#ifndef QEMU_LOG_H
+#define QEMU_LOG_H
+
+extern FILE *logfile;
+extern int loglevel;
+
+#endif
Index: qemu/target-i386/exec.h
===================================================================
--- qemu.orig/target-i386/exec.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/target-i386/exec.h	2008-08-23 13:19:38.000000000 +0000
@@ -31,8 +31,7 @@
 
 register struct CPUX86State *env asm(AREG0);
 
-extern FILE *logfile;
-extern int loglevel;
+#include "qemu-log.h"
 
 #define EAX (env->regs[R_EAX])
 #define ECX (env->regs[R_ECX])
@@ -58,13 +57,10 @@
 #include "cpu.h"
 #include "exec-all.h"
 
-void cpu_x86_update_cr0(CPUX86State *env, uint32_t new_cr0);
 void cpu_x86_update_cr3(CPUX86State *env, target_ulong new_cr3);
 void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_cr4);
 int cpu_x86_handle_mmu_fault(CPUX86State *env, target_ulong addr,
                              int is_write, int mmu_idx, int is_softmmu);
-void tlb_fill(target_ulong addr, int is_write, int mmu_idx,
-              void *retaddr);
 void __hidden cpu_lock(void);
 void __hidden cpu_unlock(void);
 void do_interrupt(int intno, int is_int, int error_code,
@@ -120,16 +116,6 @@
 #define floatx_round_to_int floatx80_round_to_int
 #define floatx_compare floatx80_compare
 #define floatx_compare_quiet floatx80_compare_quiet
-#define sin sinl
-#define cos cosl
-#define sqrt sqrtl
-#define pow powl
-#define log logl
-#define tan tanl
-#define atan2 atan2l
-#define floor floorl
-#define ceil ceill
-#define ldexp ldexpl
 #else
 #define floatx_to_int32 float64_to_int32
 #define floatx_to_int64 float64_to_int64
@@ -148,16 +134,6 @@
 #define floatx_compare_quiet float64_compare_quiet
 #endif
 
-extern CPU86_LDouble sin(CPU86_LDouble x);
-extern CPU86_LDouble cos(CPU86_LDouble x);
-extern CPU86_LDouble sqrt(CPU86_LDouble x);
-extern CPU86_LDouble pow(CPU86_LDouble, CPU86_LDouble);
-extern CPU86_LDouble log(CPU86_LDouble x);
-extern CPU86_LDouble tan(CPU86_LDouble x);
-extern CPU86_LDouble atan2(CPU86_LDouble, CPU86_LDouble);
-extern CPU86_LDouble floor(CPU86_LDouble x);
-extern CPU86_LDouble ceil(CPU86_LDouble x);
-
 #define RC_MASK         0xc00
 #define RC_NEAR		0x000
 #define RC_DOWN		0x400
Index: qemu/target-i386/helper.h
===================================================================
--- qemu.orig/target-i386/helper.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/target-i386/helper.h	2008-08-23 13:19:38.000000000 +0000
@@ -186,7 +186,6 @@
 DEF_HELPER(void, helper_fscale, (void))
 DEF_HELPER(void, helper_fsin, (void))
 DEF_HELPER(void, helper_fcos, (void))
-DEF_HELPER(void, helper_fxam_ST0, (void))
 DEF_HELPER(void, helper_fstenv, (target_ulong ptr, int data32))
 DEF_HELPER(void, helper_fldenv, (target_ulong ptr, int data32))
 DEF_HELPER(void, helper_fsave, (target_ulong ptr, int data32))
Index: qemu/softmmu_defs.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ qemu/softmmu_defs.h	2008-08-23 13:19:38.000000000 +0000
@@ -0,0 +1,22 @@
+#ifndef SOFTMMU_DEFS_H
+#define SOFTMMU_DEFS_H
+
+uint8_t REGPARM __ldb_mmu(target_ulong addr, int mmu_idx);
+void REGPARM __stb_mmu(target_ulong addr, uint8_t val, int mmu_idx);
+uint16_t REGPARM __ldw_mmu(target_ulong addr, int mmu_idx);
+void REGPARM __stw_mmu(target_ulong addr, uint16_t val, int mmu_idx);
+uint32_t REGPARM __ldl_mmu(target_ulong addr, int mmu_idx);
+void REGPARM __stl_mmu(target_ulong addr, uint32_t val, int mmu_idx);
+uint64_t REGPARM __ldq_mmu(target_ulong addr, int mmu_idx);
+void REGPARM __stq_mmu(target_ulong addr, uint64_t val, int mmu_idx);
+
+uint8_t REGPARM __ldb_cmmu(target_ulong addr, int mmu_idx);
+void REGPARM __stb_cmmu(target_ulong addr, uint8_t val, int mmu_idx);
+uint16_t REGPARM __ldw_cmmu(target_ulong addr, int mmu_idx);
+void REGPARM __stw_cmmu(target_ulong addr, uint16_t val, int mmu_idx);
+uint32_t REGPARM __ldl_cmmu(target_ulong addr, int mmu_idx);
+void REGPARM __stl_cmmu(target_ulong addr, uint32_t val, int mmu_idx);
+uint64_t REGPARM __ldq_cmmu(target_ulong addr, int mmu_idx);
+void REGPARM __stq_cmmu(target_ulong addr, uint64_t val, int mmu_idx);
+
+#endif
Index: qemu/softmmu_exec.h
===================================================================
--- qemu.orig/softmmu_exec.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/softmmu_exec.h	2008-08-23 13:19:38.000000000 +0000
@@ -9,6 +9,8 @@
 #define ldul_executive  ldl_executive
 #define ldul_supervisor ldl_supervisor
 
+#include "softmmu_defs.h"
+
 #define ACCESS_TYPE 0
 #define MEMSUFFIX MMU_MODE0_SUFFIX
 #define DATA_SIZE 1
Index: qemu/softmmu_header.h
===================================================================
--- qemu.orig/softmmu_header.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/softmmu_header.h	2008-08-23 13:19:38.000000000 +0000
@@ -70,10 +70,6 @@
 #define ADDR_READ addr_read
 #endif
 
-DATA_TYPE REGPARM glue(glue(__ld, SUFFIX), MMUSUFFIX)(target_ulong addr,
-                                                         int mmu_idx);
-void REGPARM glue(glue(__st, SUFFIX), MMUSUFFIX)(target_ulong addr, DATA_TYPE v, int mmu_idx);
-
 #if (DATA_SIZE <= 4) && (TARGET_LONG_BITS == 32) && defined(__i386__) && \
     (ACCESS_TYPE < NB_MMU_MODES) && defined(ASM_SOFTMMU)
 
Index: qemu/tcg/x86_64/tcg-target.c
===================================================================
--- qemu.orig/tcg/x86_64/tcg-target.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/tcg/x86_64/tcg-target.c	2008-08-23 13:19:38.000000000 +0000
@@ -467,16 +467,8 @@
 }
 
 #if defined(CONFIG_SOFTMMU)
-extern void __ldb_mmu(void);
-extern void __ldw_mmu(void);
-extern void __ldl_mmu(void);
-extern void __ldq_mmu(void);
-
-extern void __stb_mmu(void);
-extern void __stw_mmu(void);
-extern void __stl_mmu(void);
-extern void __stq_mmu(void);
 
+#include "../../softmmu_defs.h"
 
 static void *qemu_ld_helpers[4] = {
     __ldb_mmu,
Index: qemu/tcg/arm/tcg-target.c
===================================================================
--- qemu.orig/tcg/arm/tcg-target.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/tcg/arm/tcg-target.c	2008-08-23 13:19:38.000000000 +0000
@@ -808,15 +808,8 @@
 }
 
 #ifdef CONFIG_SOFTMMU
-extern void __ldb_mmu(void);
-extern void __ldw_mmu(void);
-extern void __ldl_mmu(void);
-extern void __ldq_mmu(void);
-
-extern void __stb_mmu(void);
-extern void __stw_mmu(void);
-extern void __stl_mmu(void);
-extern void __stq_mmu(void);
+
+#include "../../softmmu_defs.h"
 
 static void *qemu_ld_helpers[4] = {
     __ldb_mmu,
Index: qemu/tcg/hppa/tcg-target.c
===================================================================
--- qemu.orig/tcg/hppa/tcg-target.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/tcg/hppa/tcg-target.c	2008-08-23 13:19:38.000000000 +0000
@@ -345,15 +345,8 @@
 }
 
 #if defined(CONFIG_SOFTMMU)
-extern void __ldb_mmu(void);
-extern void __ldw_mmu(void);
-extern void __ldl_mmu(void);
-extern void __ldq_mmu(void);
-
-extern void __stb_mmu(void);
-extern void __stw_mmu(void);
-extern void __stl_mmu(void);
-extern void __stq_mmu(void);
+
+#include "../../softmmu_defs.h"
 
 static void *qemu_ld_helpers[4] = {
     __ldb_mmu,
Index: qemu/tcg/i386/tcg-target.c
===================================================================
--- qemu.orig/tcg/i386/tcg-target.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/tcg/i386/tcg-target.c	2008-08-23 13:19:38.000000000 +0000
@@ -404,15 +404,8 @@
 }
 
 #if defined(CONFIG_SOFTMMU)
-extern void __ldb_mmu(void);
-extern void __ldw_mmu(void);
-extern void __ldl_mmu(void);
-extern void __ldq_mmu(void);
-
-extern void __stb_mmu(void);
-extern void __stw_mmu(void);
-extern void __stl_mmu(void);
-extern void __stq_mmu(void);
+
+#include "../../softmmu_defs.h"
 
 static void *qemu_ld_helpers[4] = {
     __ldb_mmu,
Index: qemu/tcg/ppc/tcg-target.c
===================================================================
--- qemu.orig/tcg/ppc/tcg-target.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/tcg/ppc/tcg-target.c	2008-08-23 13:19:38.000000000 +0000
@@ -454,15 +454,8 @@
 }
 
 #if defined(CONFIG_SOFTMMU)
-extern void __ldb_mmu(void);
-extern void __ldw_mmu(void);
-extern void __ldl_mmu(void);
-extern void __ldq_mmu(void);
-
-extern void __stb_mmu(void);
-extern void __stw_mmu(void);
-extern void __stl_mmu(void);
-extern void __stq_mmu(void);
+
+#include "../../softmmu_defs.h"
 
 static void *qemu_ld_helpers[4] = {
     __ldb_mmu,
Index: qemu/tcg/ppc64/tcg-target.c
===================================================================
--- qemu.orig/tcg/ppc64/tcg-target.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/tcg/ppc64/tcg-target.c	2008-08-23 13:19:38.000000000 +0000
@@ -509,15 +509,8 @@
 }
 
 #if defined (CONFIG_SOFTMMU)
-extern void __ldb_mmu(void);
-extern void __ldw_mmu(void);
-extern void __ldl_mmu(void);
-extern void __ldq_mmu(void);
-
-extern void __stb_mmu(void);
-extern void __stw_mmu(void);
-extern void __stl_mmu(void);
-extern void __stq_mmu(void);
+
+#include "../../softmmu_defs.h"
 
 static void *qemu_ld_helpers[4] = {
     __ldb_mmu,
Index: qemu/tcg/sparc/tcg-target.c
===================================================================
--- qemu.orig/tcg/sparc/tcg-target.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/tcg/sparc/tcg-target.c	2008-08-23 13:19:38.000000000 +0000
@@ -472,16 +472,8 @@
 }
 
 #if defined(CONFIG_SOFTMMU)
-extern void __ldb_mmu(void);
-extern void __ldw_mmu(void);
-extern void __ldl_mmu(void);
-extern void __ldq_mmu(void);
-
-extern void __stb_mmu(void);
-extern void __stw_mmu(void);
-extern void __stl_mmu(void);
-extern void __stq_mmu(void);
 
+#include "../../softmmu_defs.h"
 
 static const void * const qemu_ld_helpers[4] = {
     __ldb_mmu,
Index: qemu/hw/arm-misc.h
===================================================================
--- qemu.orig/hw/arm-misc.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/hw/arm-misc.h	2008-08-23 13:19:38.000000000 +0000
@@ -34,6 +34,9 @@
 void arm_load_kernel(CPUState *env, struct arm_boot_info *info);
 
 /* armv7m_nvic.c */
+
+/* Multiplication factor to convert from system clock ticks to qemu timer
+   ticks.  */
 int system_clock_scale;
 qemu_irq *armv7m_nvic_init(CPUState *env);
 
Index: qemu/hw/armv7m_nvic.c
===================================================================
--- qemu.orig/hw/armv7m_nvic.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/hw/armv7m_nvic.c	2008-08-23 13:19:38.000000000 +0000
@@ -50,10 +50,6 @@
 #define SYSTICK_CLKSOURCE (1 << 2)
 #define SYSTICK_COUNTFLAG (1 << 16)
 
-/* Multiplication factor to convert from system clock ticks to qemu timer
-   ticks.  */
-int system_clock_scale;
-
 /* Conversion factor from qemu timer to SysTick frequencies.  */
 static inline int64_t systick_scale(nvic_state *s)
 {
Index: qemu/hw/isa.h
===================================================================
--- qemu.orig/hw/isa.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/hw/isa.h	2008-08-23 13:19:38.000000000 +0000
@@ -1,3 +1,5 @@
+#ifndef HW_ISA_H
+#define HW_ISA_H
 /* ISA bus */
 
 extern target_phys_addr_t isa_mem_base;
@@ -22,3 +24,4 @@
 void DMA_register_channel (int nchan,
                            DMA_transfer_handler transfer_handler,
                            void *opaque);
+#endif
Index: qemu/target-arm/exec.h
===================================================================
--- qemu.orig/target-arm/exec.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/target-arm/exec.h	2008-08-23 13:19:38.000000000 +0000
@@ -61,5 +61,3 @@
 void cpu_loop_exit(void);
 
 void raise_exception(int);
-
-uint32_t helper_neon_mul_p8(uint32_t op1, uint32_t op2);
Index: qemu/target-arm/translate.c
===================================================================
--- qemu.orig/target-arm/translate.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/target-arm/translate.c	2008-08-23 13:19:38.000000000 +0000
@@ -29,6 +29,7 @@
 #include "exec-all.h"
 #include "disas.h"
 #include "tcg-op.h"
+#include "qemu-log.h"
 
 #define GEN_HELPER 1
 #include "helpers.h"
@@ -72,10 +73,6 @@
 #define DISAS_WFI 4
 #define DISAS_SWI 5
 
-/* XXX: move that elsewhere */
-extern FILE *logfile;
-extern int loglevel;
-
 static TCGv cpu_env;
 /* We reuse the same 64-bit temporaries for efficiency.  */
 static TCGv cpu_V0, cpu_V1, cpu_M0;
Index: qemu/target-cris/exec.h
===================================================================
--- qemu.orig/target-cris/exec.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/target-cris/exec.h	2008-08-23 13:19:38.000000000 +0000
@@ -46,7 +46,6 @@
 
 int cpu_cris_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
                               int mmu_idx, int is_softmmu);
-void tlb_fill (target_ulong addr, int is_write, int mmu_idx, void *retaddr);
 
 #if !defined(CONFIG_USER_ONLY)
 #include "softmmu_exec.h"
Index: qemu/target-m68k/exec.h
===================================================================
--- qemu.orig/target-m68k/exec.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/target-m68k/exec.h	2008-08-23 13:19:38.000000000 +0000
@@ -44,8 +44,6 @@
 #include "softmmu_exec.h"
 #endif
 
-void cpu_m68k_flush_flags(CPUM68KState *env, int cc_op);
-
 void cpu_loop_exit(void);
 
 static inline int cpu_halted(CPUState *env) {
Index: qemu/target-m68k/translate.c
===================================================================
--- qemu.orig/target-m68k/translate.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/target-m68k/translate.c	2008-08-23 13:19:38.000000000 +0000
@@ -30,6 +30,7 @@
 #include "exec-all.h"
 #include "disas.h"
 #include "tcg-op.h"
+#include "qemu-log.h"
 
 #define GEN_HELPER 1
 #include "helpers.h"
@@ -157,9 +158,6 @@
 static void *gen_throws_exception;
 #define gen_last_qop NULL
 
-extern FILE *logfile;
-extern int loglevel;
-
 #define OS_BYTE 0
 #define OS_WORD 1
 #define OS_LONG 2
Index: qemu/target-mips/exec.h
===================================================================
--- qemu.orig/target-mips/exec.h	2008-08-23 13:17:32.000000000 +0000
+++ qemu/target-mips/exec.h	2008-08-23 13:19:38.000000000 +0000
@@ -33,9 +33,6 @@
 void do_raise_exception_err (uint32_t exception, int error_code);
 void do_raise_exception (uint32_t exception);
 
-void cpu_dump_state(CPUState *env, FILE *f,
-                    int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
-                    int flags);
 void cpu_mips_irqctrl_init (void);
 uint32_t cpu_mips_get_random (CPUState *env);
 uint32_t cpu_mips_get_count (CPUState *env);
Index: qemu/target-ppc/translate_init.c
===================================================================
--- qemu.orig/target-ppc/translate_init.c	2008-08-23 13:17:32.000000000 +0000
+++ qemu/target-ppc/translate_init.c	2008-08-23 13:19:38.000000000 +0000
@@ -8941,8 +8941,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-int fflush (FILE *stream);
-
 /* Opcode types */
 enum {
     PPC_DIRECT   = 0, /* Opcode routine        */
Index: qemu/linux-user/arm/nwfpe/fpa11_cprt.c
===================================================================
--- qemu.orig/linux-user/arm/nwfpe/fpa11_cprt.c	2008-08-23 15:17:36.000000000 +0000
+++ qemu/linux-user/arm/nwfpe/fpa11_cprt.c	2008-08-23 15:17:44.000000000 +0000
@@ -27,8 +27,6 @@
 //#include "fpmodule.h"
 //#include "fpmodule.inl"
 
-void SetRoundingMode(const unsigned int opcode);
-
 unsigned int PerformFLT(const unsigned int opcode);
 unsigned int PerformFIX(const unsigned int opcode);
 
Index: qemu/linux-user/arm/syscall.h
===================================================================
--- qemu.orig/linux-user/arm/syscall.h	2008-05-29 14:26:08.000000000 +0000
+++ qemu/linux-user/arm/syscall.h	2008-08-23 15:17:03.000000000 +0000
@@ -40,5 +40,3 @@
 #else
 #define UNAME_MACHINE "armv5tel"
 #endif
-
-uint32_t do_arm_semihosting(CPUState *);
Index: qemu/linux-user/m68k/syscall.h
===================================================================
--- qemu.orig/linux-user/m68k/syscall.h	2008-08-23 15:21:28.000000000 +0000
+++ qemu/linux-user/m68k/syscall.h	2008-08-23 15:21:33.000000000 +0000
@@ -18,5 +18,4 @@
 
 #define UNAME_MACHINE "m68k"
 
-void do_m68k_semihosting(CPUState *, int);
 void do_m68k_simcall(CPUState *, int);
Index: qemu/target-alpha/exec.h
===================================================================
--- qemu.orig/target-alpha/exec.h	2008-08-23 15:11:32.000000000 +0000
+++ qemu/target-alpha/exec.h	2008-08-23 15:19:26.000000000 +0000
@@ -74,8 +74,6 @@
 
 int cpu_alpha_handle_mmu_fault (CPUState *env, uint64_t address, int rw,
                                 int mmu_idx, int is_softmmu);
-int cpu_alpha_mfpr (CPUState *env, int iprn, uint64_t *valp);
-int cpu_alpha_mtpr (CPUState *env, int iprn, uint64_t val, uint64_t *oldvalp);
 
 void do_interrupt (CPUState *env);
 
