Skip to contentSkip to conversation

isa: configure serial+parallel by index.

PATCH In review Gerd Hoffmann 3 participants 3 messages Nov 17, 2009 – Dec 2, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 isa: configure serial+parallel by index.

This patch adds a 'index' property to the isa-parallel and isa-serial devices. This can be used to create devices with the default isa irqs and ioports by simply specifying the index, i.e.

-device isa-serial,index=1

instead of

-device isa-serial,iobase=0x2f8,irq=3

for ttyS1 aka com2. Likewise for parallel ports.

---
 hw/parallel.c |    2 +-
 hw/serial.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
hw/parallel.c +1 -1
index 5ae8348..12693d4 100644
@@ -587,7 +587,7 @@ static ISADeviceInfo parallel_isa_info = {
     .qdev.size  = sizeof(ISAParallelState),
     .init       = parallel_isa_initfn,
     .qdev.props = (Property[]) {
-        DEFINE_PROP_HEX32("index",  ISAParallelState, index,   -1),
+        DEFINE_PROP_UINT32("index", ISAParallelState, index,   -1),
         DEFINE_PROP_HEX32("iobase", ISAParallelState, iobase,  -1),
         DEFINE_PROP_UINT32("irq",   ISAParallelState, isairq,  7),
         DEFINE_PROP_CHR("chardev",  ISAParallelState, state.chr),
hw/serial.c +1 -1
index 0063260..e7538ac 100644
@@ -900,7 +900,7 @@ static ISADeviceInfo serial_isa_info = {
     .qdev.size  = sizeof(ISASerialState),
     .init       = serial_isa_initfn,
     .qdev.props = (Property[]) {
-        DEFINE_PROP_HEX32("index",  ISASerialState, index,   -1),
+        DEFINE_PROP_UINT32("index", ISASerialState, index,   -1),
         DEFINE_PROP_HEX32("iobase", ISASerialState, iobase,  -1),
         DEFINE_PROP_UINT32("irq",   ISASerialState, isairq,  -1),
         DEFINE_PROP_CHR("chardev",  ISASerialState, state.chr),
Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 36 lines · Gerd Hoffmann

This patch adds a 'index' property to the isa-parallel and isa-serial devices. This can be used to create devices with the default isa irqs and ioports by simply specifying the index, i.e.

-device isa-serial,index=1

instead of

   -device isa-serial,iobase=0x2f8,irq=3

for ttyS1 aka com2. Likewise for parallel ports.

---
 hw/parallel.c |    2 +-
 hw/serial.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
hw/parallel.c +1 -1
index 5ae8348..12693d4 100644
@@ -587,7 +587,7 @@ static ISADeviceInfo parallel_isa_info = {
     .qdev.size  = sizeof(ISAParallelState),
     .init       = parallel_isa_initfn,
     .qdev.props = (Property[]) {
-        DEFINE_PROP_HEX32("index",  ISAParallelState, index,   -1),
+        DEFINE_PROP_UINT32("index", ISAParallelState, index,   -1),
         DEFINE_PROP_HEX32("iobase", ISAParallelState, iobase,  -1),
         DEFINE_PROP_UINT32("irq",   ISAParallelState, isairq,  7),
         DEFINE_PROP_CHR("chardev",  ISAParallelState, state.chr),
hw/serial.c +0 -0
index 0063260..e7538ac 100644

hw/serial.c static ISADeviceInfo serial_isa_info = { · line 906

Quoted 8 lines
hw/serial.c +1 -1
@@ -900,7 +900,7 @@ static ISADeviceInfo serial_isa_info = {
     .qdev.size  = sizeof(ISASerialState),
     .init       = serial_isa_initfn,
     .qdev.props = (Property[]) {
-        DEFINE_PROP_HEX32("index",  ISASerialState, index,   -1),
+        DEFINE_PROP_UINT32("index", ISASerialState, index,   -1),
         DEFINE_PROP_HEX32("iobase", ISASerialState, iobase,  -1),
         DEFINE_PROP_UINT32("irq",   ISASerialState, isairq,  -1),
         DEFINE_PROP_CHR("chardev",  ISASerialState, state.chr),

The commit message is bogus. The patch is a minor fix of commit e8ee28fb, and the message is a copy of that commit's message.

#2 lore raw
Quoted 3 lines · Markus Armbruster

The commit message is bogus. The patch is a minor fix of commit e8ee28fb, and the message is a copy of that commit's message.

Thanks, I've updated the commit message appropriately.

Regards,

Anthony Liguori