Commit 87ecb68b authored by pbrook's avatar pbrook

Break up vl.h.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
parent 257514dd
# Makefile for QEMU.
VPATH=$(SRC_PATH):$(SRC_PATH)/hw
include config-host.mak
.PHONY: all clean distclean dvi info install install-doc tar tarbin \
......@@ -47,9 +49,15 @@ BLOCK_OBJS+=block-qcow2.o block-parallels.o
# CPUs and machines.
OBJS=$(BLOCK_OBJS)
OBJS+=readline.o console.o
OBJS+=readline.o console.o
OBJS+=block.o
OBJS+=irq.o
OBJS+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
OBJS+=ssd0303.o ssd0323.o ads7846.o
OBJS+=scsi-disk.o cdrom.o
OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o
ifdef CONFIG_WIN32
OBJS+=tap-win32.o
endif
......
......@@ -399,7 +399,6 @@ endif
VL_OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o
# XXX: suppress QEMU_TOOL tests
VL_OBJS+=block-raw.o
VL_OBJS+=irq.o
ifdef CONFIG_ALSA
LIBS += -lasound
......@@ -421,14 +420,11 @@ CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
LIBS += $(CONFIG_VNC_TLS_LIBS)
endif
VL_OBJS += i2c.o smbus.o
# SCSI layer
VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o
VL_OBJS+= lsi53c895a.o
# USB layer
VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o
VL_OBJS+= usb-wacom.o
VL_OBJS+= usb-ohci.o
# EEPROM emulation
VL_OBJS += eeprom93xx.o
......@@ -444,7 +440,7 @@ ifeq ($(TARGET_BASE_ARCH), i386)
VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
VL_OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
VL_OBJS+= usb-uhci.o smbus_eeprom.o vmmouse.o vmport.o vmware_vga.o
VL_OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
endif
ifeq ($(TARGET_BASE_ARCH), ppc)
......@@ -468,7 +464,7 @@ VL_OBJS+= mips_r4k.o mips_malta.o mips_pica61.o mips_mipssim.o
VL_OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
VL_OBJS+= jazz_led.o
VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
VL_OBJS+= piix_pci.o smbus_eeprom.o parallel.o cirrus_vga.o $(SOUND_HW)
VL_OBJS+= piix_pci.o parallel.o cirrus_vga.o $(SOUND_HW)
VL_OBJS+= mipsnet.o
CPPFLAGS += -DHAS_AUDIO
endif
......@@ -494,13 +490,13 @@ VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
VL_OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
VL_OBJS+= versatile_pci.o sd.o ptimer.o
VL_OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
VL_OBJS+= armv7m.o armv7m_nvic.o stellaris.o ssd0303.o pl022.o
VL_OBJS+= ssd0323.o pl061.o
VL_OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o
VL_OBJS+= pl061.o
VL_OBJS+= arm-semi.o
VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o max111x.o max7310.o
VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o
VL_OBJS+= pflash_cfi01.o gumstix.o
VL_OBJS+= spitz.o ads7846.o ide.o serial.o nand.o ecc.o wm8750.o
VL_OBJS+= spitz.o ide.o serial.o nand.o ecc.o
VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o omap_i2c.o
VL_OBJS+= palm.o tsc210x.o
CPPFLAGS += -DHAS_AUDIO
......
......@@ -33,7 +33,9 @@
#define ARM_ANGEL_HEAP_SIZE (128 * 1024 * 1024)
#else
#include "vl.h"
#include "qemu-common.h"
#include "sysemu.h"
#include "gdbstub.h"
#endif
#define SYS_OPEN 0x01
......
......@@ -21,7 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw/hw.h"
#include "audio.h"
#include "console.h"
#include "qemu-timer.h"
#include "sysemu.h"
#define AUDIO_CAP "audio"
#include "audio_int.h"
......
......@@ -73,7 +73,6 @@ typedef struct CaptureState {
LIST_ENTRY (CaptureState) entries;
} CaptureState;
typedef struct AudioState AudioState;
typedef struct SWVoiceOut SWVoiceOut;
typedef struct CaptureVoiceOut CaptureVoiceOut;
typedef struct SWVoiceIn SWVoiceIn;
......
......@@ -22,7 +22,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "qemu-common.h"
#include "audio.h"
#define AUDIO_CAP "mixeng"
#include "audio_int.h"
......
......@@ -21,7 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "qemu-common.h"
#include "audio.h"
#include "qemu-timer.h"
#define AUDIO_CAP "noaudio"
#include "audio_int.h"
......
......@@ -30,7 +30,8 @@
#else
#include <sys/soundcard.h>
#endif
#include "vl.h"
#include "qemu-common.h"
#include "audio.h"
#define AUDIO_CAP "oss"
#include "audio_int.h"
......
......@@ -23,7 +23,8 @@
*/
#include <SDL.h>
#include <SDL_thread.h>
#include "vl.h"
#include "qemu-common.h"
#include "audio.h"
#ifndef _WIN32
#ifdef __sun__
......
......@@ -21,7 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw/hw.h"
#include "qemu-timer.h"
#include "audio.h"
#define AUDIO_CAP "wav"
#include "audio_int.h"
......
#include "vl.h"
#include "hw/hw.h"
#include "console.h"
#include "audio.h"
typedef struct {
QEMUFile *f;
......
......@@ -21,10 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifdef QEMU_IMG
#include "qemu-common.h"
#else
#include "vl.h"
#ifndef QEMU_IMG
#include "qemu-timer.h"
#include "exec-all.h"
#endif
#include "block_int.h"
......
......@@ -21,10 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifdef QEMU_IMG
#include "qemu-common.h"
#else
#include "vl.h"
#ifndef QEMU_IMG
#include "console.h"
#endif
#include "block_int.h"
......
......@@ -2,7 +2,6 @@
#define BLOCK_H
/* block.c */
typedef struct BlockDriverState BlockDriverState;
typedef struct BlockDriver BlockDriver;
extern BlockDriver bdrv_raw;
......
......@@ -37,7 +37,9 @@
#import <Cocoa/Cocoa.h>
#include "vl.h"
#include "qemu-common.h"
#include "console.h"
#include "sysemu.h"
NSWindow *window = NULL;
NSQuickDrawView *qd_view = NULL;
......
......@@ -21,7 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "qemu-common.h"
#include "console.h"
#include "qemu-timer.h"
//#define DEBUG_CONSOLE
#define DEFAULT_BACKSCROLL 512
......
#ifndef CONSOLE_H
#define CONSOLE_H
#include "qemu-char.h"
/* keyboard/mouse support */
#define MOUSE_EVENT_LBUTTON 0x01
#define MOUSE_EVENT_RBUTTON 0x02
#define MOUSE_EVENT_MBUTTON 0x04
typedef void QEMUPutKBDEvent(void *opaque, int keycode);
typedef void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int buttons_state);
typedef struct QEMUPutMouseEntry {
QEMUPutMouseEvent *qemu_put_mouse_event;
void *qemu_put_mouse_event_opaque;
int qemu_put_mouse_event_absolute;
char *qemu_put_mouse_event_name;
/* used internally by qemu for handling mice */
struct QEMUPutMouseEntry *next;
} QEMUPutMouseEntry;
void qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque);
QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
void *opaque, int absolute,
const char *name);
void qemu_remove_mouse_event_handler(QEMUPutMouseEntry *entry);
void kbd_put_keycode(int keycode);
void kbd_mouse_event(int dx, int dy, int dz, int buttons_state);
int kbd_mouse_is_absolute(void);
void do_info_mice(void);
void do_mouse_set(int index);
/* keysym is a unicode code except for special keys (see QEMU_KEY_xxx
constants) */
#define QEMU_KEY_ESC1(c) ((c) | 0xe100)
#define QEMU_KEY_BACKSPACE 0x007f
#define QEMU_KEY_UP QEMU_KEY_ESC1('A')
#define QEMU_KEY_DOWN QEMU_KEY_ESC1('B')
#define QEMU_KEY_RIGHT QEMU_KEY_ESC1('C')
#define QEMU_KEY_LEFT QEMU_KEY_ESC1('D')
#define QEMU_KEY_HOME QEMU_KEY_ESC1(1)
#define QEMU_KEY_END QEMU_KEY_ESC1(4)
#define QEMU_KEY_PAGEUP QEMU_KEY_ESC1(5)
#define QEMU_KEY_PAGEDOWN QEMU_KEY_ESC1(6)
#define QEMU_KEY_DELETE QEMU_KEY_ESC1(3)
#define QEMU_KEY_CTRL_UP 0xe400
#define QEMU_KEY_CTRL_DOWN 0xe401
#define QEMU_KEY_CTRL_LEFT 0xe402
#define QEMU_KEY_CTRL_RIGHT 0xe403
#define QEMU_KEY_CTRL_HOME 0xe404
#define QEMU_KEY_CTRL_END 0xe405
#define QEMU_KEY_CTRL_PAGEUP 0xe406
#define QEMU_KEY_CTRL_PAGEDOWN 0xe407
void kbd_put_keysym(int keysym);
/* consoles */
struct DisplayState {
uint8_t *data;
int linesize;
int depth;
int bgr; /* BGR color order instead of RGB. Only valid for depth == 32 */
int width;
int height;
void *opaque;
struct QEMUTimer *gui_timer;
void (*dpy_update)(struct DisplayState *s, int x, int y, int w, int h);
void (*dpy_resize)(struct DisplayState *s, int w, int h);
void (*dpy_refresh)(struct DisplayState *s);
void (*dpy_copy)(struct DisplayState *s, int src_x, int src_y,
int dst_x, int dst_y, int w, int h);
void (*dpy_fill)(struct DisplayState *s, int x, int y,
int w, int h, uint32_t c);
void (*mouse_set)(int x, int y, int on);
void (*cursor_define)(int width, int height, int bpp, int hot_x, int hot_y,
uint8_t *image, uint8_t *mask);
};
static inline void dpy_update(DisplayState *s, int x, int y, int w, int h)
{
s->dpy_update(s, x, y, w, h);
}
static inline void dpy_resize(DisplayState *s, int w, int h)
{
s->dpy_resize(s, w, h);
}
typedef void (*vga_hw_update_ptr)(void *);
typedef void (*vga_hw_invalidate_ptr)(void *);
typedef void (*vga_hw_screen_dump_ptr)(void *, const char *);
TextConsole *graphic_console_init(DisplayState *ds, vga_hw_update_ptr update,
vga_hw_invalidate_ptr invalidate,
vga_hw_screen_dump_ptr screen_dump,
void *opaque);
void vga_hw_update(void);
void vga_hw_invalidate(void);
void vga_hw_screen_dump(const char *filename);
int is_graphic_console(void);
CharDriverState *text_console_init(DisplayState *ds, const char *p);
void console_select(unsigned int index);
void console_color_init(DisplayState *ds);
/* sdl.c */
void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
/* cocoa.m */
void cocoa_display_init(DisplayState *ds, int full_screen);
/* vnc.c */
void vnc_display_init(DisplayState *ds);
void vnc_display_close(DisplayState *ds);
int vnc_display_open(DisplayState *ds, const char *display);
int vnc_display_password(DisplayState *ds, const char *password);
void do_info_vnc(void);
/* x_keymap.c */
extern uint8_t _translate_keycode(const int key);
/* FIXME: term_printf et al should probably go elsewhere so everything
does not need to include console.h */
/* monitor.c */
void monitor_init(CharDriverState *hd, int show_banner);
void term_puts(const char *str);
void term_vprintf(const char *fmt, va_list ap);
void term_printf(const char *fmt, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
void term_print_filename(const char *filename);
void term_flush(void);
void term_print_help(void);
void monitor_readline(const char *prompt, int is_password,
char *buf, int buf_size);
/* readline.c */
typedef void ReadLineFunc(void *opaque, const char *str);
extern int completion_index;
void add_completion(const char *str);
void readline_handle_byte(int ch);
void readline_find_completion(const char *cmdline);
const char *readline_get_history(unsigned int index);
void readline_start(const char *prompt, int is_password,
ReadLineFunc *readline_func, void *opaque);
#endif
......@@ -20,6 +20,10 @@
#ifndef CPU_DEFS_H
#define CPU_DEFS_H
#ifndef NEED_CPU_H
#error cpu.h included from common code
#endif
#include "config.h"
#include <setjmp.h>
#include <inttypes.h>
......
......@@ -29,7 +29,10 @@
#include "qemu.h"
#else
#include "vl.h"
#include "qemu-common.h"
#include "qemu-char.h"
#include "sysemu.h"
#include "gdbstub.h"
#endif
#include "qemu_socket.h"
......
......@@ -16,7 +16,13 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "vl.h"
#include "hw.h"
#include "pc.h"
#include "pci.h"
#include "qemu-timer.h"
#include "sysemu.h"
#include "i2c.h"
#include "smbus.h"
//#define DEBUG
......
......@@ -21,7 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "ppc_mac.h"
#include "console.h"
/* ADB commands */
#define ADB_BUSRESET 0x00
......
......@@ -22,7 +22,8 @@
* THE SOFTWARE.
*/
#include <assert.h>
#include "vl.h"
#include "hw.h"
#include "audiodev.h"
#define ADLIB_KILL_TIMERS 1
......
......@@ -7,7 +7,9 @@
* This code is licensed under the GNU GPL v2.
*/
#include <vl.h>
#include "hw.h"
#include "devices.h"
#include "console.h"
struct ads7846_state_s {
qemu_irq interrupt;
......
......@@ -6,7 +6,10 @@
* This code is licenced under the GPL
*/
#include "vl.h"
#include "hw.h"
#include "mcf.h"
#include "sysemu.h"
#include "boards.h"
#define KERNEL_LOAD_ADDR 0x10000
#define AN5206_MBAR_ADDR 0x10000000
......
......@@ -26,7 +26,8 @@
Ultrasparc PCI host is called the PCI Bus Module (PBM). The APB is
the secondary PCI bridge. */
#include "vl.h"
#include "hw.h"
#include "pci.h"
typedef target_phys_addr_t pci_addr_t;
#include "pci_host.h"
......
......@@ -17,7 +17,9 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "vl.h"
#include "hw.h"
#include "pc.h"
#include "qemu-timer.h"
//#define DEBUG_APIC
//#define DEBUG_IOAPIC
......
/*
* Generic ARM Programmable Interrupt Controller support.
* Misc ARM declarations
*
* Copyright (c) 2006 CodeSourcery.
* Written by Paul Brook
*
* This code is licenced under the LGPL.
*
* Arm hardware uses a wide variety of interrupt handling hardware.
* This provides a generic framework for connecting interrupt sources and
* inputs.
*/
#ifndef ARM_INTERRUPT_H
#define ARM_INTERRUPT_H 1
#ifndef ARM_MISC_H
#define ARM_MISC_H 1
/* The CPU is also modeled as an interrupt controller. */
#define ARM_PIC_CPU_IRQ 0
#define ARM_PIC_CPU_FIQ 1
qemu_irq *arm_pic_init_cpu(CPUState *env);
#endif /* !ARM_INTERRUPT_H */
/* armv7m.c */
qemu_irq *armv7m_init(int flash_size, int sram_size,
const char *kernel_filename, const char *cpu_model);
/* arm_boot.c */
void arm_load_kernel(CPUState *env, int ram_size, const char *kernel_filename,
const char *kernel_cmdline, const char *initrd_filename,
int board_id, target_phys_addr_t loader_start);
/* armv7m_nvic.c */
qemu_irq *armv7m_nvic_init(CPUState *env);
#endif /* !ARM_MISC_H */
......@@ -7,7 +7,9 @@
* This code is licenced under the GPL.
*/
#include "vl.h"
#include "hw.h"
#include "arm-misc.h"
#include "sysemu.h"
#define KERNEL_ARGS_ADDR 0x100
#define KERNEL_LOAD_ADDR 0x00010000
......
......@@ -7,8 +7,8 @@
* This code is licenced under the LGPL
*/
#include "vl.h"
#include "arm_pic.h"
#include "hw.h"
#include "arm-misc.h"
/* Stub functions for hardware that doesn't exist. */
void pic_info(void)
......
......@@ -7,8 +7,9 @@
* This code is licenced under the GPL.
*/
#include "vl.h"
#include "arm_pic.h"
#include "hw.h"
#include "arm-misc.h"
#include "sysemu.h"
#define LOCK_VALUE 0xa05f
......
......@@ -7,8 +7,9 @@
* This code is licenced under the GPL.
*/
#include "vl.h"
#include "arm_pic.h"
#include "hw.h"
#include "arm-misc.h"
#include "qemu-timer.h"
/* Common timer implementation. */
......
......@@ -7,7 +7,9 @@
* This code is licenced under the GPL.
*/
#include "vl.h"
#include "hw.h"
#include "arm-misc.h"
#include "sysemu.h"
/* Bitbanded IO. Each word corresponds to a single bit. */
......
......@@ -10,8 +10,9 @@
* NVIC. Much of that is also implemented here.
*/
#include "vl.h"
#include "arm_pic.h"
#include "hw.h"
#include "qemu-timer.h"
#include "arm-misc.h"
#define GIC_NIRQ 64
#define NCPU 1
......
/* es1370.c */
int es1370_init (PCIBus *bus, AudioState *s);
/* sb16.c */
int SB16_init (AudioState *s, qemu_irq *pic);
/* adlib.c */
int Adlib_init (AudioState *s, qemu_irq *pic);
/* gus.c */
int GUS_init (AudioState *s, qemu_irq *pic);
/* Declarations for use by board files for creating devices. */
#ifndef HW_BOARDS_H
#define HW_BOARDS_H
typedef void QEMUMachineInitFunc(int ram_size, int vga_ram_size,
const char *boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model);
typedef struct QEMUMachine {
const char *name;
const char *desc;
QEMUMachineInitFunc *init;
struct QEMUMachine *next;
} QEMUMachine;
int qemu_register_machine(QEMUMachine *m);
/* Axis ETRAX. */
extern QEMUMachine bareetraxfs_machine;
/* pc.c */
extern QEMUMachine pc_machine;
extern QEMUMachine isapc_machine;
/* ppc.c */
extern QEMUMachine prep_machine;
extern QEMUMachine core99_machine;
extern QEMUMachine heathrow_machine;
extern QEMUMachine ref405ep_machine;
extern QEMUMachine taihu_machine;
/* mips_r4k.c */
extern QEMUMachine mips_machine;
/* mips_malta.c */
extern QEMUMachine mips_malta_machine;
/* mips_pica61.c */
extern QEMUMachine mips_pica61_machine;
/* mips_mipssim.c */
extern QEMUMachine mips_mipssim_machine;
/* shix.c */
extern QEMUMachine shix_machine;