isa: add creation function that may fail

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2011-02-05 14:34:48 +00:00
parent 91c9e09147
commit 86f4a9a5c7
2 changed files with 13 additions and 0 deletions

View File

@ -146,6 +146,18 @@ ISADevice *isa_create(const char *name)
return DO_UPCAST(ISADevice, qdev, dev);
}
ISADevice *isa_try_create(const char *name)
{
DeviceState *dev;
if (!isabus) {
hw_error("Tried to create isa device %s with no isa bus present.",
name);
}
dev = qdev_try_create(&isabus->qbus, name);
return DO_UPCAST(ISADevice, qdev, dev);
}
ISADevice *isa_create_simple(const char *name)
{
ISADevice *dev;

View File

@ -32,6 +32,7 @@ void isa_init_ioport(ISADevice *dev, uint16_t ioport);
void isa_init_ioport_range(ISADevice *dev, uint16_t start, uint16_t length);
void isa_qdev_register(ISADeviceInfo *info);
ISADevice *isa_create(const char *name);
ISADevice *isa_try_create(const char *name);
ISADevice *isa_create_simple(const char *name);
extern target_phys_addr_t isa_mem_base;