Statistics
| Branch: | Revision:

root / hw / sga.c @ 145aebec

History | View | Annotate | Download (1.8 kB)

1 a90d4690 Glauber Costa
/*
2 a90d4690 Glauber Costa
 * QEMU dummy ISA device for loading sgabios option rom.
3 a90d4690 Glauber Costa
 *
4 a90d4690 Glauber Costa
 * Copyright (c) 2011 Glauber Costa, Red Hat Inc.
5 a90d4690 Glauber Costa
 *
6 a90d4690 Glauber Costa
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 a90d4690 Glauber Costa
 * of this software and associated documentation files (the "Software"), to deal
8 a90d4690 Glauber Costa
 * in the Software without restriction, including without limitation the rights
9 a90d4690 Glauber Costa
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 a90d4690 Glauber Costa
 * copies of the Software, and to permit persons to whom the Software is
11 a90d4690 Glauber Costa
 * furnished to do so, subject to the following conditions:
12 a90d4690 Glauber Costa
 *
13 a90d4690 Glauber Costa
 * The above copyright notice and this permission notice shall be included in
14 a90d4690 Glauber Costa
 * all copies or substantial portions of the Software.
15 a90d4690 Glauber Costa
 *
16 a90d4690 Glauber Costa
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 a90d4690 Glauber Costa
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 a90d4690 Glauber Costa
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 a90d4690 Glauber Costa
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 a90d4690 Glauber Costa
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 a90d4690 Glauber Costa
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 a90d4690 Glauber Costa
 * THE SOFTWARE.
23 a90d4690 Glauber Costa
 *
24 a90d4690 Glauber Costa
 * sgabios code originally available at code.google.com/p/sgabios
25 a90d4690 Glauber Costa
 *
26 a90d4690 Glauber Costa
 */
27 a90d4690 Glauber Costa
#include "pci.h"
28 a90d4690 Glauber Costa
#include "pc.h"
29 a90d4690 Glauber Costa
#include "loader.h"
30 a90d4690 Glauber Costa
#include "sysemu.h"
31 a90d4690 Glauber Costa
32 a90d4690 Glauber Costa
#define SGABIOS_FILENAME "sgabios.bin"
33 a90d4690 Glauber Costa
34 a90d4690 Glauber Costa
typedef struct ISAGAState {
35 a90d4690 Glauber Costa
    ISADevice dev;
36 a90d4690 Glauber Costa
} ISASGAState;
37 a90d4690 Glauber Costa
38 a90d4690 Glauber Costa
static int isa_cirrus_vga_initfn(ISADevice *dev)
39 a90d4690 Glauber Costa
{
40 a90d4690 Glauber Costa
    rom_add_vga(SGABIOS_FILENAME);
41 a90d4690 Glauber Costa
    return 0;
42 a90d4690 Glauber Costa
}
43 a90d4690 Glauber Costa
44 a90d4690 Glauber Costa
static ISADeviceInfo sga_info = {
45 a90d4690 Glauber Costa
    .qdev.name    = "sga",
46 a90d4690 Glauber Costa
    .qdev.desc    = "Serial Graphics Adapter",
47 a90d4690 Glauber Costa
    .qdev.size    = sizeof(ISASGAState),
48 a90d4690 Glauber Costa
    .init         = isa_cirrus_vga_initfn,
49 a90d4690 Glauber Costa
};
50 a90d4690 Glauber Costa
51 a90d4690 Glauber Costa
static void sga_register(void)
52 a90d4690 Glauber Costa
{
53 a90d4690 Glauber Costa
      isa_qdev_register(&sga_info);
54 a90d4690 Glauber Costa
}
55 a90d4690 Glauber Costa
56 a90d4690 Glauber Costa
device_init(sga_register);