sdk/emulator/qemu.git
13 years agopxa2xx_timer: Get rid of .level in PXA2xxTimer0.
Andrzej Zaborowski [Thu, 10 Mar 2011 02:31:02 +0000 (03:31 +0100)]
pxa2xx_timer: Get rid of .level in PXA2xxTimer0.

13 years agopxa2xx_pic: fixup initialisation
Andrzej Zaborowski [Thu, 10 Mar 2011 02:11:47 +0000 (03:11 +0100)]
pxa2xx_pic: fixup initialisation

This is based on Dmitry Eremin-Solenikov's patch but simplified.

13 years agopxa2xx_timer: separate irq for pxa27x handling
Dmitry Eremin-Solenikov [Fri, 4 Mar 2011 00:40:59 +0000 (03:40 +0300)]
pxa2xx_timer: separate irq for pxa27x handling

First, sysbus_init_irq shan't be called on on-stack variables. Indeed,
it only stores a passed pointer in qdev and the stored irq is later
populated, so we get a nice write-to-stack bug.
Second, irq for pxa27x should probably be handled in a more gentler way,
as we should check if we have events to raise this irq.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agoMAINTAINERS: add LatticeMico32 maintainer
Michael Walle [Thu, 17 Feb 2011 22:45:18 +0000 (23:45 +0100)]
MAINTAINERS: add LatticeMico32 maintainer

Add me as the lm32-target and machines maintainer.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agoAdd lm32 target to configure
Michael Walle [Thu, 17 Feb 2011 22:45:17 +0000 (23:45 +0100)]
Add lm32 target to configure

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: opcode testsuite
Michael Walle [Thu, 17 Feb 2011 22:45:16 +0000 (23:45 +0100)]
lm32: opcode testsuite

This patch creates tests/lm32 directory and adds tests for every
LatticeMico32 opcode.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: todo and documentation
Michael Walle [Thu, 17 Feb 2011 22:45:15 +0000 (23:45 +0100)]
lm32: todo and documentation

This patch adds general target documentation and a todo list.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: EVR32 and uclinux BSP
Michael Walle [Thu, 17 Feb 2011 22:45:14 +0000 (23:45 +0100)]
lm32: EVR32 and uclinux BSP

This patch adds support for the following two BSPs:
 - LM32 EVR32 BSP (as used by RTEMS)
 - uclinux BSP by Theobroma Systems

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: support for creating device tree
Michael Walle [Thu, 17 Feb 2011 22:45:13 +0000 (23:45 +0100)]
lm32: support for creating device tree

This patch adds helper functions to create a ROM, which contains a hardware
description of a board. This is used in Theobromas LM32 Linux port.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: system control model
Michael Walle [Thu, 17 Feb 2011 22:45:12 +0000 (23:45 +0100)]
lm32: system control model

This patch add support for a system control block. It is supposed to
act as helper for the emulated program. E.g. shutting down the VM or
printing test results. This model is intended for testing purposes only and
doesn't fit to any real hardware. Therefore, it is not added to any board
by default. Instead a user has to add it explicitly with the '-device'
commandline parameter.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: uart model
Michael Walle [Thu, 17 Feb 2011 22:45:11 +0000 (23:45 +0100)]
lm32: uart model

This patch add support for the LatticeMico32 UART.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: timer model
Michael Walle [Thu, 17 Feb 2011 22:45:10 +0000 (23:45 +0100)]
lm32: timer model

This patch adds support for the LatticeMico32 system timer.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: pic and juart helper functions
Michael Walle [Thu, 17 Feb 2011 22:45:09 +0000 (23:45 +0100)]
lm32: pic and juart helper functions

This patch adds init functions for the PIC and JTAG UART commonly used
in the board initialization.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: juart model
Michael Walle [Thu, 17 Feb 2011 22:45:08 +0000 (23:45 +0100)]
lm32: juart model

This patch adds the JTAG UART model. It is accessed through special control
registers and opcodes. Therefore the translation uses callbacks to this
model.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: interrupt controller model
Michael Walle [Thu, 17 Feb 2011 22:45:07 +0000 (23:45 +0100)]
lm32: interrupt controller model

This patch adds the interrupt controller of the lm32. Because the PIC is
accessed through special control registers and opcodes, there are callbacks
from the lm32 translation code to this model.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: gdbstub support
Michael Walle [Thu, 17 Feb 2011 22:45:06 +0000 (23:45 +0100)]
lm32: gdbstub support

This patch adds lm32 support to the gdbstub.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: machine state loading/saving
Michael Walle [Thu, 17 Feb 2011 22:45:05 +0000 (23:45 +0100)]
lm32: machine state loading/saving

This patch adds support for saving and loading the processor state.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: translation code helper
Michael Walle [Thu, 17 Feb 2011 22:45:04 +0000 (23:45 +0100)]
lm32: translation code helper

This patch adds translation helper functions.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agolm32: translation routines
Michael Walle [Thu, 17 Feb 2011 22:45:03 +0000 (23:45 +0100)]
lm32: translation routines

This patch adds the main translation routine. All opcodes of the
LatticeMico32 processor are supported and translated to TCG ops.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agoLatticeMico32 target support
Michael Walle [Thu, 17 Feb 2011 22:45:02 +0000 (23:45 +0100)]
LatticeMico32 target support

This patch adds support for the LatticeMico32 softcore processor by Lattice
Semiconductor.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agotarget-arm: Implement a minimal set of cp14 debug registers
Peter Maydell [Tue, 22 Feb 2011 18:19:43 +0000 (18:19 +0000)]
target-arm: Implement a minimal set of cp14 debug registers

Newer ARM kernels try to probe for whether the CPU has hardware breakpoint
support. For this to work QEMU has to implement a minimal set of the cp14
debug registers. The architecture requires v7 cores to implement debug
and so there is no defined way to report its absence; however in practice
returning a zero DBGDIDR (ie with a reserved value for "debug architecture
version") should cause well-written hw debug users to do the right thing.
We also implement DBGDRAR and DBGDSAR as RAZ, indicating no memory mapped
debug components.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Use TCG temporary leak debugging facilities
Peter Maydell [Sun, 6 Mar 2011 21:39:55 +0000 (21:39 +0000)]
target-arm: Use TCG temporary leak debugging facilities

Use the new TCG temporary leak debugging facilities to
check that each ARM instruction does not leak temporaries.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Remove ad-hoc leak checking code
Peter Maydell [Sun, 6 Mar 2011 21:39:54 +0000 (21:39 +0000)]
target-arm: Remove ad-hoc leak checking code

This commit removes the ad-hoc resource leak checking code from
target-arm. This includes replacing all uses of new_tmp() with
tcg_temp_new_i32() and all uses of dead_tmp() with
tcg_temp_free_i32().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotcg: Add support for debugging leakage of temporaries
Peter Maydell [Sun, 6 Mar 2011 21:39:53 +0000 (21:39 +0000)]
tcg: Add support for debugging leakage of temporaries

Add support (if CONFIG_DEBUG_TCG is defined) for debugging leakage
of temporary variables. Generally any temporaries created by
a target while it is translating an instruction should be freed
by the end of that instruction; otherwise carefully crafted
guest code could cause TCG to run out of temporaries and assert.
By calling tcg_check_temp_count() after each instruction we can
check that we are not leaking temporaries in this way.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Integrate secondary CPU reset in arm_boot
Adam Lackorzynski [Sat, 5 Mar 2011 12:51:45 +0000 (13:51 +0100)]
target-arm: Integrate secondary CPU reset in arm_boot

Integrate secondary CPU reset into arm_boot, removing it from realview.c.
On non-Linux systems secondary CPUs start with the same entry as the boot
CPU.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Implement cp15 VA->PA translation
Adam Lackorzynski [Sat, 5 Mar 2011 12:51:44 +0000 (13:51 +0100)]
target-arm: Implement cp15 VA->PA translation

Implement VA->PA translations by cp15-c7 that went through unchanged
previously.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Fix soft interrupt in GIC distributor
Adam Lackorzynski [Sat, 5 Mar 2011 12:51:42 +0000 (13:51 +0100)]
target-arm: Fix soft interrupt in GIC distributor

Fix selection of target list filter mode.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Set carry flag correctly for Thumb2 ORNS
Peter Maydell [Sun, 6 Mar 2011 20:32:09 +0000 (20:32 +0000)]
target-arm: Set carry flag correctly for Thumb2 ORNS

The code for Thumb2 ORNS (or negated and set flags) was trashing
a TCG input register which was needed later for use in calculating
flags, with the effect that the carry flag was always set with
the wrong sense. Fix this by using the TCG orc op instead of
separate not and or ops.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoioport: Improve error output
Andreas Färber [Sun, 6 Mar 2011 14:48:13 +0000 (15:48 +0100)]
ioport: Improve error output

When failing due to conflicting I/O port registrations,
include the offending I/O port address in the message.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotracetool: Add optional argument to specify dtrace probe names
Jes Sorensen [Thu, 17 Feb 2011 12:26:05 +0000 (13:26 +0100)]
tracetool: Add optional argument to specify dtrace probe names

Optional feature allowing a user to generate the probe list to match
the name of the binary, in case they wish to install qemu under a
different name than qemu-{system,user},<arch>

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Stefan Hajnoczi <stefaha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Handle VMOV between two core and VFP single regs
Peter Maydell [Tue, 1 Mar 2011 17:35:19 +0000 (17:35 +0000)]
target-arm: Handle VMOV between two core and VFP single regs

Fix two bugs in the translation of the instructions VMOV sa,sb,rx,ry and
VMOV rx,ry,sa,sb (which copy between a pair of ARM core registers and a
pair of VFP single precision registers):

 * An incorrect condition meant these instruction patterns were being
   treated as load/store multiple, which resulted in the generation
   of bad code and a runtime segfault
 * The order of the core register pair was reversed so the values would
   go to the wrong registers

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agow32: Add support for curses
Stefan Weil [Sun, 27 Feb 2011 19:23:30 +0000 (20:23 +0100)]
w32: Add support for curses

MinGW optionally includes pdcurses, so add support for it.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Don't decode old cp15 WFI instructions on v7 cores
Peter Maydell [Fri, 25 Feb 2011 15:04:12 +0000 (15:04 +0000)]
target-arm: Don't decode old cp15 WFI instructions on v7 cores

In v7 of the ARM architecture, WFI (wait for interrupt) is a first-class
instruction, but in previous versions this functionality was provided
via a cp15 coprocessor register. Add correct feature checks to the
decoding of the cp15 WFI instructions so that they behave correctly
for newer cores. In particular, the old 0,c7,c8,2 encoding used on
ARM940 has been reused for VA-to-PA translation in v6 and v7.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agonet: Add the missing option declaration of "vhostforce"
Jason Wang [Fri, 25 Feb 2011 08:11:27 +0000 (16:11 +0800)]
net: Add the missing option declaration of "vhostforce"

Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agogt64xxx: remove savevm support
Juan Quintela [Thu, 24 Feb 2011 14:17:16 +0000 (15:17 +0100)]
gt64xxx: remove savevm support

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agovmstate: remove uninorth savevm code
Juan Quintela [Thu, 24 Feb 2011 14:17:15 +0000 (15:17 +0100)]
vmstate: remove uninorth savevm code

It was migrating the wrong structures, no way it would work

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agovmstate: remove grackle_pci savevm code
Juan Quintela [Thu, 24 Feb 2011 14:17:14 +0000 (15:17 +0100)]
vmstate: remove grackle_pci savevm code

It was migrating the wrong structures, no way it would work

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agonet: remove parse_host_src_port() function
Juan Quintela [Thu, 24 Feb 2011 11:22:10 +0000 (12:22 +0100)]
net: remove parse_host_src_port() function

It was deprecated, and it has no users.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agohw/sd.c: fix sd_set_cb() crash when bdrv == NULL
Aurelien Jarno [Sun, 6 Mar 2011 19:02:40 +0000 (20:02 +0100)]
hw/sd.c: fix sd_set_cb() crash when bdrv == NULL

sd_set_cb() calls bdrv_is_read_only() and bdrv_is_inserted() even if
no block driver is associated with the card reader.

This patch fixes the issues by not setting the irq in this case, this
fixes ARM versatile crash.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agonet: Use iov helper functions
Benjamin Poirier [Thu, 24 Feb 2011 00:57:21 +0000 (19:57 -0500)]
net: Use iov helper functions

Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agodocs: Update stderr and simple backend, add systemtap backend
Stefan Hajnoczi [Wed, 23 Feb 2011 14:00:21 +0000 (14:00 +0000)]
docs: Update stderr and simple backend, add systemtap backend

The following additions to the tracing documentation are included:

1. Move "stderr" backend documentation to top-level and out of "simple"
   backend.  Include hints on when this backend is useful.

2. Document the "simple" backend thread-safety limitation.

3. Document the "dtrace" backend for SystemTap.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agosimpletrace: Make simpletrace.py a Python module
Stefan Hajnoczi [Tue, 22 Feb 2011 13:59:41 +0000 (13:59 +0000)]
simpletrace: Make simpletrace.py a Python module

The simpletrace.py script pretty-prints a binary trace file.  Most of
the code can be reused by trace file analysis scripts, so turn it into a
module.

Here is an example script that uses the new simpletrace module:

  #!/usr/bin/env python
  # Print virtqueue elements that were never returned to the guest.

  import simpletrace

  class VirtqueueRequestTracker(simpletrace.Analyzer):
      def __init__(self):
          self.elems = set()

      def virtqueue_pop(self, vq, elem, in_num, out_num):
          self.elems.add(elem)

      def virtqueue_fill(self, vq, elem, length, idx):
          self.elems.remove(elem)

      def end(self):
          for elem in self.elems:
              print hex(elem)

  simpletrace.run(VirtqueueRequestTracker())

The simpletrace API is based around the Analyzer class.  Users implement
an analyzer subclass and add methods for trace events they want to
process.  A catchall() method is invoked for trace events which do not
have dedicated methods.  Finally, there are also begin() and end()
methods like in sed that can be used to perform setup or print
statistics at the end.

A binary trace file is processed either with:

  simpletrace.run(analyzer) # uses command-line args

or with:

  simpletrace.process('path/to/trace-events',
                      'path/to/trace-file',
                      analyzer)

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agolinux-user: Fix large seeks by 32 bit guest on 64 bit host
Peter Maydell [Tue, 22 Feb 2011 13:02:26 +0000 (13:02 +0000)]
linux-user: Fix large seeks by 32 bit guest on 64 bit host

When emulating a 32 bit Linux user-mode program on a 64 bit target
we implement the llseek syscall in terms of lseek. Correct a bug
which meant we were silently casting the result of host lseek()
to a 32 bit integer as it passed through get_errno() and thus
throwing away the top half.

We also don't try to store the result back to userspace unless
the seek succeeded; this matches the kernel behaviour.

Thanks to Eoghan Sherry for identifying the problem and suggesting
a solution.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agohw/realview: Wire up the MMC card status
Peter Maydell [Mon, 21 Feb 2011 20:57:53 +0000 (20:57 +0000)]
hw/realview: Wire up the MMC card status

Instantiate the three PL061 GPIO modules the realview boards have.
Connect the MMC card status outputs of the PL181 MMC controller
to both the system registers and the GPIO module which handles
internal devices.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agohw/irq: Add qemu_irq_split() so one GPIO output can feed two inputs
Peter Maydell [Mon, 21 Feb 2011 20:57:52 +0000 (20:57 +0000)]
hw/irq: Add qemu_irq_split() so one GPIO output can feed two inputs

Add a qemu_irq_split() function which allows a board to wire a single
GPIO output up to two GPIO inputs. This is needed for realview boards,
where the MMC card status is visible both in a system register and
via a PL061 GPIO module.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agohw/pl061.c: Implement ARM PL061 as well as Luminary one
Peter Maydell [Mon, 21 Feb 2011 20:57:51 +0000 (20:57 +0000)]
hw/pl061.c: Implement ARM PL061 as well as Luminary one

ARM's PL061 has a different set of ID registers to the one in the
Luminary Stellaris; implement this so that the Linux driver can
identify the Realview PBX PL061 correctly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agohw/arm_sysctl.c: Wire MCI register MMC card status bits to GPIO inputs
Peter Maydell [Mon, 21 Feb 2011 20:57:50 +0000 (20:57 +0000)]
hw/arm_sysctl.c: Wire MCI register MMC card status bits to GPIO inputs

Implement some GPIO inputs which a board can connect up to set the
MMC card status bits in the MCI register.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agohw/pl181: Implement GPIO output pins for card status
Peter Maydell [Mon, 21 Feb 2011 20:57:49 +0000 (20:57 +0000)]
hw/pl181: Implement GPIO output pins for card status

Add two GPIO output pins to the PL181 model to indicate the card
present and readonly status information. On ARM boards these usually
are reflected in a system register.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agolsi53c895a: Update dnad when skipping MSGOUT bytes
Stefan Hajnoczi [Wed, 26 Jan 2011 12:31:00 +0000 (12:31 +0000)]
lsi53c895a: Update dnad when skipping MSGOUT bytes

Update not only dbc but also dnad when skipping bytes during the MSGOUT
phase.  Previously only dbc was updated which is probably wrong and
could lead to bogus message codes being read.

Tested on Linux and Windows Server 2003.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agoWIN32: Add missing include for 'struct timeval', used in vnc.h
Hervé Poussineau [Sun, 6 Mar 2011 13:23:13 +0000 (13:23 +0000)]
WIN32: Add missing include for 'struct timeval', used in vnc.h

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agohw/pcnet.c: Fix EPROM contents to suit AMD netware drivers
Gerhard Wiesinger [Sat, 5 Mar 2011 12:44:39 +0000 (13:44 +0100)]
hw/pcnet.c: Fix EPROM contents to suit AMD netware drivers

bugfix under DOS for AMD netware driver:
AMD PCNTNW Ethernet MLID v3.10 (960115), network card not found

bugfix works well under DOS with:
1.) AMD NDIS driver v2.0.1
2.) AMD PCNTNW Ethernet MLID v3.10 (960115)
3.) Knoppix 6.2

Signed-off-by: Gerhard Wiesinger <lists@wiesinger.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agonet: fix qemu_can_send_packet logic
Vincent Palatin [Wed, 2 Mar 2011 22:25:02 +0000 (17:25 -0500)]
net: fix qemu_can_send_packet logic

If any of the clients is not ready to receive (ie it has a can_receive
callback and can_receive() returns false), we don't want to start
sending, else this client may miss/discard the packet.

I got this behaviour with the following setup :
the emulated machine is using an USB-ethernet adapter, it is connected
to the network using SLIRP and I'm dumping the traffic in a .pcap file.
As per the following command line :
-net nic,model=usb,vlan=1 -net user,vlan=1 -net dump,vlan=1,file=/tmp/pkt.pcap
Every time that two packets are coming in a row from the host, the
usb-net code will receive the first one, then returns 0 to can_receive
call since it has a 1 packet long queue. But as the dump code is always
ready to receive, qemu_can_send_packet will return true and the next
packet will discard the previous one in the usb-net code.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agonet: fix trace when debug is activated in slirp
Vincent Palatin [Wed, 2 Mar 2011 22:25:01 +0000 (17:25 -0500)]
net: fix trace when debug is activated in slirp

make the code compile correctly when DEBUG is activated.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agolinux-user: fix compile failure if !CONFIG_USE_GUEST_BASE
Peter Maydell [Thu, 10 Feb 2011 16:53:04 +0000 (16:53 +0000)]
linux-user: fix compile failure if !CONFIG_USE_GUEST_BASE

If CONFIG_USE_GUEST_BASE is not defined, gcc complains:
 linux-user/mmap.c:235: error: comparison of unsigned expression >= 0 is always true

because RESERVED_VA is #defined to 0. Since mmap_find_vma_reserved()
will never be called anyway if RESERVED_VA is always 0, fix this by
simply #ifdef'ing away the function and its callsite.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agovirtio-net: Fix lduw_p() pointer argument of wrong size
Stefan Hajnoczi [Thu, 3 Mar 2011 21:42:28 +0000 (21:42 +0000)]
virtio-net: Fix lduw_p() pointer argument of wrong size

A pointer to a size_t variable was passed as the void * pointer to
lduw_p() in virtio_net_receive().  Instead of acting on the 16-bit value
this caused failure on big-endian hosts.

Avoid this issue in the future by using stw_p() instead.  In general we
should use ld*_p() for loading from target memory and st*_p() for
storing to target memory anyway, not the other way around.

Also tighten up a correct use of lduw_p() when stw_p() should be used
instead in virtio_net_get_config().

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-sh4: move intr_at_halt out of cpu_halted()
Aurelien Jarno [Thu, 24 Feb 2011 11:31:41 +0000 (12:31 +0100)]
target-sh4: move intr_at_halt out of cpu_halted()

All targets except SH4 have the same cpu_halted() routine, and it has
only one caller. It is therefore a good candidate for inlining.

The difference is the handling of the intr_at_halt, which is necessary
to ignore SR.BL when sleeping. Move intr_at_halt handling out of it, by
setting this variable while executing the sleep instruction, and
clearing it when the CPU has been woken-up by an interrupt, whatever the
state of SR.BL. Also rename this variable in_sleep.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agopxa2xx: port pxa2xx_rtc to using qdev/vmstate
Andrzej Zaborowski [Thu, 3 Mar 2011 14:13:42 +0000 (15:13 +0100)]
pxa2xx: port pxa2xx_rtc to using qdev/vmstate

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agopxa2xx_dma: Get rid of a forward declaration.
Andrzej Zaborowski [Thu, 3 Mar 2011 14:06:03 +0000 (15:06 +0100)]
pxa2xx_dma: Get rid of a forward declaration.

13 years agopxa2xx_dma: port to qdev/vmstate
Andrzej Zaborowski [Thu, 3 Mar 2011 14:04:51 +0000 (15:04 +0100)]
pxa2xx_dma: port to qdev/vmstate

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agovmstate: move VMSTATE_PCIE_AER_ERRS to hw/hw.h
Dmitry Eremin-Solenikov [Sun, 20 Feb 2011 13:50:35 +0000 (16:50 +0300)]
vmstate: move VMSTATE_PCIE_AER_ERRS to hw/hw.h

VMSTATE_PCIE_AER_ERRS is indeed useful for other emulation drivers.
Move it to hw/hw.h under the name of VMSTATE_STRUCT_VARRAY_POINTER_UINT16.
Also add VMSTATE_STRUCT_VARRAY_POINTER_INT32 which is more or less
the same as _UINT16 macro, except the fact it uses int32_t internally.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agopxa2xx_dma: drop unused pxa2xx_dma_handler_t/handler field
Dmitry Eremin-Solenikov [Sun, 20 Feb 2011 13:50:36 +0000 (16:50 +0300)]
pxa2xx_dma: drop unused pxa2xx_dma_handler_t/handler field

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agopxa2xx_timer: Store relevant irq line in each timer.
Andrzej Zaborowski [Thu, 3 Mar 2011 13:24:25 +0000 (14:24 +0100)]
pxa2xx_timer: Store relevant irq line in each timer.

13 years agopxa2xx_timer: switch to using qdev/vmstate
Dmitry Eremin-Solenikov [Thu, 3 Mar 2011 13:14:44 +0000 (14:14 +0100)]
pxa2xx_timer: switch to using qdev/vmstate

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agopxa2xx_timer: change info struct name to comply with guidelines
Dmitry Eremin-Solenikov [Sun, 20 Feb 2011 13:50:33 +0000 (16:50 +0300)]
pxa2xx_timer: change info struct name to comply with guidelines

It should be PXA2xxTimerInfo, not pxa2xx_timer_info. Replace all
occurences of old name with the new one.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agopxa2xx_pic: Set base address for sysbus device.
Andrzej Zaborowski [Thu, 3 Mar 2011 02:43:40 +0000 (03:43 +0100)]
pxa2xx_pic: Set base address for sysbus device.

Thid device's registration was broken since
e1f8c729fa890c67bb4532f22c22ace6fb0e1aaf, this should fix it.

13 years agovmstate: add VMSTATE_STRUCT_ARRAY_TEST
Dmitry Eremin-Solenikov [Thu, 3 Mar 2011 02:34:01 +0000 (03:34 +0100)]
vmstate: add VMSTATE_STRUCT_ARRAY_TEST

This is a _TEST variant of VMSTATE_STRUCT_ARRAY, necessary e.g.
for future patch changing pxa2xx_timer to use vmstate.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agomicroblaze: Correct copy+paste:o in defconfigs
Edgar E. Iglesias [Tue, 1 Mar 2011 21:17:52 +0000 (22:17 +0100)]
microblaze: Correct copy+paste:o in defconfigs

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agoHACKING: Update status of format checking
Stefan Weil [Fri, 25 Feb 2011 22:30:20 +0000 (16:30 -0600)]
HACKING: Update status of format checking

Hopefully all functions with printf like arguments now use format checking.

This was tested with default build configuration on linux
and windows hosts (including some cross compilations),
so chances are good that there remain few (if any) functions
without format checking.

Therefore the last comment in HACKING is no longer valid but misleading.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: fix a memory leak in threaded vnc server
Corentin Chary [Fri, 25 Feb 2011 21:54:53 +0000 (22:54 +0100)]
vnc: fix a memory leak in threaded vnc server

VncJobQueue's buffer is intended to be used for
as the output buffer for all operations in this queue,
but unfortunatly.

vnc_async_encoding_start() is in charge of setting this
buffer as the current output buffer, but
vnc_async_encoding_end() was not writting the changes back
to VncJobQueue, resulting in a big and ugly memleak.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoUse sigwait instead of sigwaitinfo.
Tristan Gingold [Fri, 18 Feb 2011 13:17:16 +0000 (14:17 +0100)]
Use sigwait instead of sigwaitinfo.

Fix compilation failure on Darwin.

Signed-off-by: Tristan Gingold <gingold@adacore.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agobitops: fix error on OpenBSD and mingw32
Blue Swirl [Fri, 25 Feb 2011 17:21:22 +0000 (17:21 +0000)]
bitops: fix error on OpenBSD and mingw32

Fix this error:
  CC    bitops.o
In file included from /src/qemu/bitops.c:14:
/src/qemu/bitops.h:69: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'unsigned'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agobitops: fix test_and_change_bit()
Corentin Chary [Thu, 24 Feb 2011 22:47:08 +0000 (23:47 +0100)]
bitops: fix test_and_change_bit()

./bitops.h:192: warning: ‘old’ is used uninitialized in this function

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoslirp: Remove some type casts caused by bad declaration of x.tp_buf
Stefan Weil [Wed, 23 Feb 2011 18:40:14 +0000 (19:40 +0100)]
slirp: Remove some type casts caused by bad declaration of x.tp_buf

x.tp_buf was declared as a uint8_t array, but always used as
a char array (which needed a lot of type casts).

The patch includes these changes:

* Fix declaration of x.tp_buf and remove all type casts.

* Use offsetof() to get the offset of x.tp_buf.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoFixing tap adapter for win32
Pavel Dovgaluk [Mon, 21 Feb 2011 11:47:50 +0000 (14:47 +0300)]
Fixing tap adapter for win32

   This fix allows connection of internal VLAN to the external TAP interface.
If tap_win32_write function always returns 0, the TAP network interface
in QEMU is disabled.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoFixing network over sockets implementation for win32
Pavel Dovgaluk [Mon, 21 Feb 2011 11:46:44 +0000 (14:46 +0300)]
Fixing network over sockets implementation for win32

  MSDN includes the following in WSAEALREADY error description for connect()
function: "To preserve backward compatibility, this error is reported as
WSAEINVAL to Winsock applications that link to either Winsock.dll or
Wsock32.dll". So check of this error code was added to allow network
connections through the sockets in Windows.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agopxa2xx_pic: update to use qdev
Dmitry Eremin-Solenikov [Fri, 25 Feb 2011 11:13:38 +0000 (12:13 +0100)]
pxa2xx_pic: update to use qdev

Use qdev/sysbus framework to handle pxa2xx-pic. Instead of exposing IRQs
via array, reference them via qdev_get_gpio_in().

Patch has been modified by the committer.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agomst_fpga: correct irq level settings
Dmitry Eremin-Solenikov [Wed, 16 Feb 2011 13:22:33 +0000 (16:22 +0300)]
mst_fpga: correct irq level settings

Final corrections for IRQ levels that are set by mst_fpga:

* Don't retranslate IRQ if previously IRQ was masked.
* After setting or clearing IRQs through register, apply mask
  before setting parent IRQ level.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agoui/vnc-enc-tight.c: Fix compile failure if CONFIG_VNC_JPEG not defined
Peter Maydell [Thu, 24 Feb 2011 16:04:22 +0000 (16:04 +0000)]
ui/vnc-enc-tight.c: Fix compile failure if CONFIG_VNC_JPEG not defined

Add some missing #ifdefs to fix compilation failures in the !CONFIG_VNC_JPEG
case introduced by commit ce702e93.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtio-serial: kill VirtIOSerialDevice
Gerd Hoffmann [Thu, 24 Feb 2011 05:44:12 +0000 (11:14 +0530)]
virtio-serial: kill VirtIOSerialDevice

VirtIOSerialDevice is like VirtIOSerialPort with just the first two
fields, which makes it pretty pointless.  Using VirtIOSerialPort
directly works equally well and is less confusing.

[Amit: - rebase
       - rename 'dev' to 'port' in function params in virtio-serial.h ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd TAGS and *~ to .gitignore
David Gibson [Thu, 24 Feb 2011 05:34:59 +0000 (16:34 +1100)]
Add TAGS and *~ to .gitignore

Add the etags output generated by "make TAGS" and editor backup files
to .gitignore.

This patch has previously appeared in my series of patches to add
pSeries emulation support.  However, it obviously has no real
connection to that, and can be applied seperately.

Please apply.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agotarget-arm: fix support for VRSQRTE.
Christophe Lyon [Mon, 21 Feb 2011 16:38:48 +0000 (17:38 +0100)]
target-arm: fix support for VRSQRTE.

Now use the same algorithm as described in the ARM ARM.

Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: fix support for VRECPE.
Christophe Lyon [Mon, 21 Feb 2011 16:38:47 +0000 (17:38 +0100)]
target-arm: fix support for VRECPE.

Now use the same algorithm as described in the ARM ARM.

Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agotarget-arm: Introduce float64_256 and float64_512 constants.
Christophe Lyon [Mon, 21 Feb 2011 16:38:46 +0000 (17:38 +0100)]
target-arm: Introduce float64_256 and float64_512 constants.

These two constants will be used by helper functions such as recpe_f32
and rsqrte_f32.

Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agosoftfloat: add _set_sign(), _infinity and _half for 32 and 64 bits floats.
Christophe Lyon [Mon, 21 Feb 2011 16:38:45 +0000 (17:38 +0100)]
softfloat: add _set_sign(), _infinity and _half for 32 and 64 bits floats.

These constants and utility function are needed to implement some
helpers. Defining constants avoids the need to re-compute them at
runtime.

Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agosoftfloat: move all default NaN definitions to softfloat.h.
Christophe Lyon [Mon, 21 Feb 2011 16:38:44 +0000 (17:38 +0100)]
softfloat: move all default NaN definitions to softfloat.h.

These special values are needed to implement some helper functions,
which return/use these values in some cases.

Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agohw/sd.c: Add missing state change for SD_STATUS, SEND_NUM_WR_BLOCKS
Peter Maydell [Fri, 18 Feb 2011 13:39:00 +0000 (13:39 +0000)]
hw/sd.c: Add missing state change for SD_STATUS, SEND_NUM_WR_BLOCKS

The SD_STATUS and SEND_NUM_WR_BLOCKS commands are supposed to cause
the card to send data back to the host. However sd.c was missing the
state change to sd_sendingdata_state for these commands, with the effect
that the Linux driver would either hang indefinitely waiting for
nonexistent data (pl181) or read zeroes and provoke a qemu warning
message (omap).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
13 years agovnc: Fix fatal crash with vnc reverse mode
Stefan Weil [Wed, 16 Feb 2011 19:48:00 +0000 (20:48 +0100)]
vnc: Fix fatal crash with vnc reverse mode

Reverse mode is unusable:

qemu -vnc localhost:5500,reverse

crashes in vnc_refresh_server_surface because some pointers are NULL.

Fix this by calling vnc_dpy_resize (which initializes these pointers)
before calling vnc_refresh.

Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: add a non-adaptive option
Corentin Chary [Fri, 4 Feb 2011 08:06:08 +0000 (09:06 +0100)]
vnc: add a non-adaptive option

This option allow to disable adaptive behaviors in some encodings.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: tight: tweak adaptive tight settings
Corentin Chary [Fri, 4 Feb 2011 08:06:07 +0000 (09:06 +0100)]
vnc: tight: tweak adaptive tight settings

The force_jpeg threshold was too low.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: don't try to send bigger updates that client height
Corentin Chary [Fri, 4 Feb 2011 08:06:06 +0000 (09:06 +0100)]
vnc: don't try to send bigger updates that client height

Respect client size if it doesn't not support desktop resizing.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: use the new generic bitmap functions
Corentin Chary [Fri, 4 Feb 2011 08:06:05 +0000 (09:06 +0100)]
vnc: use the new generic bitmap functions

Switch to bitmap.h and bitops.h instead of redefining our own bitmap
helpers.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agobitmap: add a generic bitmap and bitops library
Corentin Chary [Fri, 4 Feb 2011 08:06:04 +0000 (09:06 +0100)]
bitmap: add a generic bitmap and bitops library

Add most used bitmap and bitops functions into bitmap.c and bitops.c.
Theses functions are mostly copied from Linux kernel source.

Some of these functions are already redefined in the VNC server. Some
of them could be used for some block stuff. The yet yo be submitted
NUMA work also need bitmaps.

bitops_ffsl() and bitops_flsl() are here because bitops/bitmap works
on unsigned long, not int, and we can't use current code because:
* ffs only works on int
* qemu_fls only works on int
* ffsl is a GNU extension

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: fix lossy rect refreshing
Corentin Chary [Fri, 4 Feb 2011 08:06:03 +0000 (09:06 +0100)]
vnc: fix lossy rect refreshing

The for loop in send_lossy_rect was totally wrong, and we can't
call vnc_set_bits() because it does not really do what it should.
Use vnc_set_bit() directly instead.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: fix uint8_t comparisons with negative values
Corentin Chary [Fri, 4 Feb 2011 08:06:02 +0000 (09:06 +0100)]
vnc: fix uint8_t comparisons with negative values

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: Add ZRLE and ZYWRLE encodings.
Corentin Chary [Fri, 4 Feb 2011 08:06:01 +0000 (09:06 +0100)]
vnc: Add ZRLE and ZYWRLE encodings.

Add ZRLE [1] and ZYWRLE [2] encodings. The code is inspire^W stolen
from libvncserver (again), but have been rewriten to match QEMU coding
style.

[1] http://www.realvnc.com/docs/rfbproto.pdf
[2] http://micro-vnc.jp/research/remote_desktop_ng/ZYWRLE/publications/

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: palette: and fill and color calls.
Corentin Chary [Fri, 4 Feb 2011 08:06:00 +0000 (09:06 +0100)]
vnc: palette: and fill and color calls.

These two helpers are needed for zrle and zywrle.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: palette: add palette_init calls
Corentin Chary [Fri, 4 Feb 2011 08:05:59 +0000 (09:05 +0100)]
vnc: palette: add palette_init calls

This allow to use palette on the stack instead of always
allocating them.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: palette: use a pool to reduce memory allocations
Corentin Chary [Fri, 4 Feb 2011 08:05:58 +0000 (09:05 +0100)]
vnc: palette: use a pool to reduce memory allocations

We now that the palette will never have more than 256
elements. Let's use a pool to reduce malloc calls.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: tight: use the update frequency to choose between lossy and lossless
Corentin Chary [Fri, 4 Feb 2011 08:05:57 +0000 (09:05 +0100)]
vnc: tight: use the update frequency to choose between lossy and lossless

Use the new update frequency infrastructure to use jpeg for regions with
high update frequency.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovnc: refresh lossy rect after a given timeout
Corentin Chary [Fri, 4 Feb 2011 08:05:56 +0000 (09:05 +0100)]
vnc: refresh lossy rect after a given timeout

If an adaptive encoding has choosen to send a lossy update
based on the result of vnc_update_freq(), then it should advertise
it with vnc_sent_lossy_rect(). This will allow to automatically refresh
this rect once it's static again.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>