[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] try to implement complete pci-to-pci bridge emu
From: |
M. Warner Losh |
Subject: |
Re: [Qemu-devel] [PATCH] try to implement complete pci-to-pci bridge emulator. |
Date: |
Fri, 01 May 2009 08:17:50 -0600 (MDT) |
In message: <address@hidden>
Isaku Yamahata <address@hidden> writes:
: Signed-off-by: Isaku Yamahata <address@hidden>
: ---
: hw/pci.c | 175
+++++++++++++++++++++++++++++++++++++++------------------
: hw/pci.h | 30 ++++++++++
: hw/unin_pci.c | 2 +-
: 3 files changed, 151 insertions(+), 56 deletions(-)
:
: diff --git a/hw/pci.c b/hw/pci.c
: index 0be3662..a1123cb 100644
: --- a/hw/pci.c
: +++ b/hw/pci.c
...
: + case 0x01:
: + case 0x02:
: + case 0x03:
: + case 0x06:
: + case 0x07:
: + case 0x08:
: + case 0x09:
: + case 0x0a:
: + case 0x0b:
: + case 0x0e:
: + case 0x10 ... 0x27: /* base */
This is wrong. BARs are writable, and must be writable to determine
their size.
: + case 0x2c ... 0x2f: /* read-only subsystem ID & vendor ID */
: + case 0x30 ... 0x33: /* rom */
This is wrong too. You have to be able to turn on and off this
mapping by writing bit 0.
: + case 0x3d:
: + can_write = 0;
: break;
General comment: hard coded magic numbers like the above are very hard
to read.
Warner