aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-21 23:00:32 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-21 23:00:32 +0000
commit7648bb760d768bb88b240e534fdb974f1adf577f (patch)
tree069b05762bb9424c89f62ab5e0c214436d2a169b /hw
parent3f546bd0b1b33f75294eb424a6f881f578d02269 (diff)
parentebb7184720640b6de903771bd9ae494b6573c513 (diff)
Rename stable branch
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@6879 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/cirrus_vga.c5
-rw-r--r--hw/e1000.c4
-rw-r--r--hw/lsi53c895a.c2
-rw-r--r--hw/usb-msd.c6
-rw-r--r--hw/usb.h5
-rw-r--r--hw/vga.c13
-rw-r--r--hw/virtio-net.c2
-rw-r--r--hw/virtio.c7
8 files changed, 33 insertions, 11 deletions
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 8aade84846..2ff80d3316 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -2637,11 +2637,16 @@ static void map_linear_vram(CirrusVGAState *s)
s->lfb_vram_mapped = 0;
+ cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x8000,
+ (s->vram_offset + s->cirrus_bank_base[0]) | IO_MEM_UNASSIGNED);
+ cpu_register_physical_memory(isa_mem_base + 0xa8000, 0x8000,
+ (s->vram_offset + s->cirrus_bank_base[1]) | IO_MEM_UNASSIGNED);
if (!(s->cirrus_srcptr != s->cirrus_srcptr_end)
&& !((s->sr[0x07] & 0x01) == 0)
&& !((s->gr[0x0B] & 0x14) == 0x14)
&& !(s->gr[0x0B] & 0x02)) {
+ vga_dirty_log_stop((VGAState *)s);
cpu_register_physical_memory(isa_mem_base + 0xa0000, 0x8000,
(s->vram_offset + s->cirrus_bank_base[0]) | IO_MEM_RAM);
cpu_register_physical_memory(isa_mem_base + 0xa8000, 0x8000,
diff --git a/hw/e1000.c b/hw/e1000.c
index e6155d6a69..1644201d6e 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -666,8 +666,8 @@ e1000_receive(void *opaque, const uint8_t *buf, int size)
n = E1000_ICS_RXT0;
if ((rdt = s->mac_reg[RDT]) < s->mac_reg[RDH])
rdt += s->mac_reg[RDLEN] / sizeof(desc);
- if (((rdt - s->mac_reg[RDH]) * sizeof(desc)) << s->rxbuf_min_shift >=
- s->mac_reg[RDLEN])
+ if (((rdt - s->mac_reg[RDH]) * sizeof(desc)) <= s->mac_reg[RDLEN] >>
+ s->rxbuf_min_shift)
n |= E1000_ICS_RXDMT0;
set_ics(s, 0, n);
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 36ee28e714..1f4f8b7ef7 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -1369,6 +1369,8 @@ static uint8_t lsi_reg_readb(LSIState *s, int offset)
CASE_GET_REG32(dsa, 0x10)
case 0x14: /* ISTAT0 */
return s->istat0;
+ case 0x15: /* ISTAT1 */
+ return s->istat1;
case 0x16: /* MBOX0 */
return s->mbox0;
case 0x17: /* MBOX1 */
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index 342b0e873a..0c8d9cca83 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -11,6 +11,7 @@
#include "usb.h"
#include "block.h"
#include "scsi-disk.h"
+#include "console.h"
//#define DEBUG_MSD
@@ -513,7 +514,7 @@ static void usb_msd_handle_destroy(USBDevice *dev)
qemu_free(s);
}
-USBDevice *usb_msd_init(const char *filename)
+USBDevice *usb_msd_init(const char *filename, BlockDriverState **pbs)
{
MSDState *s;
BlockDriverState *bdrv;
@@ -552,9 +553,8 @@ USBDevice *usb_msd_init(const char *filename)
bdrv = bdrv_new("usb");
if (bdrv_open2(bdrv, filename, 0, drv) < 0)
goto fail;
- if (qemu_key_check(bdrv, filename))
- goto fail;
s->bs = bdrv;
+ *pbs = bdrv;
s->dev.speed = USB_SPEED_FULL;
s->dev.handle_packet = usb_generic_handle_packet;
diff --git a/hw/usb.h b/hw/usb.h
index 4204808a00..4cd832d492 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -21,6 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
+#include "block.h"
+
#define USB_TOKEN_SETUP 0x2d
#define USB_TOKEN_IN 0x69 /* device -> host */
#define USB_TOKEN_OUT 0xe1 /* host -> device */
@@ -250,7 +253,7 @@ USBDevice *usb_keyboard_init(void);
void usb_hid_datain_cb(USBDevice *dev, void *opaque, void (*datain)(void *));
/* usb-msd.c */
-USBDevice *usb_msd_init(const char *filename);
+USBDevice *usb_msd_init(const char *filename, BlockDriverState **pbs);
/* usb-net.c */
USBDevice *usb_net_init(NICInfo *nd);
diff --git a/hw/vga.c b/hw/vga.c
index 98c2234f6b..044b339161 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2482,6 +2482,17 @@ int isa_vga_mm_init(uint8_t *vga_ram_base,
return 0;
}
+static void pci_vga_write_config(PCIDevice *d,
+ uint32_t address, uint32_t val, int len)
+{
+ PCIVGAState *pvs = container_of(d, PCIVGAState, dev);
+ VGAState *s = &pvs->vga_state;
+
+ vga_dirty_log_stop(s);
+ pci_default_write_config(d, address, val, len);
+ vga_dirty_log_start(s);
+}
+
int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
unsigned long vga_ram_offset, int vga_ram_size,
unsigned long vga_bios_offset, int vga_bios_size)
@@ -2492,7 +2503,7 @@ int pci_vga_init(PCIBus *bus, uint8_t *vga_ram_base,
d = (PCIVGAState *)pci_register_device(bus, "VGA",
sizeof(PCIVGAState),
- -1, NULL, NULL);
+ -1, NULL, pci_vga_write_config);
if (!d)
return -1;
s = &d->vga_state;
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index e83d1019c1..ad55bb7610 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -228,7 +228,7 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
}
if (elem.out_sg[0].iov_len < sizeof(ctrl) ||
- elem.out_sg[elem.in_num - 1].iov_len < sizeof(status)) {
+ elem.in_sg[elem.in_num - 1].iov_len < sizeof(status)) {
fprintf(stderr, "virtio-net ctrl header not in correct element\n");
exit(1);
}
diff --git a/hw/virtio.c b/hw/virtio.c
index b94ab0f054..08ea16dee5 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -726,9 +726,10 @@ VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size,
void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
{
- /* Always notify when queue is empty */
- if ((vq->inuse || vring_avail_idx(vq) != vq->last_avail_idx) &&
- (vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT))
+ /* Always notify when queue is empty (when feature acknowledge) */
+ if ((vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT) &&
+ (!(vdev->features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) ||
+ (vq->inuse || vring_avail_idx(vq) != vq->last_avail_idx)))
return;
vdev->isr |= 0x01;