Commit 87ecb68bdf8a3e40ef885ddbb7ca1797dca40ebf

Authored by pbrook
1 parent 257514dd

Break up vl.h.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 223 changed files with 2400 additions and 1826 deletions
Makefile
1 # Makefile for QEMU. 1 # Makefile for QEMU.
2 2
  3 +VPATH=$(SRC_PATH):$(SRC_PATH)/hw
  4 +
3 include config-host.mak 5 include config-host.mak
4 6
5 .PHONY: all clean distclean dvi info install install-doc tar tarbin \ 7 .PHONY: all clean distclean dvi info install install-doc tar tarbin \
@@ -47,9 +49,15 @@ BLOCK_OBJS+=block-qcow2.o block-parallels.o @@ -47,9 +49,15 @@ BLOCK_OBJS+=block-qcow2.o block-parallels.o
47 # CPUs and machines. 49 # CPUs and machines.
48 50
49 OBJS=$(BLOCK_OBJS) 51 OBJS=$(BLOCK_OBJS)
50 -OBJS+=readline.o console.o 52 +OBJS+=readline.o console.o
51 OBJS+=block.o 53 OBJS+=block.o
52 54
  55 +OBJS+=irq.o
  56 +OBJS+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
  57 +OBJS+=ssd0303.o ssd0323.o ads7846.o
  58 +OBJS+=scsi-disk.o cdrom.o
  59 +OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o
  60 +
53 ifdef CONFIG_WIN32 61 ifdef CONFIG_WIN32
54 OBJS+=tap-win32.o 62 OBJS+=tap-win32.o
55 endif 63 endif
Makefile.target
@@ -399,7 +399,6 @@ endif @@ -399,7 +399,6 @@ endif
399 VL_OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o 399 VL_OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o
400 # XXX: suppress QEMU_TOOL tests 400 # XXX: suppress QEMU_TOOL tests
401 VL_OBJS+=block-raw.o 401 VL_OBJS+=block-raw.o
402 -VL_OBJS+=irq.o  
403 402
404 ifdef CONFIG_ALSA 403 ifdef CONFIG_ALSA
405 LIBS += -lasound 404 LIBS += -lasound
@@ -421,14 +420,11 @@ CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS) @@ -421,14 +420,11 @@ CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
421 LIBS += $(CONFIG_VNC_TLS_LIBS) 420 LIBS += $(CONFIG_VNC_TLS_LIBS)
422 endif 421 endif
423 422
424 -VL_OBJS += i2c.o smbus.o  
425 -  
426 # SCSI layer 423 # SCSI layer
427 -VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o 424 +VL_OBJS+= lsi53c895a.o
428 425
429 # USB layer 426 # USB layer
430 -VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o  
431 -VL_OBJS+= usb-wacom.o 427 +VL_OBJS+= usb-ohci.o
432 428
433 # EEPROM emulation 429 # EEPROM emulation
434 VL_OBJS += eeprom93xx.o 430 VL_OBJS += eeprom93xx.o
@@ -444,7 +440,7 @@ ifeq ($(TARGET_BASE_ARCH), i386) @@ -444,7 +440,7 @@ ifeq ($(TARGET_BASE_ARCH), i386)
444 VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o 440 VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
445 VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o 441 VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
446 VL_OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o 442 VL_OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
447 -VL_OBJS+= usb-uhci.o smbus_eeprom.o vmmouse.o vmport.o vmware_vga.o 443 +VL_OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o
448 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE 444 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
449 endif 445 endif
450 ifeq ($(TARGET_BASE_ARCH), ppc) 446 ifeq ($(TARGET_BASE_ARCH), ppc)
@@ -468,7 +464,7 @@ VL_OBJS+= mips_r4k.o mips_malta.o mips_pica61.o mips_mipssim.o @@ -468,7 +464,7 @@ VL_OBJS+= mips_r4k.o mips_malta.o mips_pica61.o mips_mipssim.o
468 VL_OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o 464 VL_OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
469 VL_OBJS+= jazz_led.o 465 VL_OBJS+= jazz_led.o
470 VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o 466 VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
471 -VL_OBJS+= piix_pci.o smbus_eeprom.o parallel.o cirrus_vga.o $(SOUND_HW) 467 +VL_OBJS+= piix_pci.o parallel.o cirrus_vga.o $(SOUND_HW)
472 VL_OBJS+= mipsnet.o 468 VL_OBJS+= mipsnet.o
473 CPPFLAGS += -DHAS_AUDIO 469 CPPFLAGS += -DHAS_AUDIO
474 endif 470 endif
@@ -494,13 +490,13 @@ VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o @@ -494,13 +490,13 @@ VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
494 VL_OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o 490 VL_OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
495 VL_OBJS+= versatile_pci.o sd.o ptimer.o 491 VL_OBJS+= versatile_pci.o sd.o ptimer.o
496 VL_OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o 492 VL_OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
497 -VL_OBJS+= armv7m.o armv7m_nvic.o stellaris.o ssd0303.o pl022.o  
498 -VL_OBJS+= ssd0323.o pl061.o 493 +VL_OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o
  494 +VL_OBJS+= pl061.o
499 VL_OBJS+= arm-semi.o 495 VL_OBJS+= arm-semi.o
500 VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o 496 VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
501 -VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o max111x.o max7310.o 497 +VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o
502 VL_OBJS+= pflash_cfi01.o gumstix.o 498 VL_OBJS+= pflash_cfi01.o gumstix.o
503 -VL_OBJS+= spitz.o ads7846.o ide.o serial.o nand.o ecc.o wm8750.o 499 +VL_OBJS+= spitz.o ide.o serial.o nand.o ecc.o
504 VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o omap_i2c.o 500 VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o omap_i2c.o
505 VL_OBJS+= palm.o tsc210x.o 501 VL_OBJS+= palm.o tsc210x.o
506 CPPFLAGS += -DHAS_AUDIO 502 CPPFLAGS += -DHAS_AUDIO
arm-semi.c
@@ -33,7 +33,9 @@ @@ -33,7 +33,9 @@
33 33
34 #define ARM_ANGEL_HEAP_SIZE (128 * 1024 * 1024) 34 #define ARM_ANGEL_HEAP_SIZE (128 * 1024 * 1024)
35 #else 35 #else
36 -#include "vl.h" 36 +#include "qemu-common.h"
  37 +#include "sysemu.h"
  38 +#include "gdbstub.h"
37 #endif 39 #endif
38 40
39 #define SYS_OPEN 0x01 41 #define SYS_OPEN 0x01
audio/audio.c
@@ -21,7 +21,11 @@ @@ -21,7 +21,11 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw/hw.h"
  25 +#include "audio.h"
  26 +#include "console.h"
  27 +#include "qemu-timer.h"
  28 +#include "sysemu.h"
25 29
26 #define AUDIO_CAP "audio" 30 #define AUDIO_CAP "audio"
27 #include "audio_int.h" 31 #include "audio_int.h"
audio/audio.h
@@ -73,7 +73,6 @@ typedef struct CaptureState { @@ -73,7 +73,6 @@ typedef struct CaptureState {
73 LIST_ENTRY (CaptureState) entries; 73 LIST_ENTRY (CaptureState) entries;
74 } CaptureState; 74 } CaptureState;
75 75
76 -typedef struct AudioState AudioState;  
77 typedef struct SWVoiceOut SWVoiceOut; 76 typedef struct SWVoiceOut SWVoiceOut;
78 typedef struct CaptureVoiceOut CaptureVoiceOut; 77 typedef struct CaptureVoiceOut CaptureVoiceOut;
79 typedef struct SWVoiceIn SWVoiceIn; 78 typedef struct SWVoiceIn SWVoiceIn;
audio/mixeng.c
@@ -22,7 +22,8 @@ @@ -22,7 +22,8 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "qemu-common.h"
  26 +#include "audio.h"
26 27
27 #define AUDIO_CAP "mixeng" 28 #define AUDIO_CAP "mixeng"
28 #include "audio_int.h" 29 #include "audio_int.h"
audio/noaudio.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "qemu-common.h"
  25 +#include "audio.h"
  26 +#include "qemu-timer.h"
25 27
26 #define AUDIO_CAP "noaudio" 28 #define AUDIO_CAP "noaudio"
27 #include "audio_int.h" 29 #include "audio_int.h"
audio/ossaudio.c
@@ -30,7 +30,8 @@ @@ -30,7 +30,8 @@
30 #else 30 #else
31 #include <sys/soundcard.h> 31 #include <sys/soundcard.h>
32 #endif 32 #endif
33 -#include "vl.h" 33 +#include "qemu-common.h"
  34 +#include "audio.h"
34 35
35 #define AUDIO_CAP "oss" 36 #define AUDIO_CAP "oss"
36 #include "audio_int.h" 37 #include "audio_int.h"
audio/sdlaudio.c
@@ -23,7 +23,8 @@ @@ -23,7 +23,8 @@
23 */ 23 */
24 #include <SDL.h> 24 #include <SDL.h>
25 #include <SDL_thread.h> 25 #include <SDL_thread.h>
26 -#include "vl.h" 26 +#include "qemu-common.h"
  27 +#include "audio.h"
27 28
28 #ifndef _WIN32 29 #ifndef _WIN32
29 #ifdef __sun__ 30 #ifdef __sun__
audio/wavaudio.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw/hw.h"
  25 +#include "qemu-timer.h"
  26 +#include "audio.h"
25 27
26 #define AUDIO_CAP "wav" 28 #define AUDIO_CAP "wav"
27 #include "audio_int.h" 29 #include "audio_int.h"
audio/wavcapture.c
1 -#include "vl.h" 1 +#include "hw/hw.h"
  2 +#include "console.h"
  3 +#include "audio.h"
2 4
3 typedef struct { 5 typedef struct {
4 QEMUFile *f; 6 QEMUFile *f;
block-raw.c
@@ -21,10 +21,9 @@ @@ -21,10 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#ifdef QEMU_IMG  
25 #include "qemu-common.h" 24 #include "qemu-common.h"
26 -#else  
27 -#include "vl.h" 25 +#ifndef QEMU_IMG
  26 +#include "qemu-timer.h"
28 #include "exec-all.h" 27 #include "exec-all.h"
29 #endif 28 #endif
30 #include "block_int.h" 29 #include "block_int.h"
@@ -21,10 +21,9 @@ @@ -21,10 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#ifdef QEMU_IMG  
25 #include "qemu-common.h" 24 #include "qemu-common.h"
26 -#else  
27 -#include "vl.h" 25 +#ifndef QEMU_IMG
  26 +#include "console.h"
28 #endif 27 #endif
29 #include "block_int.h" 28 #include "block_int.h"
30 29
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 #define BLOCK_H 2 #define BLOCK_H
3 3
4 /* block.c */ 4 /* block.c */
5 -typedef struct BlockDriverState BlockDriverState;  
6 typedef struct BlockDriver BlockDriver; 5 typedef struct BlockDriver BlockDriver;
7 6
8 extern BlockDriver bdrv_raw; 7 extern BlockDriver bdrv_raw;
@@ -37,7 +37,9 @@ @@ -37,7 +37,9 @@
37 37
38 #import <Cocoa/Cocoa.h> 38 #import <Cocoa/Cocoa.h>
39 39
40 -#include "vl.h" 40 +#include "qemu-common.h"
  41 +#include "console.h"
  42 +#include "sysemu.h"
41 43
42 NSWindow *window = NULL; 44 NSWindow *window = NULL;
43 NSQuickDrawView *qd_view = NULL; 45 NSQuickDrawView *qd_view = NULL;
console.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "qemu-common.h"
  25 +#include "console.h"
  26 +#include "qemu-timer.h"
25 27
26 //#define DEBUG_CONSOLE 28 //#define DEBUG_CONSOLE
27 #define DEFAULT_BACKSCROLL 512 29 #define DEFAULT_BACKSCROLL 512
console.h 0 โ†’ 100644
  1 +#ifndef CONSOLE_H
  2 +#define CONSOLE_H
  3 +
  4 +#include "qemu-char.h"
  5 +
  6 +/* keyboard/mouse support */
  7 +
  8 +#define MOUSE_EVENT_LBUTTON 0x01
  9 +#define MOUSE_EVENT_RBUTTON 0x02
  10 +#define MOUSE_EVENT_MBUTTON 0x04
  11 +
  12 +typedef void QEMUPutKBDEvent(void *opaque, int keycode);
  13 +typedef void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int buttons_state);
  14 +
  15 +typedef struct QEMUPutMouseEntry {
  16 + QEMUPutMouseEvent *qemu_put_mouse_event;
  17 + void *qemu_put_mouse_event_opaque;
  18 + int qemu_put_mouse_event_absolute;
  19 + char *qemu_put_mouse_event_name;
  20 +
  21 + /* used internally by qemu for handling mice */
  22 + struct QEMUPutMouseEntry *next;
  23 +} QEMUPutMouseEntry;
  24 +
  25 +void qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque);
  26 +QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
  27 + void *opaque, int absolute,
  28 + const char *name);
  29 +void qemu_remove_mouse_event_handler(QEMUPutMouseEntry *entry);
  30 +
  31 +void kbd_put_keycode(int keycode);
  32 +void kbd_mouse_event(int dx, int dy, int dz, int buttons_state);
  33 +int kbd_mouse_is_absolute(void);
  34 +
  35 +void do_info_mice(void);
  36 +void do_mouse_set(int index);
  37 +
  38 +/* keysym is a unicode code except for special keys (see QEMU_KEY_xxx
  39 + constants) */
  40 +#define QEMU_KEY_ESC1(c) ((c) | 0xe100)
  41 +#define QEMU_KEY_BACKSPACE 0x007f
  42 +#define QEMU_KEY_UP QEMU_KEY_ESC1('A')
  43 +#define QEMU_KEY_DOWN QEMU_KEY_ESC1('B')
  44 +#define QEMU_KEY_RIGHT QEMU_KEY_ESC1('C')
  45 +#define QEMU_KEY_LEFT QEMU_KEY_ESC1('D')
  46 +#define QEMU_KEY_HOME QEMU_KEY_ESC1(1)
  47 +#define QEMU_KEY_END QEMU_KEY_ESC1(4)
  48 +#define QEMU_KEY_PAGEUP QEMU_KEY_ESC1(5)
  49 +#define QEMU_KEY_PAGEDOWN QEMU_KEY_ESC1(6)
  50 +#define QEMU_KEY_DELETE QEMU_KEY_ESC1(3)
  51 +
  52 +#define QEMU_KEY_CTRL_UP 0xe400
  53 +#define QEMU_KEY_CTRL_DOWN 0xe401
  54 +#define QEMU_KEY_CTRL_LEFT 0xe402
  55 +#define QEMU_KEY_CTRL_RIGHT 0xe403
  56 +#define QEMU_KEY_CTRL_HOME 0xe404
  57 +#define QEMU_KEY_CTRL_END 0xe405
  58 +#define QEMU_KEY_CTRL_PAGEUP 0xe406
  59 +#define QEMU_KEY_CTRL_PAGEDOWN 0xe407
  60 +
  61 +void kbd_put_keysym(int keysym);
  62 +
  63 +/* consoles */
  64 +
  65 +struct DisplayState {
  66 + uint8_t *data;
  67 + int linesize;
  68 + int depth;
  69 + int bgr; /* BGR color order instead of RGB. Only valid for depth == 32 */
  70 + int width;
  71 + int height;
  72 + void *opaque;
  73 + struct QEMUTimer *gui_timer;
  74 +
  75 + void (*dpy_update)(struct DisplayState *s, int x, int y, int w, int h);
  76 + void (*dpy_resize)(struct DisplayState *s, int w, int h);
  77 + void (*dpy_refresh)(struct DisplayState *s);
  78 + void (*dpy_copy)(struct DisplayState *s, int src_x, int src_y,
  79 + int dst_x, int dst_y, int w, int h);
  80 + void (*dpy_fill)(struct DisplayState *s, int x, int y,
  81 + int w, int h, uint32_t c);
  82 + void (*mouse_set)(int x, int y, int on);
  83 + void (*cursor_define)(int width, int height, int bpp, int hot_x, int hot_y,
  84 + uint8_t *image, uint8_t *mask);
  85 +};
  86 +
  87 +static inline void dpy_update(DisplayState *s, int x, int y, int w, int h)
  88 +{
  89 + s->dpy_update(s, x, y, w, h);
  90 +}
  91 +
  92 +static inline void dpy_resize(DisplayState *s, int w, int h)
  93 +{
  94 + s->dpy_resize(s, w, h);
  95 +}
  96 +
  97 +typedef void (*vga_hw_update_ptr)(void *);
  98 +typedef void (*vga_hw_invalidate_ptr)(void *);
  99 +typedef void (*vga_hw_screen_dump_ptr)(void *, const char *);
  100 +
  101 +TextConsole *graphic_console_init(DisplayState *ds, vga_hw_update_ptr update,
  102 + vga_hw_invalidate_ptr invalidate,
  103 + vga_hw_screen_dump_ptr screen_dump,
  104 + void *opaque);
  105 +void vga_hw_update(void);
  106 +void vga_hw_invalidate(void);
  107 +void vga_hw_screen_dump(const char *filename);
  108 +
  109 +int is_graphic_console(void);
  110 +CharDriverState *text_console_init(DisplayState *ds, const char *p);
  111 +void console_select(unsigned int index);
  112 +void console_color_init(DisplayState *ds);
  113 +
  114 +/* sdl.c */
  115 +void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
  116 +
  117 +/* cocoa.m */
  118 +void cocoa_display_init(DisplayState *ds, int full_screen);
  119 +
  120 +/* vnc.c */
  121 +void vnc_display_init(DisplayState *ds);
  122 +void vnc_display_close(DisplayState *ds);
  123 +int vnc_display_open(DisplayState *ds, const char *display);
  124 +int vnc_display_password(DisplayState *ds, const char *password);
  125 +void do_info_vnc(void);
  126 +
  127 +/* x_keymap.c */
  128 +extern uint8_t _translate_keycode(const int key);
  129 +
  130 +/* FIXME: term_printf et al should probably go elsewhere so everything
  131 + does not need to include console.h */
  132 +/* monitor.c */
  133 +void monitor_init(CharDriverState *hd, int show_banner);
  134 +void term_puts(const char *str);
  135 +void term_vprintf(const char *fmt, va_list ap);
  136 +void term_printf(const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
  137 +void term_print_filename(const char *filename);
  138 +void term_flush(void);
  139 +void term_print_help(void);
  140 +void monitor_readline(const char *prompt, int is_password,
  141 + char *buf, int buf_size);
  142 +
  143 +/* readline.c */
  144 +typedef void ReadLineFunc(void *opaque, const char *str);
  145 +
  146 +extern int completion_index;
  147 +void add_completion(const char *str);
  148 +void readline_handle_byte(int ch);
  149 +void readline_find_completion(const char *cmdline);
  150 +const char *readline_get_history(unsigned int index);
  151 +void readline_start(const char *prompt, int is_password,
  152 + ReadLineFunc *readline_func, void *opaque);
  153 +
  154 +#endif
cpu-defs.h
@@ -20,6 +20,10 @@ @@ -20,6 +20,10 @@
20 #ifndef CPU_DEFS_H 20 #ifndef CPU_DEFS_H
21 #define CPU_DEFS_H 21 #define CPU_DEFS_H
22 22
  23 +#ifndef NEED_CPU_H
  24 +#error cpu.h included from common code
  25 +#endif
  26 +
23 #include "config.h" 27 #include "config.h"
24 #include <setjmp.h> 28 #include <setjmp.h>
25 #include <inttypes.h> 29 #include <inttypes.h>
gdbstub.c
@@ -29,7 +29,10 @@ @@ -29,7 +29,10 @@
29 29
30 #include "qemu.h" 30 #include "qemu.h"
31 #else 31 #else
32 -#include "vl.h" 32 +#include "qemu-common.h"
  33 +#include "qemu-char.h"
  34 +#include "sysemu.h"
  35 +#include "gdbstub.h"
33 #endif 36 #endif
34 37
35 #include "qemu_socket.h" 38 #include "qemu_socket.h"
hw/acpi.c
@@ -16,7 +16,13 @@ @@ -16,7 +16,13 @@
16 * License along with this library; if not, write to the Free Software 16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 -#include "vl.h" 19 +#include "hw.h"
  20 +#include "pc.h"
  21 +#include "pci.h"
  22 +#include "qemu-timer.h"
  23 +#include "sysemu.h"
  24 +#include "i2c.h"
  25 +#include "smbus.h"
20 26
21 //#define DEBUG 27 //#define DEBUG
22 28
hw/adb.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "ppc_mac.h"
  26 +#include "console.h"
25 27
26 /* ADB commands */ 28 /* ADB commands */
27 #define ADB_BUSRESET 0x00 29 #define ADB_BUSRESET 0x00
hw/adlib.c
@@ -22,7 +22,8 @@ @@ -22,7 +22,8 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 #include <assert.h> 24 #include <assert.h>
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "audiodev.h"
26 27
27 #define ADLIB_KILL_TIMERS 1 28 #define ADLIB_KILL_TIMERS 1
28 29
hw/ads7846.c
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 * This code is licensed under the GNU GPL v2. 7 * This code is licensed under the GNU GPL v2.
8 */ 8 */
9 9
10 -#include <vl.h> 10 +#include "hw.h"
  11 +#include "devices.h"
  12 +#include "console.h"
11 13
12 struct ads7846_state_s { 14 struct ads7846_state_s {
13 qemu_irq interrupt; 15 qemu_irq interrupt;
hw/an5206.c
@@ -6,7 +6,10 @@ @@ -6,7 +6,10 @@
6 * This code is licenced under the GPL 6 * This code is licenced under the GPL
7 */ 7 */
8 8
9 -#include "vl.h" 9 +#include "hw.h"
  10 +#include "mcf.h"
  11 +#include "sysemu.h"
  12 +#include "boards.h"
10 13
11 #define KERNEL_LOAD_ADDR 0x10000 14 #define KERNEL_LOAD_ADDR 0x10000
12 #define AN5206_MBAR_ADDR 0x10000000 15 #define AN5206_MBAR_ADDR 0x10000000
hw/apb_pci.c
@@ -26,7 +26,8 @@ @@ -26,7 +26,8 @@
26 Ultrasparc PCI host is called the PCI Bus Module (PBM). The APB is 26 Ultrasparc PCI host is called the PCI Bus Module (PBM). The APB is
27 the secondary PCI bridge. */ 27 the secondary PCI bridge. */
28 28
29 -#include "vl.h" 29 +#include "hw.h"
  30 +#include "pci.h"
30 typedef target_phys_addr_t pci_addr_t; 31 typedef target_phys_addr_t pci_addr_t;
31 #include "pci_host.h" 32 #include "pci_host.h"
32 33
hw/apic.c
@@ -17,7 +17,9 @@ @@ -17,7 +17,9 @@
17 * License along with this library; if not, write to the Free Software 17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 -#include "vl.h" 20 +#include "hw.h"
  21 +#include "pc.h"
  22 +#include "qemu-timer.h"
21 23
22 //#define DEBUG_APIC 24 //#define DEBUG_APIC
23 //#define DEBUG_IOAPIC 25 //#define DEBUG_IOAPIC
hw/arm_pic.h renamed to hw/arm-misc.h
1 /* 1 /*
2 - * Generic ARM Programmable Interrupt Controller support. 2 + * Misc ARM declarations
3 * 3 *
4 * Copyright (c) 2006 CodeSourcery. 4 * Copyright (c) 2006 CodeSourcery.
5 * Written by Paul Brook 5 * Written by Paul Brook
6 * 6 *
7 * This code is licenced under the LGPL. 7 * This code is licenced under the LGPL.
8 * 8 *
9 - * Arm hardware uses a wide variety of interrupt handling hardware.  
10 - * This provides a generic framework for connecting interrupt sources and  
11 - * inputs.  
12 */ 9 */
13 10
14 -#ifndef ARM_INTERRUPT_H  
15 -#define ARM_INTERRUPT_H 1 11 +#ifndef ARM_MISC_H
  12 +#define ARM_MISC_H 1
16 13
17 /* The CPU is also modeled as an interrupt controller. */ 14 /* The CPU is also modeled as an interrupt controller. */
18 #define ARM_PIC_CPU_IRQ 0 15 #define ARM_PIC_CPU_IRQ 0
19 #define ARM_PIC_CPU_FIQ 1 16 #define ARM_PIC_CPU_FIQ 1
20 qemu_irq *arm_pic_init_cpu(CPUState *env); 17 qemu_irq *arm_pic_init_cpu(CPUState *env);
21 18
22 -#endif /* !ARM_INTERRUPT_H */ 19 +/* armv7m.c */
  20 +qemu_irq *armv7m_init(int flash_size, int sram_size,
  21 + const char *kernel_filename, const char *cpu_model);
  22 +
  23 +/* arm_boot.c */
  24 +
  25 +void arm_load_kernel(CPUState *env, int ram_size, const char *kernel_filename,
  26 + const char *kernel_cmdline, const char *initrd_filename,
  27 + int board_id, target_phys_addr_t loader_start);
  28 +
  29 +/* armv7m_nvic.c */
  30 +qemu_irq *armv7m_nvic_init(CPUState *env);
  31 +
  32 +#endif /* !ARM_MISC_H */
23 33
hw/arm_boot.c
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "arm-misc.h"
  12 +#include "sysemu.h"
11 13
12 #define KERNEL_ARGS_ADDR 0x100 14 #define KERNEL_ARGS_ADDR 0x100
13 #define KERNEL_LOAD_ADDR 0x00010000 15 #define KERNEL_LOAD_ADDR 0x00010000
hw/arm_pic.c
@@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
7 * This code is licenced under the LGPL 7 * This code is licenced under the LGPL
8 */ 8 */
9 9
10 -#include "vl.h"  
11 -#include "arm_pic.h" 10 +#include "hw.h"
  11 +#include "arm-misc.h"
12 12
13 /* Stub functions for hardware that doesn't exist. */ 13 /* Stub functions for hardware that doesn't exist. */
14 void pic_info(void) 14 void pic_info(void)
hw/arm_sysctl.c
@@ -7,8 +7,9 @@ @@ -7,8 +7,9 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h"  
11 -#include "arm_pic.h" 10 +#include "hw.h"
  11 +#include "arm-misc.h"
  12 +#include "sysemu.h"
12 13
13 #define LOCK_VALUE 0xa05f 14 #define LOCK_VALUE 0xa05f
14 15
hw/arm_timer.c
@@ -7,8 +7,9 @@ @@ -7,8 +7,9 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h"  
11 -#include "arm_pic.h" 10 +#include "hw.h"
  11 +#include "arm-misc.h"
  12 +#include "qemu-timer.h"
12 13
13 /* Common timer implementation. */ 14 /* Common timer implementation. */
14 15
hw/armv7m.c
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "arm-misc.h"
  12 +#include "sysemu.h"
11 13
12 /* Bitbanded IO. Each word corresponds to a single bit. */ 14 /* Bitbanded IO. Each word corresponds to a single bit. */
13 15
hw/armv7m_nvic.c
@@ -10,8 +10,9 @@ @@ -10,8 +10,9 @@
10 * NVIC. Much of that is also implemented here. 10 * NVIC. Much of that is also implemented here.
11 */ 11 */
12 12
13 -#include "vl.h"  
14 -#include "arm_pic.h" 13 +#include "hw.h"
  14 +#include "qemu-timer.h"
  15 +#include "arm-misc.h"
15 16
16 #define GIC_NIRQ 64 17 #define GIC_NIRQ 64
17 #define NCPU 1 18 #define NCPU 1
hw/audiodev.h 0 โ†’ 100644
  1 +/* es1370.c */
  2 +int es1370_init (PCIBus *bus, AudioState *s);
  3 +
  4 +/* sb16.c */
  5 +int SB16_init (AudioState *s, qemu_irq *pic);
  6 +
  7 +/* adlib.c */
  8 +int Adlib_init (AudioState *s, qemu_irq *pic);
  9 +
  10 +/* gus.c */
  11 +int GUS_init (AudioState *s, qemu_irq *pic);
  12 +
hw/boards.h 0 โ†’ 100644
  1 +/* Declarations for use by board files for creating devices. */
  2 +
  3 +#ifndef HW_BOARDS_H
  4 +#define HW_BOARDS_H
  5 +
  6 +typedef void QEMUMachineInitFunc(int ram_size, int vga_ram_size,
  7 + const char *boot_device,
  8 + DisplayState *ds, const char **fd_filename, int snapshot,
  9 + const char *kernel_filename, const char *kernel_cmdline,
  10 + const char *initrd_filename, const char *cpu_model);
  11 +
  12 +typedef struct QEMUMachine {
  13 + const char *name;
  14 + const char *desc;
  15 + QEMUMachineInitFunc *init;
  16 + struct QEMUMachine *next;
  17 +} QEMUMachine;
  18 +
  19 +int qemu_register_machine(QEMUMachine *m);
  20 +
  21 +/* Axis ETRAX. */
  22 +extern QEMUMachine bareetraxfs_machine;
  23 +
  24 +/* pc.c */
  25 +extern QEMUMachine pc_machine;
  26 +extern QEMUMachine isapc_machine;
  27 +
  28 +/* ppc.c */
  29 +extern QEMUMachine prep_machine;
  30 +extern QEMUMachine core99_machine;
  31 +extern QEMUMachine heathrow_machine;
  32 +extern QEMUMachine ref405ep_machine;
  33 +extern QEMUMachine taihu_machine;
  34 +
  35 +/* mips_r4k.c */
  36 +extern QEMUMachine mips_machine;
  37 +
  38 +/* mips_malta.c */
  39 +extern QEMUMachine mips_malta_machine;
  40 +
  41 +/* mips_pica61.c */
  42 +extern QEMUMachine mips_pica61_machine;
  43 +
  44 +/* mips_mipssim.c */
  45 +extern QEMUMachine mips_mipssim_machine;
  46 +
  47 +/* shix.c */
  48 +extern QEMUMachine shix_machine;
  49 +
  50 +/* r2d.c */
  51 +extern QEMUMachine r2d_machine;
  52 +
  53 +/* sun4m.c */
  54 +extern QEMUMachine ss5_machine, ss10_machine, ss600mp_machine;
  55 +
  56 +/* sun4u.c */
  57 +extern QEMUMachine sun4u_machine;
  58 +
  59 +/* integratorcp.c */
  60 +extern QEMUMachine integratorcp_machine;
  61 +
  62 +/* versatilepb.c */
  63 +extern QEMUMachine versatilepb_machine;
  64 +extern QEMUMachine versatileab_machine;
  65 +
  66 +/* realview.c */
  67 +extern QEMUMachine realview_machine;
  68 +
  69 +/* spitz.c */
  70 +extern QEMUMachine akitapda_machine;
  71 +extern QEMUMachine spitzpda_machine;
  72 +extern QEMUMachine borzoipda_machine;
  73 +extern QEMUMachine terrierpda_machine;
  74 +
  75 +/* palm.c */
  76 +extern QEMUMachine palmte_machine;
  77 +
  78 +/* gumstix.c */
  79 +extern QEMUMachine connex_machine;
  80 +
  81 +/* stellaris.c */
  82 +extern QEMUMachine lm3s811evb_machine;
  83 +extern QEMUMachine lm3s6965evb_machine;
  84 +
  85 +/* an5206.c */
  86 +extern QEMUMachine an5206_machine;
  87 +
  88 +/* mcf5208.c */
  89 +extern QEMUMachine mcf5208evb_machine;
  90 +
  91 +/* dummy_m68k.c */
  92 +extern QEMUMachine dummy_m68k_machine;
  93 +
  94 +#endif
hw/cdrom.c
@@ -25,7 +25,8 @@ @@ -25,7 +25,8 @@
25 /* ??? Most of the ATAPI emulation is still in ide.c. It should be moved 25 /* ??? Most of the ATAPI emulation is still in ide.c. It should be moved
26 here. */ 26 here. */
27 27
28 -#include <vl.h> 28 +#include "qemu-common.h"
  29 +#include "scsi-disk.h"
29 30
30 static void lba_to_msf(uint8_t *buf, int lba) 31 static void lba_to_msf(uint8_t *buf, int lba)
31 { 32 {
hw/cirrus_vga.c
@@ -26,7 +26,10 @@ @@ -26,7 +26,10 @@
26 * Reference: Finn Thogersons' VGADOC4b 26 * Reference: Finn Thogersons' VGADOC4b
27 * available at http://home.worldonline.dk/~finth/ 27 * available at http://home.worldonline.dk/~finth/
28 */ 28 */
29 -#include "vl.h" 29 +#include "hw.h"
  30 +#include "pc.h"
  31 +#include "pci.h"
  32 +#include "console.h"
30 #include "vga_int.h" 33 #include "vga_int.h"
31 34
32 /* 35 /*
hw/cs4231.c
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "sun4m.h"
25 26
26 /* debug CS4231 */ 27 /* debug CS4231 */
27 //#define DEBUG_CS 28 //#define DEBUG_CS
hw/cuda.c
@@ -22,8 +22,10 @@ @@ -22,8 +22,10 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "hw.h"
26 #include "ppc_mac.h" 26 #include "ppc_mac.h"
  27 +#include "qemu-timer.h"
  28 +#include "sysemu.h"
27 29
28 /* XXX: implement all timer modes */ 30 /* XXX: implement all timer modes */
29 31
hw/devices.h 0 โ†’ 100644
  1 +#ifndef QEMU_DEVICES_H
  2 +#define QEMU_DEVICES_H
  3 +
  4 +/* Devices that have nowhere better to go. */
  5 +
  6 +/* smc91c111.c */
  7 +void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
  8 +
  9 +/* ssd0323.c */
  10 +int ssd0323_xfer_ssi(void *opaque, int data);
  11 +void *ssd0323_init(DisplayState *ds, qemu_irq *cmd_p);
  12 +
  13 +/* ads7846.c */
  14 +struct ads7846_state_s;
  15 +uint32_t ads7846_read(void *opaque);
  16 +void ads7846_write(void *opaque, uint32_t value);
  17 +struct ads7846_state_s *ads7846_init(qemu_irq penirq);
  18 +
  19 +#endif
hw/dma.c
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "isa.h"
25 26
26 /* #define DEBUG_DMA */ 27 /* #define DEBUG_DMA */
27 28
hw/ds1225y.c
@@ -22,7 +22,9 @@ @@ -22,7 +22,9 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "mips.h"
  27 +#include "nvram.h"
26 28
27 typedef enum 29 typedef enum
28 { 30 {
hw/dummy_m68k.c
@@ -6,7 +6,9 @@ @@ -6,7 +6,9 @@
6 * This code is licenced under the GPL 6 * This code is licenced under the GPL
7 */ 7 */
8 8
9 -#include "vl.h" 9 +#include "hw.h"
  10 +#include "sysemu.h"
  11 +#include "boards.h"
10 12
11 #define KERNEL_LOAD_ADDR 0x10000 13 #define KERNEL_LOAD_ADDR 0x10000
12 14
hw/ecc.c
@@ -8,7 +8,8 @@ @@ -8,7 +8,8 @@
8 * This code is licensed under the GNU GPL v2. 8 * This code is licensed under the GNU GPL v2.
9 */ 9 */
10 10
11 -#include "vl.h" 11 +#include "hw.h"
  12 +#include "flash.h"
12 13
13 /* 14 /*
14 * Pre-calculated 256-way 1 byte column parity. Table borrowed from Linux. 15 * Pre-calculated 256-way 1 byte column parity. Table borrowed from Linux.
hw/eepro100.c
@@ -40,7 +40,9 @@ @@ -40,7 +40,9 @@
40 40
41 #include <assert.h> 41 #include <assert.h>
42 #include <stddef.h> /* offsetof */ 42 #include <stddef.h> /* offsetof */
43 -#include "vl.h" 43 +#include "hw.h"
  44 +#include "pci.h"
  45 +#include "net.h"
44 #include "eeprom93xx.h" 46 #include "eeprom93xx.h"
45 47
46 /* Common declarations for all PCI devices. */ 48 /* Common declarations for all PCI devices. */
hw/eeprom93xx.c
@@ -37,6 +37,7 @@ @@ -37,6 +37,7 @@
37 */ 37 */
38 38
39 #include <assert.h> 39 #include <assert.h>
  40 +#include "hw.h"
40 #include "eeprom93xx.h" 41 #include "eeprom93xx.h"
41 42
42 /* Debug EEPROM emulation. */ 43 /* Debug EEPROM emulation. */
hw/eeprom93xx.h
@@ -21,8 +21,6 @@ @@ -21,8 +21,6 @@
21 #ifndef EEPROM93XX_H 21 #ifndef EEPROM93XX_H
22 #define EEPROM93XX_H 22 #define EEPROM93XX_H
23 23
24 -#include "vl.h"  
25 -  
26 typedef struct _eeprom_t eeprom_t; 24 typedef struct _eeprom_t eeprom_t;
27 25
28 /* Create a new EEPROM with (nwords * 2) bytes. */ 26 /* Create a new EEPROM with (nwords * 2) bytes. */
hw/es1370.c
@@ -26,7 +26,10 @@ @@ -26,7 +26,10 @@
26 /* #define VERBOSE_ES1370 */ 26 /* #define VERBOSE_ES1370 */
27 #define SILENT_ES1370 27 #define SILENT_ES1370
28 28
29 -#include "vl.h" 29 +#include "hw.h"
  30 +#include "audiodev.h"
  31 +#include "audio/audio.h"
  32 +#include "pci.h"
30 33
31 /* Missing stuff: 34 /* Missing stuff:
32 SCTRL_P[12](END|ST)INC 35 SCTRL_P[12](END|ST)INC
hw/esp.c
@@ -21,7 +21,12 @@ @@ -21,7 +21,12 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "block.h"
  26 +#include "scsi-disk.h"
  27 +#include "sun4m.h"
  28 +/* FIXME: Only needed for MAX_DISKS, which is probably wrong. */
  29 +#include "sysemu.h"
25 30
26 /* debug ESP card */ 31 /* debug ESP card */
27 //#define DEBUG_ESP 32 //#define DEBUG_ESP
hw/etraxfs.c
@@ -23,7 +23,9 @@ @@ -23,7 +23,9 @@
23 */ 23 */
24 #include <time.h> 24 #include <time.h>
25 #include <sys/time.h> 25 #include <sys/time.h>
26 -#include "vl.h" 26 +#include "hw.h"
  27 +#include "sysemu.h"
  28 +#include "boards.h"
27 29
28 extern FILE *logfile; 30 extern FILE *logfile;
29 31
hw/etraxfs_ser.c
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 24
25 #include <stdio.h> 25 #include <stdio.h>
26 #include <ctype.h> 26 #include <ctype.h>
27 -#include "vl.h" 27 +#include "hw.h"
28 28
29 #define RW_TR_DMA_EN 0xb0026004 29 #define RW_TR_DMA_EN 0xb0026004
30 #define RW_DOUT 0xb002601c 30 #define RW_DOUT 0xb002601c
hw/etraxfs_timer.c
@@ -23,7 +23,8 @@ @@ -23,7 +23,8 @@
23 */ 23 */
24 #include <stdio.h> 24 #include <stdio.h>
25 #include <sys/time.h> 25 #include <sys/time.h>
26 -#include "vl.h" 26 +#include "hw.h"
  27 +#include "qemu-timer.h"
27 28
28 void etrax_ack_irq(CPUState *env, uint32_t mask); 29 void etrax_ack_irq(CPUState *env, uint32_t mask);
29 30
hw/fdc.c
@@ -25,7 +25,11 @@ @@ -25,7 +25,11 @@
25 * The controller is used in Sun4m systems in a slightly different 25 * The controller is used in Sun4m systems in a slightly different
26 * way. There are changes in DOR register and DMA is not available. 26 * way. There are changes in DOR register and DMA is not available.
27 */ 27 */
28 -#include "vl.h" 28 +#include "hw.h"
  29 +#include "fdc.h"
  30 +#include "block.h"
  31 +#include "qemu-timer.h"
  32 +#include "isa.h"
29 33
30 /********************************************************/ 34 /********************************************************/
31 /* debug Floppy devices */ 35 /* debug Floppy devices */
hw/fdc.h 0 โ†’ 100644
  1 +/* fdc.c */
  2 +#define MAX_FD 2
  3 +extern BlockDriverState *fd_table[MAX_FD];
  4 +
  5 +typedef struct fdctrl_t fdctrl_t;
  6 +
  7 +fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped,
  8 + target_phys_addr_t io_base,
  9 + BlockDriverState **fds);
  10 +fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base,
  11 + BlockDriverState **fds);
  12 +int fdctrl_get_drive_type(fdctrl_t *fdctrl, int drive_num);
hw/flash.h 0 โ†’ 100644
  1 +/* NOR flash devices */
  2 +typedef struct pflash_t pflash_t;
  3 +
  4 +pflash_t *pflash_register (target_phys_addr_t base, ram_addr_t off,
  5 + BlockDriverState *bs,
  6 + uint32_t sector_len, int nb_blocs, int width,
  7 + uint16_t id0, uint16_t id1,
  8 + uint16_t id2, uint16_t id3);
  9 +
  10 +/* nand.c */
  11 +struct nand_flash_s;
  12 +struct nand_flash_s *nand_init(int manf_id, int chip_id);
  13 +void nand_done(struct nand_flash_s *s);
  14 +void nand_setpins(struct nand_flash_s *s,
  15 + int cle, int ale, int ce, int wp, int gnd);
  16 +void nand_getpins(struct nand_flash_s *s, int *rb);
  17 +void nand_setio(struct nand_flash_s *s, uint8_t value);
  18 +uint8_t nand_getio(struct nand_flash_s *s);
  19 +
  20 +#define NAND_MFR_TOSHIBA 0x98
  21 +#define NAND_MFR_SAMSUNG 0xec
  22 +#define NAND_MFR_FUJITSU 0x04
  23 +#define NAND_MFR_NATIONAL 0x8f
  24 +#define NAND_MFR_RENESAS 0x07
  25 +#define NAND_MFR_STMICRO 0x20
  26 +#define NAND_MFR_HYNIX 0xad
  27 +#define NAND_MFR_MICRON 0x2c
  28 +
  29 +/* ecc.c */
  30 +struct ecc_state_s {
  31 + uint8_t cp; /* Column parity */
  32 + uint16_t lp[2]; /* Line parity */
  33 + uint16_t count;
  34 +};
  35 +
  36 +uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample);
  37 +void ecc_reset(struct ecc_state_s *s);
  38 +void ecc_put(QEMUFile *f, struct ecc_state_s *s);
  39 +void ecc_get(QEMUFile *f, struct ecc_state_s *s);
  40 +
hw/grackle_pci.c
@@ -23,8 +23,10 @@ @@ -23,8 +23,10 @@
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 25
26 -#include "vl.h" 26 +#include "hw.h"
27 #include "ppc_mac.h" 27 #include "ppc_mac.h"
  28 +#include "pci.h"
  29 +
28 typedef target_phys_addr_t pci_addr_t; 30 typedef target_phys_addr_t pci_addr_t;
29 #include "pci_host.h" 31 #include "pci_host.h"
30 32
hw/gt64xxx.c
@@ -22,7 +22,10 @@ @@ -22,7 +22,10 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "mips.h"
  27 +#include "pci.h"
  28 +#include "pc.h"
26 29
27 typedef target_phys_addr_t pci_addr_t; 30 typedef target_phys_addr_t pci_addr_t;
28 #include "pci_host.h" 31 #include "pci_host.h"
hw/gumstix.c
@@ -8,7 +8,13 @@ @@ -8,7 +8,13 @@
8 * This code is licensed under the GNU GPL v2. 8 * This code is licensed under the GNU GPL v2.
9 */ 9 */
10 10
11 -#include "vl.h" 11 +#include "hw.h"
  12 +#include "pxa.h"
  13 +#include "net.h"
  14 +#include "flash.h"
  15 +#include "sysemu.h"
  16 +#include "devices.h"
  17 +#include "boards.h"
12 18
13 /* Board init. */ 19 /* Board init. */
14 enum gumstix_model_e { connex }; 20 enum gumstix_model_e { connex };
hw/heathrow_pic.c
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "hw.h"
26 #include "ppc_mac.h" 26 #include "ppc_mac.h"
27 27
28 //#define DEBUG 28 //#define DEBUG
hw/hw.h 0 โ†’ 100644
  1 +/* Declarations for use by hardware emulation. */
  2 +#ifndef QEMU_HW_H
  3 +#define QEMU_HW_H
  4 +
  5 +#include "qemu-common.h"
  6 +#include "irq.h"
  7 +
  8 +/* VM Load/Save */
  9 +
  10 +QEMUFile *qemu_fopen(const char *filename, const char *mode);
  11 +void qemu_fflush(QEMUFile *f);
  12 +void qemu_fclose(QEMUFile *f);
  13 +void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size);
  14 +void qemu_put_byte(QEMUFile *f, int v);
  15 +void qemu_put_be16(QEMUFile *f, unsigned int v);
  16 +void qemu_put_be32(QEMUFile *f, unsigned int v);
  17 +void qemu_put_be64(QEMUFile *f, uint64_t v);
  18 +int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size);
  19 +int qemu_get_byte(QEMUFile *f);
  20 +unsigned int qemu_get_be16(QEMUFile *f);
  21 +unsigned int qemu_get_be32(QEMUFile *f);
  22 +uint64_t qemu_get_be64(QEMUFile *f);
  23 +
  24 +static inline void qemu_put_be64s(QEMUFile *f, const uint64_t *pv)
  25 +{
  26 + qemu_put_be64(f, *pv);
  27 +}
  28 +
  29 +static inline void qemu_put_be32s(QEMUFile *f, const uint32_t *pv)
  30 +{
  31 + qemu_put_be32(f, *pv);
  32 +}
  33 +
  34 +static inline void qemu_put_be16s(QEMUFile *f, const uint16_t *pv)
  35 +{
  36 + qemu_put_be16(f, *pv);
  37 +}
  38 +
  39 +static inline void qemu_put_8s(QEMUFile *f, const uint8_t *pv)
  40 +{
  41 + qemu_put_byte(f, *pv);
  42 +}
  43 +
  44 +static inline void qemu_get_be64s(QEMUFile *f, uint64_t *pv)
  45 +{
  46 + *pv = qemu_get_be64(f);
  47 +}
  48 +
  49 +static inline void qemu_get_be32s(QEMUFile *f, uint32_t *pv)
  50 +{
  51 + *pv = qemu_get_be32(f);
  52 +}
  53 +
  54 +static inline void qemu_get_be16s(QEMUFile *f, uint16_t *pv)
  55 +{
  56 + *pv = qemu_get_be16(f);
  57 +}
  58 +
  59 +static inline void qemu_get_8s(QEMUFile *f, uint8_t *pv)
  60 +{
  61 + *pv = qemu_get_byte(f);
  62 +}
  63 +
  64 +#ifdef NEED_CPU_H
  65 +#if TARGET_LONG_BITS == 64
  66 +#define qemu_put_betl qemu_put_be64
  67 +#define qemu_get_betl qemu_get_be64
  68 +#define qemu_put_betls qemu_put_be64s
  69 +#define qemu_get_betls qemu_get_be64s
  70 +#else
  71 +#define qemu_put_betl qemu_put_be32
  72 +#define qemu_get_betl qemu_get_be32
  73 +#define qemu_put_betls qemu_put_be32s
  74 +#define qemu_get_betls qemu_get_be32s
  75 +#endif
  76 +#endif
  77 +
  78 +int64_t qemu_ftell(QEMUFile *f);
  79 +int64_t qemu_fseek(QEMUFile *f, int64_t pos, int whence);
  80 +
  81 +typedef void SaveStateHandler(QEMUFile *f, void *opaque);
  82 +typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
  83 +
  84 +int register_savevm(const char *idstr,
  85 + int instance_id,
  86 + int version_id,
  87 + SaveStateHandler *save_state,
  88 + LoadStateHandler *load_state,
  89 + void *opaque);
  90 +
  91 +typedef void QEMUResetHandler(void *opaque);
  92 +
  93 +void qemu_register_reset(QEMUResetHandler *func, void *opaque);
  94 +
  95 +/* These should really be in isa.h, but are here to make pc.h happy. */
  96 +typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);
  97 +typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);
  98 +
  99 +#endif
hw/i2c.c
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 * This code is licenced under the LGPL. 7 * This code is licenced under the LGPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "i2c.h"
11 12
12 struct i2c_bus 13 struct i2c_bus
13 { 14 {
@@ -30,7 +31,7 @@ i2c_slave *i2c_slave_init(i2c_bus *bus, int address, int size) @@ -30,7 +31,7 @@ i2c_slave *i2c_slave_init(i2c_bus *bus, int address, int size)
30 i2c_slave *dev; 31 i2c_slave *dev;
31 32
32 if (size < sizeof(i2c_slave)) 33 if (size < sizeof(i2c_slave))
33 - cpu_abort(cpu_single_env, "I2C struct too small"); 34 + hw_error("I2C struct too small");
34 35
35 dev = (i2c_slave *)qemu_mallocz(size); 36 dev = (i2c_slave *)qemu_mallocz(size);
36 dev->address = address; 37 dev->address = address;
hw/i2c.h
@@ -13,8 +13,6 @@ enum i2c_event { @@ -13,8 +13,6 @@ enum i2c_event {
13 I2C_NACK /* Masker NACKed a receive byte. */ 13 I2C_NACK /* Masker NACKed a receive byte. */
14 }; 14 };
15 15
16 -typedef struct i2c_slave i2c_slave;  
17 -  
18 /* Master to slave. */ 16 /* Master to slave. */
19 typedef int (*i2c_send_cb)(i2c_slave *s, uint8_t data); 17 typedef int (*i2c_send_cb)(i2c_slave *s, uint8_t data);
20 /* Slave to master. */ 18 /* Slave to master. */
@@ -34,8 +32,6 @@ struct i2c_slave @@ -34,8 +32,6 @@ struct i2c_slave
34 void *next; 32 void *next;
35 }; 33 };
36 34
37 -typedef struct i2c_bus i2c_bus;  
38 -  
39 i2c_bus *i2c_init_bus(void); 35 i2c_bus *i2c_init_bus(void);
40 i2c_slave *i2c_slave_init(i2c_bus *bus, int address, int size); 36 i2c_slave *i2c_slave_init(i2c_bus *bus, int address, int size);
41 void i2c_set_slave_address(i2c_slave *dev, int address); 37 void i2c_set_slave_address(i2c_slave *dev, int address);
@@ -50,6 +46,14 @@ void i2c_bus_load(QEMUFile *f, i2c_bus *bus); @@ -50,6 +46,14 @@ void i2c_bus_load(QEMUFile *f, i2c_bus *bus);
50 void i2c_slave_save(QEMUFile *f, i2c_slave *dev); 46 void i2c_slave_save(QEMUFile *f, i2c_slave *dev);
51 void i2c_slave_load(QEMUFile *f, i2c_slave *dev); 47 void i2c_slave_load(QEMUFile *f, i2c_slave *dev);
52 48
  49 +/* max111x.c */
  50 +struct max111x_s;
  51 +uint32_t max111x_read(void *opaque);
  52 +void max111x_write(void *opaque, uint32_t value);
  53 +struct max111x_s *max1110_init(qemu_irq cb);
  54 +struct max111x_s *max1111_init(qemu_irq cb);
  55 +void max111x_set_input(struct max111x_s *s, int line, uint8_t value);
  56 +
53 /* max7310.c */ 57 /* max7310.c */
54 i2c_slave *max7310_init(i2c_bus *bus); 58 i2c_slave *max7310_init(i2c_bus *bus);
55 void max7310_reset(i2c_slave *i2c); 59 void max7310_reset(i2c_slave *i2c);
@@ -64,4 +68,7 @@ void wm8750_data_req_set(i2c_slave *i2c, @@ -64,4 +68,7 @@ void wm8750_data_req_set(i2c_slave *i2c,
64 void wm8750_dac_dat(void *opaque, uint32_t sample); 68 void wm8750_dac_dat(void *opaque, uint32_t sample);
65 uint32_t wm8750_adc_dat(void *opaque); 69 uint32_t wm8750_adc_dat(void *opaque);
66 70
  71 +/* ssd0303.c */
  72 +void ssd0303_init(DisplayState *ds, i2c_bus *bus, int address);
  73 +
67 #endif 74 #endif
hw/i8254.c
@@ -21,7 +21,10 @@ @@ -21,7 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "pc.h"
  26 +#include "isa.h"
  27 +#include "qemu-timer.h"
25 28
26 //#define DEBUG_PIT 29 //#define DEBUG_PIT
27 30
hw/i8259.c
@@ -21,7 +21,10 @@ @@ -21,7 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "pc.h"
  26 +#include "isa.h"
  27 +#include "console.h"
25 28
26 /* debug PIC */ 29 /* debug PIC */
27 //#define DEBUG_PIC 30 //#define DEBUG_PIC
hw/ide.c
@@ -22,7 +22,14 @@ @@ -22,7 +22,14 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "pc.h"
  27 +#include "pci.h"
  28 +#include "scsi-disk.h"
  29 +#include "pcmcia.h"
  30 +#include "block.h"
  31 +#include "qemu-timer.h"
  32 +#include "sysemu.h"
26 33
27 /* debug IDE devices */ 34 /* debug IDE devices */
28 //#define DEBUG_IDE 35 //#define DEBUG_IDE
hw/integratorcp.c
@@ -7,8 +7,13 @@ @@ -7,8 +7,13 @@
7 * This code is licenced under the GPL 7 * This code is licenced under the GPL
8 */ 8 */
9 9
10 -#include "vl.h"  
11 -#include "arm_pic.h" 10 +#include "hw.h"
  11 +#include "primecell.h"
  12 +#include "devices.h"
  13 +#include "sysemu.h"
  14 +#include "boards.h"
  15 +#include "arm-misc.h"
  16 +#include "net.h"
12 17
13 void DMA_run (void) 18 void DMA_run (void)
14 { 19 {
hw/iommu.c
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "sun4m.h"
25 26
26 /* debug iommu */ 27 /* debug iommu */
27 //#define DEBUG_IOMMU 28 //#define DEBUG_IOMMU
hw/irq.c
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "qemu-common.h"
  25 +#include "irq.h"
25 26
26 struct IRQState { 27 struct IRQState {
27 qemu_irq_handler handler; 28 qemu_irq_handler handler;
hw/irq.h
  1 +#ifndef QEMU_IRQ_H
  2 +#define QEMU_IRQ_H
  3 +
1 /* Generic IRQ/GPIO pin infrastructure. */ 4 /* Generic IRQ/GPIO pin infrastructure. */
2 5
  6 +/* FIXME: Rmove one of these. */
3 typedef void (*qemu_irq_handler)(void *opaque, int n, int level); 7 typedef void (*qemu_irq_handler)(void *opaque, int n, int level);
4 -  
5 -typedef struct IRQState *qemu_irq; 8 +typedef void SetIRQFunc(void *opaque, int irq_num, int level);
6 9
7 void qemu_set_irq(qemu_irq irq, int level); 10 void qemu_set_irq(qemu_irq irq, int level);
8 11
@@ -21,3 +24,5 @@ qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n); @@ -21,3 +24,5 @@ qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n);
21 24
22 /* Returns a new IRQ with opposite polarity. */ 25 /* Returns a new IRQ with opposite polarity. */
23 qemu_irq qemu_irq_invert(qemu_irq irq); 26 qemu_irq qemu_irq_invert(qemu_irq irq);
  27 +
  28 +#endif
hw/isa.h 0 โ†’ 100644
  1 +/* ISA bus */
  2 +
  3 +extern target_phys_addr_t isa_mem_base;
  4 +
  5 +int register_ioport_read(int start, int length, int size,
  6 + IOPortReadFunc *func, void *opaque);
  7 +int register_ioport_write(int start, int length, int size,
  8 + IOPortWriteFunc *func, void *opaque);
  9 +void isa_unassign_ioport(int start, int length);
  10 +
  11 +void isa_mmio_init(target_phys_addr_t base, target_phys_addr_t size);
  12 +
  13 +/* dma.c */
  14 +int DMA_get_channel_mode (int nchan);
  15 +int DMA_read_memory (int nchan, void *buf, int pos, int size);
  16 +int DMA_write_memory (int nchan, void *buf, int pos, int size);
  17 +void DMA_hold_DREQ (int nchan);
  18 +void DMA_release_DREQ (int nchan);
  19 +void DMA_schedule(int nchan);
  20 +void DMA_run (void);
  21 +void DMA_init (int high_page_enable);
  22 +void DMA_register_channel (int nchan,
  23 + DMA_transfer_handler transfer_handler,
  24 + void *opaque);
hw/isa_mmio.c
@@ -22,7 +22,8 @@ @@ -22,7 +22,8 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "isa.h"
26 27
27 static void isa_mmio_writeb (void *opaque, target_phys_addr_t addr, 28 static void isa_mmio_writeb (void *opaque, target_phys_addr_t addr,
28 uint32_t val) 29 uint32_t val)
hw/jazz_led.c
@@ -22,7 +22,9 @@ @@ -22,7 +22,9 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "mips.h"
  27 +#include "console.h"
26 #include "pixel_ops.h" 28 #include "pixel_ops.h"
27 29
28 //#define DEBUG_LED 30 //#define DEBUG_LED
hw/lsi53c895a.c
@@ -10,7 +10,9 @@ @@ -10,7 +10,9 @@
10 /* ??? Need to check if the {read,write}[wl] routines work properly on 10 /* ??? Need to check if the {read,write}[wl] routines work properly on
11 big-endian targets. */ 11 big-endian targets. */
12 12
13 -#include "vl.h" 13 +#include "hw.h"
  14 +#include "pci.h"
  15 +#include "scsi-disk.h"
14 16
15 //#define DEBUG_LSI 17 //#define DEBUG_LSI
16 //#define DEBUG_LSI_REG 18 //#define DEBUG_LSI_REG
hw/m48t59.c
@@ -21,8 +21,11 @@ @@ -21,8 +21,11 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h"  
25 -#include "m48t59.h" 24 +#include "hw.h"
  25 +#include "nvram.h"
  26 +#include "isa.h"
  27 +#include "qemu-timer.h"
  28 +#include "sysemu.h"
26 29
27 //#define DEBUG_NVRAM 30 //#define DEBUG_NVRAM
28 31
hw/m48t59.h deleted 100644 โ†’ 0
1 -#if !defined (__M48T59_H__)  
2 -#define __M48T59_H__  
3 -  
4 -typedef struct m48t59_t m48t59_t;  
5 -  
6 -void m48t59_write (void *private, uint32_t addr, uint32_t val);  
7 -uint32_t m48t59_read (void *private, uint32_t addr);  
8 -void m48t59_toggle_lock (void *private, int lock);  
9 -m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,  
10 - uint32_t io_base, uint16_t size,  
11 - int type);  
12 -  
13 -#endif /* !defined (__M48T59_H__) */  
hw/mac_dbdma.c
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "hw.h"
26 #include "ppc_mac.h" 26 #include "ppc_mac.h"
27 27
28 /* DBDMA: currently no op - should suffice right now */ 28 /* DBDMA: currently no op - should suffice right now */
hw/mac_nvram.c
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "hw.h"
26 #include "ppc_mac.h" 26 #include "ppc_mac.h"
27 27
28 struct MacIONVRAMState { 28 struct MacIONVRAMState {
hw/macio.c
@@ -22,8 +22,9 @@ @@ -22,8 +22,9 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "hw.h"
26 #include "ppc_mac.h" 26 #include "ppc_mac.h"
  27 +#include "pci.h"
27 28
28 typedef struct macio_state_t macio_state_t; 29 typedef struct macio_state_t macio_state_t;
29 struct macio_state_t { 30 struct macio_state_t {
hw/max111x.c
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 * This code is licensed under the GNU GPLv2. 7 * This code is licensed under the GNU GPLv2.
8 */ 8 */
9 9
10 -#include <vl.h> 10 +#include "hw.h"
  11 +#include "i2c.h"
11 12
12 struct max111x_s { 13 struct max111x_s {
13 qemu_irq interrupt; 14 qemu_irq interrupt;
hw/max7310.c
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 * This file is licensed under GNU GPL. 7 * This file is licensed under GNU GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "i2c.h"
11 12
12 struct max7310_s { 13 struct max7310_s {
13 i2c_slave i2c; 14 i2c_slave i2c;
@@ -182,7 +183,7 @@ static void max7310_gpio_set(void *opaque, int line, int level) @@ -182,7 +183,7 @@ static void max7310_gpio_set(void *opaque, int line, int level)
182 { 183 {
183 struct max7310_s *s = (struct max7310_s *) opaque; 184 struct max7310_s *s = (struct max7310_s *) opaque;
184 if (line >= sizeof(s->handler) / sizeof(*s->handler) || line < 0) 185 if (line >= sizeof(s->handler) / sizeof(*s->handler) || line < 0)
185 - cpu_abort(cpu_single_env, "bad GPIO line"); 186 + hw_error("bad GPIO line");
186 187
187 if (level) 188 if (level)
188 s->level |= s->direction & (1 << line); 189 s->level |= s->direction & (1 << line);
@@ -220,7 +221,7 @@ void max7310_gpio_out_set(i2c_slave *i2c, int line, qemu_irq handler) @@ -220,7 +221,7 @@ void max7310_gpio_out_set(i2c_slave *i2c, int line, qemu_irq handler)
220 { 221 {
221 struct max7310_s *s = (struct max7310_s *) i2c; 222 struct max7310_s *s = (struct max7310_s *) i2c;
222 if (line >= sizeof(s->handler) / sizeof(*s->handler) || line < 0) 223 if (line >= sizeof(s->handler) / sizeof(*s->handler) || line < 0)
223 - cpu_abort(cpu_single_env, "bad GPIO line"); 224 + hw_error("bad GPIO line");
224 225
225 s->handler[line] = handler; 226 s->handler[line] = handler;
226 } 227 }
hw/mc146818rtc.c
@@ -21,7 +21,11 @@ @@ -21,7 +21,11 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "qemu-timer.h"
  26 +#include "sysemu.h"
  27 +#include "pc.h"
  28 +#include "isa.h"
25 29
26 //#define DEBUG_CMOS 30 //#define DEBUG_CMOS
27 31
hw/mcf.h 0 โ†’ 100644
  1 +#ifndef HW_MCF_H
  2 +#define HW_MCF_H
  3 +/* Motorola ColdFire device prototypes. */
  4 +
  5 +/* mcf_uart.c */
  6 +uint32_t mcf_uart_read(void *opaque, target_phys_addr_t addr);
  7 +void mcf_uart_write(void *opaque, target_phys_addr_t addr, uint32_t val);
  8 +void *mcf_uart_init(qemu_irq irq, CharDriverState *chr);
  9 +void mcf_uart_mm_init(target_phys_addr_t base, qemu_irq irq,
  10 + CharDriverState *chr);
  11 +
  12 +/* mcf_intc.c */
  13 +qemu_irq *mcf_intc_init(target_phys_addr_t base, CPUState *env);
  14 +
  15 +/* mcf_fec.c */
  16 +void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq);
  17 +
  18 +/* mcf5206.c */
  19 +qemu_irq *mcf5206_init(uint32_t base, CPUState *env);
  20 +
  21 +#endif
hw/mcf5206.c
@@ -5,7 +5,10 @@ @@ -5,7 +5,10 @@
5 * 5 *
6 * This code is licenced under the GPL 6 * This code is licenced under the GPL
7 */ 7 */
8 -#include "vl.h" 8 +#include "hw.h"
  9 +#include "mcf.h"
  10 +#include "qemu-timer.h"
  11 +#include "sysemu.h"
9 12
10 /* General purpose timer module. */ 13 /* General purpose timer module. */
11 typedef struct { 14 typedef struct {
hw/mcf5208.c
@@ -5,7 +5,12 @@ @@ -5,7 +5,12 @@
5 * 5 *
6 * This code is licenced under the GPL 6 * This code is licenced under the GPL
7 */ 7 */
8 -#include "vl.h" 8 +#include "hw.h"
  9 +#include "mcf.h"
  10 +#include "qemu-timer.h"
  11 +#include "sysemu.h"
  12 +#include "net.h"
  13 +#include "boards.h"
9 14
10 #define SYS_FREQ 66000000 15 #define SYS_FREQ 66000000
11 16
hw/mcf_fec.c
@@ -5,7 +5,9 @@ @@ -5,7 +5,9 @@
5 * 5 *
6 * This code is licenced under the GPL 6 * This code is licenced under the GPL
7 */ 7 */
8 -#include "vl.h" 8 +#include "hw.h"
  9 +#include "net.h"
  10 +#include "mcf.h"
9 /* For crc32 */ 11 /* For crc32 */
10 #include <zlib.h> 12 #include <zlib.h>
11 13
hw/mcf_intc.c
@@ -5,7 +5,8 @@ @@ -5,7 +5,8 @@
5 * 5 *
6 * This code is licenced under the GPL 6 * This code is licenced under the GPL
7 */ 7 */
8 -#include "vl.h" 8 +#include "hw.h"
  9 +#include "mcf.h"
9 10
10 typedef struct { 11 typedef struct {
11 uint64_t ipr; 12 uint64_t ipr;
hw/mcf_uart.c
@@ -5,7 +5,9 @@ @@ -5,7 +5,9 @@
5 * 5 *
6 * This code is licenced under the GPL 6 * This code is licenced under the GPL
7 */ 7 */
8 -#include "vl.h" 8 +#include "hw.h"
  9 +#include "mcf.h"
  10 +#include "qemu-char.h"
9 11
10 typedef struct { 12 typedef struct {
11 uint8_t mr[2]; 13 uint8_t mr[2];
hw/mips.h 0 โ†’ 100644
  1 +#ifndef HW_MIPS_H
  2 +#define HW_MIPS_H
  3 +/* Definitions for mips board emulation. */
  4 +
  5 +/* gt64xxx.c */
  6 +PCIBus *pci_gt64120_init(qemu_irq *pic);
  7 +
  8 +/* ds1225y.c */
  9 +typedef struct ds1225y_t ds1225y_t;
  10 +ds1225y_t *ds1225y_init(target_phys_addr_t mem_base, const char *filename);
  11 +
  12 +/* mipsnet.c */
  13 +void mipsnet_init(int base, qemu_irq irq, NICInfo *nd);
  14 +
  15 +/* jazz_led.c */
  16 +extern void jazz_led_init(DisplayState *ds, target_phys_addr_t base);
  17 +
  18 +/* mips_int.c */
  19 +extern void cpu_mips_irq_init_cpu(CPUState *env);
  20 +
  21 +/* mips_timer.c */
  22 +extern void cpu_mips_clock_init(CPUState *);
  23 +extern void cpu_mips_irqctrl_init (void);
  24 +
  25 +#endif
hw/mips_int.c
1 -#include "vl.h" 1 +#include "hw.h"
  2 +#include "mips.h"
2 #include "cpu.h" 3 #include "cpu.h"
3 4
4 /* Raise IRQ to CPU if necessary. It must be called every time the active 5 /* Raise IRQ to CPU if necessary. It must be called every time the active
hw/mips_malta.c
@@ -22,7 +22,17 @@ @@ -22,7 +22,17 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "pc.h"
  27 +#include "net.h"
  28 +#include "boards.h"
  29 +#include "smbus.h"
  30 +#include "mips.h"
  31 +#include "pci.h"
  32 +#include "qemu-char.h"
  33 +#include "sysemu.h"
  34 +#include "audio/audio.h"
  35 +#include "boards.h"
26 36
27 #ifdef TARGET_WORDS_BIGENDIAN 37 #ifdef TARGET_WORDS_BIGENDIAN
28 #define BIOS_FILENAME "mips_bios.bin" 38 #define BIOS_FILENAME "mips_bios.bin"
hw/mips_mipssim.c
@@ -24,7 +24,13 @@ @@ -24,7 +24,13 @@
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 * THE SOFTWARE. 25 * THE SOFTWARE.
26 */ 26 */
27 -#include "vl.h" 27 +#include "hw.h"
  28 +#include "mips.h"
  29 +#include "pc.h"
  30 +#include "isa.h"
  31 +#include "net.h"
  32 +#include "sysemu.h"
  33 +#include "boards.h"
28 34
29 #ifdef TARGET_WORDS_BIGENDIAN 35 #ifdef TARGET_WORDS_BIGENDIAN
30 #define BIOS_FILENAME "mips_bios.bin" 36 #define BIOS_FILENAME "mips_bios.bin"
hw/mips_pica61.c
@@ -22,7 +22,13 @@ @@ -22,7 +22,13 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "mips.h"
  27 +#include "isa.h"
  28 +#include "pc.h"
  29 +#include "fdc.h"
  30 +#include "sysemu.h"
  31 +#include "boards.h"
26 32
27 #ifdef TARGET_WORDS_BIGENDIAN 33 #ifdef TARGET_WORDS_BIGENDIAN
28 #define BIOS_FILENAME "mips_bios.bin" 34 #define BIOS_FILENAME "mips_bios.bin"
hw/mips_r4k.c
@@ -7,7 +7,13 @@ @@ -7,7 +7,13 @@
7 * All peripherial devices are attached to this "bus" with 7 * All peripherial devices are attached to this "bus" with
8 * the standard PC ISA addresses. 8 * the standard PC ISA addresses.
9 */ 9 */
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "mips.h"
  12 +#include "pc.h"
  13 +#include "isa.h"
  14 +#include "net.h"
  15 +#include "sysemu.h"
  16 +#include "boards.h"
11 17
12 #ifdef TARGET_WORDS_BIGENDIAN 18 #ifdef TARGET_WORDS_BIGENDIAN
13 #define BIOS_FILENAME "mips_bios.bin" 19 #define BIOS_FILENAME "mips_bios.bin"
hw/mips_timer.c
1 -#include "vl.h" 1 +#include "hw.h"
  2 +#include "mips.h"
  3 +#include "qemu-timer.h"
2 4
3 void cpu_mips_irqctrl_init (void) 5 void cpu_mips_irqctrl_init (void)
4 { 6 {
hw/mipsnet.c
1 -#include "vl.h" 1 +#include "hw.h"
  2 +#include "mips.h"
  3 +#include "net.h"
  4 +#include "isa.h"
2 5
3 //#define DEBUG_MIPSNET_SEND 6 //#define DEBUG_MIPSNET_SEND
4 //#define DEBUG_MIPSNET_RECEIVE 7 //#define DEBUG_MIPSNET_RECEIVE
hw/mpcore.c
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "qemu-timer.h"
  12 +#include "primecell.h"
11 13
12 #define MPCORE_PRIV_BASE 0x10100000 14 #define MPCORE_PRIV_BASE 0x10100000
13 #define NCPU 4 15 #define NCPU 4
hw/nand.c
@@ -11,7 +11,11 @@ @@ -11,7 +11,11 @@
11 11
12 #ifndef NAND_IO 12 #ifndef NAND_IO
13 13
14 -# include "vl.h" 14 +# include "hw.h"
  15 +# include "flash.h"
  16 +# include "block.h"
  17 +/* FIXME: Pass block device as an argument. */
  18 +# include "sysemu.h"
15 19
16 # define NAND_CMD_READ0 0x00 20 # define NAND_CMD_READ0 0x00
17 # define NAND_CMD_READ1 0x01 21 # define NAND_CMD_READ1 0x01
hw/ne2000.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "pci.h"
  26 +#include "net.h"
25 27
26 /* debug NE2000 card */ 28 /* debug NE2000 card */
27 //#define DEBUG_NE2000 29 //#define DEBUG_NE2000
hw/nvram.h 0 โ†’ 100644
  1 +#ifndef NVRAM_H
  2 +#define NVRAM_H
  3 +
  4 +/* NVRAM helpers */
  5 +typedef uint32_t (*nvram_read_t)(void *private, uint32_t addr);
  6 +typedef void (*nvram_write_t)(void *private, uint32_t addr, uint32_t val);
  7 +typedef struct nvram_t {
  8 + void *opaque;
  9 + nvram_read_t read_fn;
  10 + nvram_write_t write_fn;
  11 +} nvram_t;
  12 +
  13 +void NVRAM_set_byte (nvram_t *nvram, uint32_t addr, uint8_t value);
  14 +uint8_t NVRAM_get_byte (nvram_t *nvram, uint32_t addr);
  15 +void NVRAM_set_word (nvram_t *nvram, uint32_t addr, uint16_t value);
  16 +uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr);
  17 +void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value);
  18 +uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr);
  19 +void NVRAM_set_string (nvram_t *nvram, uint32_t addr,
  20 + const unsigned char *str, uint32_t max);
  21 +int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max);
  22 +void NVRAM_set_crc (nvram_t *nvram, uint32_t addr,
  23 + uint32_t start, uint32_t count);
  24 +int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size,
  25 + const unsigned char *arch,
  26 + uint32_t RAM_size, int boot_device,
  27 + uint32_t kernel_image, uint32_t kernel_size,
  28 + const char *cmdline,
  29 + uint32_t initrd_image, uint32_t initrd_size,
  30 + uint32_t NVRAM_image,
  31 + int width, int height, int depth);
  32 +typedef struct m48t59_t m48t59_t;
  33 +
  34 +void m48t59_write (void *private, uint32_t addr, uint32_t val);
  35 +uint32_t m48t59_read (void *private, uint32_t addr);
  36 +void m48t59_toggle_lock (void *private, int lock);
  37 +m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,
  38 + uint32_t io_base, uint16_t size,
  39 + int type);
  40 +
  41 +#endif /* !NVRAM_H */
hw/omap.c
@@ -18,8 +18,13 @@ @@ -18,8 +18,13 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19 * MA 02111-1307 USA 19 * MA 02111-1307 USA
20 */ 20 */
21 -#include "vl.h"  
22 -#include "arm_pic.h" 21 +#include "hw.h"
  22 +#include "arm-misc.h"
  23 +#include "omap.h"
  24 +#include "sysemu.h"
  25 +#include "qemu-timer.h"
  26 +/* We use pc-style serial ports. */
  27 +#include "pc.h"
23 28
24 /* Should signal the TCMI */ 29 /* Should signal the TCMI */
25 uint32_t omap_badwidth_read8(void *opaque, target_phys_addr_t addr) 30 uint32_t omap_badwidth_read8(void *opaque, target_phys_addr_t addr)
@@ -4716,7 +4721,7 @@ struct omap_mpu_state_s *omap310_mpu_init(unsigned long sdram_size, @@ -4716,7 +4721,7 @@ struct omap_mpu_state_s *omap310_mpu_init(unsigned long sdram_size,
4716 omap_dpll_init(&s->dpll[1], 0xfffed000, omap_findclk(s, "dpll2")); 4721 omap_dpll_init(&s->dpll[1], 0xfffed000, omap_findclk(s, "dpll2"));
4717 omap_dpll_init(&s->dpll[2], 0xfffed100, omap_findclk(s, "dpll3")); 4722 omap_dpll_init(&s->dpll[2], 0xfffed100, omap_findclk(s, "dpll3"));
4718 4723
4719 - s->mmc = omap_mmc_init(0xfffb7800, s->irq[1][OMAP_INT_OQN], 4724 + s->mmc = omap_mmc_init(0xfffb7800, sd_bdrv, s->irq[1][OMAP_INT_OQN],
4720 &s->drq[OMAP_DMA_MMC_TX], omap_findclk(s, "mmc_ck")); 4725 &s->drq[OMAP_DMA_MMC_TX], omap_findclk(s, "mmc_ck"));
4721 4726
4722 s->mpuio = omap_mpuio_init(0xfffb5000, 4727 s->mpuio = omap_mpuio_init(0xfffb5000,
hw/omap.h
@@ -513,6 +513,7 @@ struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq, @@ -513,6 +513,7 @@ struct omap_lcd_panel_s *omap_lcdc_init(target_phys_addr_t base, qemu_irq irq,
513 /* omap_mmc.c */ 513 /* omap_mmc.c */
514 struct omap_mmc_s; 514 struct omap_mmc_s;
515 struct omap_mmc_s *omap_mmc_init(target_phys_addr_t base, 515 struct omap_mmc_s *omap_mmc_init(target_phys_addr_t base,
  516 + BlockDriverState *bd,
516 qemu_irq irq, qemu_irq dma[], omap_clk clk); 517 qemu_irq irq, qemu_irq dma[], omap_clk clk);
517 void omap_mmc_reset(struct omap_mmc_s *s); 518 void omap_mmc_reset(struct omap_mmc_s *s);
518 void omap_mmc_handlers(struct omap_mmc_s *s, qemu_irq ro, qemu_irq cover); 519 void omap_mmc_handlers(struct omap_mmc_s *s, qemu_irq ro, qemu_irq cover);
@@ -788,4 +789,10 @@ inline static int debug_register_io_memory(int io_index, @@ -788,4 +789,10 @@ inline static int debug_register_io_memory(int io_index,
788 # define cpu_register_io_memory debug_register_io_memory 789 # define cpu_register_io_memory debug_register_io_memory
789 # endif 790 # endif
790 791
  792 +/* Not really omap specific, but is the only thing that uses the
  793 + uwire interface. */
  794 +/* tsc210x.c */
  795 +struct uwire_slave_s *tsc2102_init(qemu_irq pint, AudioState *audio);
  796 +struct i2s_codec_s *tsc210x_codec(struct uwire_slave_s *chip);
  797 +
791 #endif /* hw_omap_h */ 798 #endif /* hw_omap_h */
hw/omap1_clk.c
@@ -20,7 +20,8 @@ @@ -20,7 +20,8 @@
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA 21 * MA 02111-1307 USA
22 */ 22 */
23 -#include "vl.h" 23 +#include "hw.h"
  24 +#include "omap.h"
24 25
25 struct clk { 26 struct clk {
26 const char *name; 27 const char *name;
hw/omap_i2c.c
@@ -18,7 +18,9 @@ @@ -18,7 +18,9 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19 * MA 02111-1307 USA 19 * MA 02111-1307 USA
20 */ 20 */
21 -#include "vl.h" 21 +#include "hw.h"
  22 +#include "i2c.h"
  23 +#include "omap.h"
22 24
23 struct omap_i2c_s { 25 struct omap_i2c_s {
24 target_phys_addr_t base; 26 target_phys_addr_t base;
hw/omap_lcdc.c
@@ -18,7 +18,9 @@ @@ -18,7 +18,9 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19 * MA 02111-1307 USA 19 * MA 02111-1307 USA
20 */ 20 */
21 -#include "vl.h" 21 +#include "hw.h"
  22 +#include "console.h"
  23 +#include "omap.h"
22 24
23 struct omap_lcd_panel_s { 25 struct omap_lcd_panel_s {
24 target_phys_addr_t base; 26 target_phys_addr_t base;
hw/omap_mmc.c
@@ -18,7 +18,8 @@ @@ -18,7 +18,8 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19 * MA 02111-1307 USA 19 * MA 02111-1307 USA
20 */ 20 */
21 -#include "vl.h" 21 +#include "hw.h"
  22 +#include "omap.h"
22 #include "sd.h" 23 #include "sd.h"
23 24
24 struct omap_mmc_s { 25 struct omap_mmc_s {
@@ -507,6 +508,7 @@ void omap_mmc_reset(struct omap_mmc_s *host) @@ -507,6 +508,7 @@ void omap_mmc_reset(struct omap_mmc_s *host)
507 } 508 }
508 509
509 struct omap_mmc_s *omap_mmc_init(target_phys_addr_t base, 510 struct omap_mmc_s *omap_mmc_init(target_phys_addr_t base,
  511 + BlockDriverState *bd,
510 qemu_irq irq, qemu_irq dma[], omap_clk clk) 512 qemu_irq irq, qemu_irq dma[], omap_clk clk)
511 { 513 {
512 int iomemtype; 514 int iomemtype;
@@ -523,7 +525,7 @@ struct omap_mmc_s *omap_mmc_init(target_phys_addr_t base, @@ -523,7 +525,7 @@ struct omap_mmc_s *omap_mmc_init(target_phys_addr_t base,
523 cpu_register_physical_memory(s->base, 0x800, iomemtype); 525 cpu_register_physical_memory(s->base, 0x800, iomemtype);
524 526
525 /* Instantiate the storage */ 527 /* Instantiate the storage */
526 - s->card = sd_init(sd_bdrv); 528 + s->card = sd_init(bd);
527 529
528 return s; 530 return s;
529 } 531 }
hw/openpic.c
@@ -32,7 +32,9 @@ @@ -32,7 +32,9 @@
32 * Serial interrupts, as implemented in Raven chipset are not supported yet. 32 * Serial interrupts, as implemented in Raven chipset are not supported yet.
33 * 33 *
34 */ 34 */
35 -#include "vl.h" 35 +#include "hw.h"
  36 +#include "ppc_mac.h"
  37 +#include "pci.h"
36 38
37 //#define DEBUG_OPENPIC 39 //#define DEBUG_OPENPIC
38 40
hw/palm.c
@@ -18,7 +18,13 @@ @@ -18,7 +18,13 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19 * MA 02111-1307 USA 19 * MA 02111-1307 USA
20 */ 20 */
21 -#include "vl.h" 21 +#include "hw.h"
  22 +#include "audio/audio.h"
  23 +#include "sysemu.h"
  24 +#include "console.h"
  25 +#include "omap.h"
  26 +#include "boards.h"
  27 +#include "arm-misc.h"
22 28
23 static uint32_t static_readb(void *opaque, target_phys_addr_t offset) 29 static uint32_t static_readb(void *opaque, target_phys_addr_t offset)
24 { 30 {
hw/parallel.c
@@ -22,7 +22,10 @@ @@ -22,7 +22,10 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "qemu-char.h"
  27 +#include "isa.h"
  28 +#include "pc.h"
26 29
27 //#define DEBUG_PARALLEL 30 //#define DEBUG_PARALLEL
28 31
@@ -21,7 +21,16 @@ @@ -21,7 +21,16 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "pc.h"
  26 +#include "fdc.h"
  27 +#include "pci.h"
  28 +#include "block.h"
  29 +#include "sysemu.h"
  30 +#include "audio/audio.h"
  31 +#include "net.h"
  32 +#include "smbus.h"
  33 +#include "boards.h"
25 34
26 /* output Bochs bios info messages */ 35 /* output Bochs bios info messages */
27 //#define DEBUG_BIOS 36 //#define DEBUG_BIOS
hw/pc.h 0 โ†’ 100644
  1 +#ifndef HW_PC_H
  2 +#define HW_PC_H
  3 +/* PC-style peripherals (also used by other machines). */
  4 +
  5 +/* serial.c */
  6 +
  7 +SerialState *serial_init(int base, qemu_irq irq, CharDriverState *chr);
  8 +SerialState *serial_mm_init (target_phys_addr_t base, int it_shift,
  9 + qemu_irq irq, CharDriverState *chr,
  10 + int ioregister);
  11 +uint32_t serial_mm_readb (void *opaque, target_phys_addr_t addr);
  12 +void serial_mm_writeb (void *opaque, target_phys_addr_t addr, uint32_t value);
  13 +uint32_t serial_mm_readw (void *opaque, target_phys_addr_t addr);
  14 +void serial_mm_writew (void *opaque, target_phys_addr_t addr, uint32_t value);
  15 +uint32_t serial_mm_readl (void *opaque, target_phys_addr_t addr);
  16 +void serial_mm_writel (void *opaque, target_phys_addr_t addr, uint32_t value);
  17 +
  18 +/* parallel.c */
  19 +
  20 +typedef struct ParallelState ParallelState;
  21 +ParallelState *parallel_init(int base, qemu_irq irq, CharDriverState *chr);
  22 +ParallelState *parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq, CharDriverState *chr);
  23 +
  24 +/* i8259.c */
  25 +
  26 +typedef struct PicState2 PicState2;
  27 +extern PicState2 *isa_pic;
  28 +void pic_set_irq(int irq, int level);
  29 +void pic_set_irq_new(void *opaque, int irq, int level);
  30 +qemu_irq *i8259_init(qemu_irq parent_irq);
  31 +void pic_set_alt_irq_func(PicState2 *s, SetIRQFunc *alt_irq_func,
  32 + void *alt_irq_opaque);
  33 +int pic_read_irq(PicState2 *s);
  34 +void pic_update_irq(PicState2 *s);
  35 +uint32_t pic_intack_read(PicState2 *s);
  36 +void pic_info(void);
  37 +void irq_info(void);
  38 +
  39 +/* APIC */
  40 +typedef struct IOAPICState IOAPICState;
  41 +
  42 +int apic_init(CPUState *env);
  43 +int apic_accept_pic_intr(CPUState *env);
  44 +int apic_get_interrupt(CPUState *env);
  45 +IOAPICState *ioapic_init(void);
  46 +void ioapic_set_irq(void *opaque, int vector, int level);
  47 +
  48 +/* i8254.c */
  49 +
  50 +#define PIT_FREQ 1193182
  51 +
  52 +typedef struct PITState PITState;
  53 +
  54 +PITState *pit_init(int base, qemu_irq irq);
  55 +void pit_set_gate(PITState *pit, int channel, int val);
  56 +int pit_get_gate(PITState *pit, int channel);
  57 +int pit_get_initial_count(PITState *pit, int channel);
  58 +int pit_get_mode(PITState *pit, int channel);
  59 +int pit_get_out(PITState *pit, int channel, int64_t current_time);
  60 +
  61 +/* vmport.c */
  62 +void vmport_init(CPUState *env);
  63 +void vmport_register(unsigned char command, IOPortReadFunc *func, void *opaque);
  64 +
  65 +/* vmmouse.c */
  66 +void *vmmouse_init(void *m);
  67 +
  68 +/* pckbd.c */
  69 +
  70 +void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base);
  71 +void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
  72 + target_phys_addr_t base, int it_shift);
  73 +
  74 +/* mc146818rtc.c */
  75 +
  76 +typedef struct RTCState RTCState;
  77 +
  78 +RTCState *rtc_init(int base, qemu_irq irq);
  79 +RTCState *rtc_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq);
  80 +void rtc_set_memory(RTCState *s, int addr, int val);
  81 +void rtc_set_date(RTCState *s, const struct tm *tm);
  82 +
  83 +/* pc.c */
  84 +extern int fd_bootchk;
  85 +
  86 +void ioport_set_a20(int enable);
  87 +int ioport_get_a20(void);
  88 +
  89 +/* acpi.c */
  90 +extern int acpi_enabled;
  91 +i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base);
  92 +void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
  93 +void acpi_bios_init(void);
  94 +
  95 +/* pcspk.c */
  96 +void pcspk_init(PITState *);
  97 +int pcspk_audio_init(AudioState *, qemu_irq *pic);
  98 +
  99 +/* piix_pci.c */
  100 +PCIBus *i440fx_init(PCIDevice **pi440fx_state, qemu_irq *pic);
  101 +void i440fx_set_smm(PCIDevice *d, int val);
  102 +int piix3_init(PCIBus *bus, int devfn);
  103 +void i440fx_init_memory_mappings(PCIDevice *d);
  104 +
  105 +int piix4_init(PCIBus *bus, int devfn);
  106 +
  107 +/* vga.c */
  108 +
  109 +#ifndef TARGET_SPARC
  110 +#define VGA_RAM_SIZE (8192 * 1024)
  111 +#else
  112 +#define VGA_RAM_SIZE (9 * 1024 * 1024)
  113 +#endif
  114 +
  115 +int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
  116 + unsigned long vga_ram_offset, int vga_ram_size);
  117 +int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
  118 + unsigned long vga_ram_offset, int vga_ram_size,
  119 + unsigned long vga_bios_offset, int vga_bios_size);
  120 +int isa_vga_mm_init(DisplayState *ds, uint8_t *vga_ram_base,
  121 + unsigned long vga_ram_offset, int vga_ram_size,
  122 + target_phys_addr_t vram_base, target_phys_addr_t ctrl_base,
  123 + int it_shift);
  124 +
  125 +/* cirrus_vga.c */
  126 +void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
  127 + unsigned long vga_ram_offset, int vga_ram_size);
  128 +void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base,
  129 + unsigned long vga_ram_offset, int vga_ram_size);
  130 +
  131 +/* ide.c */
  132 +void isa_ide_init(int iobase, int iobase2, qemu_irq irq,
  133 + BlockDriverState *hd0, BlockDriverState *hd1);
  134 +void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
  135 + int secondary_ide_enabled);
  136 +void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn,
  137 + qemu_irq *pic);
  138 +void pci_piix4_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn,
  139 + qemu_irq *pic);
  140 +
  141 +/* ne2000.c */
  142 +
  143 +void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd);
  144 +
  145 +#endif
hw/pci.c
@@ -21,7 +21,10 @@ @@ -21,7 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "pci.h"
  26 +#include "console.h"
  27 +#include "net.h"
25 28
26 //#define DEBUG_PCI 29 //#define DEBUG_PCI
27 30
hw/pci.h 0 โ†’ 100644
  1 +#ifndef QEMU_PCI_H
  2 +#define QEMU_PCI_H
  3 +
  4 +/* PCI includes legacy ISA access. */
  5 +#include "isa.h"
  6 +
  7 +/* PCI bus */
  8 +
  9 +extern target_phys_addr_t pci_mem_base;
  10 +
  11 +typedef void PCIConfigWriteFunc(PCIDevice *pci_dev,
  12 + uint32_t address, uint32_t data, int len);
  13 +typedef uint32_t PCIConfigReadFunc(PCIDevice *pci_dev,
  14 + uint32_t address, int len);
  15 +typedef void PCIMapIORegionFunc(PCIDevice *pci_dev, int region_num,
  16 + uint32_t addr, uint32_t size, int type);
  17 +
  18 +#define PCI_ADDRESS_SPACE_MEM 0x00
  19 +#define PCI_ADDRESS_SPACE_IO 0x01
  20 +#define PCI_ADDRESS_SPACE_MEM_PREFETCH 0x08
  21 +
  22 +typedef struct PCIIORegion {
  23 + uint32_t addr; /* current PCI mapping address. -1 means not mapped */
  24 + uint32_t size;
  25 + uint8_t type;
  26 + PCIMapIORegionFunc *map_func;
  27 +} PCIIORegion;
  28 +
  29 +#define PCI_ROM_SLOT 6
  30 +#define PCI_NUM_REGIONS 7
  31 +
  32 +#define PCI_DEVICES_MAX 64
  33 +
  34 +#define PCI_VENDOR_ID 0x00 /* 16 bits */
  35 +#define PCI_DEVICE_ID 0x02 /* 16 bits */
  36 +#define PCI_COMMAND 0x04 /* 16 bits */
  37 +#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
  38 +#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
  39 +#define PCI_CLASS_DEVICE 0x0a /* Device class */
  40 +#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
  41 +#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
  42 +#define PCI_MIN_GNT 0x3e /* 8 bits */
  43 +#define PCI_MAX_LAT 0x3f /* 8 bits */
  44 +
  45 +struct PCIDevice {
  46 + /* PCI config space */
  47 + uint8_t config[256];
  48 +
  49 + /* the following fields are read only */
  50 + PCIBus *bus;
  51 + int devfn;
  52 + char name[64];
  53 + PCIIORegion io_regions[PCI_NUM_REGIONS];
  54 +
  55 + /* do not access the following fields */
  56 + PCIConfigReadFunc *config_read;
  57 + PCIConfigWriteFunc *config_write;
  58 + /* ??? This is a PC-specific hack, and should be removed. */
  59 + int irq_index;
  60 +
  61 + /* IRQ objects for the INTA-INTD pins. */
  62 + qemu_irq *irq;
  63 +
  64 + /* Current IRQ levels. Used internally by the generic PCI code. */
  65 + int irq_state[4];
  66 +};
  67 +
  68 +PCIDevice *pci_register_device(PCIBus *bus, const char *name,
  69 + int instance_size, int devfn,
  70 + PCIConfigReadFunc *config_read,
  71 + PCIConfigWriteFunc *config_write);
  72 +
  73 +void pci_register_io_region(PCIDevice *pci_dev, int region_num,
  74 + uint32_t size, int type,
  75 + PCIMapIORegionFunc *map_func);
  76 +
  77 +uint32_t pci_default_read_config(PCIDevice *d,
  78 + uint32_t address, int len);
  79 +void pci_default_write_config(PCIDevice *d,
  80 + uint32_t address, uint32_t val, int len);
  81 +void pci_device_save(PCIDevice *s, QEMUFile *f);
  82 +int pci_device_load(PCIDevice *s, QEMUFile *f);
  83 +
  84 +typedef void (*pci_set_irq_fn)(qemu_irq *pic, int irq_num, int level);
  85 +typedef int (*pci_map_irq_fn)(PCIDevice *pci_dev, int irq_num);
  86 +PCIBus *pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq,
  87 + qemu_irq *pic, int devfn_min, int nirq);
  88 +
  89 +void pci_nic_init(PCIBus *bus, NICInfo *nd, int devfn);
  90 +void pci_data_write(void *opaque, uint32_t addr, uint32_t val, int len);
  91 +uint32_t pci_data_read(void *opaque, uint32_t addr, int len);
  92 +int pci_bus_num(PCIBus *s);
  93 +void pci_for_each_device(int bus_num, void (*fn)(PCIDevice *d));
  94 +
  95 +void pci_info(void);
  96 +PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id,
  97 + pci_map_irq_fn map_irq, const char *name);
  98 +
  99 +/* lsi53c895a.c */
  100 +void lsi_scsi_attach(void *opaque, BlockDriverState *bd, int id);
  101 +void *lsi_scsi_init(PCIBus *bus, int devfn);
  102 +
  103 +/* vmware_vga.c */
  104 +void pci_vmsvga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
  105 + unsigned long vga_ram_offset, int vga_ram_size);
  106 +
  107 +/* usb-uhci.c */
  108 +void usb_uhci_piix3_init(PCIBus *bus, int devfn);
  109 +void usb_uhci_piix4_init(PCIBus *bus, int devfn);
  110 +
  111 +/* usb-ohci.c */
  112 +void usb_ohci_init_pci(struct PCIBus *bus, int num_ports, int devfn);
  113 +
  114 +/* eepro100.c */
  115 +
  116 +void pci_i82551_init(PCIBus *bus, NICInfo *nd, int devfn);
  117 +void pci_i82557b_init(PCIBus *bus, NICInfo *nd, int devfn);
  118 +void pci_i82559er_init(PCIBus *bus, NICInfo *nd, int devfn);
  119 +
  120 +/* ne2000.c */
  121 +
  122 +void pci_ne2000_init(PCIBus *bus, NICInfo *nd, int devfn);
  123 +
  124 +/* rtl8139.c */
  125 +
  126 +void pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn);
  127 +
  128 +/* pcnet.c */
  129 +void pci_pcnet_init(PCIBus *bus, NICInfo *nd, int devfn);
  130 +
  131 +/* prep_pci.c */
  132 +PCIBus *pci_prep_init(qemu_irq *pic);
  133 +
  134 +/* apb_pci.c */
  135 +PCIBus *pci_apb_init(target_phys_addr_t special_base, target_phys_addr_t mem_base,
  136 + qemu_irq *pic);
  137 +
  138 +#endif
hw/pckbd.c
@@ -21,7 +21,11 @@ @@ -21,7 +21,11 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "isa.h"
  26 +#include "pc.h"
  27 +#include "ps2.h"
  28 +#include "sysemu.h"
25 29
26 /* debug PC keyboard */ 30 /* debug PC keyboard */
27 //#define DEBUG_KBD 31 //#define DEBUG_KBD
hw/pcmcia.h 0 โ†’ 100644
  1 +/* PCMCIA/Cardbus */
  2 +
  3 +struct pcmcia_socket_s {
  4 + qemu_irq irq;
  5 + int attached;
  6 + const char *slot_string;
  7 + const char *card_string;
  8 +};
  9 +
  10 +void pcmcia_socket_register(struct pcmcia_socket_s *socket);
  11 +void pcmcia_socket_unregister(struct pcmcia_socket_s *socket);
  12 +void pcmcia_info(void);
  13 +
  14 +struct pcmcia_card_s {
  15 + void *state;
  16 + struct pcmcia_socket_s *slot;
  17 + int (*attach)(void *state);
  18 + int (*detach)(void *state);
  19 + const uint8_t *cis;
  20 + int cis_len;
  21 +
  22 + /* Only valid if attached */
  23 + uint8_t (*attr_read)(void *state, uint32_t address);
  24 + void (*attr_write)(void *state, uint32_t address, uint8_t value);
  25 + uint16_t (*common_read)(void *state, uint32_t address);
  26 + void (*common_write)(void *state, uint32_t address, uint16_t value);
  27 + uint16_t (*io_read)(void *state, uint32_t address);
  28 + void (*io_write)(void *state, uint32_t address, uint16_t value);
  29 +};
  30 +
  31 +#define CISTPL_DEVICE 0x01 /* 5V Device Information Tuple */
  32 +#define CISTPL_NO_LINK 0x14 /* No Link Tuple */
  33 +#define CISTPL_VERS_1 0x15 /* Level 1 Version Tuple */
  34 +#define CISTPL_JEDEC_C 0x18 /* JEDEC ID Tuple */
  35 +#define CISTPL_JEDEC_A 0x19 /* JEDEC ID Tuple */
  36 +#define CISTPL_CONFIG 0x1a /* Configuration Tuple */
  37 +#define CISTPL_CFTABLE_ENTRY 0x1b /* 16-bit PCCard Configuration */
  38 +#define CISTPL_DEVICE_OC 0x1c /* Additional Device Information */
  39 +#define CISTPL_DEVICE_OA 0x1d /* Additional Device Information */
  40 +#define CISTPL_DEVICE_GEO 0x1e /* Additional Device Information */
  41 +#define CISTPL_DEVICE_GEO_A 0x1f /* Additional Device Information */
  42 +#define CISTPL_MANFID 0x20 /* Manufacture ID Tuple */
  43 +#define CISTPL_FUNCID 0x21 /* Function ID Tuple */
  44 +#define CISTPL_FUNCE 0x22 /* Function Extension Tuple */
  45 +#define CISTPL_END 0xff /* Tuple End */
  46 +#define CISTPL_ENDMARK 0xff
  47 +
  48 +/* dscm1xxxx.c */
  49 +struct pcmcia_card_s *dscm1xxxx_init(BlockDriverState *bdrv);
  50 +
hw/pcnet.c
@@ -35,7 +35,10 @@ @@ -35,7 +35,10 @@
35 * http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR92C990.txt 35 * http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR92C990.txt
36 */ 36 */
37 37
38 -#include "vl.h" 38 +#include "hw.h"
  39 +#include "pci.h"
  40 +#include "net.h"
  41 +#include "qemu-timer.h"
39 42
40 //#define PCNET_DEBUG 43 //#define PCNET_DEBUG
41 //#define PCNET_DEBUG_IO 44 //#define PCNET_DEBUG_IO
@@ -2008,6 +2011,7 @@ void pci_pcnet_init(PCIBus *bus, NICInfo *nd, int devfn) @@ -2008,6 +2011,7 @@ void pci_pcnet_init(PCIBus *bus, NICInfo *nd, int devfn)
2008 /* SPARC32 interface */ 2011 /* SPARC32 interface */
2009 2012
2010 #if defined (TARGET_SPARC) && !defined(TARGET_SPARC64) // Avoid compile failure 2013 #if defined (TARGET_SPARC) && !defined(TARGET_SPARC64) // Avoid compile failure
  2014 +#include "sun4m.h"
2011 2015
2012 static void parent_lance_reset(void *opaque, int irq, int level) 2016 static void parent_lance_reset(void *opaque, int irq, int level)
2013 { 2017 {
hw/pcspk.c
@@ -22,7 +22,11 @@ @@ -22,7 +22,11 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "pc.h"
  27 +#include "isa.h"
  28 +#include "audio/audio.h"
  29 +#include "qemu-timer.h"
26 30
27 #define PCSPK_BUF_LEN 1792 31 #define PCSPK_BUF_LEN 1792
28 #define PCSPK_SAMPLE_RATE 32000 32 #define PCSPK_SAMPLE_RATE 32000
hw/pflash_cfi01.c
@@ -37,7 +37,10 @@ @@ -37,7 +37,10 @@
37 * It does not implement much more ... 37 * It does not implement much more ...
38 */ 38 */
39 39
40 -#include "vl.h" 40 +#include "hw.h"
  41 +#include "flash.h"
  42 +#include "block.h"
  43 +#include "qemu-timer.h"
41 44
42 #define PFLASH_BUG(fmt, args...) \ 45 #define PFLASH_BUG(fmt, args...) \
43 do { \ 46 do { \
hw/pflash_cfi02.c
@@ -36,7 +36,10 @@ @@ -36,7 +36,10 @@
36 * It does not implement multiple sectors erase 36 * It does not implement multiple sectors erase
37 */ 37 */
38 38
39 -#include "vl.h" 39 +#include "hw.h"
  40 +#include "flash.h"
  41 +#include "qemu-timer.h"
  42 +#include "block.h"
40 43
41 //#define PFLASH_DEBUG 44 //#define PFLASH_DEBUG
42 #ifdef PFLASH_DEBUG 45 #ifdef PFLASH_DEBUG
hw/piix_pci.c
@@ -22,7 +22,10 @@ @@ -22,7 +22,10 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "pc.h"
  27 +#include "pci.h"
  28 +
26 typedef uint32_t pci_addr_t; 29 typedef uint32_t pci_addr_t;
27 #include "pci_host.h" 30 #include "pci_host.h"
28 31
hw/pl011.c
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "qemu-char.h"
  12 +#include "primecell.h"
11 13
12 typedef struct { 14 typedef struct {
13 uint32_t base; 15 uint32_t base;
hw/pl022.c
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "primecell.h"
11 12
12 //#define DEBUG_PL022 1 13 //#define DEBUG_PL022 1
13 14
hw/pl031.c
@@ -9,7 +9,10 @@ @@ -9,7 +9,10 @@
9 * 9 *
10 */ 10 */
11 11
12 -#include"vl.h" 12 +#include "hw.h"
  13 +#include "primecell.h"
  14 +#include "qemu-timer.h"
  15 +#include "sysemu.h"
13 16
14 //#define DEBUG_PL031 17 //#define DEBUG_PL031
15 18
hw/pl050.c
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "primecell.h"
  12 +#include "ps2.h"
11 13
12 typedef struct { 14 typedef struct {
13 void *dev; 15 void *dev;
hw/pl061.c
@@ -8,7 +8,8 @@ @@ -8,7 +8,8 @@
8 * This code is licenced under the GPL. 8 * This code is licenced under the GPL.
9 */ 9 */
10 10
11 -#include "vl.h" 11 +#include "hw.h"
  12 +#include "primecell.h"
12 13
13 //#define DEBUG_PL061 1 14 //#define DEBUG_PL061 1
14 15
hw/pl080.c
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "primecell.h"
11 12
12 #define PL080_MAX_CHANNELS 8 13 #define PL080_MAX_CHANNELS 8
13 #define PL080_CONF_E 0x1 14 #define PL080_CONF_E 0x1
hw/pl110.c
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 * This code is licenced under the GNU LGPL 7 * This code is licenced under the GNU LGPL
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "primecell.h"
  12 +#include "console.h"
11 13
12 #define PL110_CR_EN 0x001 14 #define PL110_CR_EN 0x001
13 #define PL110_CR_BGR 0x100 15 #define PL110_CR_BGR 0x100
hw/pl181.c
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "primecell.h"
11 #include "sd.h" 12 #include "sd.h"
12 13
13 //#define DEBUG_PL181 1 14 //#define DEBUG_PL181 1
hw/pl190.c
@@ -7,8 +7,9 @@ @@ -7,8 +7,9 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h"  
11 -#include "arm_pic.h" 10 +#include "hw.h"
  11 +#include "primecell.h"
  12 +#include "arm-misc.h"
12 13
13 /* The number of virtual priority levels. 16 user vectors plus the 14 /* The number of virtual priority levels. 16 user vectors plus the
14 unvectored IRQ. Chained interrupts would require an additional level 15 unvectored IRQ. Chained interrupts would require an additional level
hw/ppc.c
@@ -21,7 +21,11 @@ @@ -21,7 +21,11 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "ppc.h"
  26 +#include "qemu-timer.h"
  27 +#include "sysemu.h"
  28 +#include "nvram.h"
25 29
26 //#define PPC_DEBUG_IRQ 30 //#define PPC_DEBUG_IRQ
27 //#define PPC_DEBUG_TB 31 //#define PPC_DEBUG_TB
hw/ppc.h 0 โ†’ 100644
  1 +/* PowerPC hardware exceptions management helpers */
  2 +typedef void (*clk_setup_cb)(void *opaque, uint32_t freq);
  3 +typedef struct clk_setup_t clk_setup_t;
  4 +struct clk_setup_t {
  5 + clk_setup_cb cb;
  6 + void *opaque;
  7 +};
  8 +static inline void clk_setup (clk_setup_t *clk, uint32_t freq)
  9 +{
  10 + if (clk->cb != NULL)
  11 + (*clk->cb)(clk->opaque, freq);
  12 +}
  13 +
  14 +clk_setup_cb cpu_ppc_tb_init (CPUState *env, uint32_t freq);
  15 +/* Embedded PowerPC DCR management */
  16 +typedef target_ulong (*dcr_read_cb)(void *opaque, int dcrn);
  17 +typedef void (*dcr_write_cb)(void *opaque, int dcrn, target_ulong val);
  18 +int ppc_dcr_init (CPUState *env, int (*dcr_read_error)(int dcrn),
  19 + int (*dcr_write_error)(int dcrn));
  20 +int ppc_dcr_register (CPUState *env, int dcrn, void *opaque,
  21 + dcr_read_cb drc_read, dcr_write_cb dcr_write);
  22 +clk_setup_cb ppc_emb_timers_init (CPUState *env, uint32_t freq);
  23 +/* Embedded PowerPC reset */
  24 +void ppc40x_core_reset (CPUState *env);
  25 +void ppc40x_chip_reset (CPUState *env);
  26 +void ppc40x_system_reset (CPUState *env);
  27 +void PREP_debug_write (void *opaque, uint32_t addr, uint32_t val);
  28 +
  29 +extern CPUWriteMemoryFunc *PPC_io_write[];
  30 +extern CPUReadMemoryFunc *PPC_io_read[];
  31 +void PPC_debug_write (void *opaque, uint32_t addr, uint32_t val);
hw/ppc405_boards.c
@@ -21,8 +21,14 @@ @@ -21,8 +21,14 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "ppc.h"
25 #include "ppc405.h" 26 #include "ppc405.h"
  27 +#include "nvram.h"
  28 +#include "flash.h"
  29 +#include "sysemu.h"
  30 +#include "block.h"
  31 +#include "boards.h"
26 32
27 extern int loglevel; 33 extern int loglevel;
28 extern FILE *logfile; 34 extern FILE *logfile;
hw/ppc405_uc.c
@@ -21,8 +21,12 @@ @@ -21,8 +21,12 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "ppc.h"
25 #include "ppc405.h" 26 #include "ppc405.h"
  27 +#include "pc.h"
  28 +#include "qemu-timer.h"
  29 +#include "sysemu.h"
26 30
27 extern int loglevel; 31 extern int loglevel;
28 extern FILE *logfile; 32 extern FILE *logfile;
hw/ppc4xx_devs.c
@@ -21,8 +21,10 @@ @@ -21,8 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "ppc.h"
25 #include "ppc4xx.h" 26 #include "ppc4xx.h"
  27 +#include "sysemu.h"
26 28
27 extern int loglevel; 29 extern int loglevel;
28 extern FILE *logfile; 30 extern FILE *logfile;
hw/ppc_chrp.c
@@ -22,8 +22,15 @@ @@ -22,8 +22,15 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "ppc.h"
26 #include "ppc_mac.h" 27 #include "ppc_mac.h"
  28 +#include "nvram.h"
  29 +#include "pc.h"
  30 +#include "pci.h"
  31 +#include "net.h"
  32 +#include "sysemu.h"
  33 +#include "boards.h"
27 34
28 /* UniN device */ 35 /* UniN device */
29 static void unin_writel (void *opaque, target_phys_addr_t addr, uint32_t value) 36 static void unin_writel (void *opaque, target_phys_addr_t addr, uint32_t value)
hw/ppc_mac.h
@@ -68,4 +68,58 @@ void pmac_format_nvram_partition (MacIONVRAMState *nvr, int len); @@ -68,4 +68,58 @@ void pmac_format_nvram_partition (MacIONVRAMState *nvr, int len);
68 uint32_t macio_nvram_read (void *opaque, uint32_t addr); 68 uint32_t macio_nvram_read (void *opaque, uint32_t addr);
69 void macio_nvram_write (void *opaque, uint32_t addr, uint32_t val); 69 void macio_nvram_write (void *opaque, uint32_t addr, uint32_t val);
70 70
  71 +/* adb.c */
  72 +
  73 +#define MAX_ADB_DEVICES 16
  74 +
  75 +#define ADB_MAX_OUT_LEN 16
  76 +
  77 +typedef struct ADBDevice ADBDevice;
  78 +
  79 +/* buf = NULL means polling */
  80 +typedef int ADBDeviceRequest(ADBDevice *d, uint8_t *buf_out,
  81 + const uint8_t *buf, int len);
  82 +typedef int ADBDeviceReset(ADBDevice *d);
  83 +
  84 +struct ADBDevice {
  85 + struct ADBBusState *bus;
  86 + int devaddr;
  87 + int handler;
  88 + ADBDeviceRequest *devreq;
  89 + ADBDeviceReset *devreset;
  90 + void *opaque;
  91 +};
  92 +
  93 +typedef struct ADBBusState {
  94 + ADBDevice devices[MAX_ADB_DEVICES];
  95 + int nb_devices;
  96 + int poll_index;
  97 +} ADBBusState;
  98 +
  99 +int adb_request(ADBBusState *s, uint8_t *buf_out,
  100 + const uint8_t *buf, int len);
  101 +int adb_poll(ADBBusState *s, uint8_t *buf_out);
  102 +
  103 +ADBDevice *adb_register_device(ADBBusState *s, int devaddr,
  104 + ADBDeviceRequest *devreq,
  105 + ADBDeviceReset *devreset,
  106 + void *opaque);
  107 +void adb_kbd_init(ADBBusState *bus);
  108 +void adb_mouse_init(ADBBusState *bus);
  109 +
  110 +extern ADBBusState adb_bus;
  111 +
  112 +/* openpic.c */
  113 +/* OpenPIC have 5 outputs per CPU connected and one IRQ out single output */
  114 +enum {
  115 + OPENPIC_OUTPUT_INT = 0, /* IRQ */
  116 + OPENPIC_OUTPUT_CINT, /* critical IRQ */
  117 + OPENPIC_OUTPUT_MCK, /* Machine check event */
  118 + OPENPIC_OUTPUT_DEBUG, /* Inconditional debug event */
  119 + OPENPIC_OUTPUT_RESET, /* Core reset event */
  120 + OPENPIC_OUTPUT_NB,
  121 +};
  122 +qemu_irq *openpic_init (PCIBus *bus, int *pmem_index, int nb_cpus,
  123 + qemu_irq **irqs, qemu_irq irq_out);
  124 +
71 #endif /* !defined(__PPC_MAC_H__) */ 125 #endif /* !defined(__PPC_MAC_H__) */
hw/ppc_oldworld.c
@@ -22,8 +22,16 @@ @@ -22,8 +22,16 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "ppc.h"
26 #include "ppc_mac.h" 27 #include "ppc_mac.h"
  28 +#include "nvram.h"
  29 +#include "pc.h"
  30 +#include "sysemu.h"
  31 +#include "net.h"
  32 +#include "isa.h"
  33 +#include "pci.h"
  34 +#include "boards.h"
27 35
28 /* temporary frame buffer OSI calls for the video.x driver. The right 36 /* temporary frame buffer OSI calls for the video.x driver. The right
29 solution is to modify the driver to use VGA PCI I/Os */ 37 solution is to modify the driver to use VGA PCI I/Os */
hw/ppc_prep.c
@@ -21,7 +21,16 @@ @@ -21,7 +21,16 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "nvram.h"
  26 +#include "pc.h"
  27 +#include "fdc.h"
  28 +#include "net.h"
  29 +#include "sysemu.h"
  30 +#include "isa.h"
  31 +#include "pci.h"
  32 +#include "ppc.h"
  33 +#include "boards.h"
25 34
26 //#define HARD_DEBUG_PPC_IO 35 //#define HARD_DEBUG_PPC_IO
27 //#define DEBUG_PPC_IO 36 //#define DEBUG_PPC_IO
hw/prep_pci.c
@@ -22,7 +22,9 @@ @@ -22,7 +22,9 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "pci.h"
  27 +
26 typedef uint32_t pci_addr_t; 28 typedef uint32_t pci_addr_t;
27 #include "pci_host.h" 29 #include "pci_host.h"
28 30
hw/primecell.h 0 โ†’ 100644
  1 +#ifndef PRIMECELL_H
  2 +#define PRIMECELL_H
  3 +
  4 +/* Declarations for ARM PrimeCell based periperals. */
  5 +/* Also includes some devices that are currently only used by the
  6 + ARM boards. */
  7 +
  8 +/* pl031.c */
  9 +void pl031_init(uint32_t base, qemu_irq irq);
  10 +
  11 +/* pl110.c */
  12 +void *pl110_init(DisplayState *ds, uint32_t base, qemu_irq irq, int);
  13 +
  14 +/* pl011.c */
  15 +enum pl011_type {
  16 + PL011_ARM,
  17 + PL011_LUMINARY
  18 +};
  19 +
  20 +void pl011_init(uint32_t base, qemu_irq irq, CharDriverState *chr,
  21 + enum pl011_type type);
  22 +
  23 +/* pl022.c */
  24 +void pl022_init(uint32_t base, qemu_irq irq, int (*xfer_cb)(void *, int),
  25 + void *opaque);
  26 +
  27 +/* pl050.c */
  28 +void pl050_init(uint32_t base, qemu_irq irq, int is_mouse);
  29 +
  30 +/* pl061.c */
  31 +qemu_irq *pl061_init(uint32_t base, qemu_irq irq, qemu_irq **out);
  32 +
  33 +/* pl080.c */
  34 +void *pl080_init(uint32_t base, qemu_irq irq, int nchannels);
  35 +
  36 +/* pl181.c */
  37 +void pl181_init(uint32_t base, BlockDriverState *bd,
  38 + qemu_irq irq0, qemu_irq irq1);
  39 +
  40 +/* pl190.c */
  41 +qemu_irq *pl190_init(uint32_t base, qemu_irq irq, qemu_irq fiq);
  42 +
  43 +/* realview_gic.c */
  44 +qemu_irq *realview_gic_init(uint32_t base, qemu_irq parent_irq);
  45 +
  46 +/* mpcore.c */
  47 +extern qemu_irq *mpcore_irq_init(qemu_irq *cpu_irq);
  48 +
  49 +/* arm-timer.c */
  50 +void sp804_init(uint32_t base, qemu_irq irq);
  51 +void icp_pit_init(uint32_t base, qemu_irq *pic, int irq);
  52 +
  53 +/* arm_sysctl.c */
  54 +void arm_sysctl_init(uint32_t base, uint32_t sys_id);
  55 +
  56 +/* versatile_pci.c */
  57 +PCIBus *pci_vpb_init(qemu_irq *pic, int irq, int realview);
  58 +
  59 +#endif
hw/ps2.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "ps2.h"
  26 +#include "console.h"
25 27
26 /* debug PC keyboard */ 28 /* debug PC keyboard */
27 //#define DEBUG_KBD 29 //#define DEBUG_KBD
hw/ps2.h 0 โ†’ 100644
  1 +/* ps2.c */
  2 +void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg);
  3 +void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg);
  4 +void ps2_write_mouse(void *, int val);
  5 +void ps2_write_keyboard(void *, int val);
  6 +uint32_t ps2_read_data(void *);
  7 +void ps2_queue(void *, int b);
  8 +void ps2_keyboard_set_translation(void *opaque, int mode);
  9 +void ps2_mouse_fake_event(void *opaque);
  10 +
hw/ptimer.c
@@ -5,7 +5,8 @@ @@ -5,7 +5,8 @@
5 * 5 *
6 * This code is licenced under the GNU LGPL. 6 * This code is licenced under the GNU LGPL.
7 */ 7 */
8 -#include "vl.h" 8 +#include "hw.h"
  9 +#include "qemu-timer.h"
9 10
10 11
11 struct ptimer_state 12 struct ptimer_state
hw/pxa.h
@@ -95,7 +95,7 @@ void pxa2xx_lcdc_oritentation(void *opaque, int angle); @@ -95,7 +95,7 @@ void pxa2xx_lcdc_oritentation(void *opaque, int angle);
95 /* pxa2xx_mmci.c */ 95 /* pxa2xx_mmci.c */
96 struct pxa2xx_mmci_s; 96 struct pxa2xx_mmci_s;
97 struct pxa2xx_mmci_s *pxa2xx_mmci_init(target_phys_addr_t base, 97 struct pxa2xx_mmci_s *pxa2xx_mmci_init(target_phys_addr_t base,
98 - qemu_irq irq, void *dma); 98 + BlockDriverState *bd, qemu_irq irq, void *dma);
99 void pxa2xx_mmci_handlers(struct pxa2xx_mmci_s *s, qemu_irq readonly, 99 void pxa2xx_mmci_handlers(struct pxa2xx_mmci_s *s, qemu_irq readonly,
100 qemu_irq coverswitch); 100 qemu_irq coverswitch);
101 101
@@ -207,4 +207,8 @@ struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size, DisplayState *ds, @@ -207,4 +207,8 @@ struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size, DisplayState *ds,
207 const char *revision); 207 const char *revision);
208 struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size, DisplayState *ds); 208 struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size, DisplayState *ds);
209 209
  210 +/* usb-ohci.c */
  211 +void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, int devfn,
  212 + qemu_irq irq);
  213 +
210 #endif /* PXA_H */ 214 #endif /* PXA_H */
hw/pxa2xx.c
@@ -7,7 +7,13 @@ @@ -7,7 +7,13 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -# include "vl.h" 10 +#include "hw.h"
  11 +#include "pxa.h"
  12 +#include "sysemu.h"
  13 +#include "pc.h"
  14 +#include "i2c.h"
  15 +#include "qemu-timer.h"
  16 +#include "qemu-char.h"
11 17
12 static struct { 18 static struct {
13 target_phys_addr_t io_base; 19 target_phys_addr_t io_base;
@@ -2064,7 +2070,8 @@ struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size, @@ -2064,7 +2070,8 @@ struct pxa2xx_state_s *pxa270_init(unsigned int sdram_size,
2064 2070
2065 s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 121); 2071 s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 121);
2066 2072
2067 - s->mmc = pxa2xx_mmci_init(0x41100000, s->pic[PXA2XX_PIC_MMC], s->dma); 2073 + s->mmc = pxa2xx_mmci_init(0x41100000, sd_bdrv, s->pic[PXA2XX_PIC_MMC],
  2074 + s->dma);
2068 2075
2069 for (i = 0; pxa270_serial[i].io_base; i ++) 2076 for (i = 0; pxa270_serial[i].io_base; i ++)
2070 if (serial_hds[i]) 2077 if (serial_hds[i])
@@ -2180,7 +2187,8 @@ struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size, @@ -2180,7 +2187,8 @@ struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size,
2180 2187
2181 s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 85); 2188 s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 85);
2182 2189
2183 - s->mmc = pxa2xx_mmci_init(0x41100000, s->pic[PXA2XX_PIC_MMC], s->dma); 2190 + s->mmc = pxa2xx_mmci_init(0x41100000, sd_bdrv, s->pic[PXA2XX_PIC_MMC],
  2191 + s->dma);
2184 2192
2185 for (i = 0; pxa255_serial[i].io_base; i ++) 2193 for (i = 0; pxa255_serial[i].io_base; i ++)
2186 if (serial_hds[i]) 2194 if (serial_hds[i])
hw/pxa2xx_dma.c
@@ -8,7 +8,8 @@ @@ -8,7 +8,8 @@
8 * This code is licenced under the GPL. 8 * This code is licenced under the GPL.
9 */ 9 */
10 10
11 -#include "vl.h" 11 +#include "hw.h"
  12 +#include "pxa.h"
12 13
13 struct pxa2xx_dma_channel_s { 14 struct pxa2xx_dma_channel_s {
14 target_phys_addr_t descr; 15 target_phys_addr_t descr;
hw/pxa2xx_gpio.c
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 * This code is licensed under the GPL. 7 * This code is licensed under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "pxa.h"
11 12
12 #define PXA2XX_GPIO_BANKS 4 13 #define PXA2XX_GPIO_BANKS 4
13 14
hw/pxa2xx_lcd.c
@@ -7,8 +7,12 @@ @@ -7,8 +7,12 @@
7 * This code is licensed under the GPLv2. 7 * This code is licensed under the GPLv2.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "console.h"
  12 +#include "pxa.h"
11 #include "pixel_ops.h" 13 #include "pixel_ops.h"
  14 +/* FIXME: For graphic_rotate. Should probably be done in common code. */
  15 +#include "sysemu.h"
12 16
13 typedef void (*drawfn)(uint32_t *, uint8_t *, const uint8_t *, int, int); 17 typedef void (*drawfn)(uint32_t *, uint8_t *, const uint8_t *, int, int);
14 18
hw/pxa2xx_mmci.c
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 * This code is licensed under the GPLv2. 7 * This code is licensed under the GPLv2.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "pxa.h"
11 #include "sd.h" 12 #include "sd.h"
12 13
13 struct pxa2xx_mmci_s { 14 struct pxa2xx_mmci_s {
@@ -522,7 +523,7 @@ static int pxa2xx_mmci_load(QEMUFile *f, void *opaque, int version_id) @@ -522,7 +523,7 @@ static int pxa2xx_mmci_load(QEMUFile *f, void *opaque, int version_id)
522 } 523 }
523 524
524 struct pxa2xx_mmci_s *pxa2xx_mmci_init(target_phys_addr_t base, 525 struct pxa2xx_mmci_s *pxa2xx_mmci_init(target_phys_addr_t base,
525 - qemu_irq irq, void *dma) 526 + BlockDriverState *bd, qemu_irq irq, void *dma)
526 { 527 {
527 int iomemtype; 528 int iomemtype;
528 struct pxa2xx_mmci_s *s; 529 struct pxa2xx_mmci_s *s;
@@ -537,7 +538,7 @@ struct pxa2xx_mmci_s *pxa2xx_mmci_init(target_phys_addr_t base, @@ -537,7 +538,7 @@ struct pxa2xx_mmci_s *pxa2xx_mmci_init(target_phys_addr_t base,
537 cpu_register_physical_memory(base, 0x00100000, iomemtype); 538 cpu_register_physical_memory(base, 0x00100000, iomemtype);
538 539
539 /* Instantiate the actual storage */ 540 /* Instantiate the actual storage */
540 - s->card = sd_init(sd_bdrv); 541 + s->card = sd_init(bd);
541 542
542 register_savevm("pxa2xx_mmci", 0, 0, 543 register_savevm("pxa2xx_mmci", 0, 0,
543 pxa2xx_mmci_save, pxa2xx_mmci_load, s); 544 pxa2xx_mmci_save, pxa2xx_mmci_load, s);
hw/pxa2xx_pcmcia.c
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 * This code is licensed under the GPLv2. 7 * This code is licensed under the GPLv2.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "pcmcia.h"
11 12
12 struct pxa2xx_pcmcia_s { 13 struct pxa2xx_pcmcia_s {
13 struct pcmcia_socket_s slot; 14 struct pcmcia_socket_s slot;
hw/pxa2xx_pic.c
@@ -8,7 +8,8 @@ @@ -8,7 +8,8 @@
8 * This code is licenced under the GPL. 8 * This code is licenced under the GPL.
9 */ 9 */
10 10
11 -#include "vl.h" 11 +#include "hw.h"
  12 +#include "pxa.h"
12 13
13 #define ICIP 0x00 /* Interrupt Controller IRQ Pending register */ 14 #define ICIP 0x00 /* Interrupt Controller IRQ Pending register */
14 #define ICMR 0x04 /* Interrupt Controller Mask register */ 15 #define ICMR 0x04 /* Interrupt Controller Mask register */
hw/pxa2xx_timer.c
@@ -7,7 +7,10 @@ @@ -7,7 +7,10 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "qemu-timer.h"
  12 +#include "sysemu.h"
  13 +#include "pxa.h"
11 14
12 #define OSMR0 0x00 15 #define OSMR0 0x00
13 #define OSMR1 0x04 16 #define OSMR1 0x04
hw/r2d.c
@@ -22,7 +22,10 @@ @@ -22,7 +22,10 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "sh.h"
  27 +#include "sysemu.h"
  28 +#include "boards.h"
26 29
27 #define SDRAM_BASE 0x0c000000 /* Physical location of SDRAM: Area 3 */ 30 #define SDRAM_BASE 0x0c000000 /* Physical location of SDRAM: Area 3 */
28 #define SDRAM_SIZE 0x04000000 31 #define SDRAM_SIZE 0x04000000
hw/realview.c
@@ -7,8 +7,14 @@ @@ -7,8 +7,14 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h"  
11 -#include "arm_pic.h" 10 +#include "hw.h"
  11 +#include "arm-misc.h"
  12 +#include "primecell.h"
  13 +#include "devices.h"
  14 +#include "pci.h"
  15 +#include "net.h"
  16 +#include "sysemu.h"
  17 +#include "boards.h"
12 18
13 /* Board init. */ 19 /* Board init. */
14 20
hw/realview_gic.c
@@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h"  
11 -#include "arm_pic.h" 10 +#include "hw.h"
  11 +#include "arm-misc.h"
12 12
13 #define GIC_NIRQ 96 13 #define GIC_NIRQ 96
14 #define NCPU 1 14 #define NCPU 1
hw/rtl8139.c
@@ -43,7 +43,10 @@ @@ -43,7 +43,10 @@
43 * Added rx/tx buffer reset when enabling rx/tx operation 43 * Added rx/tx buffer reset when enabling rx/tx operation
44 */ 44 */
45 45
46 -#include "vl.h" 46 +#include "hw.h"
  47 +#include "pci.h"
  48 +#include "qemu-timer.h"
  49 +#include "net.h"
47 50
48 /* debug RTL8139 card */ 51 /* debug RTL8139 card */
49 //#define DEBUG_RTL8139 1 52 //#define DEBUG_RTL8139 1
hw/sb16.c
@@ -21,7 +21,11 @@ @@ -21,7 +21,11 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "audiodev.h"
  26 +#include "audio/audio.h"
  27 +#include "isa.h"
  28 +#include "qemu-timer.h"
25 29
26 #define LENOFA(a) ((int) (sizeof(a)/sizeof(a[0]))) 30 #define LENOFA(a) ((int) (sizeof(a)/sizeof(a[0])))
27 31
hw/scsi-disk.c
@@ -25,7 +25,9 @@ do { printf(&quot;scsi-disk: &quot; fmt , ##args); } while (0) @@ -25,7 +25,9 @@ do { printf(&quot;scsi-disk: &quot; fmt , ##args); } while (0)
25 #define BADF(fmt, args...) \ 25 #define BADF(fmt, args...) \
26 do { fprintf(stderr, "scsi-disk: " fmt , ##args); } while (0) 26 do { fprintf(stderr, "scsi-disk: " fmt , ##args); } while (0)
27 27
28 -#include "vl.h" 28 +#include "qemu-common.h"
  29 +#include "block.h"
  30 +#include "scsi-disk.h"
29 31
30 #define SENSE_NO_SENSE 0 32 #define SENSE_NO_SENSE 0
31 #define SENSE_NOT_READY 2 33 #define SENSE_NOT_READY 2
hw/scsi-disk.h 0 โ†’ 100644
  1 +#ifndef SCSI_DISK_H
  2 +#define SCSI_DISK_H
  3 +
  4 +/* scsi-disk.c */
  5 +enum scsi_reason {
  6 + SCSI_REASON_DONE, /* Command complete. */
  7 + SCSI_REASON_DATA /* Transfer complete, more data required. */
  8 +};
  9 +
  10 +typedef struct SCSIDevice SCSIDevice;
  11 +typedef void (*scsi_completionfn)(void *opaque, int reason, uint32_t tag,
  12 + uint32_t arg);
  13 +
  14 +SCSIDevice *scsi_disk_init(BlockDriverState *bdrv,
  15 + int tcq,
  16 + scsi_completionfn completion,
  17 + void *opaque);
  18 +void scsi_disk_destroy(SCSIDevice *s);
  19 +
  20 +int32_t scsi_send_command(SCSIDevice *s, uint32_t tag, uint8_t *buf, int lun);
  21 +/* SCSI data transfers are asynchrnonous. However, unlike the block IO
  22 + layer the completion routine may be called directly by
  23 + scsi_{read,write}_data. */
  24 +void scsi_read_data(SCSIDevice *s, uint32_t tag);
  25 +int scsi_write_data(SCSIDevice *s, uint32_t tag);
  26 +void scsi_cancel_io(SCSIDevice *s, uint32_t tag);
  27 +uint8_t *scsi_get_buf(SCSIDevice *s, uint32_t tag);
  28 +
  29 +/* cdrom.c */
  30 +int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track);
  31 +int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int session_num);
  32 +
  33 +#endif
@@ -29,6 +29,8 @@ @@ -29,6 +29,8 @@
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
  32 +#include "hw.h"
  33 +#include "block.h"
32 #include "sd.h" 34 #include "sd.h"
33 35
34 //#define DEBUG_SD 1 36 //#define DEBUG_SD 1
@@ -29,8 +29,6 @@ @@ -29,8 +29,6 @@
29 #ifndef __hw_sd_h 29 #ifndef __hw_sd_h
30 #define __hw_sd_h 1 30 #define __hw_sd_h 1
31 31
32 -#include <vl.h>  
33 -  
34 #define OUT_OF_RANGE (1 << 31) 32 #define OUT_OF_RANGE (1 << 31)
35 #define ADDRESS_ERROR (1 << 30) 33 #define ADDRESS_ERROR (1 << 30)
36 #define BLOCK_LEN_ERROR (1 << 29) 34 #define BLOCK_LEN_ERROR (1 << 29)
hw/serial.c
@@ -21,7 +21,10 @@ @@ -21,7 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "qemu-char.h"
  26 +#include "isa.h"
  27 +#include "pc.h"
25 28
26 //#define DEBUG_SERIAL 29 //#define DEBUG_SERIAL
27 30
hw/sh.h 0 โ†’ 100644
  1 +#ifndef QEMU_SH_H
  2 +#define QEMU_SH_H
  3 +/* Definitions for SH board emulation. */
  4 +
  5 +/* sh7750.c */
  6 +struct SH7750State;
  7 +
  8 +struct SH7750State *sh7750_init(CPUState * cpu);
  9 +
  10 +typedef struct {
  11 + /* The callback will be triggered if any of the designated lines change */
  12 + uint16_t portamask_trigger;
  13 + uint16_t portbmask_trigger;
  14 + /* Return 0 if no action was taken */
  15 + int (*port_change_cb) (uint16_t porta, uint16_t portb,
  16 + uint16_t * periph_pdtra,
  17 + uint16_t * periph_portdira,
  18 + uint16_t * periph_pdtrb,
  19 + uint16_t * periph_portdirb);
  20 +} sh7750_io_device;
  21 +
  22 +int sh7750_register_io_device(struct SH7750State *s,
  23 + sh7750_io_device * device);
  24 +/* sh_timer.c */
  25 +#define TMU012_FEAT_TOCR (1 << 0)
  26 +#define TMU012_FEAT_3CHAN (1 << 1)
  27 +#define TMU012_FEAT_EXTCLK (1 << 2)
  28 +void tmu012_init(uint32_t base, int feat, uint32_t freq);
  29 +
  30 +/* sh_serial.c */
  31 +#define SH_SERIAL_FEAT_SCIF (1 << 0)
  32 +void sh_serial_init (target_phys_addr_t base, int feat,
  33 + uint32_t freq, CharDriverState *chr);
  34 +
  35 +/* tc58128.c */
  36 +int tc58128_init(struct SH7750State *s, char *zone1, char *zone2);
  37 +
  38 +#endif
hw/sh7750.c
@@ -24,7 +24,9 @@ @@ -24,7 +24,9 @@
24 */ 24 */
25 #include <stdio.h> 25 #include <stdio.h>
26 #include <assert.h> 26 #include <assert.h>
27 -#include "vl.h" 27 +#include "hw.h"
  28 +#include "sh.h"
  29 +#include "sysemu.h"
28 #include "sh7750_regs.h" 30 #include "sh7750_regs.h"
29 #include "sh7750_regnames.h" 31 #include "sh7750_regnames.h"
30 #include "sh_intc.h" 32 #include "sh_intc.h"
hw/sh7750_regnames.c
1 -#include "vl.h" 1 +#include "hw.h"
  2 +#include "sh.h"
2 #include "sh7750_regs.h" 3 #include "sh7750_regs.h"
3 4
4 #define REGNAME(r) {r, #r}, 5 #define REGNAME(r) {r, #r},
hw/sh_intc.c
@@ -10,7 +10,8 @@ @@ -10,7 +10,8 @@
10 10
11 #include <assert.h> 11 #include <assert.h>
12 #include "sh_intc.h" 12 #include "sh_intc.h"
13 -#include "vl.h" 13 +#include "hw.h"
  14 +#include "sh.h"
14 15
15 //#define DEBUG_INTC 16 //#define DEBUG_INTC
16 17
hw/sh_serial.c
@@ -24,7 +24,9 @@ @@ -24,7 +24,9 @@
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 * THE SOFTWARE. 25 * THE SOFTWARE.
26 */ 26 */
27 -#include "vl.h" 27 +#include "hw.h"
  28 +#include "sh.h"
  29 +#include "qemu-char.h"
28 #include <assert.h> 30 #include <assert.h>
29 31
30 //#define DEBUG_SERIAL 32 //#define DEBUG_SERIAL
hw/sh_timer.c
@@ -8,7 +8,9 @@ @@ -8,7 +8,9 @@
8 * This code is licenced under the GPL. 8 * This code is licenced under the GPL.
9 */ 9 */
10 10
11 -#include "vl.h" 11 +#include "hw.h"
  12 +#include "sh.h"
  13 +#include "qemu-timer.h"
12 14
13 //#define DEBUG_TIMER 15 //#define DEBUG_TIMER
14 16
hw/shix.c
@@ -27,7 +27,10 @@ @@ -27,7 +27,10 @@
27 27
28 More information in target-sh4/README.sh4 28 More information in target-sh4/README.sh4
29 */ 29 */
30 -#include "vl.h" 30 +#include "hw.h"
  31 +#include "sh.h"
  32 +#include "sysemu.h"
  33 +#include "boards.h"
31 34
32 #define BIOS_FILENAME "shix_bios.bin" 35 #define BIOS_FILENAME "shix_bios.bin"
33 #define BIOS_ADDRESS 0xA0000000 36 #define BIOS_ADDRESS 0xA0000000
hw/slavio_intctl.c
@@ -21,7 +21,10 @@ @@ -21,7 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "sun4m.h"
  26 +#include "console.h"
  27 +
25 //#define DEBUG_IRQ_COUNT 28 //#define DEBUG_IRQ_COUNT
26 //#define DEBUG_IRQ 29 //#define DEBUG_IRQ
27 30
hw/slavio_misc.c
@@ -21,7 +21,10 @@ @@ -21,7 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "sun4m.h"
  26 +#include "sysemu.h"
  27 +
25 /* debug misc */ 28 /* debug misc */
26 //#define DEBUG_MISC 29 //#define DEBUG_MISC
27 30
hw/slavio_serial.c
@@ -21,7 +21,11 @@ @@ -21,7 +21,11 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "sun4m.h"
  26 +#include "qemu-char.h"
  27 +#include "console.h"
  28 +
25 /* debug serial */ 29 /* debug serial */
26 //#define DEBUG_SERIAL 30 //#define DEBUG_SERIAL
27 31
hw/slavio_timer.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "sun4m.h"
  26 +#include "qemu-timer.h"
25 27
26 //#define DEBUG_TIMER 28 //#define DEBUG_TIMER
27 29
hw/smbus.c
@@ -9,7 +9,9 @@ @@ -9,7 +9,9 @@
9 9
10 /* TODO: Implement PEC. */ 10 /* TODO: Implement PEC. */
11 11
12 -#include "vl.h" 12 +#include "hw.h"
  13 +#include "i2c.h"
  14 +#include "smbus.h"
13 15
14 //#define DEBUG_SMBUS 1 16 //#define DEBUG_SMBUS 1
15 17
@@ -194,7 +196,7 @@ SMBusDevice *smbus_device_init(i2c_bus *bus, int address, int size) @@ -194,7 +196,7 @@ SMBusDevice *smbus_device_init(i2c_bus *bus, int address, int size)
194 SMBusDevice *dev; 196 SMBusDevice *dev;
195 197
196 if (size < sizeof(SMBusDevice)) 198 if (size < sizeof(SMBusDevice))
197 - cpu_abort(cpu_single_env, "SMBus struct too small"); 199 + hw_error("SMBus struct too small");
198 200
199 dev = (SMBusDevice *)i2c_slave_init(bus, address, size); 201 dev = (SMBusDevice *)i2c_slave_init(bus, address, size);
200 dev->i2c.event = smbus_i2c_event; 202 dev->i2c.event = smbus_i2c_event;
hw/smbus.h
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -typedef struct SMBusDevice SMBusDevice; 25 +#include "i2c.h"
26 26
27 struct SMBusDevice { 27 struct SMBusDevice {
28 /* The SMBus protocol is implemented on top of I2C. */ 28 /* The SMBus protocol is implemented on top of I2C. */
hw/smbus_eeprom.c
@@ -22,7 +22,9 @@ @@ -22,7 +22,9 @@
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 24
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "i2c.h"
  27 +#include "smbus.h"
26 28
27 //#define DEBUG 29 //#define DEBUG
28 30
hw/smc91c111.c
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 * This code is licenced under the GPL 7 * This code is licenced under the GPL
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "net.h"
  12 +#include "devices.h"
11 /* For crc32 */ 13 /* For crc32 */
12 #include <zlib.h> 14 #include <zlib.h>
13 15
hw/sparc32_dma.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "sparc32_dma.h"
  26 +#include "sun4m.h"
25 27
26 /* debug DMA */ 28 /* debug DMA */
27 //#define DEBUG_DMA 29 //#define DEBUG_DMA
hw/sparc32_dma.h 0 โ†’ 100644
  1 +#ifndef SPARC32_DMA_H
  2 +#define SPARC32_DMA_H
  3 +
  4 +/* sparc32_dma.c */
  5 +void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq,
  6 + void *iommu, qemu_irq **dev_irq, qemu_irq **reset);
  7 +void ledma_memory_read(void *opaque, target_phys_addr_t addr,
  8 + uint8_t *buf, int len, int do_bswap);
  9 +void ledma_memory_write(void *opaque, target_phys_addr_t addr,
  10 + uint8_t *buf, int len, int do_bswap);
  11 +void espdma_memory_read(void *opaque, uint8_t *buf, int len);
  12 +void espdma_memory_write(void *opaque, uint8_t *buf, int len);
  13 +
  14 +#endif
hw/spitz.c
@@ -7,7 +7,19 @@ @@ -7,7 +7,19 @@
7 * This code is licensed under the GNU GPL v2. 7 * This code is licensed under the GNU GPL v2.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "pxa.h"
  12 +#include "arm-misc.h"
  13 +#include "sysemu.h"
  14 +#include "pcmcia.h"
  15 +#include "i2c.h"
  16 +#include "flash.h"
  17 +#include "qemu-timer.h"
  18 +#include "devices.h"
  19 +#include "console.h"
  20 +#include "block.h"
  21 +#include "audio/audio.h"
  22 +#include "boards.h"
11 23
12 #define spitz_printf(format, ...) \ 24 #define spitz_printf(format, ...) \
13 fprintf(stderr, "%s: " format, __FUNCTION__, ##__VA_ARGS__) 25 fprintf(stderr, "%s: " format, __FUNCTION__, ##__VA_ARGS__)
hw/ssd0303.c
@@ -10,7 +10,9 @@ @@ -10,7 +10,9 @@
10 /* The controller can support a variety of different displays, but we only 10 /* The controller can support a variety of different displays, but we only
11 implement one. Most of the commends relating to brightness and geometry 11 implement one. Most of the commends relating to brightness and geometry
12 setup are ignored. */ 12 setup are ignored. */
13 -#include "vl.h" 13 +#include "hw.h"
  14 +#include "i2c.h"
  15 +#include "console.h"
14 16
15 //#define DEBUG_SSD0303 1 17 //#define DEBUG_SSD0303 1
16 18
hw/ssd0323.c
@@ -10,7 +10,9 @@ @@ -10,7 +10,9 @@
10 /* The controller can support a variety of different displays, but we only 10 /* The controller can support a variety of different displays, but we only
11 implement one. Most of the commends relating to brightness and geometry 11 implement one. Most of the commends relating to brightness and geometry
12 setup are ignored. */ 12 setup are ignored. */
13 -#include "vl.h" 13 +#include "hw.h"
  14 +#include "devices.h"
  15 +#include "console.h"
14 16
15 //#define DEBUG_SSD0323 1 17 //#define DEBUG_SSD0323 1
16 18
hw/stellaris.c
@@ -7,8 +7,14 @@ @@ -7,8 +7,14 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h"  
11 -#include "arm_pic.h" 10 +#include "hw.h"
  11 +#include "arm-misc.h"
  12 +#include "primecell.h"
  13 +#include "devices.h"
  14 +#include "qemu-timer.h"
  15 +#include "i2c.h"
  16 +#include "sysemu.h"
  17 +#include "boards.h"
12 18
13 typedef const struct { 19 typedef const struct {
14 const char *name; 20 const char *name;
hw/sun4m.c
@@ -21,8 +21,15 @@ @@ -21,8 +21,15 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h"  
25 -#include "m48t59.h" 24 +#include "hw.h"
  25 +#include "qemu-timer.h"
  26 +#include "sun4m.h"
  27 +#include "nvram.h"
  28 +#include "sparc32_dma.h"
  29 +#include "fdc.h"
  30 +#include "sysemu.h"
  31 +#include "net.h"
  32 +#include "boards.h"
26 #include "firmware_abi.h" 33 #include "firmware_abi.h"
27 34
28 //#define DEBUG_IRQ 35 //#define DEBUG_IRQ
hw/sun4m.h 0 โ†’ 100644
  1 +#ifndef SUN4M_H
  2 +#define SUN4M_H
  3 +
  4 +/* Devices used by sparc32 system. */
  5 +
  6 +/* iommu.c */
  7 +void *iommu_init(target_phys_addr_t addr, uint32_t version);
  8 +void sparc_iommu_memory_rw(void *opaque, target_phys_addr_t addr,
  9 + uint8_t *buf, int len, int is_write);
  10 +static inline void sparc_iommu_memory_read(void *opaque,
  11 + target_phys_addr_t addr,
  12 + uint8_t *buf, int len)
  13 +{
  14 + sparc_iommu_memory_rw(opaque, addr, buf, len, 0);
  15 +}
  16 +
  17 +static inline void sparc_iommu_memory_write(void *opaque,
  18 + target_phys_addr_t addr,
  19 + uint8_t *buf, int len)
  20 +{
  21 + sparc_iommu_memory_rw(opaque, addr, buf, len, 1);
  22 +}
  23 +
  24 +/* tcx.c */
  25 +void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base,
  26 + unsigned long vram_offset, int vram_size, int width, int height,
  27 + int depth);
  28 +
  29 +/* slavio_intctl.c */
  30 +void *slavio_intctl_init(target_phys_addr_t addr, target_phys_addr_t addrg,
  31 + const uint32_t *intbit_to_level,
  32 + qemu_irq **irq, qemu_irq **cpu_irq,
  33 + qemu_irq **parent_irq, unsigned int cputimer);
  34 +void slavio_pic_info(void *opaque);
  35 +void slavio_irq_info(void *opaque);
  36 +
  37 +/* slavio_timer.c */
  38 +void slavio_timer_init_all(target_phys_addr_t base, qemu_irq master_irq,
  39 + qemu_irq *cpu_irqs);
  40 +
  41 +/* slavio_serial.c */
  42 +SerialState *slavio_serial_init(target_phys_addr_t base, qemu_irq irq,
  43 + CharDriverState *chr1, CharDriverState *chr2);
  44 +void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq);
  45 +
  46 +/* slavio_misc.c */
  47 +void *slavio_misc_init(target_phys_addr_t base, target_phys_addr_t power_base,
  48 + qemu_irq irq);
  49 +void slavio_set_power_fail(void *opaque, int power_failing);
  50 +
  51 +/* esp.c */
  52 +void esp_scsi_attach(void *opaque, BlockDriverState *bd, int id);
  53 +void *esp_init(BlockDriverState **bd, target_phys_addr_t espaddr,
  54 + void *dma_opaque, qemu_irq irq, qemu_irq *reset);
  55 +
  56 +/* cs4231.c */
  57 +void cs_init(target_phys_addr_t base, int irq, void *intctl);
  58 +
  59 +/* sparc32_dma.c */
  60 +void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq,
  61 + void *iommu, qemu_irq **dev_irq, qemu_irq **reset);
  62 +void ledma_memory_read(void *opaque, target_phys_addr_t addr,
  63 + uint8_t *buf, int len, int do_bswap);
  64 +void ledma_memory_write(void *opaque, target_phys_addr_t addr,
  65 + uint8_t *buf, int len, int do_bswap);
  66 +void espdma_memory_read(void *opaque, uint8_t *buf, int len);
  67 +void espdma_memory_write(void *opaque, uint8_t *buf, int len);
  68 +
  69 +/* pcnet.c */
  70 +void lance_init(NICInfo *nd, target_phys_addr_t leaddr, void *dma_opaque,
  71 + qemu_irq irq, qemu_irq *reset);
  72 +
  73 +#endif
hw/sun4u.c
@@ -21,8 +21,15 @@ @@ -21,8 +21,15 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h"  
25 -#include "m48t59.h" 24 +#include "hw.h"
  25 +#include "pci.h"
  26 +#include "pc.h"
  27 +#include "nvram.h"
  28 +#include "fdc.h"
  29 +#include "net.h"
  30 +#include "qemu-timer.h"
  31 +#include "sysemu.h"
  32 +#include "boards.h"
26 #include "firmware_abi.h" 33 #include "firmware_abi.h"
27 34
28 #define KERNEL_LOAD_ADDR 0x00404000 35 #define KERNEL_LOAD_ADDR 0x00404000
hw/tc58128.c
1 #include <assert.h> 1 #include <assert.h>
2 -#include "vl.h" 2 +#include "hw.h"
  3 +#include "sh.h"
  4 +#include "sysemu.h"
3 5
4 #define CE1 0x0100 6 #define CE1 0x0100
5 #define CE2 0x0200 7 #define CE2 0x0200
hw/tcx.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "sun4m.h"
  26 +#include "console.h"
25 #include "pixel_ops.h" 27 #include "pixel_ops.h"
26 28
27 #define MAXX 1024 29 #define MAXX 1024
hw/tsc210x.c
@@ -19,7 +19,11 @@ @@ -19,7 +19,11 @@
19 * MA 02111-1307 USA 19 * MA 02111-1307 USA
20 */ 20 */
21 21
22 -#include "vl.h" 22 +#include "hw.h"
  23 +#include "audio/audio.h"
  24 +#include "qemu-timer.h"
  25 +#include "console.h"
  26 +#include "omap.h"
23 27
24 #define TSC_DATA_REGISTERS_PAGE 0x0 28 #define TSC_DATA_REGISTERS_PAGE 0x0
25 #define TSC_CONTROL_REGISTERS_PAGE 0x1 29 #define TSC_CONTROL_REGISTERS_PAGE 0x1
hw/unin_pci.c
@@ -21,7 +21,10 @@ @@ -21,7 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "ppc_mac.h"
  26 +#include "pci.h"
  27 +
25 typedef target_phys_addr_t pci_addr_t; 28 typedef target_phys_addr_t pci_addr_t;
26 #include "pci_host.h" 29 #include "pci_host.h"
27 30
hw/usb-hid.c
@@ -22,7 +22,9 @@ @@ -22,7 +22,9 @@
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 -#include "vl.h" 25 +#include "hw.h"
  26 +#include "console.h"
  27 +#include "usb.h"
26 28
27 /* HID interface requests */ 29 /* HID interface requests */
28 #define GET_REPORT 0xa101 30 #define GET_REPORT 0xa101
hw/usb-hub.c
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "qemu-common.h"
  25 +#include "usb.h"
25 26
26 //#define DEBUG 27 //#define DEBUG
27 28
hw/usb-msd.c
@@ -7,7 +7,10 @@ @@ -7,7 +7,10 @@
7 * This code is licenced under the LGPL. 7 * This code is licenced under the LGPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "qemu-common.h"
  11 +#include "usb.h"
  12 +#include "block.h"
  13 +#include "scsi-disk.h"
11 14
12 //#define DEBUG_MSD 15 //#define DEBUG_MSD
13 16
hw/usb-ohci.c
@@ -27,7 +27,10 @@ @@ -27,7 +27,10 @@
27 * o BIOS work to boot from USB storage 27 * o BIOS work to boot from USB storage
28 */ 28 */
29 29
30 -#include "vl.h" 30 +#include "hw.h"
  31 +#include "qemu-timer.h"
  32 +#include "usb.h"
  33 +#include "pci.h"
31 34
32 //#define DEBUG_OHCI 35 //#define DEBUG_OHCI
33 /* Dump packet contents. */ 36 /* Dump packet contents. */
hw/usb-uhci.c
@@ -21,7 +21,10 @@ @@ -21,7 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "usb.h"
  26 +#include "pci.h"
  27 +#include "qemu-timer.h"
25 28
26 //#define DEBUG 29 //#define DEBUG
27 //#define DEBUG_PACKET 30 //#define DEBUG_PACKET
hw/usb-wacom.c
@@ -25,7 +25,9 @@ @@ -25,7 +25,9 @@
25 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 * THE SOFTWARE. 26 * THE SOFTWARE.
27 */ 27 */
28 -#include "vl.h" 28 +#include "hw.h"
  29 +#include "console.h"
  30 +#include "usb.h"
29 31
30 /* Interface requests */ 32 /* Interface requests */
31 #define WACOM_GET_REPORT 0x2101 33 #define WACOM_GET_REPORT 0x2101
hw/usb.c
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "qemu-common.h"
  25 +#include "usb.h"
25 26
26 void usb_attach(USBPort *port, USBDevice *dev) 27 void usb_attach(USBPort *port, USBDevice *dev)
27 { 28 {
hw/usb.h
@@ -202,15 +202,6 @@ void usb_packet_complete(USBPacket *p); @@ -202,15 +202,6 @@ void usb_packet_complete(USBPacket *p);
202 /* usb hub */ 202 /* usb hub */
203 USBDevice *usb_hub_init(int nb_ports); 203 USBDevice *usb_hub_init(int nb_ports);
204 204
205 -/* usb-uhci.c */  
206 -void usb_uhci_piix3_init(PCIBus *bus, int devfn);  
207 -void usb_uhci_piix4_init(PCIBus *bus, int devfn);  
208 -  
209 -/* usb-ohci.c */  
210 -void usb_ohci_init_pci(struct PCIBus *bus, int num_ports, int devfn);  
211 -void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, int devfn,  
212 - qemu_irq irq);  
213 -  
214 /* usb-linux.c */ 205 /* usb-linux.c */
215 USBDevice *usb_host_device_open(const char *devname); 206 USBDevice *usb_host_device_open(const char *devname);
216 void usb_host_info(void); 207 void usb_host_info(void);
@@ -225,3 +216,11 @@ USBDevice *usb_msd_init(const char *filename); @@ -225,3 +216,11 @@ USBDevice *usb_msd_init(const char *filename);
225 216
226 /* usb-wacom.c */ 217 /* usb-wacom.c */
227 USBDevice *usb_wacom_init(void); 218 USBDevice *usb_wacom_init(void);
  219 +
  220 +/* usb ports of the VM */
  221 +
  222 +void qemu_register_usb_port(USBPort *port, void *opaque, int index,
  223 + usb_attachfn attach);
  224 +
  225 +#define VM_USB_HUB_SIZE 8
  226 +
hw/versatile_pci.c
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 * This code is licenced under the LGPL. 7 * This code is licenced under the LGPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "pci.h"
  12 +#include "primecell.h"
11 13
12 static inline uint32_t vpb_pci_config_addr(target_phys_addr_t addr) 14 static inline uint32_t vpb_pci_config_addr(target_phys_addr_t addr)
13 { 15 {
hw/versatilepb.c
@@ -7,8 +7,14 @@ @@ -7,8 +7,14 @@
7 * This code is licenced under the GPL. 7 * This code is licenced under the GPL.
8 */ 8 */
9 9
10 -#include "vl.h"  
11 -#include "arm_pic.h" 10 +#include "hw.h"
  11 +#include "arm-misc.h"
  12 +#include "primecell.h"
  13 +#include "devices.h"
  14 +#include "net.h"
  15 +#include "sysemu.h"
  16 +#include "pci.h"
  17 +#include "boards.h"
12 18
13 /* Primary interrupt controller. */ 19 /* Primary interrupt controller. */
14 20
hw/vga.c
@@ -21,7 +21,10 @@ @@ -21,7 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "console.h"
  26 +#include "pc.h"
  27 +#include "pci.h"
25 #include "vga_int.h" 28 #include "vga_int.h"
26 #include "pixel_ops.h" 29 #include "pixel_ops.h"
27 30
hw/vmmouse.c
@@ -21,7 +21,10 @@ @@ -21,7 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "console.h"
  26 +#include "ps2.h"
  27 +#include "pc.h"
25 28
26 /* debug only vmmouse */ 29 /* debug only vmmouse */
27 //#define DEBUG_VMMOUSE 30 //#define DEBUG_VMMOUSE
hw/vmport.c
@@ -21,8 +21,10 @@ @@ -21,8 +21,10 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h"  
25 -#include "cpu-all.h" 24 +#include "hw.h"
  25 +#include "isa.h"
  26 +#include "pc.h"
  27 +#include "sysemu.h"
26 28
27 #define VMPORT_CMD_GETVERSION 0x0a 29 #define VMPORT_CMD_GETVERSION 0x0a
28 #define VMPORT_CMD_GETRAMSIZE 0x14 30 #define VMPORT_CMD_GETRAMSIZE 0x14
hw/vmware_vga.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw.h"
  25 +#include "console.h"
  26 +#include "pci.h"
25 27
26 #define VERBOSE 28 #define VERBOSE
27 #define EMBED_STDVGA 29 #define EMBED_STDVGA
hw/wm8750.c
@@ -7,7 +7,9 @@ @@ -7,7 +7,9 @@
7 * This file is licensed under GNU GPL. 7 * This file is licensed under GNU GPL.
8 */ 8 */
9 9
10 -#include "vl.h" 10 +#include "hw.h"
  11 +#include "i2c.h"
  12 +#include "audio/audio.h"
11 13
12 #define IN_PORT_N 3 14 #define IN_PORT_N 3
13 #define OUT_PORT_N 3 15 #define OUT_PORT_N 3
loader.c
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "qemu-common.h"
25 #include "disas.h" 25 #include "disas.h"
26 #include "uboot_image.h" 26 #include "uboot_image.h"
27 27
m68k-semi.c
@@ -33,7 +33,9 @@ @@ -33,7 +33,9 @@
33 #include "qemu.h" 33 #include "qemu.h"
34 #define SEMIHOSTING_HEAP_SIZE (128 * 1024 * 1024) 34 #define SEMIHOSTING_HEAP_SIZE (128 * 1024 * 1024)
35 #else 35 #else
36 -#include "vl.h" 36 +#include "qemu-common.h"
  37 +#include "sysemu.h"
  38 +#include "gdbstub.h"
37 #include "softmmu-semi.h" 39 #include "softmmu-semi.h"
38 #endif 40 #endif
39 41
monitor.c
@@ -21,7 +21,18 @@ @@ -21,7 +21,18 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw/hw.h"
  25 +#include "hw/usb.h"
  26 +#include "hw/pcmcia.h"
  27 +#include "hw/pc.h"
  28 +#include "hw/pci.h"
  29 +#include "gdbstub.h"
  30 +#include "net.h"
  31 +#include "qemu-char.h"
  32 +#include "sysemu.h"
  33 +#include "console.h"
  34 +#include "block.h"
  35 +#include "audio/audio.h"
25 #include "disas.h" 36 #include "disas.h"
26 #include <dirent.h> 37 #include <dirent.h>
27 38
net.h 0 โ†’ 100644
  1 +#ifndef QEMU_NET_H
  2 +#define QEMU_NET_H
  3 +
  4 +/* VLANs support */
  5 +
  6 +typedef struct VLANClientState VLANClientState;
  7 +
  8 +struct VLANClientState {
  9 + IOReadHandler *fd_read;
  10 + /* Packets may still be sent if this returns zero. It's used to
  11 + rate-limit the slirp code. */
  12 + IOCanRWHandler *fd_can_read;
  13 + void *opaque;
  14 + struct VLANClientState *next;
  15 + struct VLANState *vlan;
  16 + char info_str[256];
  17 +};
  18 +
  19 +struct VLANState {
  20 + int id;
  21 + VLANClientState *first_client;
  22 + struct VLANState *next;
  23 + unsigned int nb_guest_devs, nb_host_devs;
  24 +};
  25 +
  26 +VLANState *qemu_find_vlan(int id);
  27 +VLANClientState *qemu_new_vlan_client(VLANState *vlan,
  28 + IOReadHandler *fd_read,
  29 + IOCanRWHandler *fd_can_read,
  30 + void *opaque);
  31 +int qemu_can_send_packet(VLANClientState *vc);
  32 +void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size);
  33 +void qemu_handler_true(void *opaque);
  34 +
  35 +void do_info_network(void);
  36 +
  37 +/* NIC info */
  38 +
  39 +#define MAX_NICS 8
  40 +
  41 +struct NICInfo {
  42 + uint8_t macaddr[6];
  43 + const char *model;
  44 + VLANState *vlan;
  45 +};
  46 +
  47 +extern int nb_nics;
  48 +extern NICInfo nd_table[MAX_NICS];
  49 +
  50 +#endif
@@ -33,10 +33,8 @@ @@ -33,10 +33,8 @@
33 #include <sys/statvfs.h> 33 #include <sys/statvfs.h>
34 #endif 34 #endif
35 35
36 -#include "cpu.h"  
37 -#if defined(USE_KQEMU)  
38 -#include "vl.h"  
39 -#endif 36 +#include "qemu-common.h"
  37 +#include "sysemu.h"
40 38
41 #ifdef _WIN32 39 #ifdef _WIN32
42 #include <windows.h> 40 #include <windows.h>
qemu-char.h 0 โ†’ 100644
  1 +#ifndef QEMU_CHAR_H
  2 +#define QEMU_CHAR_H
  3 +
  4 +/* character device */
  5 +
  6 +#define CHR_EVENT_BREAK 0 /* serial break char */
  7 +#define CHR_EVENT_FOCUS 1 /* focus to this terminal (modal input needed) */
  8 +#define CHR_EVENT_RESET 2 /* new connection established */
  9 +
  10 +
  11 +#define CHR_IOCTL_SERIAL_SET_PARAMS 1
  12 +typedef struct {
  13 + int speed;
  14 + int parity;
  15 + int data_bits;
  16 + int stop_bits;
  17 +} QEMUSerialSetParams;
  18 +
  19 +#define CHR_IOCTL_SERIAL_SET_BREAK 2
  20 +
  21 +#define CHR_IOCTL_PP_READ_DATA 3
  22 +#define CHR_IOCTL_PP_WRITE_DATA 4
  23 +#define CHR_IOCTL_PP_READ_CONTROL 5
  24 +#define CHR_IOCTL_PP_WRITE_CONTROL 6
  25 +#define CHR_IOCTL_PP_READ_STATUS 7
  26 +#define CHR_IOCTL_PP_EPP_READ_ADDR 8
  27 +#define CHR_IOCTL_PP_EPP_READ 9
  28 +#define CHR_IOCTL_PP_EPP_WRITE_ADDR 10
  29 +#define CHR_IOCTL_PP_EPP_WRITE 11
  30 +
  31 +typedef void IOEventHandler(void *opaque, int event);
  32 +
  33 +struct CharDriverState {
  34 + int (*chr_write)(struct CharDriverState *s, const uint8_t *buf, int len);
  35 + void (*chr_update_read_handler)(struct CharDriverState *s);
  36 + int (*chr_ioctl)(struct CharDriverState *s, int cmd, void *arg);
  37 + IOEventHandler *chr_event;
  38 + IOCanRWHandler *chr_can_read;
  39 + IOReadHandler *chr_read;
  40 + void *handler_opaque;
  41 + void (*chr_send_event)(struct CharDriverState *chr, int event);
  42 + void (*chr_close)(struct CharDriverState *chr);
  43 + void *opaque;
  44 + int focus;
  45 + QEMUBH *bh;
  46 +};
  47 +
  48 +CharDriverState *qemu_chr_open(const char *filename);
  49 +void qemu_chr_printf(CharDriverState *s, const char *fmt, ...);
  50 +int qemu_chr_write(CharDriverState *s, const uint8_t *buf, int len);
  51 +void qemu_chr_send_event(CharDriverState *s, int event);
  52 +void qemu_chr_add_handlers(CharDriverState *s,
  53 + IOCanRWHandler *fd_can_read,
  54 + IOReadHandler *fd_read,
  55 + IOEventHandler *fd_event,
  56 + void *opaque);
  57 +int qemu_chr_ioctl(CharDriverState *s, int cmd, void *arg);
  58 +void qemu_chr_reset(CharDriverState *s);
  59 +int qemu_chr_can_read(CharDriverState *s);
  60 +void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len);
  61 +
  62 +/* async I/O support */
  63 +
  64 +int qemu_set_fd_handler2(int fd,
  65 + IOCanRWHandler *fd_read_poll,
  66 + IOHandler *fd_read,
  67 + IOHandler *fd_write,
  68 + void *opaque);
  69 +int qemu_set_fd_handler(int fd,
  70 + IOHandler *fd_read,
  71 + IOHandler *fd_write,
  72 + void *opaque);
  73 +
  74 +#endif
qemu-common.h
@@ -62,6 +62,37 @@ static inline char *realpath(const char *path, char *resolved_path) @@ -62,6 +62,37 @@ static inline char *realpath(const char *path, char *resolved_path)
62 62
63 #endif /* !defined(NEED_CPU_H) */ 63 #endif /* !defined(NEED_CPU_H) */
64 64
  65 +#ifndef glue
  66 +#define xglue(x, y) x ## y
  67 +#define glue(x, y) xglue(x, y)
  68 +#define stringify(s) tostring(s)
  69 +#define tostring(s) #s
  70 +#endif
  71 +
  72 +#ifndef likely
  73 +#if __GNUC__ < 3
  74 +#define __builtin_expect(x, n) (x)
  75 +#endif
  76 +
  77 +#define likely(x) __builtin_expect(!!(x), 1)
  78 +#define unlikely(x) __builtin_expect(!!(x), 0)
  79 +#endif
  80 +
  81 +#ifndef MIN
  82 +#define MIN(a, b) (((a) < (b)) ? (a) : (b))
  83 +#endif
  84 +#ifndef MAX
  85 +#define MAX(a, b) (((a) > (b)) ? (a) : (b))
  86 +#endif
  87 +
  88 +#ifndef always_inline
  89 +#if (__GNUC__ < 3) || defined(__APPLE__)
  90 +#define always_inline inline
  91 +#else
  92 +#define always_inline __attribute__ (( always_inline )) inline
  93 +#endif
  94 +#endif
  95 +
65 /* bottom halves */ 96 /* bottom halves */
66 typedef struct QEMUBH QEMUBH; 97 typedef struct QEMUBH QEMUBH;
67 98
@@ -73,6 +104,8 @@ void qemu_bh_cancel(QEMUBH *bh); @@ -73,6 +104,8 @@ void qemu_bh_cancel(QEMUBH *bh);
73 void qemu_bh_delete(QEMUBH *bh); 104 void qemu_bh_delete(QEMUBH *bh);
74 int qemu_bh_poll(void); 105 int qemu_bh_poll(void);
75 106
  107 +uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
  108 +
76 /* cutils.c */ 109 /* cutils.c */
77 void pstrcpy(char *buf, int buf_size, const char *str); 110 void pstrcpy(char *buf, int buf_size, const char *str);
78 char *pstrcat(char *buf, int buf_size, const char *s); 111 char *pstrcat(char *buf, int buf_size, const char *s);
@@ -80,4 +113,42 @@ int strstart(const char *str, const char *val, const char **ptr); @@ -80,4 +113,42 @@ int strstart(const char *str, const char *val, const char **ptr);
80 int stristart(const char *str, const char *val, const char **ptr); 113 int stristart(const char *str, const char *val, const char **ptr);
81 time_t mktimegm(struct tm *tm); 114 time_t mktimegm(struct tm *tm);
82 115
  116 +/* Error handling. */
  117 +
  118 +void hw_error(const char *fmt, ...)
  119 + __attribute__ ((__format__ (__printf__, 1, 2)))
  120 + __attribute__ ((__noreturn__));
  121 +
  122 +/* IO callbacks. */
  123 +typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
  124 +typedef int IOCanRWHandler(void *opaque);
  125 +typedef void IOHandler(void *opaque);
  126 +
  127 +struct ParallelIOArg {
  128 + void *buffer;
  129 + int count;
  130 +};
  131 +
  132 +typedef int (*DMA_transfer_handler) (void *opaque, int nchan, int pos, int size);
  133 +
  134 +/* A load of opaque types so that device init declarations don't have to
  135 + pull in all the real definitions. */
  136 +typedef struct NICInfo NICInfo;
  137 +typedef struct AudioState AudioState;
  138 +typedef struct BlockDriverState BlockDriverState;
  139 +typedef struct DisplayState DisplayState;
  140 +typedef struct TextConsole TextConsole;
  141 +typedef struct CharDriverState CharDriverState;
  142 +typedef struct VLANState VLANState;
  143 +typedef struct QEMUFile QEMUFile;
  144 +typedef struct i2c_bus i2c_bus;
  145 +typedef struct i2c_slave i2c_slave;
  146 +typedef struct SMBusDevice SMBusDevice;
  147 +typedef struct QEMUTimer QEMUTimer;
  148 +typedef struct PCIBus PCIBus;
  149 +typedef struct PCIDevice PCIDevice;
  150 +typedef struct SerialState SerialState;
  151 +typedef struct IRQState *qemu_irq;
  152 +struct pcmcia_card_s;
  153 +
83 #endif 154 #endif
qemu-timer.h 0 โ†’ 100644
  1 +#ifndef QEMU_TIMER_H
  2 +#define QEMU_TIMER_H
  3 +
  4 +/* timers */
  5 +
  6 +typedef struct QEMUClock QEMUClock;
  7 +typedef void QEMUTimerCB(void *opaque);
  8 +
  9 +/* The real time clock should be used only for stuff which does not
  10 + change the virtual machine state, as it is run even if the virtual
  11 + machine is stopped. The real time clock has a frequency of 1000
  12 + Hz. */
  13 +extern QEMUClock *rt_clock;
  14 +
  15 +/* The virtual clock is only run during the emulation. It is stopped
  16 + when the virtual machine is stopped. Virtual timers use a high
  17 + precision clock, usually cpu cycles (use ticks_per_sec). */
  18 +extern QEMUClock *vm_clock;
  19 +
  20 +int64_t qemu_get_clock(QEMUClock *clock);
  21 +
  22 +QEMUTimer *qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque);
  23 +void qemu_free_timer(QEMUTimer *ts);
  24 +void qemu_del_timer(QEMUTimer *ts);
  25 +void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time);
  26 +int qemu_timer_pending(QEMUTimer *ts);
  27 +
  28 +extern int64_t ticks_per_sec;
  29 +
  30 +void qemu_get_timer(QEMUFile *f, QEMUTimer *ts);
  31 +void qemu_put_timer(QEMUFile *f, QEMUTimer *ts);
  32 +
  33 +/* ptimer.c */
  34 +typedef struct ptimer_state ptimer_state;
  35 +typedef void (*ptimer_cb)(void *opaque);
  36 +
  37 +ptimer_state *ptimer_init(QEMUBH *bh);
  38 +void ptimer_set_period(ptimer_state *s, int64_t period);
  39 +void ptimer_set_freq(ptimer_state *s, uint32_t freq);
  40 +void ptimer_set_limit(ptimer_state *s, uint64_t limit, int reload);
  41 +uint64_t ptimer_get_count(ptimer_state *s);
  42 +void ptimer_set_count(ptimer_state *s, uint64_t count);
  43 +void ptimer_run(ptimer_state *s, int oneshot);
  44 +void ptimer_stop(ptimer_state *s);
  45 +void qemu_put_ptimer(QEMUFile *f, ptimer_state *s);
  46 +void qemu_get_ptimer(QEMUFile *f, ptimer_state *s);
  47 +
  48 +#endif
readline.c
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "qemu-common.h"
  25 +#include "console.h"
25 26
26 #define TERM_CMD_BUF_SIZE 4095 27 #define TERM_CMD_BUF_SIZE 4095
27 #define TERM_MAX_CMDS 64 28 #define TERM_MAX_CMDS 64
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "qemu-common.h"
  25 +#include "console.h"
  26 +#include "sysemu.h"
25 27
26 #include <SDL.h> 28 #include <SDL.h>
27 29
sysemu.h 0 โ†’ 100644
  1 +#ifndef SYSEMU_H
  2 +#define SYSEMU_H
  3 +/* Misc. things related to the system emulator. */
  4 +
  5 +/* vl.c */
  6 +extern const char *bios_name;
  7 +extern const char *bios_dir;
  8 +
  9 +extern int vm_running;
  10 +extern const char *qemu_name;
  11 +
  12 +typedef struct vm_change_state_entry VMChangeStateEntry;
  13 +typedef void VMChangeStateHandler(void *opaque, int running);
  14 +typedef void VMStopHandler(void *opaque, int reason);
  15 +
  16 +VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
  17 + void *opaque);
  18 +void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
  19 +
  20 +int qemu_add_vm_stop_handler(VMStopHandler *cb, void *opaque);
  21 +void qemu_del_vm_stop_handler(VMStopHandler *cb, void *opaque);
  22 +
  23 +void vm_start(void);
  24 +void vm_stop(int reason);
  25 +
  26 +int64_t cpu_get_ticks(void);
  27 +void cpu_enable_ticks(void);
  28 +void cpu_disable_ticks(void);
  29 +
  30 +void qemu_system_reset_request(void);
  31 +void qemu_system_shutdown_request(void);
  32 +void qemu_system_powerdown_request(void);
  33 +#if !defined(TARGET_SPARC)
  34 +// Please implement a power failure function to signal the OS
  35 +#define qemu_system_powerdown() do{}while(0)
  36 +#else
  37 +void qemu_system_powerdown(void);
  38 +#endif
  39 +
  40 +void cpu_save(QEMUFile *f, void *opaque);
  41 +int cpu_load(QEMUFile *f, void *opaque, int version_id);
  42 +
  43 +void do_savevm(const char *name);
  44 +void do_loadvm(const char *name);
  45 +void do_delvm(const char *name);
  46 +void do_info_snapshots(void);
  47 +
  48 +void main_loop_wait(int timeout);
  49 +
  50 +/* Polling handling */
  51 +
  52 +/* return TRUE if no sleep should be done afterwards */
  53 +typedef int PollingFunc(void *opaque);
  54 +
  55 +int qemu_add_polling_cb(PollingFunc *func, void *opaque);
  56 +void qemu_del_polling_cb(PollingFunc *func, void *opaque);
  57 +
  58 +#ifdef _WIN32
  59 +/* Wait objects handling */
  60 +typedef void WaitObjectFunc(void *opaque);
  61 +
  62 +int qemu_add_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
  63 +void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
  64 +#endif
  65 +
  66 +/* TAP win32 */
  67 +int tap_win32_init(VLANState *vlan, const char *ifname);
  68 +
  69 +/* SLIRP */
  70 +void do_info_slirp(void);
  71 +
  72 +extern int ram_size;
  73 +extern int bios_size;
  74 +extern int rtc_utc;
  75 +extern int rtc_start_date;
  76 +extern int cirrus_vga_enabled;
  77 +extern int vmsvga_enabled;
  78 +extern int graphic_width;
  79 +extern int graphic_height;
  80 +extern int graphic_depth;
  81 +extern const char *keyboard_layout;
  82 +extern int win2k_install_hack;
  83 +extern int alt_grab;
  84 +extern int usb_enabled;
  85 +extern int smp_cpus;
  86 +extern int cursor_hide;
  87 +extern int graphic_rotate;
  88 +extern int no_quit;
  89 +extern int semihosting_enabled;
  90 +extern int autostart;
  91 +extern int old_param;
  92 +extern const char *bootp_filename;
  93 +
  94 +
  95 +#ifdef USE_KQEMU
  96 +extern int kqemu_allowed;
  97 +#endif
  98 +
  99 +#define MAX_OPTION_ROMS 16
  100 +extern const char *option_rom[MAX_OPTION_ROMS];
  101 +extern int nb_option_roms;
  102 +
  103 +#ifdef TARGET_SPARC
  104 +#define MAX_PROM_ENVS 128
  105 +extern const char *prom_envs[MAX_PROM_ENVS];
  106 +extern unsigned int nb_prom_envs;
  107 +#endif
  108 +
  109 +/* XXX: make it dynamic */
  110 +#define MAX_BIOS_SIZE (4 * 1024 * 1024)
  111 +#if defined (TARGET_PPC)
  112 +#define BIOS_SIZE (1024 * 1024)
  113 +#elif defined (TARGET_SPARC64)
  114 +#define BIOS_SIZE ((512 + 32) * 1024)
  115 +#elif defined(TARGET_MIPS)
  116 +#define BIOS_SIZE (4 * 1024 * 1024)
  117 +#endif
  118 +
  119 +#define MAX_DISKS 4
  120 +
  121 +extern BlockDriverState *bs_table[MAX_DISKS + 1];
  122 +extern BlockDriverState *sd_bdrv;
  123 +extern BlockDriverState *mtd_bdrv;
  124 +
  125 +/* NOR flash devices */
  126 +#define MAX_PFLASH 4
  127 +extern BlockDriverState *pflash_table[MAX_PFLASH];
  128 +
  129 +/* serial ports */
  130 +
  131 +#define MAX_SERIAL_PORTS 4
  132 +
  133 +extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
  134 +
  135 +/* parallel ports */
  136 +
  137 +#define MAX_PARALLEL_PORTS 3
  138 +
  139 +extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
  140 +
  141 +#ifdef NEED_CPU_H
  142 +/* loader.c */
  143 +int get_image_size(const char *filename);
  144 +int load_image(const char *filename, uint8_t *addr);
  145 +int load_elf(const char *filename, int64_t virt_to_phys_addend,
  146 + uint64_t *pentry, uint64_t *lowaddr, uint64_t *highaddr);
  147 +int load_aout(const char *filename, uint8_t *addr);
  148 +int load_uboot(const char *filename, target_ulong *ep, int *is_linux);
  149 +#endif
  150 +
  151 +#ifdef HAS_AUDIO
  152 +struct soundhw {
  153 + const char *name;
  154 + const char *descr;
  155 + int enabled;
  156 + int isa;
  157 + union {
  158 + int (*init_isa) (AudioState *s, qemu_irq *pic);
  159 + int (*init_pci) (PCIBus *bus, AudioState *s);
  160 + } init;
  161 +};
  162 +
  163 +extern struct soundhw soundhw[];
  164 +#endif
  165 +
  166 +void do_usb_add(const char *devname);
  167 +void do_usb_del(const char *devname);
  168 +void usb_info(void);
  169 +
  170 +#endif
tap-win32.c
@@ -26,7 +26,9 @@ @@ -26,7 +26,9 @@
26 * distribution); if not, write to the Free Software Foundation, Inc., 26 * distribution); if not, write to the Free Software Foundation, Inc.,
27 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 27 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 */ 28 */
29 -#include "vl.h" 29 +#include "qemu-common.h"
  30 +#include "net.h"
  31 +#include "sysemu.h"
30 #include <stdio.h> 32 #include <stdio.h>
31 #include <windows.h> 33 #include <windows.h>
32 34
target-sparc/helper.c
@@ -604,3 +604,34 @@ void memcpy32(target_ulong *dst, const target_ulong *src) @@ -604,3 +604,34 @@ void memcpy32(target_ulong *dst, const target_ulong *src)
604 dst[6] = src[6]; 604 dst[6] = src[6];
605 dst[7] = src[7]; 605 dst[7] = src[7];
606 } 606 }
  607 +
  608 +#ifdef TARGET_SPARC64
  609 +#if !defined(CONFIG_USER_ONLY)
  610 +#include "qemu-common.h"
  611 +#include "hw/irq.h"
  612 +#include "qemu-timer.h"
  613 +#endif
  614 +
  615 +void do_tick_set_count(void *opaque, uint64_t count)
  616 +{
  617 +#if !defined(CONFIG_USER_ONLY)
  618 + ptimer_set_count(opaque, -count);
  619 +#endif
  620 +}
  621 +
  622 +uint64_t do_tick_get_count(void *opaque)
  623 +{
  624 +#if !defined(CONFIG_USER_ONLY)
  625 + return -ptimer_get_count(opaque);
  626 +#else
  627 + return 0;
  628 +#endif
  629 +}
  630 +
  631 +void do_tick_set_limit(void *opaque, uint64_t limit)
  632 +{
  633 +#if !defined(CONFIG_USER_ONLY)
  634 + ptimer_set_limit(opaque, -limit, 0);
  635 +#endif
  636 +}
  637 +#endif
target-sparc/op_helper.c
@@ -1804,27 +1804,3 @@ void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec, @@ -1804,27 +1804,3 @@ void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec,
1804 } 1804 }
1805 #endif 1805 #endif
1806 1806
1807 -#ifdef TARGET_SPARC64  
1808 -void do_tick_set_count(void *opaque, uint64_t count)  
1809 -{  
1810 -#if !defined(CONFIG_USER_ONLY)  
1811 - ptimer_set_count(opaque, -count);  
1812 -#endif  
1813 -}  
1814 -  
1815 -uint64_t do_tick_get_count(void *opaque)  
1816 -{  
1817 -#if !defined(CONFIG_USER_ONLY)  
1818 - return -ptimer_get_count(opaque);  
1819 -#else  
1820 - return 0;  
1821 -#endif  
1822 -}  
1823 -  
1824 -void do_tick_set_limit(void *opaque, uint64_t limit)  
1825 -{  
1826 -#if !defined(CONFIG_USER_ONLY)  
1827 - ptimer_set_limit(opaque, -limit, 0);  
1828 -#endif  
1829 -}  
1830 -#endif  
usb-linux.c
@@ -21,7 +21,9 @@ @@ -21,7 +21,9 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "qemu-common.h"
  25 +#include "hw/usb.h"
  26 +#include "console.h"
25 27
26 #if defined(__linux__) 28 #if defined(__linux__)
27 #include <dirent.h> 29 #include <dirent.h>
@@ -21,7 +21,22 @@ @@ -21,7 +21,22 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "hw/hw.h"
  25 +#include "hw/boards.h"
  26 +#include "hw/usb.h"
  27 +#include "hw/pcmcia.h"
  28 +#include "hw/pc.h"
  29 +#include "hw/fdc.h"
  30 +#include "hw/audiodev.h"
  31 +#include "hw/isa.h"
  32 +#include "net.h"
  33 +#include "console.h"
  34 +#include "sysemu.h"
  35 +#include "gdbstub.h"
  36 +#include "qemu-timer.h"
  37 +#include "qemu-char.h"
  38 +#include "block.h"
  39 +#include "audio/audio.h"
25 40
26 #include <unistd.h> 41 #include <unistd.h>
27 #include <fcntl.h> 42 #include <fcntl.h>
vl.h deleted 100644 โ†’ 0
1 -/*  
2 - * QEMU System Emulator header  
3 - *  
4 - * Copyright (c) 2003 Fabrice Bellard  
5 - *  
6 - * Permission is hereby granted, free of charge, to any person obtaining a copy  
7 - * of this software and associated documentation files (the "Software"), to deal  
8 - * in the Software without restriction, including without limitation the rights  
9 - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell  
10 - * copies of the Software, and to permit persons to whom the Software is  
11 - * furnished to do so, subject to the following conditions:  
12 - *  
13 - * The above copyright notice and this permission notice shall be included in  
14 - * all copies or substantial portions of the Software.  
15 - *  
16 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  
17 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  
18 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL  
19 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  
20 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  
21 - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN  
22 - * THE SOFTWARE.  
23 - */  
24 -#ifndef VL_H  
25 -#define VL_H  
26 -  
27 -#include "qemu-common.h"  
28 -  
29 -/* FIXME: Remove this. */  
30 -#include "block.h"  
31 -  
32 -#ifndef glue  
33 -#define xglue(x, y) x ## y  
34 -#define glue(x, y) xglue(x, y)  
35 -#define stringify(s) tostring(s)  
36 -#define tostring(s) #s  
37 -#endif  
38 -  
39 -#ifndef likely  
40 -#if __GNUC__ < 3  
41 -#define __builtin_expect(x, n) (x)  
42 -#endif  
43 -  
44 -#define likely(x) __builtin_expect(!!(x), 1)  
45 -#define unlikely(x) __builtin_expect(!!(x), 0)  
46 -#endif  
47 -  
48 -#ifndef MIN  
49 -#define MIN(a, b) (((a) < (b)) ? (a) : (b))  
50 -#endif  
51 -#ifndef MAX  
52 -#define MAX(a, b) (((a) > (b)) ? (a) : (b))  
53 -#endif  
54 -  
55 -#ifndef always_inline  
56 -#if (__GNUC__ < 3) || defined(__APPLE__)  
57 -#define always_inline inline  
58 -#else  
59 -#define always_inline __attribute__ (( always_inline )) inline  
60 -#endif  
61 -#endif  
62 -  
63 -#include "audio/audio.h"  
64 -  
65 -/* vl.c */  
66 -uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);  
67 -  
68 -void hw_error(const char *fmt, ...);  
69 -  
70 -extern const char *bios_dir;  
71 -extern const char *bios_name;  
72 -  
73 -extern int vm_running;  
74 -extern const char *qemu_name;  
75 -  
76 -typedef struct vm_change_state_entry VMChangeStateEntry;  
77 -typedef void VMChangeStateHandler(void *opaque, int running);  
78 -typedef void VMStopHandler(void *opaque, int reason);  
79 -  
80 -VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,  
81 - void *opaque);  
82 -void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);  
83 -  
84 -int qemu_add_vm_stop_handler(VMStopHandler *cb, void *opaque);  
85 -void qemu_del_vm_stop_handler(VMStopHandler *cb, void *opaque);  
86 -  
87 -void vm_start(void);  
88 -void vm_stop(int reason);  
89 -  
90 -typedef void QEMUResetHandler(void *opaque);  
91 -  
92 -void qemu_register_reset(QEMUResetHandler *func, void *opaque);  
93 -void qemu_system_reset_request(void);  
94 -void qemu_system_shutdown_request(void);  
95 -void qemu_system_powerdown_request(void);  
96 -#if !defined(TARGET_SPARC)  
97 -// Please implement a power failure function to signal the OS  
98 -#define qemu_system_powerdown() do{}while(0)  
99 -#else  
100 -void qemu_system_powerdown(void);  
101 -#endif  
102 -  
103 -void main_loop_wait(int timeout);  
104 -  
105 -extern int ram_size;  
106 -extern int bios_size;  
107 -extern int rtc_utc;  
108 -extern int rtc_start_date;  
109 -extern int cirrus_vga_enabled;  
110 -extern int vmsvga_enabled;  
111 -extern int graphic_width;  
112 -extern int graphic_height;  
113 -extern int graphic_depth;  
114 -extern const char *keyboard_layout;  
115 -extern int kqemu_allowed;  
116 -extern int win2k_install_hack;  
117 -extern int alt_grab;  
118 -extern int usb_enabled;  
119 -extern int smp_cpus;  
120 -extern int cursor_hide;  
121 -extern int graphic_rotate;  
122 -extern int no_quit;  
123 -extern int semihosting_enabled;  
124 -extern int autostart;  
125 -extern int old_param;  
126 -extern const char *bootp_filename;  
127 -  
128 -#define MAX_OPTION_ROMS 16  
129 -extern const char *option_rom[MAX_OPTION_ROMS];  
130 -extern int nb_option_roms;  
131 -  
132 -#ifdef TARGET_SPARC  
133 -#define MAX_PROM_ENVS 128  
134 -extern const char *prom_envs[MAX_PROM_ENVS];  
135 -extern unsigned int nb_prom_envs;  
136 -#endif  
137 -  
138 -/* XXX: make it dynamic */  
139 -#define MAX_BIOS_SIZE (4 * 1024 * 1024)  
140 -#if defined (TARGET_PPC)  
141 -#define BIOS_SIZE (1024 * 1024)  
142 -#elif defined (TARGET_SPARC64)  
143 -#define BIOS_SIZE ((512 + 32) * 1024)  
144 -#elif defined(TARGET_MIPS)  
145 -#define BIOS_SIZE (4 * 1024 * 1024)  
146 -#endif  
147 -  
148 -/* keyboard/mouse support */  
149 -  
150 -#define MOUSE_EVENT_LBUTTON 0x01  
151 -#define MOUSE_EVENT_RBUTTON 0x02  
152 -#define MOUSE_EVENT_MBUTTON 0x04  
153 -  
154 -typedef void QEMUPutKBDEvent(void *opaque, int keycode);  
155 -typedef void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int buttons_state);  
156 -  
157 -typedef struct QEMUPutMouseEntry {  
158 - QEMUPutMouseEvent *qemu_put_mouse_event;  
159 - void *qemu_put_mouse_event_opaque;  
160 - int qemu_put_mouse_event_absolute;  
161 - char *qemu_put_mouse_event_name;  
162 -  
163 - /* used internally by qemu for handling mice */  
164 - struct QEMUPutMouseEntry *next;  
165 -} QEMUPutMouseEntry;  
166 -  
167 -void qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque);  
168 -QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,  
169 - void *opaque, int absolute,  
170 - const char *name);  
171 -void qemu_remove_mouse_event_handler(QEMUPutMouseEntry *entry);  
172 -  
173 -void kbd_put_keycode(int keycode);  
174 -void kbd_mouse_event(int dx, int dy, int dz, int buttons_state);  
175 -int kbd_mouse_is_absolute(void);  
176 -  
177 -void do_info_mice(void);  
178 -void do_mouse_set(int index);  
179 -  
180 -/* keysym is a unicode code except for special keys (see QEMU_KEY_xxx  
181 - constants) */  
182 -#define QEMU_KEY_ESC1(c) ((c) | 0xe100)  
183 -#define QEMU_KEY_BACKSPACE 0x007f  
184 -#define QEMU_KEY_UP QEMU_KEY_ESC1('A')  
185 -#define QEMU_KEY_DOWN QEMU_KEY_ESC1('B')  
186 -#define QEMU_KEY_RIGHT QEMU_KEY_ESC1('C')  
187 -#define QEMU_KEY_LEFT QEMU_KEY_ESC1('D')  
188 -#define QEMU_KEY_HOME QEMU_KEY_ESC1(1)  
189 -#define QEMU_KEY_END QEMU_KEY_ESC1(4)  
190 -#define QEMU_KEY_PAGEUP QEMU_KEY_ESC1(5)  
191 -#define QEMU_KEY_PAGEDOWN QEMU_KEY_ESC1(6)  
192 -#define QEMU_KEY_DELETE QEMU_KEY_ESC1(3)  
193 -  
194 -#define QEMU_KEY_CTRL_UP 0xe400  
195 -#define QEMU_KEY_CTRL_DOWN 0xe401  
196 -#define QEMU_KEY_CTRL_LEFT 0xe402  
197 -#define QEMU_KEY_CTRL_RIGHT 0xe403  
198 -#define QEMU_KEY_CTRL_HOME 0xe404  
199 -#define QEMU_KEY_CTRL_END 0xe405  
200 -#define QEMU_KEY_CTRL_PAGEUP 0xe406  
201 -#define QEMU_KEY_CTRL_PAGEDOWN 0xe407  
202 -  
203 -void kbd_put_keysym(int keysym);  
204 -  
205 -/* async I/O support */  
206 -  
207 -typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);  
208 -typedef int IOCanRWHandler(void *opaque);  
209 -typedef void IOHandler(void *opaque);  
210 -  
211 -int qemu_set_fd_handler2(int fd,  
212 - IOCanRWHandler *fd_read_poll,  
213 - IOHandler *fd_read,  
214 - IOHandler *fd_write,  
215 - void *opaque);  
216 -int qemu_set_fd_handler(int fd,  
217 - IOHandler *fd_read,  
218 - IOHandler *fd_write,  
219 - void *opaque);  
220 -  
221 -/* Polling handling */  
222 -  
223 -/* return TRUE if no sleep should be done afterwards */  
224 -typedef int PollingFunc(void *opaque);  
225 -  
226 -int qemu_add_polling_cb(PollingFunc *func, void *opaque);  
227 -void qemu_del_polling_cb(PollingFunc *func, void *opaque);  
228 -  
229 -#ifdef _WIN32  
230 -/* Wait objects handling */  
231 -typedef void WaitObjectFunc(void *opaque);  
232 -  
233 -int qemu_add_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);  
234 -void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);  
235 -#endif  
236 -  
237 -/* character device */  
238 -  
239 -#define CHR_EVENT_BREAK 0 /* serial break char */  
240 -#define CHR_EVENT_FOCUS 1 /* focus to this terminal (modal input needed) */  
241 -#define CHR_EVENT_RESET 2 /* new connection established */  
242 -  
243 -  
244 -#define CHR_IOCTL_SERIAL_SET_PARAMS 1  
245 -typedef struct {  
246 - int speed;  
247 - int parity;  
248 - int data_bits;  
249 - int stop_bits;  
250 -} QEMUSerialSetParams;  
251 -  
252 -#define CHR_IOCTL_SERIAL_SET_BREAK 2  
253 -  
254 -#define CHR_IOCTL_PP_READ_DATA 3  
255 -#define CHR_IOCTL_PP_WRITE_DATA 4  
256 -#define CHR_IOCTL_PP_READ_CONTROL 5  
257 -#define CHR_IOCTL_PP_WRITE_CONTROL 6  
258 -#define CHR_IOCTL_PP_READ_STATUS 7  
259 -#define CHR_IOCTL_PP_EPP_READ_ADDR 8  
260 -#define CHR_IOCTL_PP_EPP_READ 9  
261 -#define CHR_IOCTL_PP_EPP_WRITE_ADDR 10  
262 -#define CHR_IOCTL_PP_EPP_WRITE 11  
263 -  
264 -typedef void IOEventHandler(void *opaque, int event);  
265 -  
266 -typedef struct CharDriverState {  
267 - int (*chr_write)(struct CharDriverState *s, const uint8_t *buf, int len);  
268 - void (*chr_update_read_handler)(struct CharDriverState *s);  
269 - int (*chr_ioctl)(struct CharDriverState *s, int cmd, void *arg);  
270 - IOEventHandler *chr_event;  
271 - IOCanRWHandler *chr_can_read;  
272 - IOReadHandler *chr_read;  
273 - void *handler_opaque;  
274 - void (*chr_send_event)(struct CharDriverState *chr, int event);  
275 - void (*chr_close)(struct CharDriverState *chr);  
276 - void *opaque;  
277 - int focus;  
278 - QEMUBH *bh;  
279 -} CharDriverState;  
280 -  
281 -CharDriverState *qemu_chr_open(const char *filename);  
282 -void qemu_chr_printf(CharDriverState *s, const char *fmt, ...);  
283 -int qemu_chr_write(CharDriverState *s, const uint8_t *buf, int len);  
284 -void qemu_chr_send_event(CharDriverState *s, int event);  
285 -void qemu_chr_add_handlers(CharDriverState *s,  
286 - IOCanRWHandler *fd_can_read,  
287 - IOReadHandler *fd_read,  
288 - IOEventHandler *fd_event,  
289 - void *opaque);  
290 -int qemu_chr_ioctl(CharDriverState *s, int cmd, void *arg);  
291 -void qemu_chr_reset(CharDriverState *s);  
292 -int qemu_chr_can_read(CharDriverState *s);  
293 -void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len);  
294 -  
295 -/* consoles */  
296 -  
297 -typedef struct DisplayState DisplayState;  
298 -typedef struct TextConsole TextConsole;  
299 -  
300 -struct DisplayState {  
301 - uint8_t *data;  
302 - int linesize;  
303 - int depth;  
304 - int bgr; /* BGR color order instead of RGB. Only valid for depth == 32 */  
305 - int width;  
306 - int height;  
307 - void *opaque;  
308 - struct QEMUTimer *gui_timer;  
309 -  
310 - void (*dpy_update)(struct DisplayState *s, int x, int y, int w, int h);  
311 - void (*dpy_resize)(struct DisplayState *s, int w, int h);  
312 - void (*dpy_refresh)(struct DisplayState *s);  
313 - void (*dpy_copy)(struct DisplayState *s, int src_x, int src_y,  
314 - int dst_x, int dst_y, int w, int h);  
315 - void (*dpy_fill)(struct DisplayState *s, int x, int y,  
316 - int w, int h, uint32_t c);  
317 - void (*mouse_set)(int x, int y, int on);  
318 - void (*cursor_define)(int width, int height, int bpp, int hot_x, int hot_y,  
319 - uint8_t *image, uint8_t *mask);  
320 -};  
321 -  
322 -static inline void dpy_update(DisplayState *s, int x, int y, int w, int h)  
323 -{  
324 - s->dpy_update(s, x, y, w, h);  
325 -}  
326 -  
327 -static inline void dpy_resize(DisplayState *s, int w, int h)  
328 -{  
329 - s->dpy_resize(s, w, h);  
330 -}  
331 -  
332 -typedef void (*vga_hw_update_ptr)(void *);  
333 -typedef void (*vga_hw_invalidate_ptr)(void *);  
334 -typedef void (*vga_hw_screen_dump_ptr)(void *, const char *);  
335 -  
336 -TextConsole *graphic_console_init(DisplayState *ds, vga_hw_update_ptr update,  
337 - vga_hw_invalidate_ptr invalidate,  
338 - vga_hw_screen_dump_ptr screen_dump,  
339 - void *opaque);  
340 -void vga_hw_update(void);  
341 -void vga_hw_invalidate(void);  
342 -void vga_hw_screen_dump(const char *filename);  
343 -  
344 -int is_graphic_console(void);  
345 -CharDriverState *text_console_init(DisplayState *ds, const char *p);  
346 -void console_select(unsigned int index);  
347 -void console_color_init(DisplayState *ds);  
348 -  
349 -/* serial ports */  
350 -  
351 -#define MAX_SERIAL_PORTS 4  
352 -  
353 -extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];  
354 -  
355 -/* parallel ports */  
356 -  
357 -#define MAX_PARALLEL_PORTS 3  
358 -  
359 -extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];  
360 -  
361 -struct ParallelIOArg {  
362 - void *buffer;  
363 - int count;  
364 -};  
365 -  
366 -/* VLANs support */  
367 -  
368 -typedef struct VLANClientState VLANClientState;  
369 -  
370 -struct VLANClientState {  
371 - IOReadHandler *fd_read;  
372 - /* Packets may still be sent if this returns zero. It's used to  
373 - rate-limit the slirp code. */  
374 - IOCanRWHandler *fd_can_read;  
375 - void *opaque;  
376 - struct VLANClientState *next;  
377 - struct VLANState *vlan;  
378 - char info_str[256];  
379 -};  
380 -  
381 -typedef struct VLANState {  
382 - int id;  
383 - VLANClientState *first_client;  
384 - struct VLANState *next;  
385 - unsigned int nb_guest_devs, nb_host_devs;  
386 -} VLANState;  
387 -  
388 -VLANState *qemu_find_vlan(int id);  
389 -VLANClientState *qemu_new_vlan_client(VLANState *vlan,  
390 - IOReadHandler *fd_read,  
391 - IOCanRWHandler *fd_can_read,  
392 - void *opaque);  
393 -int qemu_can_send_packet(VLANClientState *vc);  
394 -void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size);  
395 -void qemu_handler_true(void *opaque);  
396 -  
397 -void do_info_network(void);  
398 -  
399 -/* TAP win32 */  
400 -int tap_win32_init(VLANState *vlan, const char *ifname);  
401 -  
402 -/* NIC info */  
403 -  
404 -#define MAX_NICS 8  
405 -  
406 -typedef struct NICInfo {  
407 - uint8_t macaddr[6];  
408 - const char *model;  
409 - VLANState *vlan;  
410 -} NICInfo;  
411 -  
412 -extern int nb_nics;  
413 -extern NICInfo nd_table[MAX_NICS];  
414 -  
415 -/* SLIRP */  
416 -void do_info_slirp(void);  
417 -  
418 -/* timers */  
419 -  
420 -typedef struct QEMUClock QEMUClock;  
421 -typedef struct QEMUTimer QEMUTimer;  
422 -typedef void QEMUTimerCB(void *opaque);  
423 -  
424 -/* The real time clock should be used only for stuff which does not  
425 - change the virtual machine state, as it is run even if the virtual  
426 - machine is stopped. The real time clock has a frequency of 1000  
427 - Hz. */  
428 -extern QEMUClock *rt_clock;  
429 -  
430 -/* The virtual clock is only run during the emulation. It is stopped  
431 - when the virtual machine is stopped. Virtual timers use a high  
432 - precision clock, usually cpu cycles (use ticks_per_sec). */  
433 -extern QEMUClock *vm_clock;  
434 -  
435 -int64_t qemu_get_clock(QEMUClock *clock);  
436 -  
437 -QEMUTimer *qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque);  
438 -void qemu_free_timer(QEMUTimer *ts);  
439 -void qemu_del_timer(QEMUTimer *ts);  
440 -void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time);  
441 -int qemu_timer_pending(QEMUTimer *ts);  
442 -  
443 -extern int64_t ticks_per_sec;  
444 -  
445 -int64_t cpu_get_ticks(void);  
446 -void cpu_enable_ticks(void);  
447 -void cpu_disable_ticks(void);  
448 -  
449 -/* VM Load/Save */  
450 -  
451 -typedef struct QEMUFile QEMUFile;  
452 -  
453 -QEMUFile *qemu_fopen(const char *filename, const char *mode);  
454 -void qemu_fflush(QEMUFile *f);  
455 -void qemu_fclose(QEMUFile *f);  
456 -void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size);  
457 -void qemu_put_byte(QEMUFile *f, int v);  
458 -void qemu_put_be16(QEMUFile *f, unsigned int v);  
459 -void qemu_put_be32(QEMUFile *f, unsigned int v);  
460 -void qemu_put_be64(QEMUFile *f, uint64_t v);  
461 -int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size);  
462 -int qemu_get_byte(QEMUFile *f);  
463 -unsigned int qemu_get_be16(QEMUFile *f);  
464 -unsigned int qemu_get_be32(QEMUFile *f);  
465 -uint64_t qemu_get_be64(QEMUFile *f);  
466 -  
467 -static inline void qemu_put_be64s(QEMUFile *f, const uint64_t *pv)  
468 -{  
469 - qemu_put_be64(f, *pv);  
470 -}  
471 -  
472 -static inline void qemu_put_be32s(QEMUFile *f, const uint32_t *pv)  
473 -{  
474 - qemu_put_be32(f, *pv);  
475 -}  
476 -  
477 -static inline void qemu_put_be16s(QEMUFile *f, const uint16_t *pv)  
478 -{  
479 - qemu_put_be16(f, *pv);  
480 -}  
481 -  
482 -static inline void qemu_put_8s(QEMUFile *f, const uint8_t *pv)  
483 -{  
484 - qemu_put_byte(f, *pv);  
485 -}  
486 -  
487 -static inline void qemu_get_be64s(QEMUFile *f, uint64_t *pv)  
488 -{  
489 - *pv = qemu_get_be64(f);  
490 -}  
491 -  
492 -static inline void qemu_get_be32s(QEMUFile *f, uint32_t *pv)  
493 -{  
494 - *pv = qemu_get_be32(f);  
495 -}  
496 -  
497 -static inline void qemu_get_be16s(QEMUFile *f, uint16_t *pv)  
498 -{  
499 - *pv = qemu_get_be16(f);  
500 -}  
501 -  
502 -static inline void qemu_get_8s(QEMUFile *f, uint8_t *pv)  
503 -{  
504 - *pv = qemu_get_byte(f);  
505 -}  
506 -  
507 -#if TARGET_LONG_BITS == 64  
508 -#define qemu_put_betl qemu_put_be64  
509 -#define qemu_get_betl qemu_get_be64  
510 -#define qemu_put_betls qemu_put_be64s  
511 -#define qemu_get_betls qemu_get_be64s  
512 -#else  
513 -#define qemu_put_betl qemu_put_be32  
514 -#define qemu_get_betl qemu_get_be32  
515 -#define qemu_put_betls qemu_put_be32s  
516 -#define qemu_get_betls qemu_get_be32s  
517 -#endif  
518 -  
519 -int64_t qemu_ftell(QEMUFile *f);  
520 -int64_t qemu_fseek(QEMUFile *f, int64_t pos, int whence);  
521 -  
522 -typedef void SaveStateHandler(QEMUFile *f, void *opaque);  
523 -typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);  
524 -  
525 -int register_savevm(const char *idstr,  
526 - int instance_id,  
527 - int version_id,  
528 - SaveStateHandler *save_state,  
529 - LoadStateHandler *load_state,  
530 - void *opaque);  
531 -void qemu_get_timer(QEMUFile *f, QEMUTimer *ts);  
532 -void qemu_put_timer(QEMUFile *f, QEMUTimer *ts);  
533 -  
534 -void cpu_save(QEMUFile *f, void *opaque);  
535 -int cpu_load(QEMUFile *f, void *opaque, int version_id);  
536 -  
537 -void do_savevm(const char *name);  
538 -void do_loadvm(const char *name);  
539 -void do_delvm(const char *name);  
540 -void do_info_snapshots(void);  
541 -  
542 -/* monitor.c */  
543 -void monitor_init(CharDriverState *hd, int show_banner);  
544 -void term_puts(const char *str);  
545 -void term_vprintf(const char *fmt, va_list ap);  
546 -void term_printf(const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2)));  
547 -void term_print_filename(const char *filename);  
548 -void term_flush(void);  
549 -void term_print_help(void);  
550 -void monitor_readline(const char *prompt, int is_password,  
551 - char *buf, int buf_size);  
552 -  
553 -/* readline.c */  
554 -typedef void ReadLineFunc(void *opaque, const char *str);  
555 -  
556 -extern int completion_index;  
557 -void add_completion(const char *str);  
558 -void readline_handle_byte(int ch);  
559 -void readline_find_completion(const char *cmdline);  
560 -const char *readline_get_history(unsigned int index);  
561 -void readline_start(const char *prompt, int is_password,  
562 - ReadLineFunc *readline_func, void *opaque);  
563 -  
564 -void kqemu_record_dump(void);  
565 -  
566 -/* sdl.c */  
567 -void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);  
568 -  
569 -/* cocoa.m */  
570 -void cocoa_display_init(DisplayState *ds, int full_screen);  
571 -  
572 -/* vnc.c */  
573 -void vnc_display_init(DisplayState *ds);  
574 -void vnc_display_close(DisplayState *ds);  
575 -int vnc_display_open(DisplayState *ds, const char *display);  
576 -int vnc_display_password(DisplayState *ds, const char *password);  
577 -void do_info_vnc(void);  
578 -  
579 -/* x_keymap.c */  
580 -extern uint8_t _translate_keycode(const int key);  
581 -  
582 -#ifdef NEED_CPU_H  
583 -  
584 -typedef void QEMUMachineInitFunc(int ram_size, int vga_ram_size,  
585 - const char *boot_device,  
586 - DisplayState *ds, const char **fd_filename, int snapshot,  
587 - const char *kernel_filename, const char *kernel_cmdline,  
588 - const char *initrd_filename, const char *cpu_model);  
589 -  
590 -typedef struct QEMUMachine {  
591 - const char *name;  
592 - const char *desc;  
593 - QEMUMachineInitFunc *init;  
594 - struct QEMUMachine *next;  
595 -} QEMUMachine;  
596 -  
597 -int qemu_register_machine(QEMUMachine *m);  
598 -  
599 -typedef void SetIRQFunc(void *opaque, int irq_num, int level);  
600 -  
601 -#include "hw/irq.h"  
602 -  
603 -/* ISA bus */  
604 -  
605 -extern target_phys_addr_t isa_mem_base;  
606 -  
607 -typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);  
608 -typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);  
609 -  
610 -int register_ioport_read(int start, int length, int size,  
611 - IOPortReadFunc *func, void *opaque);  
612 -int register_ioport_write(int start, int length, int size,  
613 - IOPortWriteFunc *func, void *opaque);  
614 -void isa_unassign_ioport(int start, int length);  
615 -  
616 -void isa_mmio_init(target_phys_addr_t base, target_phys_addr_t size);  
617 -  
618 -/* PCI bus */  
619 -  
620 -extern target_phys_addr_t pci_mem_base;  
621 -  
622 -typedef struct PCIBus PCIBus;  
623 -typedef struct PCIDevice PCIDevice;  
624 -  
625 -typedef void PCIConfigWriteFunc(PCIDevice *pci_dev,  
626 - uint32_t address, uint32_t data, int len);  
627 -typedef uint32_t PCIConfigReadFunc(PCIDevice *pci_dev,  
628 - uint32_t address, int len);  
629 -typedef void PCIMapIORegionFunc(PCIDevice *pci_dev, int region_num,  
630 - uint32_t addr, uint32_t size, int type);  
631 -  
632 -#define PCI_ADDRESS_SPACE_MEM 0x00  
633 -#define PCI_ADDRESS_SPACE_IO 0x01  
634 -#define PCI_ADDRESS_SPACE_MEM_PREFETCH 0x08  
635 -  
636 -typedef struct PCIIORegion {  
637 - uint32_t addr; /* current PCI mapping address. -1 means not mapped */  
638 - uint32_t size;  
639 - uint8_t type;  
640 - PCIMapIORegionFunc *map_func;  
641 -} PCIIORegion;  
642 -  
643 -#define PCI_ROM_SLOT 6  
644 -#define PCI_NUM_REGIONS 7  
645 -  
646 -#define PCI_DEVICES_MAX 64  
647 -  
648 -#define PCI_VENDOR_ID 0x00 /* 16 bits */  
649 -#define PCI_DEVICE_ID 0x02 /* 16 bits */  
650 -#define PCI_COMMAND 0x04 /* 16 bits */  
651 -#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */  
652 -#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */  
653 -#define PCI_CLASS_DEVICE 0x0a /* Device class */  
654 -#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */  
655 -#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */  
656 -#define PCI_MIN_GNT 0x3e /* 8 bits */  
657 -#define PCI_MAX_LAT 0x3f /* 8 bits */  
658 -  
659 -struct PCIDevice {  
660 - /* PCI config space */  
661 - uint8_t config[256];  
662 -  
663 - /* the following fields are read only */  
664 - PCIBus *bus;  
665 - int devfn;  
666 - char name[64];  
667 - PCIIORegion io_regions[PCI_NUM_REGIONS];  
668 -  
669 - /* do not access the following fields */  
670 - PCIConfigReadFunc *config_read;  
671 - PCIConfigWriteFunc *config_write;  
672 - /* ??? This is a PC-specific hack, and should be removed. */  
673 - int irq_index;  
674 -  
675 - /* IRQ objects for the INTA-INTD pins. */  
676 - qemu_irq *irq;  
677 -  
678 - /* Current IRQ levels. Used internally by the generic PCI code. */  
679 - int irq_state[4];  
680 -};  
681 -  
682 -PCIDevice *pci_register_device(PCIBus *bus, const char *name,  
683 - int instance_size, int devfn,  
684 - PCIConfigReadFunc *config_read,  
685 - PCIConfigWriteFunc *config_write);  
686 -  
687 -void pci_register_io_region(PCIDevice *pci_dev, int region_num,  
688 - uint32_t size, int type,  
689 - PCIMapIORegionFunc *map_func);  
690 -  
691 -uint32_t pci_default_read_config(PCIDevice *d,  
692 - uint32_t address, int len);  
693 -void pci_default_write_config(PCIDevice *d,  
694 - uint32_t address, uint32_t val, int len);  
695 -void pci_device_save(PCIDevice *s, QEMUFile *f);  
696 -int pci_device_load(PCIDevice *s, QEMUFile *f);  
697 -  
698 -typedef void (*pci_set_irq_fn)(qemu_irq *pic, int irq_num, int level);  
699 -typedef int (*pci_map_irq_fn)(PCIDevice *pci_dev, int irq_num);  
700 -PCIBus *pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq,  
701 - qemu_irq *pic, int devfn_min, int nirq);  
702 -  
703 -void pci_nic_init(PCIBus *bus, NICInfo *nd, int devfn);  
704 -void pci_data_write(void *opaque, uint32_t addr, uint32_t val, int len);  
705 -uint32_t pci_data_read(void *opaque, uint32_t addr, int len);  
706 -int pci_bus_num(PCIBus *s);  
707 -void pci_for_each_device(int bus_num, void (*fn)(PCIDevice *d));  
708 -  
709 -void pci_info(void);  
710 -PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id,  
711 - pci_map_irq_fn map_irq, const char *name);  
712 -  
713 -/* prep_pci.c */  
714 -PCIBus *pci_prep_init(qemu_irq *pic);  
715 -  
716 -/* apb_pci.c */  
717 -PCIBus *pci_apb_init(target_phys_addr_t special_base, target_phys_addr_t mem_base,  
718 - qemu_irq *pic);  
719 -  
720 -PCIBus *pci_vpb_init(qemu_irq *pic, int irq, int realview);  
721 -  
722 -/* piix_pci.c */  
723 -PCIBus *i440fx_init(PCIDevice **pi440fx_state, qemu_irq *pic);  
724 -void i440fx_set_smm(PCIDevice *d, int val);  
725 -int piix3_init(PCIBus *bus, int devfn);  
726 -void i440fx_init_memory_mappings(PCIDevice *d);  
727 -  
728 -int piix4_init(PCIBus *bus, int devfn);  
729 -  
730 -/* openpic.c */  
731 -/* OpenPIC have 5 outputs per CPU connected and one IRQ out single output */  
732 -enum {  
733 - OPENPIC_OUTPUT_INT = 0, /* IRQ */  
734 - OPENPIC_OUTPUT_CINT, /* critical IRQ */  
735 - OPENPIC_OUTPUT_MCK, /* Machine check event */  
736 - OPENPIC_OUTPUT_DEBUG, /* Inconditional debug event */  
737 - OPENPIC_OUTPUT_RESET, /* Core reset event */  
738 - OPENPIC_OUTPUT_NB,  
739 -};  
740 -qemu_irq *openpic_init (PCIBus *bus, int *pmem_index, int nb_cpus,  
741 - qemu_irq **irqs, qemu_irq irq_out);  
742 -  
743 -/* gt64xxx.c */  
744 -PCIBus *pci_gt64120_init(qemu_irq *pic);  
745 -  
746 -#ifdef HAS_AUDIO  
747 -struct soundhw {  
748 - const char *name;  
749 - const char *descr;  
750 - int enabled;  
751 - int isa;  
752 - union {  
753 - int (*init_isa) (AudioState *s, qemu_irq *pic);  
754 - int (*init_pci) (PCIBus *bus, AudioState *s);  
755 - } init;  
756 -};  
757 -  
758 -extern struct soundhw soundhw[];  
759 -#endif  
760 -  
761 -/* vga.c */  
762 -  
763 -#ifndef TARGET_SPARC  
764 -#define VGA_RAM_SIZE (8192 * 1024)  
765 -#else  
766 -#define VGA_RAM_SIZE (9 * 1024 * 1024)  
767 -#endif  
768 -  
769 -int isa_vga_init(DisplayState *ds, uint8_t *vga_ram_base,  
770 - unsigned long vga_ram_offset, int vga_ram_size);  
771 -int pci_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,  
772 - unsigned long vga_ram_offset, int vga_ram_size,  
773 - unsigned long vga_bios_offset, int vga_bios_size);  
774 -int isa_vga_mm_init(DisplayState *ds, uint8_t *vga_ram_base,  
775 - unsigned long vga_ram_offset, int vga_ram_size,  
776 - target_phys_addr_t vram_base, target_phys_addr_t ctrl_base,  
777 - int it_shift);  
778 -  
779 -/* cirrus_vga.c */  
780 -void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,  
781 - unsigned long vga_ram_offset, int vga_ram_size);  
782 -void isa_cirrus_vga_init(DisplayState *ds, uint8_t *vga_ram_base,  
783 - unsigned long vga_ram_offset, int vga_ram_size);  
784 -  
785 -/* vmware_vga.c */  
786 -void pci_vmsvga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,  
787 - unsigned long vga_ram_offset, int vga_ram_size);  
788 -  
789 -/* ide.c */  
790 -#define MAX_DISKS 4  
791 -  
792 -extern BlockDriverState *bs_table[MAX_DISKS + 1];  
793 -extern BlockDriverState *sd_bdrv;  
794 -extern BlockDriverState *mtd_bdrv;  
795 -  
796 -void isa_ide_init(int iobase, int iobase2, qemu_irq irq,  
797 - BlockDriverState *hd0, BlockDriverState *hd1);  
798 -void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,  
799 - int secondary_ide_enabled);  
800 -void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn,  
801 - qemu_irq *pic);  
802 -void pci_piix4_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn,  
803 - qemu_irq *pic);  
804 -  
805 -/* cdrom.c */  
806 -int cdrom_read_toc(int nb_sectors, uint8_t *buf, int msf, int start_track);  
807 -int cdrom_read_toc_raw(int nb_sectors, uint8_t *buf, int msf, int session_num);  
808 -  
809 -/* ds1225y.c */  
810 -typedef struct ds1225y_t ds1225y_t;  
811 -ds1225y_t *ds1225y_init(target_phys_addr_t mem_base, const char *filename);  
812 -  
813 -/* es1370.c */  
814 -int es1370_init (PCIBus *bus, AudioState *s);  
815 -  
816 -/* sb16.c */  
817 -int SB16_init (AudioState *s, qemu_irq *pic);  
818 -  
819 -/* adlib.c */  
820 -int Adlib_init (AudioState *s, qemu_irq *pic);  
821 -  
822 -/* gus.c */  
823 -int GUS_init (AudioState *s, qemu_irq *pic);  
824 -  
825 -/* dma.c */  
826 -typedef int (*DMA_transfer_handler) (void *opaque, int nchan, int pos, int size);  
827 -int DMA_get_channel_mode (int nchan);  
828 -int DMA_read_memory (int nchan, void *buf, int pos, int size);  
829 -int DMA_write_memory (int nchan, void *buf, int pos, int size);  
830 -void DMA_hold_DREQ (int nchan);  
831 -void DMA_release_DREQ (int nchan);  
832 -void DMA_schedule(int nchan);  
833 -void DMA_run (void);  
834 -void DMA_init (int high_page_enable);  
835 -void DMA_register_channel (int nchan,  
836 - DMA_transfer_handler transfer_handler,  
837 - void *opaque);  
838 -/* fdc.c */  
839 -#define MAX_FD 2  
840 -extern BlockDriverState *fd_table[MAX_FD];  
841 -  
842 -typedef struct fdctrl_t fdctrl_t;  
843 -  
844 -fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped,  
845 - target_phys_addr_t io_base,  
846 - BlockDriverState **fds);  
847 -fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base,  
848 - BlockDriverState **fds);  
849 -int fdctrl_get_drive_type(fdctrl_t *fdctrl, int drive_num);  
850 -  
851 -/* eepro100.c */  
852 -  
853 -void pci_i82551_init(PCIBus *bus, NICInfo *nd, int devfn);  
854 -void pci_i82557b_init(PCIBus *bus, NICInfo *nd, int devfn);  
855 -void pci_i82559er_init(PCIBus *bus, NICInfo *nd, int devfn);  
856 -  
857 -/* ne2000.c */  
858 -  
859 -void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd);  
860 -void pci_ne2000_init(PCIBus *bus, NICInfo *nd, int devfn);  
861 -  
862 -/* rtl8139.c */  
863 -  
864 -void pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn);  
865 -  
866 -/* pcnet.c */  
867 -  
868 -void pci_pcnet_init(PCIBus *bus, NICInfo *nd, int devfn);  
869 -void lance_init(NICInfo *nd, target_phys_addr_t leaddr, void *dma_opaque,  
870 - qemu_irq irq, qemu_irq *reset);  
871 -  
872 -/* mipsnet.c */  
873 -void mipsnet_init(int base, qemu_irq irq, NICInfo *nd);  
874 -  
875 -/* vmmouse.c */  
876 -void *vmmouse_init(void *m);  
877 -  
878 -/* vmport.c */  
879 -#ifdef TARGET_I386  
880 -void vmport_init(CPUState *env);  
881 -void vmport_register(unsigned char command, IOPortReadFunc *func, void *opaque);  
882 -#endif  
883 -  
884 -/* pckbd.c */  
885 -  
886 -void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base);  
887 -void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,  
888 - target_phys_addr_t base, int it_shift);  
889 -  
890 -/* mc146818rtc.c */  
891 -  
892 -typedef struct RTCState RTCState;  
893 -  
894 -RTCState *rtc_init(int base, qemu_irq irq);  
895 -RTCState *rtc_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq);  
896 -void rtc_set_memory(RTCState *s, int addr, int val);  
897 -void rtc_set_date(RTCState *s, const struct tm *tm);  
898 -  
899 -/* serial.c */  
900 -  
901 -typedef struct SerialState SerialState;  
902 -SerialState *serial_init(int base, qemu_irq irq, CharDriverState *chr);  
903 -SerialState *serial_mm_init (target_phys_addr_t base, int it_shift,  
904 - qemu_irq irq, CharDriverState *chr,  
905 - int ioregister);  
906 -uint32_t serial_mm_readb (void *opaque, target_phys_addr_t addr);  
907 -void serial_mm_writeb (void *opaque, target_phys_addr_t addr, uint32_t value);  
908 -uint32_t serial_mm_readw (void *opaque, target_phys_addr_t addr);  
909 -void serial_mm_writew (void *opaque, target_phys_addr_t addr, uint32_t value);  
910 -uint32_t serial_mm_readl (void *opaque, target_phys_addr_t addr);  
911 -void serial_mm_writel (void *opaque, target_phys_addr_t addr, uint32_t value);  
912 -  
913 -/* parallel.c */  
914 -  
915 -typedef struct ParallelState ParallelState;  
916 -ParallelState *parallel_init(int base, qemu_irq irq, CharDriverState *chr);  
917 -ParallelState *parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq, CharDriverState *chr);  
918 -  
919 -/* i8259.c */  
920 -  
921 -typedef struct PicState2 PicState2;  
922 -extern PicState2 *isa_pic;  
923 -void pic_set_irq(int irq, int level);  
924 -void pic_set_irq_new(void *opaque, int irq, int level);  
925 -qemu_irq *i8259_init(qemu_irq parent_irq);  
926 -void pic_set_alt_irq_func(PicState2 *s, SetIRQFunc *alt_irq_func,  
927 - void *alt_irq_opaque);  
928 -int pic_read_irq(PicState2 *s);  
929 -void pic_update_irq(PicState2 *s);  
930 -uint32_t pic_intack_read(PicState2 *s);  
931 -void pic_info(void);  
932 -void irq_info(void);  
933 -  
934 -/* APIC */  
935 -typedef struct IOAPICState IOAPICState;  
936 -  
937 -int apic_init(CPUState *env);  
938 -int apic_accept_pic_intr(CPUState *env);  
939 -int apic_get_interrupt(CPUState *env);  
940 -IOAPICState *ioapic_init(void);  
941 -void ioapic_set_irq(void *opaque, int vector, int level);  
942 -  
943 -/* i8254.c */  
944 -  
945 -#define PIT_FREQ 1193182  
946 -  
947 -typedef struct PITState PITState;  
948 -  
949 -PITState *pit_init(int base, qemu_irq irq);  
950 -void pit_set_gate(PITState *pit, int channel, int val);  
951 -int pit_get_gate(PITState *pit, int channel);  
952 -int pit_get_initial_count(PITState *pit, int channel);  
953 -int pit_get_mode(PITState *pit, int channel);  
954 -int pit_get_out(PITState *pit, int channel, int64_t current_time);  
955 -  
956 -/* jazz_led.c */  
957 -extern void jazz_led_init(DisplayState *ds, target_phys_addr_t base);  
958 -  
959 -/* pcspk.c */  
960 -void pcspk_init(PITState *);  
961 -int pcspk_audio_init(AudioState *, qemu_irq *pic);  
962 -  
963 -#include "hw/i2c.h"  
964 -  
965 -#include "hw/smbus.h"  
966 -  
967 -/* acpi.c */  
968 -extern int acpi_enabled;  
969 -i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base);  
970 -void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);  
971 -void acpi_bios_init(void);  
972 -  
973 -/* Axis ETRAX. */  
974 -extern QEMUMachine bareetraxfs_machine;  
975 -  
976 -/* pc.c */  
977 -extern QEMUMachine pc_machine;  
978 -extern QEMUMachine isapc_machine;  
979 -extern int fd_bootchk;  
980 -  
981 -void ioport_set_a20(int enable);  
982 -int ioport_get_a20(void);  
983 -  
984 -/* ppc.c */  
985 -extern QEMUMachine prep_machine;  
986 -extern QEMUMachine core99_machine;  
987 -extern QEMUMachine heathrow_machine;  
988 -extern QEMUMachine ref405ep_machine;  
989 -extern QEMUMachine taihu_machine;  
990 -  
991 -/* mips_r4k.c */  
992 -extern QEMUMachine mips_machine;  
993 -  
994 -/* mips_malta.c */  
995 -extern QEMUMachine mips_malta_machine;  
996 -  
997 -/* mips_pica61.c */  
998 -extern QEMUMachine mips_pica61_machine;  
999 -  
1000 -/* mips_mipssim.c */  
1001 -extern QEMUMachine mips_mipssim_machine;  
1002 -  
1003 -/* mips_int.c */  
1004 -extern void cpu_mips_irq_init_cpu(CPUState *env);  
1005 -  
1006 -/* mips_timer.c */  
1007 -extern void cpu_mips_clock_init(CPUState *);  
1008 -extern void cpu_mips_irqctrl_init (void);  
1009 -  
1010 -/* shix.c */  
1011 -extern QEMUMachine shix_machine;  
1012 -  
1013 -/* r2d.c */  
1014 -extern QEMUMachine r2d_machine;  
1015 -  
1016 -#ifdef TARGET_PPC  
1017 -/* PowerPC hardware exceptions management helpers */  
1018 -typedef void (*clk_setup_cb)(void *opaque, uint32_t freq);  
1019 -typedef struct clk_setup_t clk_setup_t;  
1020 -struct clk_setup_t {  
1021 - clk_setup_cb cb;  
1022 - void *opaque;  
1023 -};  
1024 -static inline void clk_setup (clk_setup_t *clk, uint32_t freq)  
1025 -{  
1026 - if (clk->cb != NULL)  
1027 - (*clk->cb)(clk->opaque, freq);  
1028 -}  
1029 -  
1030 -clk_setup_cb cpu_ppc_tb_init (CPUState *env, uint32_t freq);  
1031 -/* Embedded PowerPC DCR management */  
1032 -typedef target_ulong (*dcr_read_cb)(void *opaque, int dcrn);  
1033 -typedef void (*dcr_write_cb)(void *opaque, int dcrn, target_ulong val);  
1034 -int ppc_dcr_init (CPUState *env, int (*dcr_read_error)(int dcrn),  
1035 - int (*dcr_write_error)(int dcrn));  
1036 -int ppc_dcr_register (CPUState *env, int dcrn, void *opaque,  
1037 - dcr_read_cb drc_read, dcr_write_cb dcr_write);  
1038 -clk_setup_cb ppc_emb_timers_init (CPUState *env, uint32_t freq);  
1039 -/* Embedded PowerPC reset */  
1040 -void ppc40x_core_reset (CPUState *env);  
1041 -void ppc40x_chip_reset (CPUState *env);  
1042 -void ppc40x_system_reset (CPUState *env);  
1043 -void PREP_debug_write (void *opaque, uint32_t addr, uint32_t val);  
1044 -  
1045 -extern CPUWriteMemoryFunc *PPC_io_write[];  
1046 -extern CPUReadMemoryFunc *PPC_io_read[];  
1047 -void PPC_debug_write (void *opaque, uint32_t addr, uint32_t val);  
1048 -#endif  
1049 -  
1050 -/* sun4m.c */  
1051 -extern QEMUMachine ss5_machine, ss10_machine, ss600mp_machine;  
1052 -  
1053 -/* iommu.c */  
1054 -void *iommu_init(target_phys_addr_t addr, uint32_t version);  
1055 -void sparc_iommu_memory_rw(void *opaque, target_phys_addr_t addr,  
1056 - uint8_t *buf, int len, int is_write);  
1057 -static inline void sparc_iommu_memory_read(void *opaque,  
1058 - target_phys_addr_t addr,  
1059 - uint8_t *buf, int len)  
1060 -{  
1061 - sparc_iommu_memory_rw(opaque, addr, buf, len, 0);  
1062 -}  
1063 -  
1064 -static inline void sparc_iommu_memory_write(void *opaque,  
1065 - target_phys_addr_t addr,  
1066 - uint8_t *buf, int len)  
1067 -{  
1068 - sparc_iommu_memory_rw(opaque, addr, buf, len, 1);  
1069 -}  
1070 -  
1071 -/* tcx.c */  
1072 -void tcx_init(DisplayState *ds, target_phys_addr_t addr, uint8_t *vram_base,  
1073 - unsigned long vram_offset, int vram_size, int width, int height,  
1074 - int depth);  
1075 -  
1076 -/* slavio_intctl.c */  
1077 -void *slavio_intctl_init(target_phys_addr_t addr, target_phys_addr_t addrg,  
1078 - const uint32_t *intbit_to_level,  
1079 - qemu_irq **irq, qemu_irq **cpu_irq,  
1080 - qemu_irq **parent_irq, unsigned int cputimer);  
1081 -void slavio_pic_info(void *opaque);  
1082 -void slavio_irq_info(void *opaque);  
1083 -  
1084 -/* loader.c */  
1085 -int get_image_size(const char *filename);  
1086 -int load_image(const char *filename, uint8_t *addr);  
1087 -int load_elf(const char *filename, int64_t virt_to_phys_addend,  
1088 - uint64_t *pentry, uint64_t *lowaddr, uint64_t *highaddr);  
1089 -int load_aout(const char *filename, uint8_t *addr);  
1090 -int load_uboot(const char *filename, target_ulong *ep, int *is_linux);  
1091 -  
1092 -/* slavio_timer.c */  
1093 -void slavio_timer_init_all(target_phys_addr_t base, qemu_irq master_irq,  
1094 - qemu_irq *cpu_irqs);  
1095 -  
1096 -/* slavio_serial.c */  
1097 -SerialState *slavio_serial_init(target_phys_addr_t base, qemu_irq irq,  
1098 - CharDriverState *chr1, CharDriverState *chr2);  
1099 -void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq);  
1100 -  
1101 -/* slavio_misc.c */  
1102 -void *slavio_misc_init(target_phys_addr_t base, target_phys_addr_t power_base,  
1103 - qemu_irq irq);  
1104 -void slavio_set_power_fail(void *opaque, int power_failing);  
1105 -  
1106 -/* esp.c */  
1107 -void esp_scsi_attach(void *opaque, BlockDriverState *bd, int id);  
1108 -void *esp_init(BlockDriverState **bd, target_phys_addr_t espaddr,  
1109 - void *dma_opaque, qemu_irq irq, qemu_irq *reset);  
1110 -  
1111 -/* sparc32_dma.c */  
1112 -void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq,  
1113 - void *iommu, qemu_irq **dev_irq, qemu_irq **reset);  
1114 -void ledma_memory_read(void *opaque, target_phys_addr_t addr,  
1115 - uint8_t *buf, int len, int do_bswap);  
1116 -void ledma_memory_write(void *opaque, target_phys_addr_t addr,  
1117 - uint8_t *buf, int len, int do_bswap);  
1118 -void espdma_memory_read(void *opaque, uint8_t *buf, int len);  
1119 -void espdma_memory_write(void *opaque, uint8_t *buf, int len);  
1120 -  
1121 -/* cs4231.c */  
1122 -void cs_init(target_phys_addr_t base, int irq, void *intctl);  
1123 -  
1124 -/* sun4u.c */  
1125 -extern QEMUMachine sun4u_machine;  
1126 -  
1127 -/* NVRAM helpers */  
1128 -typedef uint32_t (*nvram_read_t)(void *private, uint32_t addr);  
1129 -typedef void (*nvram_write_t)(void *private, uint32_t addr, uint32_t val);  
1130 -typedef struct nvram_t {  
1131 - void *opaque;  
1132 - nvram_read_t read_fn;  
1133 - nvram_write_t write_fn;  
1134 -} nvram_t;  
1135 -  
1136 -#include "hw/m48t59.h"  
1137 -  
1138 -void NVRAM_set_byte (nvram_t *nvram, uint32_t addr, uint8_t value);  
1139 -uint8_t NVRAM_get_byte (nvram_t *nvram, uint32_t addr);  
1140 -void NVRAM_set_word (nvram_t *nvram, uint32_t addr, uint16_t value);  
1141 -uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr);  
1142 -void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value);  
1143 -uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr);  
1144 -void NVRAM_set_string (nvram_t *nvram, uint32_t addr,  
1145 - const unsigned char *str, uint32_t max);  
1146 -int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max);  
1147 -void NVRAM_set_crc (nvram_t *nvram, uint32_t addr,  
1148 - uint32_t start, uint32_t count);  
1149 -int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size,  
1150 - const unsigned char *arch,  
1151 - uint32_t RAM_size, int boot_device,  
1152 - uint32_t kernel_image, uint32_t kernel_size,  
1153 - const char *cmdline,  
1154 - uint32_t initrd_image, uint32_t initrd_size,  
1155 - uint32_t NVRAM_image,  
1156 - int width, int height, int depth);  
1157 -  
1158 -/* adb.c */  
1159 -  
1160 -#define MAX_ADB_DEVICES 16  
1161 -  
1162 -#define ADB_MAX_OUT_LEN 16  
1163 -  
1164 -typedef struct ADBDevice ADBDevice;  
1165 -  
1166 -/* buf = NULL means polling */  
1167 -typedef int ADBDeviceRequest(ADBDevice *d, uint8_t *buf_out,  
1168 - const uint8_t *buf, int len);  
1169 -typedef int ADBDeviceReset(ADBDevice *d);  
1170 -  
1171 -struct ADBDevice {  
1172 - struct ADBBusState *bus;  
1173 - int devaddr;  
1174 - int handler;  
1175 - ADBDeviceRequest *devreq;  
1176 - ADBDeviceReset *devreset;  
1177 - void *opaque;  
1178 -};  
1179 -  
1180 -typedef struct ADBBusState {  
1181 - ADBDevice devices[MAX_ADB_DEVICES];  
1182 - int nb_devices;  
1183 - int poll_index;  
1184 -} ADBBusState;  
1185 -  
1186 -int adb_request(ADBBusState *s, uint8_t *buf_out,  
1187 - const uint8_t *buf, int len);  
1188 -int adb_poll(ADBBusState *s, uint8_t *buf_out);  
1189 -  
1190 -ADBDevice *adb_register_device(ADBBusState *s, int devaddr,  
1191 - ADBDeviceRequest *devreq,  
1192 - ADBDeviceReset *devreset,  
1193 - void *opaque);  
1194 -void adb_kbd_init(ADBBusState *bus);  
1195 -void adb_mouse_init(ADBBusState *bus);  
1196 -  
1197 -extern ADBBusState adb_bus;  
1198 -  
1199 -#include "hw/usb.h"  
1200 -  
1201 -/* usb ports of the VM */  
1202 -  
1203 -void qemu_register_usb_port(USBPort *port, void *opaque, int index,  
1204 - usb_attachfn attach);  
1205 -  
1206 -#define VM_USB_HUB_SIZE 8  
1207 -  
1208 -void do_usb_add(const char *devname);  
1209 -void do_usb_del(const char *devname);  
1210 -void usb_info(void);  
1211 -  
1212 -/* scsi-disk.c */  
1213 -enum scsi_reason {  
1214 - SCSI_REASON_DONE, /* Command complete. */  
1215 - SCSI_REASON_DATA /* Transfer complete, more data required. */  
1216 -};  
1217 -  
1218 -typedef struct SCSIDevice SCSIDevice;  
1219 -typedef void (*scsi_completionfn)(void *opaque, int reason, uint32_t tag,  
1220 - uint32_t arg);  
1221 -  
1222 -SCSIDevice *scsi_disk_init(BlockDriverState *bdrv,  
1223 - int tcq,  
1224 - scsi_completionfn completion,  
1225 - void *opaque);  
1226 -void scsi_disk_destroy(SCSIDevice *s);  
1227 -  
1228 -int32_t scsi_send_command(SCSIDevice *s, uint32_t tag, uint8_t *buf, int lun);  
1229 -/* SCSI data transfers are asynchrnonous. However, unlike the block IO  
1230 - layer the completion routine may be called directly by  
1231 - scsi_{read,write}_data. */  
1232 -void scsi_read_data(SCSIDevice *s, uint32_t tag);  
1233 -int scsi_write_data(SCSIDevice *s, uint32_t tag);  
1234 -void scsi_cancel_io(SCSIDevice *s, uint32_t tag);  
1235 -uint8_t *scsi_get_buf(SCSIDevice *s, uint32_t tag);  
1236 -  
1237 -/* lsi53c895a.c */  
1238 -void lsi_scsi_attach(void *opaque, BlockDriverState *bd, int id);  
1239 -void *lsi_scsi_init(PCIBus *bus, int devfn);  
1240 -  
1241 -/* integratorcp.c */  
1242 -extern QEMUMachine integratorcp_machine;  
1243 -  
1244 -/* versatilepb.c */  
1245 -extern QEMUMachine versatilepb_machine;  
1246 -extern QEMUMachine versatileab_machine;  
1247 -  
1248 -/* realview.c */  
1249 -extern QEMUMachine realview_machine;  
1250 -  
1251 -/* spitz.c */  
1252 -extern QEMUMachine akitapda_machine;  
1253 -extern QEMUMachine spitzpda_machine;  
1254 -extern QEMUMachine borzoipda_machine;  
1255 -extern QEMUMachine terrierpda_machine;  
1256 -  
1257 -/* gumstix.c */  
1258 -extern QEMUMachine connex_machine;  
1259 -  
1260 -/* palm.c */  
1261 -extern QEMUMachine palmte_machine;  
1262 -  
1263 -/* armv7m.c */  
1264 -qemu_irq *armv7m_init(int flash_size, int sram_size,  
1265 - const char *kernel_filename, const char *cpu_model);  
1266 -  
1267 -/* stellaris.c */  
1268 -extern QEMUMachine lm3s811evb_machine;  
1269 -extern QEMUMachine lm3s6965evb_machine;  
1270 -  
1271 -/* ps2.c */  
1272 -void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg);  
1273 -void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg);  
1274 -void ps2_write_mouse(void *, int val);  
1275 -void ps2_write_keyboard(void *, int val);  
1276 -uint32_t ps2_read_data(void *);  
1277 -void ps2_queue(void *, int b);  
1278 -void ps2_keyboard_set_translation(void *opaque, int mode);  
1279 -void ps2_mouse_fake_event(void *opaque);  
1280 -  
1281 -/* smc91c111.c */  
1282 -void smc91c111_init(NICInfo *, uint32_t, qemu_irq);  
1283 -  
1284 -/* pl031.c */  
1285 -void pl031_init(uint32_t base, qemu_irq irq);  
1286 -  
1287 -/* pl110.c */  
1288 -void *pl110_init(DisplayState *ds, uint32_t base, qemu_irq irq, int);  
1289 -  
1290 -/* pl011.c */  
1291 -enum pl011_type {  
1292 - PL011_ARM,  
1293 - PL011_LUMINARY  
1294 -};  
1295 -  
1296 -void pl011_init(uint32_t base, qemu_irq irq, CharDriverState *chr,  
1297 - enum pl011_type type);  
1298 -  
1299 -/* pl022.c */  
1300 -void pl022_init(uint32_t base, qemu_irq irq, int (*xfer_cb)(void *, int),  
1301 - void *opaque);  
1302 -  
1303 -/* pl050.c */  
1304 -void pl050_init(uint32_t base, qemu_irq irq, int is_mouse);  
1305 -  
1306 -/* pl061.c */  
1307 -qemu_irq *pl061_init(uint32_t base, qemu_irq irq, qemu_irq **out);  
1308 -  
1309 -/* pl080.c */  
1310 -void *pl080_init(uint32_t base, qemu_irq irq, int nchannels);  
1311 -  
1312 -/* pl181.c */  
1313 -void pl181_init(uint32_t base, BlockDriverState *bd,  
1314 - qemu_irq irq0, qemu_irq irq1);  
1315 -  
1316 -/* pl190.c */  
1317 -qemu_irq *pl190_init(uint32_t base, qemu_irq irq, qemu_irq fiq);  
1318 -  
1319 -/* arm-timer.c */  
1320 -void sp804_init(uint32_t base, qemu_irq irq);  
1321 -void icp_pit_init(uint32_t base, qemu_irq *pic, int irq);  
1322 -  
1323 -/* arm_sysctl.c */  
1324 -void arm_sysctl_init(uint32_t base, uint32_t sys_id);  
1325 -  
1326 -/* realview_gic.c */  
1327 -qemu_irq *realview_gic_init(uint32_t base, qemu_irq parent_irq);  
1328 -  
1329 -/* mpcore.c */  
1330 -extern qemu_irq *mpcore_irq_init(qemu_irq *cpu_irq);  
1331 -  
1332 -/* arm_boot.c */  
1333 -  
1334 -void arm_load_kernel(CPUState *env, int ram_size, const char *kernel_filename,  
1335 - const char *kernel_cmdline, const char *initrd_filename,  
1336 - int board_id, target_phys_addr_t loader_start);  
1337 -  
1338 -/* armv7m_nvic.c */  
1339 -qemu_irq *armv7m_nvic_init(CPUState *env);  
1340 -  
1341 -/* ssd0303.c */  
1342 -void ssd0303_init(DisplayState *ds, i2c_bus *bus, int address);  
1343 -  
1344 -/* ssd0323.c */  
1345 -int ssd0323_xfer_ssi(void *opaque, int data);  
1346 -void *ssd0323_init(DisplayState *ds, qemu_irq *cmd_p);  
1347 -  
1348 -/* sh7750.c */  
1349 -struct SH7750State;  
1350 -  
1351 -struct SH7750State *sh7750_init(CPUState * cpu);  
1352 -  
1353 -typedef struct {  
1354 - /* The callback will be triggered if any of the designated lines change */  
1355 - uint16_t portamask_trigger;  
1356 - uint16_t portbmask_trigger;  
1357 - /* Return 0 if no action was taken */  
1358 - int (*port_change_cb) (uint16_t porta, uint16_t portb,  
1359 - uint16_t * periph_pdtra,  
1360 - uint16_t * periph_portdira,  
1361 - uint16_t * periph_pdtrb,  
1362 - uint16_t * periph_portdirb);  
1363 -} sh7750_io_device;  
1364 -  
1365 -int sh7750_register_io_device(struct SH7750State *s,  
1366 - sh7750_io_device * device);  
1367 -/* sh_timer.c */  
1368 -#define TMU012_FEAT_TOCR (1 << 0)  
1369 -#define TMU012_FEAT_3CHAN (1 << 1)  
1370 -#define TMU012_FEAT_EXTCLK (1 << 2)  
1371 -void tmu012_init(uint32_t base, int feat, uint32_t freq);  
1372 -  
1373 -/* sh_serial.c */  
1374 -#define SH_SERIAL_FEAT_SCIF (1 << 0)  
1375 -void sh_serial_init (target_phys_addr_t base, int feat,  
1376 - uint32_t freq, CharDriverState *chr);  
1377 -  
1378 -/* tc58128.c */  
1379 -int tc58128_init(struct SH7750State *s, char *zone1, char *zone2);  
1380 -  
1381 -/* NOR flash devices */  
1382 -#define MAX_PFLASH 4  
1383 -extern BlockDriverState *pflash_table[MAX_PFLASH];  
1384 -typedef struct pflash_t pflash_t;  
1385 -  
1386 -pflash_t *pflash_register (target_phys_addr_t base, ram_addr_t off,  
1387 - BlockDriverState *bs,  
1388 - uint32_t sector_len, int nb_blocs, int width,  
1389 - uint16_t id0, uint16_t id1,  
1390 - uint16_t id2, uint16_t id3);  
1391 -  
1392 -/* nand.c */  
1393 -struct nand_flash_s;  
1394 -struct nand_flash_s *nand_init(int manf_id, int chip_id);  
1395 -void nand_done(struct nand_flash_s *s);  
1396 -void nand_setpins(struct nand_flash_s *s,  
1397 - int cle, int ale, int ce, int wp, int gnd);  
1398 -void nand_getpins(struct nand_flash_s *s, int *rb);  
1399 -void nand_setio(struct nand_flash_s *s, uint8_t value);  
1400 -uint8_t nand_getio(struct nand_flash_s *s);  
1401 -  
1402 -#define NAND_MFR_TOSHIBA 0x98  
1403 -#define NAND_MFR_SAMSUNG 0xec  
1404 -#define NAND_MFR_FUJITSU 0x04  
1405 -#define NAND_MFR_NATIONAL 0x8f  
1406 -#define NAND_MFR_RENESAS 0x07  
1407 -#define NAND_MFR_STMICRO 0x20  
1408 -#define NAND_MFR_HYNIX 0xad  
1409 -#define NAND_MFR_MICRON 0x2c  
1410 -  
1411 -/* ecc.c */  
1412 -struct ecc_state_s {  
1413 - uint8_t cp; /* Column parity */  
1414 - uint16_t lp[2]; /* Line parity */  
1415 - uint16_t count;  
1416 -};  
1417 -  
1418 -uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample);  
1419 -void ecc_reset(struct ecc_state_s *s);  
1420 -void ecc_put(QEMUFile *f, struct ecc_state_s *s);  
1421 -void ecc_get(QEMUFile *f, struct ecc_state_s *s);  
1422 -  
1423 -/* ads7846.c */  
1424 -struct ads7846_state_s;  
1425 -uint32_t ads7846_read(void *opaque);  
1426 -void ads7846_write(void *opaque, uint32_t value);  
1427 -struct ads7846_state_s *ads7846_init(qemu_irq penirq);  
1428 -  
1429 -/* max111x.c */  
1430 -struct max111x_s;  
1431 -uint32_t max111x_read(void *opaque);  
1432 -void max111x_write(void *opaque, uint32_t value);  
1433 -struct max111x_s *max1110_init(qemu_irq cb);  
1434 -struct max111x_s *max1111_init(qemu_irq cb);  
1435 -void max111x_set_input(struct max111x_s *s, int line, uint8_t value);  
1436 -  
1437 -/* PCMCIA/Cardbus */  
1438 -  
1439 -struct pcmcia_socket_s {  
1440 - qemu_irq irq;  
1441 - int attached;  
1442 - const char *slot_string;  
1443 - const char *card_string;  
1444 -};  
1445 -  
1446 -void pcmcia_socket_register(struct pcmcia_socket_s *socket);  
1447 -void pcmcia_socket_unregister(struct pcmcia_socket_s *socket);  
1448 -void pcmcia_info(void);  
1449 -  
1450 -struct pcmcia_card_s {  
1451 - void *state;  
1452 - struct pcmcia_socket_s *slot;  
1453 - int (*attach)(void *state);  
1454 - int (*detach)(void *state);  
1455 - const uint8_t *cis;  
1456 - int cis_len;  
1457 -  
1458 - /* Only valid if attached */  
1459 - uint8_t (*attr_read)(void *state, uint32_t address);  
1460 - void (*attr_write)(void *state, uint32_t address, uint8_t value);  
1461 - uint16_t (*common_read)(void *state, uint32_t address);  
1462 - void (*common_write)(void *state, uint32_t address, uint16_t value);  
1463 - uint16_t (*io_read)(void *state, uint32_t address);  
1464 - void (*io_write)(void *state, uint32_t address, uint16_t value);  
1465 -};  
1466 -  
1467 -#define CISTPL_DEVICE 0x01 /* 5V Device Information Tuple */  
1468 -#define CISTPL_NO_LINK 0x14 /* No Link Tuple */  
1469 -#define CISTPL_VERS_1 0x15 /* Level 1 Version Tuple */  
1470 -#define CISTPL_JEDEC_C 0x18 /* JEDEC ID Tuple */  
1471 -#define CISTPL_JEDEC_A 0x19 /* JEDEC ID Tuple */  
1472 -#define CISTPL_CONFIG 0x1a /* Configuration Tuple */  
1473 -#define CISTPL_CFTABLE_ENTRY 0x1b /* 16-bit PCCard Configuration */  
1474 -#define CISTPL_DEVICE_OC 0x1c /* Additional Device Information */  
1475 -#define CISTPL_DEVICE_OA 0x1d /* Additional Device Information */  
1476 -#define CISTPL_DEVICE_GEO 0x1e /* Additional Device Information */  
1477 -#define CISTPL_DEVICE_GEO_A 0x1f /* Additional Device Information */  
1478 -#define CISTPL_MANFID 0x20 /* Manufacture ID Tuple */  
1479 -#define CISTPL_FUNCID 0x21 /* Function ID Tuple */  
1480 -#define CISTPL_FUNCE 0x22 /* Function Extension Tuple */  
1481 -#define CISTPL_END 0xff /* Tuple End */  
1482 -#define CISTPL_ENDMARK 0xff  
1483 -  
1484 -/* dscm1xxxx.c */  
1485 -struct pcmcia_card_s *dscm1xxxx_init(BlockDriverState *bdrv);  
1486 -  
1487 -/* ptimer.c */  
1488 -typedef struct ptimer_state ptimer_state;  
1489 -typedef void (*ptimer_cb)(void *opaque);  
1490 -  
1491 -ptimer_state *ptimer_init(QEMUBH *bh);  
1492 -void ptimer_set_period(ptimer_state *s, int64_t period);  
1493 -void ptimer_set_freq(ptimer_state *s, uint32_t freq);  
1494 -void ptimer_set_limit(ptimer_state *s, uint64_t limit, int reload);  
1495 -uint64_t ptimer_get_count(ptimer_state *s);  
1496 -void ptimer_set_count(ptimer_state *s, uint64_t count);  
1497 -void ptimer_run(ptimer_state *s, int oneshot);  
1498 -void ptimer_stop(ptimer_state *s);  
1499 -void qemu_put_ptimer(QEMUFile *f, ptimer_state *s);  
1500 -void qemu_get_ptimer(QEMUFile *f, ptimer_state *s);  
1501 -  
1502 -#include "hw/pxa.h"  
1503 -  
1504 -#include "hw/omap.h"  
1505 -  
1506 -/* tsc210x.c */  
1507 -struct uwire_slave_s *tsc2102_init(qemu_irq pint, AudioState *audio);  
1508 -struct i2s_codec_s *tsc210x_codec(struct uwire_slave_s *chip);  
1509 -  
1510 -/* mcf_uart.c */  
1511 -uint32_t mcf_uart_read(void *opaque, target_phys_addr_t addr);  
1512 -void mcf_uart_write(void *opaque, target_phys_addr_t addr, uint32_t val);  
1513 -void *mcf_uart_init(qemu_irq irq, CharDriverState *chr);  
1514 -void mcf_uart_mm_init(target_phys_addr_t base, qemu_irq irq,  
1515 - CharDriverState *chr);  
1516 -  
1517 -/* mcf_intc.c */  
1518 -qemu_irq *mcf_intc_init(target_phys_addr_t base, CPUState *env);  
1519 -  
1520 -/* mcf_fec.c */  
1521 -void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq);  
1522 -  
1523 -/* mcf5206.c */  
1524 -qemu_irq *mcf5206_init(uint32_t base, CPUState *env);  
1525 -  
1526 -/* an5206.c */  
1527 -extern QEMUMachine an5206_machine;  
1528 -  
1529 -/* mcf5208.c */  
1530 -extern QEMUMachine mcf5208evb_machine;  
1531 -  
1532 -/* dummy_m68k.c */  
1533 -extern QEMUMachine dummy_m68k_machine;  
1534 -  
1535 -#include "gdbstub.h"  
1536 -  
1537 -#endif /* defined(NEED_CPU_H) */  
1538 -#endif /* VL_H */  
@@ -23,8 +23,11 @@ @@ -23,8 +23,11 @@
23 * THE SOFTWARE. 23 * THE SOFTWARE.
24 */ 24 */
25 25
26 -#include "vl.h" 26 +#include "qemu-common.h"
  27 +#include "console.h"
  28 +#include "sysemu.h"
27 #include "qemu_socket.h" 29 #include "qemu_socket.h"
  30 +#include "qemu-timer.h"
28 31
29 #define VNC_REFRESH_INTERVAL (1000 / 30) 32 #define VNC_REFRESH_INTERVAL (1000 / 30)
30 33
x_keymap.c
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE. 22 * THE SOFTWARE.
23 */ 23 */
24 -#include "vl.h" 24 +#include "qemu-common.h"
  25 +
25 static const uint8_t x_keycode_to_pc_keycode[115] = { 26 static const uint8_t x_keycode_to_pc_keycode[115] = {
26 0xc7, /* 97 Home */ 27 0xc7, /* 97 Home */
27 0xc8, /* 98 Up */ 28 0xc8, /* 98 Up */