~ubuntu-branches/ubuntu/natty/qemu-linaro/natty

« back to all changes in this revision

Viewing changes to hw/vga-isa.c

  • Committer: Package Import Robot
  • Author(s): Steve Langasek, Loïc Minier, Steve Langasek
  • Date: 2011-03-07 22:55:03 UTC
  • Revision ID: package-import@ubuntu.com-20110307225503-3opjapw0ksg7glo6
[ Loïc Minier ]
* Also pass -fno-var-tracking on armhf.

[ Steve Langasek ]
* New upstream release.
* Build with -marm on armel/armhf; Peter Maydell reports that building for
  Thumb-2 gives an emulator that doesn't work.
* Add support for cross-compiling the package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "qemu-timer.h"
30
30
#include "loader.h"
31
31
 
32
 
int isa_vga_init(void)
33
 
{
34
 
    VGACommonState *s;
35
 
 
36
 
    s = qemu_mallocz(sizeof(*s));
 
32
typedef struct ISAVGAState {
 
33
    ISADevice dev;
 
34
    struct VGACommonState state;
 
35
} ISAVGAState;
 
36
 
 
37
static void vga_reset_isa(DeviceState *dev)
 
38
{
 
39
    ISAVGAState *d = container_of(dev, ISAVGAState, dev.qdev);
 
40
    VGACommonState *s = &d->state;
 
41
 
 
42
    vga_common_reset(s);
 
43
}
 
44
 
 
45
static int vga_initfn(ISADevice *dev)
 
46
{
 
47
    ISAVGAState *d = DO_UPCAST(ISAVGAState, dev, dev);
 
48
    VGACommonState *s = &d->state;
 
49
    int vga_io_memory;
37
50
 
38
51
    vga_common_init(s, VGA_RAM_SIZE);
39
 
    vga_init(s);
40
 
    vmstate_register(NULL, 0, &vmstate_vga_common, s);
41
 
 
 
52
    vga_io_memory = vga_init_io(s);
 
53
    cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000,
 
54
                                 vga_io_memory);
 
55
    qemu_register_coalesced_mmio(isa_mem_base + 0x000a0000, 0x20000);
 
56
    isa_init_ioport(dev, 0x3c0);
 
57
    isa_init_ioport(dev, 0x3b4);
 
58
    isa_init_ioport(dev, 0x3ba);
 
59
    isa_init_ioport(dev, 0x3da);
 
60
    isa_init_ioport(dev, 0x3c0);
 
61
#ifdef CONFIG_BOCHS_VBE
 
62
    isa_init_ioport(dev, 0x1ce);
 
63
    isa_init_ioport(dev, 0x1cf);
 
64
    isa_init_ioport(dev, 0x1d0);
 
65
#endif /* CONFIG_BOCHS_VBE */
42
66
    s->ds = graphic_console_init(s->update, s->invalidate,
43
67
                                 s->screen_dump, s->text_update, s);
44
68
 
47
71
    rom_add_vga(VGABIOS_FILENAME);
48
72
    return 0;
49
73
}
 
74
 
 
75
static ISADeviceInfo vga_info = {
 
76
    .qdev.name     = "isa-vga",
 
77
    .qdev.size     = sizeof(ISAVGAState),
 
78
    .qdev.vmsd     = &vmstate_vga_common,
 
79
    .qdev.reset     = vga_reset_isa,
 
80
    .qdev.no_user  = 1,
 
81
    .init          = vga_initfn,
 
82
};
 
83
 
 
84
static void vga_register(void)
 
85
{
 
86
    isa_qdev_register(&vga_info);
 
87
}
 
88
device_init(vga_register)