Break up vl.h.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
master
pbrook 2007-11-17 17:14:51 +00:00
parent 257514ddce
commit 87ecb68bdf
224 changed files with 2416 additions and 1842 deletions

View File

@ -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 \
@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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;

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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__

View File

@ -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"

View File

@ -1,4 +1,6 @@
#include "vl.h"
#include "hw/hw.h"
#include "console.h"
#include "audio.h"
typedef struct {
QEMUFile *f;

View File

@ -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"

View File

@ -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"

View File

@ -2,7 +2,6 @@
#define BLOCK_H
/* block.c */
typedef struct BlockDriverState BlockDriverState;
typedef struct BlockDriver BlockDriver;
extern BlockDriver bdrv_raw;

View File

@ -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;

View File

@ -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

154
console.h Normal file
View File

@ -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

View File

@ -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>

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -22,7 +22,8 @@
* THE SOFTWARE.
*/
#include <assert.h>
#include "vl.h"
#include "hw.h"
#include "audiodev.h"
#define ADLIB_KILL_TIMERS 1

View File

@ -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;

View File

@ -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

View File

@ -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"

View File

@ -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

33
hw/arm-misc.h Normal file
View File

@ -0,0 +1,33 @@
/*
* Misc ARM declarations
*
* Copyright (c) 2006 CodeSourcery.
* Written by Paul Brook
*
* This code is licenced under the LGPL.
*
*/
#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);
/* 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 */

View File

@ -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

View File

@ -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)

View File

@ -1,23 +0,0 @@
/*
* Generic ARM Programmable Interrupt Controller support.
*
* 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
/* 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 */

View File

@ -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

View File

@ -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. */

View File

@ -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. */

View File

@ -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

12
hw/audiodev.h Normal file
View File

@ -0,0 +1,12 @@
/* 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);

94
hw/boards.h Normal file
View File

@ -0,0 +1,94 @@
/* 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;
/* r2d.c */
extern QEMUMachine r2d_machine;
/* sun4m.c */
extern QEMUMachine ss5_machine, ss10_machine, ss600mp_machine;
/* sun4u.c */
extern QEMUMachine sun4u_machine;
/* integratorcp.c */
extern QEMUMachine integratorcp_machine;
/* versatilepb.c */
extern QEMUMachine versatilepb_machine;
extern QEMUMachine versatileab_machine;
/* realview.c */
extern QEMUMachine realview_machine;
/* spitz.c */
extern QEMUMachine akitapda_machine;
extern QEMUMachine spitzpda_machine;
extern QEMUMachine borzoipda_machine;
extern QEMUMachine terrierpda_machine;
/* palm.c */
extern QEMUMachine palmte_machine;
/* gumstix.c */
extern QEMUMachine connex_machine;
/* stellaris.c */
extern QEMUMachine lm3s811evb_machine;
extern QEMUMachine lm3s6965evb_machine;
/* an5206.c */
extern QEMUMachine an5206_machine;
/* mcf5208.c */
extern QEMUMachine mcf5208evb_machine;
/* dummy_m68k.c */
extern QEMUMachine dummy_m68k_machine;
#endif

View File

@ -25,7 +25,8 @@
/* ??? Most of the ATAPI emulation is still in ide.c. It should be moved
here. */
#include <vl.h>
#include "qemu-common.h"
#include "scsi-disk.h"
static void lba_to_msf(uint8_t *buf, int lba)
{

View File

@ -26,7 +26,10 @@
* Reference: Finn Thogersons' VGADOC4b
* available at http://home.worldonline.dk/~finth/
*/
#include "vl.h"
#include "hw.h"
#include "pc.h"
#include "pci.h"
#include "console.h"
#include "vga_int.h"
/*

View File

@ -21,7 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "sun4m.h"
/* debug CS4231 */
//#define DEBUG_CS

View File

@ -22,8 +22,10 @@
* 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 "qemu-timer.h"
#include "sysemu.h"
/* XXX: implement all timer modes */

19
hw/devices.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef QEMU_DEVICES_H
#define QEMU_DEVICES_H
/* Devices that have nowhere better to go. */
/* smc91c111.c */
void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
/* ssd0323.c */
int ssd0323_xfer_ssi(void *opaque, int data);
void *ssd0323_init(DisplayState *ds, qemu_irq *cmd_p);
/* ads7846.c */
struct ads7846_state_s;
uint32_t ads7846_read(void *opaque);
void ads7846_write(void *opaque, uint32_t value);
struct ads7846_state_s *ads7846_init(qemu_irq penirq);
#endif

View File

@ -21,7 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "isa.h"
/* #define DEBUG_DMA */

View File

@ -22,7 +22,9 @@
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "mips.h"
#include "nvram.h"
typedef enum
{

View File

@ -6,7 +6,9 @@
* This code is licenced under the GPL
*/
#include "vl.h"
#include "hw.h"
#include "sysemu.h"
#include "boards.h"
#define KERNEL_LOAD_ADDR 0x10000

View File

@ -8,7 +8,8 @@
* This code is licensed under the GNU GPL v2.
*/
#include "vl.h"
#include "hw.h"
#include "flash.h"
/*
* Pre-calculated 256-way 1 byte column parity. Table borrowed from Linux.

View File

@ -40,7 +40,9 @@
#include <assert.h>
#include <stddef.h> /* offsetof */
#include "vl.h"
#include "hw.h"
#include "pci.h"
#include "net.h"
#include "eeprom93xx.h"
/* Common declarations for all PCI devices. */

View File

@ -37,6 +37,7 @@
*/
#include <assert.h>
#include "hw.h"
#include "eeprom93xx.h"
/* Debug EEPROM emulation. */

View File

@ -21,8 +21,6 @@
#ifndef EEPROM93XX_H
#define EEPROM93XX_H
#include "vl.h"
typedef struct _eeprom_t eeprom_t;
/* Create a new EEPROM with (nwords * 2) bytes. */

View File

@ -26,7 +26,10 @@
/* #define VERBOSE_ES1370 */
#define SILENT_ES1370
#include "vl.h"
#include "hw.h"
#include "audiodev.h"
#include "audio/audio.h"
#include "pci.h"
/* Missing stuff:
SCTRL_P[12](END|ST)INC

View File

@ -21,7 +21,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "block.h"
#include "scsi-disk.h"
#include "sun4m.h"
/* FIXME: Only needed for MAX_DISKS, which is probably wrong. */
#include "sysemu.h"
/* debug ESP card */
//#define DEBUG_ESP

View File

@ -23,7 +23,9 @@
*/
#include <time.h>
#include <sys/time.h>
#include "vl.h"
#include "hw.h"
#include "sysemu.h"
#include "boards.h"
extern FILE *logfile;

View File

@ -24,7 +24,7 @@
#include <stdio.h>
#include <ctype.h>
#include "vl.h"
#include "hw.h"
#define RW_TR_DMA_EN 0xb0026004
#define RW_DOUT 0xb002601c

View File

@ -23,7 +23,8 @@
*/
#include <stdio.h>
#include <sys/time.h>
#include "vl.h"
#include "hw.h"
#include "qemu-timer.h"
void etrax_ack_irq(CPUState *env, uint32_t mask);

View File

@ -25,7 +25,11 @@
* The controller is used in Sun4m systems in a slightly different
* way. There are changes in DOR register and DMA is not available.
*/
#include "vl.h"
#include "hw.h"
#include "fdc.h"
#include "block.h"
#include "qemu-timer.h"
#include "isa.h"
/********************************************************/
/* debug Floppy devices */

12
hw/fdc.h Normal file
View File

@ -0,0 +1,12 @@
/* fdc.c */
#define MAX_FD 2
extern BlockDriverState *fd_table[MAX_FD];
typedef struct fdctrl_t fdctrl_t;
fdctrl_t *fdctrl_init (qemu_irq irq, int dma_chann, int mem_mapped,
target_phys_addr_t io_base,
BlockDriverState **fds);
fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base,
BlockDriverState **fds);
int fdctrl_get_drive_type(fdctrl_t *fdctrl, int drive_num);

40
hw/flash.h Normal file
View File

@ -0,0 +1,40 @@
/* NOR flash devices */
typedef struct pflash_t pflash_t;
pflash_t *pflash_register (target_phys_addr_t base, ram_addr_t off,
BlockDriverState *bs,
uint32_t sector_len, int nb_blocs, int width,
uint16_t id0, uint16_t id1,
uint16_t id2, uint16_t id3);
/* nand.c */
struct nand_flash_s;
struct nand_flash_s *nand_init(int manf_id, int chip_id);
void nand_done(struct nand_flash_s *s);
void nand_setpins(struct nand_flash_s *s,
int cle, int ale, int ce, int wp, int gnd);
void nand_getpins(struct nand_flash_s *s, int *rb);
void nand_setio(struct nand_flash_s *s, uint8_t value);
uint8_t nand_getio(struct nand_flash_s *s);
#define NAND_MFR_TOSHIBA 0x98
#define NAND_MFR_SAMSUNG 0xec
#define NAND_MFR_FUJITSU 0x04
#define NAND_MFR_NATIONAL 0x8f
#define NAND_MFR_RENESAS 0x07
#define NAND_MFR_STMICRO 0x20
#define NAND_MFR_HYNIX 0xad
#define NAND_MFR_MICRON 0x2c
/* ecc.c */
struct ecc_state_s {
uint8_t cp; /* Column parity */
uint16_t lp[2]; /* Line parity */
uint16_t count;
};
uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample);
void ecc_reset(struct ecc_state_s *s);
void ecc_put(QEMUFile *f, struct ecc_state_s *s);
void ecc_get(QEMUFile *f, struct ecc_state_s *s);

View File

@ -23,8 +23,10 @@
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "ppc_mac.h"
#include "pci.h"
typedef target_phys_addr_t pci_addr_t;
#include "pci_host.h"

View File

@ -22,7 +22,10 @@
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "mips.h"
#include "pci.h"
#include "pc.h"
typedef target_phys_addr_t pci_addr_t;
#include "pci_host.h"

View File

@ -8,7 +8,13 @@
* This code is licensed under the GNU GPL v2.
*/
#include "vl.h"
#include "hw.h"
#include "pxa.h"
#include "net.h"
#include "flash.h"
#include "sysemu.h"
#include "devices.h"
#include "boards.h"
/* Board init. */
enum gumstix_model_e { connex };

View File

@ -22,7 +22,7 @@
* 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"
//#define DEBUG

99
hw/hw.h Normal file
View File

@ -0,0 +1,99 @@
/* Declarations for use by hardware emulation. */
#ifndef QEMU_HW_H
#define QEMU_HW_H
#include "qemu-common.h"
#include "irq.h"
/* VM Load/Save */
QEMUFile *qemu_fopen(const char *filename, const char *mode);
void qemu_fflush(QEMUFile *f);
void qemu_fclose(QEMUFile *f);
void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size);
void qemu_put_byte(QEMUFile *f, int v);
void qemu_put_be16(QEMUFile *f, unsigned int v);
void qemu_put_be32(QEMUFile *f, unsigned int v);
void qemu_put_be64(QEMUFile *f, uint64_t v);
int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size);
int qemu_get_byte(QEMUFile *f);
unsigned int qemu_get_be16(QEMUFile *f);
unsigned int qemu_get_be32(QEMUFile *f);
uint64_t qemu_get_be64(QEMUFile *f);
static inline void qemu_put_be64s(QEMUFile *f, const uint64_t *pv)
{
qemu_put_be64(f, *pv);
}
static inline void qemu_put_be32s(QEMUFile *f, const uint32_t *pv)
{
qemu_put_be32(f, *pv);
}
static inline void qemu_put_be16s(QEMUFile *f, const uint16_t *pv)
{
qemu_put_be16(f, *pv);
}
static inline void qemu_put_8s(QEMUFile *f, const uint8_t *pv)
{
qemu_put_byte(f, *pv);
}
static inline void qemu_get_be64s(QEMUFile *f, uint64_t *pv)
{
*pv = qemu_get_be64(f);
}
static inline void qemu_get_be32s(QEMUFile *f, uint32_t *pv)
{
*pv = qemu_get_be32(f);
}
static inline void qemu_get_be16s(QEMUFile *f, uint16_t *pv)
{
*pv = qemu_get_be16(f);
}
static inline void qemu_get_8s(QEMUFile *f, uint8_t *pv)
{
*pv = qemu_get_byte(f);
}
#ifdef NEED_CPU_H
#if TARGET_LONG_BITS == 64
#define qemu_put_betl qemu_put_be64
#define qemu_get_betl qemu_get_be64
#define qemu_put_betls qemu_put_be64s
#define qemu_get_betls qemu_get_be64s
#else
#define qemu_put_betl qemu_put_be32
#define qemu_get_betl qemu_get_be32
#define qemu_put_betls qemu_put_be32s
#define qemu_get_betls qemu_get_be32s
#endif
#endif
int64_t qemu_ftell(QEMUFile *f);
int64_t qemu_fseek(QEMUFile *f, int64_t pos, int whence);
typedef void SaveStateHandler(QEMUFile *f, void *opaque);
typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
int register_savevm(const char *idstr,
int instance_id,
int version_id,
SaveStateHandler *save_state,
LoadStateHandler *load_state,
void *opaque);
typedef void QEMUResetHandler(void *opaque);
void qemu_register_reset(QEMUResetHandler *func, void *opaque);
/* These should really be in isa.h, but are here to make pc.h happy. */
typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data);
typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address);
#endif

View File

@ -7,7 +7,8 @@
* This code is licenced under the LGPL.
*/
#include "vl.h"
#include "hw.h"
#include "i2c.h"
struct i2c_bus
{
@ -30,7 +31,7 @@ i2c_slave *i2c_slave_init(i2c_bus *bus, int address, int size)
i2c_slave *dev;
if (size < sizeof(i2c_slave))
cpu_abort(cpu_single_env, "I2C struct too small");
hw_error("I2C struct too small");
dev = (i2c_slave *)qemu_mallocz(size);
dev->address = address;

View File

@ -13,8 +13,6 @@ enum i2c_event {
I2C_NACK /* Masker NACKed a receive byte. */
};
typedef struct i2c_slave i2c_slave;
/* Master to slave. */
typedef int (*i2c_send_cb)(i2c_slave *s, uint8_t data);
/* Slave to master. */
@ -34,8 +32,6 @@ struct i2c_slave
void *next;
};
typedef struct i2c_bus i2c_bus;
i2c_bus *i2c_init_bus(void);
i2c_slave *i2c_slave_init(i2c_bus *bus, int address, int size);
void i2c_set_slave_address(i2c_slave *dev, int address);
@ -50,6 +46,14 @@ void i2c_bus_load(QEMUFile *f, i2c_bus *bus);
void i2c_slave_save(QEMUFile *f, i2c_slave *dev);
void i2c_slave_load(QEMUFile *f, i2c_slave *dev);
/* max111x.c */
struct max111x_s;
uint32_t max111x_read(void *opaque);
void max111x_write(void *opaque, uint32_t value);
struct max111x_s *max1110_init(qemu_irq cb);
struct max111x_s *max1111_init(qemu_irq cb);
void max111x_set_input(struct max111x_s *s, int line, uint8_t value);
/* max7310.c */
i2c_slave *max7310_init(i2c_bus *bus);
void max7310_reset(i2c_slave *i2c);
@ -64,4 +68,7 @@ void wm8750_data_req_set(i2c_slave *i2c,
void wm8750_dac_dat(void *opaque, uint32_t sample);
uint32_t wm8750_adc_dat(void *opaque);
/* ssd0303.c */
void ssd0303_init(DisplayState *ds, i2c_bus *bus, int address);
#endif

View File

@ -21,7 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "pc.h"
#include "isa.h"
#include "qemu-timer.h"
//#define DEBUG_PIT

View File

@ -21,7 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "pc.h"
#include "isa.h"
#include "console.h"
/* debug PIC */
//#define DEBUG_PIC

View File

@ -22,7 +22,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "pc.h"
#include "pci.h"
#include "scsi-disk.h"
#include "pcmcia.h"
#include "block.h"
#include "qemu-timer.h"
#include "sysemu.h"
/* debug IDE devices */
//#define DEBUG_IDE

View File

@ -7,8 +7,13 @@
* This code is licenced under the GPL
*/
#include "vl.h"
#include "arm_pic.h"
#include "hw.h"
#include "primecell.h"
#include "devices.h"
#include "sysemu.h"
#include "boards.h"
#include "arm-misc.h"
#include "net.h"
void DMA_run (void)
{

View File

@ -21,7 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "sun4m.h"
/* debug iommu */
//#define DEBUG_IOMMU

View File

@ -21,7 +21,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 "irq.h"
struct IRQState {
qemu_irq_handler handler;

View File

@ -1,8 +1,11 @@
#ifndef QEMU_IRQ_H
#define QEMU_IRQ_H
/* Generic IRQ/GPIO pin infrastructure. */
/* FIXME: Rmove one of these. */
typedef void (*qemu_irq_handler)(void *opaque, int n, int level);
typedef struct IRQState *qemu_irq;
typedef void SetIRQFunc(void *opaque, int irq_num, int level);
void qemu_set_irq(qemu_irq irq, int level);
@ -21,3 +24,5 @@ qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n);
/* Returns a new IRQ with opposite polarity. */
qemu_irq qemu_irq_invert(qemu_irq irq);
#endif

24
hw/isa.h Normal file
View File

@ -0,0 +1,24 @@
/* ISA bus */
extern target_phys_addr_t isa_mem_base;
int register_ioport_read(int start, int length, int size,
IOPortReadFunc *func, void *opaque);
int register_ioport_write(int start, int length, int size,
IOPortWriteFunc *func, void *opaque);
void isa_unassign_ioport(int start, int length);
void isa_mmio_init(target_phys_addr_t base, target_phys_addr_t size);
/* dma.c */
int DMA_get_channel_mode (int nchan);
int DMA_read_memory (int nchan, void *buf, int pos, int size);
int DMA_write_memory (int nchan, void *buf, int pos, int size);
void DMA_hold_DREQ (int nchan);
void DMA_release_DREQ (int nchan);
void DMA_schedule(int nchan);
void DMA_run (void);
void DMA_init (int high_page_enable);
void DMA_register_channel (int nchan,
DMA_transfer_handler transfer_handler,
void *opaque);

View File

@ -22,7 +22,8 @@
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "isa.h"
static void isa_mmio_writeb (void *opaque, target_phys_addr_t addr,
uint32_t val)

View File

@ -22,7 +22,9 @@
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "mips.h"
#include "console.h"
#include "pixel_ops.h"
//#define DEBUG_LED

View File

@ -10,7 +10,9 @@
/* ??? Need to check if the {read,write}[wl] routines work properly on
big-endian targets. */
#include "vl.h"
#include "hw.h"
#include "pci.h"
#include "scsi-disk.h"
//#define DEBUG_LSI
//#define DEBUG_LSI_REG

View File

@ -21,8 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "m48t59.h"
#include "hw.h"
#include "nvram.h"
#include "isa.h"
#include "qemu-timer.h"
#include "sysemu.h"
//#define DEBUG_NVRAM

View File

@ -1,13 +0,0 @@
#if !defined (__M48T59_H__)
#define __M48T59_H__
typedef struct m48t59_t m48t59_t;
void m48t59_write (void *private, uint32_t addr, uint32_t val);
uint32_t m48t59_read (void *private, uint32_t addr);
void m48t59_toggle_lock (void *private, int lock);
m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,
uint32_t io_base, uint16_t size,
int type);
#endif /* !defined (__M48T59_H__) */

View File

@ -22,7 +22,7 @@
* 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"
/* DBDMA: currently no op - should suffice right now */

View File

@ -22,7 +22,7 @@
* 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"
struct MacIONVRAMState {

View File

@ -22,8 +22,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 "pci.h"
typedef struct macio_state_t macio_state_t;
struct macio_state_t {

View File

@ -7,7 +7,8 @@
* This code is licensed under the GNU GPLv2.
*/
#include <vl.h>
#include "hw.h"
#include "i2c.h"
struct max111x_s {
qemu_irq interrupt;

View File

@ -7,7 +7,8 @@
* This file is licensed under GNU GPL.
*/
#include "vl.h"
#include "hw.h"
#include "i2c.h"
struct max7310_s {
i2c_slave i2c;
@ -182,7 +183,7 @@ static void max7310_gpio_set(void *opaque, int line, int level)
{
struct max7310_s *s = (struct max7310_s *) opaque;
if (line >= sizeof(s->handler) / sizeof(*s->handler) || line < 0)
cpu_abort(cpu_single_env, "bad GPIO line");
hw_error("bad GPIO line");
if (level)
s->level |= s->direction & (1 << line);
@ -220,7 +221,7 @@ void max7310_gpio_out_set(i2c_slave *i2c, int line, qemu_irq handler)
{
struct max7310_s *s = (struct max7310_s *) i2c;
if (line >= sizeof(s->handler) / sizeof(*s->handler) || line < 0)
cpu_abort(cpu_single_env, "bad GPIO line");
hw_error("bad GPIO line");
s->handler[line] = handler;
}

View File

@ -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.h"
#include "qemu-timer.h"
#include "sysemu.h"
#include "pc.h"
#include "isa.h"
//#define DEBUG_CMOS

21
hw/mcf.h Normal file
View File

@ -0,0 +1,21 @@
#ifndef HW_MCF_H
#define HW_MCF_H
/* Motorola ColdFire device prototypes. */
/* mcf_uart.c */
uint32_t mcf_uart_read(void *opaque, target_phys_addr_t addr);
void mcf_uart_write(void *opaque, target_phys_addr_t addr, uint32_t val);
void *mcf_uart_init(qemu_irq irq, CharDriverState *chr);
void mcf_uart_mm_init(target_phys_addr_t base, qemu_irq irq,
CharDriverState *chr);
/* mcf_intc.c */
qemu_irq *mcf_intc_init(target_phys_addr_t base, CPUState *env);
/* mcf_fec.c */
void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq);
/* mcf5206.c */
qemu_irq *mcf5206_init(uint32_t base, CPUState *env);
#endif

View File

@ -5,7 +5,10 @@
*
* This code is licenced under the GPL
*/
#include "vl.h"
#include "hw.h"
#include "mcf.h"
#include "qemu-timer.h"
#include "sysemu.h"
/* General purpose timer module. */
typedef struct {

View File

@ -5,7 +5,12 @@
*
* This code is licenced under the GPL
*/
#include "vl.h"
#include "hw.h"
#include "mcf.h"
#include "qemu-timer.h"
#include "sysemu.h"
#include "net.h"
#include "boards.h"
#define SYS_FREQ 66000000

View File

@ -5,7 +5,9 @@
*
* This code is licenced under the GPL
*/
#include "vl.h"
#include "hw.h"
#include "net.h"
#include "mcf.h"
/* For crc32 */
#include <zlib.h>

View File

@ -5,7 +5,8 @@
*
* This code is licenced under the GPL
*/
#include "vl.h"
#include "hw.h"
#include "mcf.h"
typedef struct {
uint64_t ipr;

View File

@ -5,7 +5,9 @@
*
* This code is licenced under the GPL
*/
#include "vl.h"
#include "hw.h"
#include "mcf.h"
#include "qemu-char.h"
typedef struct {
uint8_t mr[2];

25
hw/mips.h Normal file
View File

@ -0,0 +1,25 @@
#ifndef HW_MIPS_H
#define HW_MIPS_H
/* Definitions for mips board emulation. */
/* gt64xxx.c */
PCIBus *pci_gt64120_init(qemu_irq *pic);
/* ds1225y.c */
typedef struct ds1225y_t ds1225y_t;
ds1225y_t *ds1225y_init(target_phys_addr_t mem_base, const char *filename);
/* mipsnet.c */
void mipsnet_init(int base, qemu_irq irq, NICInfo *nd);
/* jazz_led.c */
extern void jazz_led_init(DisplayState *ds, target_phys_addr_t base);
/* mips_int.c */
extern void cpu_mips_irq_init_cpu(CPUState *env);
/* mips_timer.c */
extern void cpu_mips_clock_init(CPUState *);
extern void cpu_mips_irqctrl_init (void);
#endif

View File

@ -1,4 +1,5 @@
#include "vl.h"
#include "hw.h"
#include "mips.h"
#include "cpu.h"
/* Raise IRQ to CPU if necessary. It must be called every time the active

View File

@ -22,7 +22,17 @@
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "pc.h"
#include "net.h"
#include "boards.h"
#include "smbus.h"
#include "mips.h"
#include "pci.h"
#include "qemu-char.h"
#include "sysemu.h"
#include "audio/audio.h"
#include "boards.h"
#ifdef TARGET_WORDS_BIGENDIAN
#define BIOS_FILENAME "mips_bios.bin"

View File

@ -24,7 +24,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "mips.h"
#include "pc.h"
#include "isa.h"
#include "net.h"
#include "sysemu.h"
#include "boards.h"
#ifdef TARGET_WORDS_BIGENDIAN
#define BIOS_FILENAME "mips_bios.bin"

View File

@ -22,7 +22,13 @@
* THE SOFTWARE.
*/
#include "vl.h"
#include "hw.h"
#include "mips.h"
#include "isa.h"
#include "pc.h"
#include "fdc.h"
#include "sysemu.h"
#include "boards.h"
#ifdef TARGET_WORDS_BIGENDIAN
#define BIOS_FILENAME "mips_bios.bin"

View File

@ -7,7 +7,13 @@
* All peripherial devices are attached to this "bus" with
* the standard PC ISA addresses.
*/
#include "vl.h"
#include "hw.h"
#include "mips.h"
#include "pc.h"
#include "isa.h"
#include "net.h"
#include "sysemu.h"
#include "boards.h"
#ifdef TARGET_WORDS_BIGENDIAN
#define BIOS_FILENAME "mips_bios.bin"

View File

@ -1,4 +1,6 @@
#include "vl.h"
#include "hw.h"
#include "mips.h"
#include "qemu-timer.h"
void cpu_mips_irqctrl_init (void)
{

View File

@ -1,4 +1,7 @@
#include "vl.h"
#include "hw.h"
#include "mips.h"
#include "net.h"
#include "isa.h"
//#define DEBUG_MIPSNET_SEND
//#define DEBUG_MIPSNET_RECEIVE

View File

@ -7,7 +7,9 @@
* This code is licenced under the GPL.
*/
#include "vl.h"
#include "hw.h"
#include "qemu-timer.h"
#include "primecell.h"
#define MPCORE_PRIV_BASE 0x10100000
#define NCPU 4

View File

@ -11,7 +11,11 @@
#ifndef NAND_IO
# include "vl.h"
# include "hw.h"
# include "flash.h"
# include "block.h"
/* FIXME: Pass block device as an argument. */
# include "sysemu.h"
# define NAND_CMD_READ0 0x00
# define NAND_CMD_READ1 0x01

View File

@ -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 "pci.h"
#include "net.h"
/* debug NE2000 card */
//#define DEBUG_NE2000

41
hw/nvram.h Normal file
View File

@ -0,0 +1,41 @@
#ifndef NVRAM_H
#define NVRAM_H
/* NVRAM helpers */
typedef uint32_t (*nvram_read_t)(void *private, uint32_t addr);
typedef void (*nvram_write_t)(void *private, uint32_t addr, uint32_t val);
typedef struct nvram_t {
void *opaque;
nvram_read_t read_fn;
nvram_write_t write_fn;
} nvram_t;
void NVRAM_set_byte (nvram_t *nvram, uint32_t addr, uint8_t value);
uint8_t NVRAM_get_byte (nvram_t *nvram, uint32_t addr);
void NVRAM_set_word (nvram_t *nvram, uint32_t addr, uint16_t value);
uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr);
void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value);
uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr);
void NVRAM_set_string (nvram_t *nvram, uint32_t addr,
const unsigned char *str, uint32_t max);
int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max);
void NVRAM_set_crc (nvram_t *nvram, uint32_t addr,
uint32_t start, uint32_t count);
int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size,
const unsigned char *arch,
uint32_t RAM_size, int boot_device,
uint32_t kernel_image, uint32_t kernel_size,
const char *cmdline,
uint32_t initrd_image, uint32_t initrd_size,
uint32_t NVRAM_image,
int width, int height, int depth);
typedef struct m48t59_t m48t59_t;
void m48t59_write (void *private, uint32_t addr, uint32_t val);
uint32_t m48t59_read (void *private, uint32_t addr);
void m48t59_toggle_lock (void *private, int lock);
m48t59_t *m48t59_init (qemu_irq IRQ, target_phys_addr_t mem_base,
uint32_t io_base, uint16_t size,
int type);
#endif /* !NVRAM_H */

Some files were not shown because too many files have changed in this diff Show More