提交 b582b5a3 编写于 作者: A Andreas Färber 提交者: Anthony Liguori

sga: QOM'ify

Introduce type constant and cast macro.

Prepares for ISA realizefn.
Signed-off-by: NAndreas Färber <afaerber@suse.de>
Signed-off-by: NAndreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-17-git-send-email-afaerber@suse.de
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 eeceb084
......@@ -31,8 +31,11 @@
#define SGABIOS_FILENAME "sgabios.bin"
typedef struct ISAGAState {
ISADevice dev;
#define TYPE_SGA "sga"
#define SGA(obj) OBJECT_CHECK(ISASGAState, (obj), TYPE_SGA)
typedef struct ISASGAState {
ISADevice parent_obj;
} ISASGAState;
static int sga_initfn(ISADevice *dev)
......@@ -40,6 +43,7 @@ static int sga_initfn(ISADevice *dev)
rom_add_vga(SGABIOS_FILENAME);
return 0;
}
static void sga_class_initfn(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
......@@ -49,7 +53,7 @@ static void sga_class_initfn(ObjectClass *klass, void *data)
}
static const TypeInfo sga_info = {
.name = "sga",
.name = TYPE_SGA,
.parent = TYPE_ISA_DEVICE,
.instance_size = sizeof(ISASGAState),
.class_init = sga_class_initfn,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册