SDL static config fix (Roman Zippel)
[qemu] / vl.h
diff --git a/vl.h b/vl.h
index 65c8f08..7fb81c8 100644 (file)
--- a/vl.h
+++ b/vl.h
@@ -44,7 +44,7 @@
 #endif
 
 #ifdef _WIN32
-#define lseek64 lseek
+#define lseek64 _lseeki64
 #endif
 
 #include "cpu.h"
@@ -67,6 +67,16 @@ static inline uint16_t be16_to_cpu(uint16_t v)
     return v;
 }
 
+static inline uint32_t cpu_to_be32(uint32_t v)
+{
+    return v;
+}
+
+static inline uint16_t cpu_to_be16(uint16_t v)
+{
+    return v;
+}
+
 static inline uint32_t le32_to_cpu(uint32_t v)
 {
     return bswap32(v);
@@ -77,7 +87,18 @@ static inline uint16_t le16_to_cpu(uint16_t v)
     return bswap16(v);
 }
 
+static inline uint32_t cpu_to_le32(uint32_t v)
+{
+    return bswap32(v);
+}
+
+static inline uint16_t cpu_to_le16(uint16_t v)
+{
+    return bswap16(v);
+}
+
 #else
+
 static inline uint32_t be32_to_cpu(uint32_t v)
 {
     return bswap32(v);
@@ -88,6 +109,16 @@ static inline uint16_t be16_to_cpu(uint16_t v)
     return bswap16(v);
 }
 
+static inline uint32_t cpu_to_be32(uint32_t v)
+{
+    return bswap32(v);
+}
+
+static inline uint16_t cpu_to_be16(uint16_t v)
+{
+    return bswap16(v);
+}
+
 static inline uint32_t le32_to_cpu(uint32_t v)
 {
     return v;
@@ -97,19 +128,22 @@ static inline uint16_t le16_to_cpu(uint16_t v)
 {
     return v;
 }
+
+static inline uint32_t cpu_to_le32(uint32_t v)
+{
+    return v;
+}
+
+static inline uint16_t cpu_to_le16(uint16_t v)
+{
+    return v;
+}
 #endif
 
 
 /* vl.c */
 extern int reset_requested;
 
-typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);
-typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);
-
-int register_ioport_read(int start, int length, int size, 
-                         IOPortReadFunc *func, void *opaque);
-int register_ioport_write(int start, int length, int size, 
-                          IOPortWriteFunc *func, void *opaque);
 uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
 
 void hw_error(const char *fmt, ...);
@@ -132,29 +166,41 @@ void qemu_del_vm_stop_handler(VMStopHandler *cb, void *opaque);
 void vm_start(void);
 void vm_stop(int reason);
 
+extern int audio_enabled;
+
+/* async I/O support */
+
+typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
+typedef int IOCanRWHandler(void *opaque);
+
+int qemu_add_fd_read_handler(int fd, IOCanRWHandler *fd_can_read, 
+                             IOReadHandler *fd_read, void *opaque);
+void qemu_del_fd_read_handler(int fd);
+
 /* network redirectors support */
 
 #define MAX_NICS 8
 
 typedef struct NetDriverState {
-    int fd;
+    int index; /* index number in QEMU */
     uint8_t macaddr[6];
     char ifname[16];
+    void (*send_packet)(struct NetDriverState *nd, 
+                        const uint8_t *buf, int size);
+    void (*add_read_packet)(struct NetDriverState *nd, 
+                            IOCanRWHandler *fd_can_read, 
+                            IOReadHandler *fd_read, void *opaque);
+    /* tun specific data */
+    int fd;
+    /* slirp specific data */
 } NetDriverState;
 
 extern int nb_nics;
 extern NetDriverState nd_table[MAX_NICS];
 
-void net_send_packet(NetDriverState *nd, const uint8_t *buf, int size);
-
-/* async I/O support */
-
-typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
-typedef int IOCanRWHandler(void *opaque);
-
-int qemu_add_fd_read_handler(int fd, IOCanRWHandler *fd_can_read, 
-                             IOReadHandler *fd_read, void *opaque);
-void qemu_del_fd_read_handler(int fd);
+void qemu_send_packet(NetDriverState *nd, const uint8_t *buf, int size);
+void qemu_add_read_packet(NetDriverState *nd, IOCanRWHandler *fd_can_read, 
+                          IOReadHandler *fd_read, void *opaque);
 
 /* timers */
 
@@ -295,6 +341,18 @@ void bdrv_set_change_cb(BlockDriverState *bs,
 void bdrv_info(void);
 BlockDriverState *bdrv_find(const char *name);
 
+/* ISA bus */
+
+extern target_phys_addr_t isa_mem_base;
+
+typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);
+typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);
+
+int register_ioport_read(int start, int length, int size, 
+                         IOPortReadFunc *func, void *opaque);
+int register_ioport_write(int start, int length, int size, 
+                          IOPortWriteFunc *func, void *opaque);
+
 /* vga.c */
 
 #define VGA_RAM_SIZE (4096 * 1024)
@@ -416,6 +474,8 @@ void serial_receive_break(SerialState *s);
 
 void pic_set_irq(int irq, int level);
 void pic_init(void);
+uint32_t pic_intack_read(CPUState *env);
+void pic_info(void);
 
 /* i8254.c */
 
@@ -448,6 +508,12 @@ void pc_init(int ram_size, int vga_ram_size, int boot_device,
              const char *kernel_filename, const char *kernel_cmdline,
              const char *initrd_filename);
 
+/* ppc.c */
+void ppc_init (int ram_size, int vga_ram_size, int boot_device,
+              DisplayState *ds, const char **fd_filename, int snapshot,
+              const char *kernel_filename, const char *kernel_cmdline,
+              const char *initrd_filename);
+
 /* monitor.c */
 void monitor_init(void);
 void term_printf(const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2)));