PCI_FUNC_MAX is introduced by
6eab3de16d36c48a983366b09d0a0029a5260bc3
and
6fa84913eccec4266a27c81ae88465f6790742b9
which should be safe to rename to PCI_FUNCTIONS_PER_DEVICES.
Signed-off-by: Ken CC
---
hw/pci.c |4 ++--
hw/pci.h |1 -
2 files changed, 2 insertions(+), 3 deletions
If pci addr provided from command line is bigger than 32,
PCIBUS_MAX_DEVICES, return error -EINVAL.
32 << 3 | 7 == 256 (PCIBUS_MAX_FUNCTIONS)
PCIBUS_MAX_FUNCTIONS = PCIBUS_MAX_DEVICES * PCI_FUNCTIONS_PER_DEVICE
Signed-off-by: Ken CC
---
hw/qdev-properties.c |4 +++-
1 files chan
Check if devfn < PCIBUS_MAX_DEVICES * PCI_FUNCTIONS_PER_DEVICE
Signed-off-by: Ken CC
---
hw/pci.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 9234fe3..fc4becd 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -747,6 +747,7 @@ static PCIDev
And update the max function number used in struct PCIBus{} to
PCIBUS_MAX_FUNCTIONS = PCI_FUNCTIONS_PER_DEVICE * PCIBUS_MAX_DEVICES
TODO:
according to Avi Kivity, PCIBus.devices[] should be renamed to functions[]
Signed-off-by: Ken CC
---
hw/pci.c |2 +-
hw/pci.h |2 ++
2 files
broken thread, please ignore.
On Tue, Aug 24, 2010 at 02:33:51PM +0800, Ken CC wrote:
> assert(devfn < PCIBUS_MAX_DEVICES)
>
> Signed-off-by: Ken CC
> ---
> hw/pci.c |1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/hw/pci.c b/hw/pci
assert(devfn < PCIBUS_MAX_DEVICES)
Signed-off-by: Ken CC
---
hw/pci.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 02019a1..1e804da 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -747,6 +747,7 @@ static PCIDevice *do_pci_register_device(PCIDev
Define MAX_PCI_SLOTS as 0x1f, if pci addr provided from command line
is bigger than 0x1f, return error -EINVAL.
0x1f << 3 | 7 == 255 (PCIBUS_MAX_DEVICES - 1)
Signed-off-by: Ken CC
---
hw/qdev-properties.c |2 ++
hw/qdev.h|3 +++
2 files changed, 5 insertions(+), 0 del
Define MAX_PCI_SLOTS as 0x1f, if pci addr provided from command line
is bigger than 0x1f, return error -EINVAL.
0x1f << 3 | 7 == 255 (PCIBUS_MAX_DEVICES - 1)
Signed-off-by: Ken CC
---
hw/qdev-properties.c |2 ++
hw/qdev.h|3 +++
2 files changed, 5 insertions(+), 0 del
assert(devfn < PCIBUS_MAX_DEVICES)
Signed-off-by: Ken CC
---
hw/pci.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 02019a1..1e804da 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -747,6 +747,7 @@ static PCIDevice *do_pci_register_device(PCIDev
Signed-off-by: Ken CC
---
hw/pci.c |2 +-
hw/pci.h |1 +
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 70dbace..02019a1 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -47,7 +47,7 @@ struct PCIBus {
pci_hotplug_fn hotplug;
DeviceState
-m 2048 -vnc :11
assert() is good to me.
and i think checking in the caller should be done too.
> On Mon, Aug 23, 2010 at 01:56:31PM +0800, Ken CC wrote:
> >
> > Check before trying subindexing.
> >
> > Signed-off-by: Ken CC
> >
Check before trying subindexing.
Signed-off-by: Ken CC
---
hw/pci.c |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index a09fbac..f6f00c6 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -675,6 +675,10 @@ static PCIDevice *do_pci_register_device(PCIDevice
Check before trying subindexing.
Signed-off-by: Ken CC
---
hw/pci.c |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index a09fbac..f6f00c6 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -675,6 +675,10 @@ static PCIDevice *do_pci_register_device
Signed-off-by: Ken CC
---
hw/pci.c |2 +-
hw/pci.h |1 +
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index a98d6f3..a09fbac 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -44,7 +44,7 @@ struct PCIBus {
pci_hotplug_fn hotplug;
DeviceState
Check before trying subindexing.
Signed-off-by: Ken CC
---
hw/pci.c |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index a09fbac..f6f00c6 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -675,6 +675,10 @@ static PCIDevice *do_pci_register_device(PCIDevice
Signed-off-by: Ken CC
---
hw/pci.c |2 +-
hw/pci.h |1 +
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index a98d6f3..a09fbac 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -44,7 +44,7 @@ struct PCIBus {
pci_hotplug_fn hotplug;
DeviceState
Check before trying subindexing.
Signed-off-by: Ken CC
---
hw/pci.c |4
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index a09fbac..f6f00c6 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -675,6 +675,10 @@ static PCIDevice *do_pci_register_device(PCIDevice
17 matches
Mail list logo