Revision bc3e6a0d hw/misc/pvpanic.c
b/hw/misc/pvpanic.c | ||
---|---|---|
97 | 97 |
{ |
98 | 98 |
ISADevice *d = ISA_DEVICE(dev); |
99 | 99 |
PVPanicState *s = ISA_PVPANIC_DEVICE(dev); |
100 |
static bool port_configured; |
|
101 |
FWCfgState *fw_cfg; |
|
102 | 100 |
|
103 | 101 |
isa_register_ioport(d, &s->io, s->ioport); |
102 |
} |
|
104 | 103 |
|
105 |
if (!port_configured) { |
|
106 |
fw_cfg = fw_cfg_find(); |
|
107 |
if (fw_cfg) { |
|
108 |
fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", |
|
109 |
g_memdup(&s->ioport, sizeof(s->ioport)), |
|
110 |
sizeof(s->ioport)); |
|
111 |
port_configured = true; |
|
112 |
} |
|
113 |
} |
|
104 |
static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg) |
|
105 |
{ |
|
106 |
PVPanicState *s = ISA_PVPANIC_DEVICE(dev); |
|
107 |
|
|
108 |
fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", |
|
109 |
g_memdup(&s->ioport, sizeof(s->ioport)), |
|
110 |
sizeof(s->ioport)); |
|
114 | 111 |
} |
115 | 112 |
|
116 |
int pvpanic_init(ISABus *bus)
|
|
113 |
void pvpanic_init(ISABus *bus)
|
|
117 | 114 |
{ |
118 |
isa_create_simple(bus, TYPE_ISA_PVPANIC_DEVICE); |
|
119 |
return 0; |
|
115 |
ISADevice *dev; |
|
116 |
FWCfgState *fw_cfg = fw_cfg_find(); |
|
117 |
if (!fw_cfg) { |
|
118 |
return; |
|
119 |
} |
|
120 |
dev = isa_create_simple (bus, TYPE_ISA_PVPANIC_DEVICE); |
|
121 |
pvpanic_fw_cfg(dev, fw_cfg); |
|
120 | 122 |
} |
121 | 123 |
|
122 | 124 |
static Property pvpanic_isa_properties[] = { |
Also available in: Unified diff