Skip to content

Commit

Permalink
Break up vl.h.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
pbrook committed Nov 17, 2007
1 parent 257514d commit 87ecb68
Show file tree
Hide file tree
Showing 224 changed files with 2,416 additions and 1,842 deletions.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Makefile for QEMU.

VPATH=$(SRC_PATH):$(SRC_PATH)/hw

include config-host.mak

.PHONY: all clean distclean dvi info install install-doc tar tarbin \
Expand Down Expand Up @@ -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
Expand Down
20 changes: 8 additions & 12 deletions Makefile.target
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion arm-semi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion audio/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion audio/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion audio/mixeng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion audio/noaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion audio/ossaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion audio/sdlaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
4 changes: 3 additions & 1 deletion audio/wavaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion audio/wavcapture.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "vl.h"
#include "hw/hw.h"
#include "console.h"
#include "audio.h"

typedef struct {
QEMUFile *f;
Expand Down
5 changes: 2 additions & 3 deletions block-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion block.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define BLOCK_H

/* block.c */
typedef struct BlockDriverState BlockDriverState;
typedef struct BlockDriver BlockDriver;

extern BlockDriver bdrv_raw;
Expand Down
4 changes: 3 additions & 1 deletion cocoa.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
154 changes: 154 additions & 0 deletions console.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#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
4 changes: 4 additions & 0 deletions cpu-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Loading

0 comments on commit 87ecb68

Please sign in to comment.