sdk/emulator/qemu.git
14 years agoQJSON: Introduce qobject_from_jsonv()
Luiz Capitulino [Thu, 19 Nov 2009 01:05:24 +0000 (23:05 -0200)]
QJSON: Introduce qobject_from_jsonv()

It accepts a va_list and will be used by QError. Also simplifies
the code a little, as the other qobject_from_() functions can
use it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agofix I2C slave addressing
Juha Riihimäki [Mon, 8 Jun 2009 06:27:19 +0000 (09:27 +0300)]
fix I2C slave addressing

With the recent device handling changes the I2C slave addressing code
was broken. With current code, if a slave with the correct address is

not found on the bus the last scanned slave on the bus will be
addressed. This is wrong. Please find attached a patch to fix it.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Acked-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix qdev property type definition for isa serial/parallel devices
Gerd Hoffmann [Tue, 17 Nov 2009 10:28:41 +0000 (11:28 +0100)]
Fix qdev property type definition for isa serial/parallel devices

Use the correct qdev property type for these devices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix qemu_malloc/qemu_free use in rtl8139.c
Jean-Christophe DUBOIS [Sun, 15 Nov 2009 18:18:20 +0000 (19:18 +0100)]
Fix qemu_malloc/qemu_free use in rtl8139.c

rtl8139.c is using malloc()/free() instead of qemu_malloc()/qemu_free().
Fix it.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix free use in xen_backend.c
Jean-Christophe DUBOIS [Sun, 15 Nov 2009 18:18:19 +0000 (19:18 +0100)]
Fix free use in xen_backend.c

xen_backend.c is using qemu_free() instead of free().
Fix it.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix qemu_free use in scsi-generic.c
Jean-Christophe DUBOIS [Sun, 15 Nov 2009 18:18:18 +0000 (19:18 +0100)]
Fix qemu_free use in scsi-generic.c

scsi-generic.c is using free() instead of qemu_free().
Fix it.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix qemu_free use in nseries.c
Jean-Christophe DUBOIS [Sun, 15 Nov 2009 18:18:17 +0000 (19:18 +0100)]
Fix qemu_free use in nseries.c

nseries.c is using free() instead of qemu_free().
Fix it.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix qemu_free use in bt-l2cap.c
Jean-Christophe DUBOIS [Sun, 15 Nov 2009 18:18:16 +0000 (19:18 +0100)]
Fix qemu_free use in bt-l2cap.c

bt-l2cap.c is using free() instead of qemu_free().
Fix it.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix qemu_free use in nand.c
Jean-Christophe DUBOIS [Sun, 15 Nov 2009 18:18:15 +0000 (19:18 +0100)]
Fix qemu_free use in nand.c

nand.c is using free() instead of qemu_free().
Fix it.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix qemu_free use in baum.c
Jean-Christophe DUBOIS [Sun, 15 Nov 2009 18:18:14 +0000 (19:18 +0100)]
Fix qemu_free use in baum.c

baum.c is using free() instead of qemu_free().
Fix it.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix qemu_free use in acpi.c
Jean-Christophe DUBOIS [Sun, 15 Nov 2009 18:18:13 +0000 (19:18 +0100)]
Fix qemu_free use in acpi.c

acpi.c is using free() instead of qemu_free().
Fix it.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopci: move apb specific stuff to apb_pci.c
Michael S. Tsirkin [Wed, 11 Nov 2009 12:33:54 +0000 (14:33 +0200)]
pci: move apb specific stuff to apb_pci.c

pci code had a TODO to move apb specific
pci bridge initialization to apb_pci.
Implement this and remove the TODO.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoconfigure: use correct cflags in compiler checks
Michael S. Tsirkin [Wed, 11 Nov 2009 11:50:09 +0000 (13:50 +0200)]
configure: use correct cflags in compiler checks

linux-user build on fedora 11 breaks because fallocate
is broken on that system if -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
are specified, which is what QEMU uses.

We do have a configure check to catch this and disable fallocate,
however, it turns out that default QEMU_CFLAGS/LDFLAGS were assigned in
script *after* all compiler checks: so during checks we were not running
compiler with same flags that we used for build later.

Fix this by moving QEMU_CFLAGS to before compiler checks, and using
comple_prog when checking for fallocate.  This also fixes the fact that
we do some compiler checks while assigning the flags, right below a
comment that says "no cc tests beyond this point".

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovga-pci: Fix access to linear framebuffer
Stefan Weil [Mon, 16 Nov 2009 20:11:38 +0000 (21:11 +0100)]
vga-pci: Fix access to linear framebuffer

Anthony Liguori's patch fixes the problems with
vga display in graphical mode and SeaBIOS.

I only adapted some values for vga-pci.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoMakefile: Remove unneeded prerequisites
Stefan Weil [Thu, 12 Nov 2009 18:08:56 +0000 (19:08 +0100)]
Makefile: Remove unneeded prerequisites

Thanks to f527c57935e22b56952d1ed1af36070b682ecf70
(fix parallel build), these prerequisites
are redundant now and can be removed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoMerge commit 'mst/for_anthony' into mst
Anthony Liguori [Tue, 1 Dec 2009 17:54:39 +0000 (11:54 -0600)]
Merge commit 'mst/for_anthony' into mst

14 years agomsix: clear pending bit of an unused vector
Michael S. Tsirkin [Wed, 25 Nov 2009 10:24:14 +0000 (12:24 +0200)]
msix: clear pending bit of an unused vector

PCI spec states:
if a masked vector has its Pending bit set, and the associated
underlying interrupt events are somehow satisfied (usually by software
though the exact manner is function-specific), the function must clear
the Pending bit, to avoid sending a spurious interrupt message later
when software unmasks the vector.

In our case this happens if vector becomes unused.
Clear pending bit in this case.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agomsix: fix reset value for enable bit
Michael S. Tsirkin [Wed, 25 Nov 2009 10:00:10 +0000 (12:00 +0200)]
msix: fix reset value for enable bit

On reset, we currently clear all bits in msix control register *except*
enable bit.  This is wrong: the spec says we should clear writeable
bits: function mask and enable bit.
Correct this.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agomsix: fix mask bit state after reset
Michael S. Tsirkin [Wed, 25 Nov 2009 09:41:48 +0000 (11:41 +0200)]
msix: fix mask bit state after reset

PCI spec states that mask bit must be 1 after reset.
Make it so.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agovirtio: do not reset msix state on soft reset
Michael S. Tsirkin [Tue, 24 Nov 2009 14:45:35 +0000 (16:45 +0200)]
virtio: do not reset msix state on soft reset

msix state is managed by OS, not the
driver, so it's wrong to touch it
on io from driver.
Mark all vectors unused instead.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agomsix: add helper to unuse all msix entries
Michael S. Tsirkin [Tue, 24 Nov 2009 14:44:15 +0000 (16:44 +0200)]
msix: add helper to unuse all msix entries

will be used by virtio on soft reset

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: convert goto into scope in bridge_filter
Michael S. Tsirkin [Thu, 12 Nov 2009 11:54:31 +0000 (13:54 +0200)]
pci: convert goto into scope in bridge_filter

goto into scope is evil. rearrange pci_bridge_filter
so that we always go to end of function on error.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
14 years agopci: pci bridge related clean up.
Isaku Yamahata [Thu, 12 Nov 2009 05:58:47 +0000 (14:58 +0900)]
pci: pci bridge related clean up.

- fix bridge prefetchable memory accesser to check 64bit or not.
- use pcibus_t consistently instead mixing pcibus_t and uint64_t.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: fix pci_config_get_io_base().
Isaku Yamahata [Thu, 12 Nov 2009 05:58:46 +0000 (14:58 +0900)]
pci: fix pci_config_get_io_base().

fix typo in pci_config_get_io_base().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: remove magic number, 256 in pci.c
Isaku Yamahata [Thu, 12 Nov 2009 05:58:45 +0000 (14:58 +0900)]
pci: remove magic number, 256 in pci.c

This patch replaces magic number, 256, with ARRAY_SIZE().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: split up up pci_update mappings
Michael S. Tsirkin [Thu, 12 Nov 2009 11:47:17 +0000 (13:47 +0200)]
pci: split up up pci_update mappings

Split bar address math into a separate function.
In particular, this gets rid of an ugly forward goto
into scope that we have there.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
14 years agopci: clean up of pci_update_mappings()
Isaku Yamahata [Thu, 12 Nov 2009 05:58:43 +0000 (14:58 +0900)]
pci: clean up of pci_update_mappings()

This patch converts r->size == 0 to !r_size.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: remove unused constants
Isaku Yamahata [Thu, 12 Nov 2009 05:58:42 +0000 (14:58 +0900)]
pci: remove unused constants

This patch removes unused constants committed by
fb23162885f7fd8cf7334bed22c25ac32c7d8b9d.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: move typedef, PCIHostState, PCIExpressHost to qemu-common.h.
Isaku Yamahata [Thu, 12 Nov 2009 05:58:41 +0000 (14:58 +0900)]
pci: move typedef, PCIHostState, PCIExpressHost to qemu-common.h.

This patch moves two typedefs, PCIHostState and PCIExpressHost to
qemu-common.h for consistency as PCIBus and PCIDevice are typedefed
in qemu-common.h.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: remove some unnecessary comment in pci.h
Isaku Yamahata [Thu, 12 Nov 2009 05:58:40 +0000 (14:58 +0900)]
pci: remove some unnecessary comment in pci.h

This patch removes some comment which should go into commit log
in pci.h.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: clean up of pci_init_wmask().
Isaku Yamahata [Thu, 12 Nov 2009 05:58:39 +0000 (14:58 +0900)]
pci: clean up of pci_init_wmask().

This patch replaces for loop by memset in pci_init_wmask().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: kill unnecessary included in pci.c
Isaku Yamahata [Thu, 12 Nov 2009 05:58:38 +0000 (14:58 +0900)]
pci: kill unnecessary included in pci.c

including pci_host.h isn't needed by pci.c.
This patch kills it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci_host: remove unnecessary & 0xff.
Isaku Yamahata [Thu, 12 Nov 2009 05:58:37 +0000 (14:58 +0900)]
pci_host: remove unnecessary & 0xff.

This patch removes unnecessary & 0xff in pci_dev_find_by_addr().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: s/pci_find_host_bus/pci_find_root_bus/g
Isaku Yamahata [Thu, 12 Nov 2009 05:58:36 +0000 (14:58 +0900)]
pci: s/pci_find_host_bus/pci_find_root_bus/g

This patch renames pci_find_host_bus() to pci_find_root_bus()
as suggested by "Michael S. Tsirkin" <mst@redhat.com>.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: remove pci_sub_bus() by open coding.
Isaku Yamahata [Thu, 12 Nov 2009 05:58:35 +0000 (14:58 +0900)]
pci: remove pci_sub_bus() by open coding.

Because pci_sub_bus() is used only once so eliminate it
by open coding as suggested by "Michael S. Tsirkin" <mst@redhat.com>.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: shorten pci_host_{conf, data}_register_xxx function a bit.
Isaku Yamahata [Thu, 12 Nov 2009 05:58:34 +0000 (14:58 +0900)]
pci: shorten pci_host_{conf, data}_register_xxx function a bit.

pci_host_data_register_io_memory and its variants are too long a bit.
So shorten them. Now they are
pci_host_{conf, data}_register_{mmio, mmio_noswap, ioport}()

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: rename (pci_/pcie_mmcfg_)addr_to_dev
Isaku Yamahata [Thu, 12 Nov 2009 11:17:23 +0000 (13:17 +0200)]
pci: rename (pci_/pcie_mmcfg_)addr_to_dev

This patch renames pci_addr_to_dev(), pcie_mmcfg_addr_to_dev()
to pci_dev_find_by_addr(), pcie_dev_find_by_mmcfg_addr()
as "Michael S. Tsirkin" <mst@redhat.com> suggested.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: remove pci_addr_to_config() by open code
Isaku Yamahata [Thu, 12 Nov 2009 05:58:32 +0000 (14:58 +0900)]
pci: remove pci_addr_to_config() by open code

This patch removes pci_addr_to_config() and open code it
as suggested by Michael S. Tsirkin <mst@redhat.com>.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: simplify (pci_/pcie_mmcfg_)data_read()
Michael S. Tsirkin [Thu, 12 Nov 2009 05:58:31 +0000 (14:58 +0900)]
pci: simplify (pci_/pcie_mmcfg_)data_read()

Remove switch on length: we don't care about
high bits for value, so just return all ones
if no device.  And add one assert().

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
14 years agopci: move pci_data_{read, write}() declaration from pci.h to pci_host.h
Isaku Yamahata [Thu, 12 Nov 2009 05:58:30 +0000 (14:58 +0900)]
pci: move pci_data_{read, write}() declaration from pci.h to pci_host.h

Now pci host stuff has been moved from pci.[hc] to pci_host.[hc]
so the declaration of pci_data_{read, write}() should be in
pci_host.h
This patch moves them from pci.h to pci_host.h for consistency.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: fix pci_info_device().
Isaku Yamahata [Thu, 12 Nov 2009 05:58:29 +0000 (14:58 +0900)]
pci: fix pci_info_device().

It printed wrong limit value of bridge.
This patch fixes it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agopci: pci.h cleanup: move out stuff not in pci.c
Michael S. Tsirkin [Wed, 11 Nov 2009 12:59:56 +0000 (14:59 +0200)]
pci: pci.h cleanup: move out stuff not in pci.c

pci.h declares some functions which aren't
defined in pci.h. Clean up moving things
to appropriate headers, and update all users.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agotcg: increase TCG_MAX_OP_SIZE to 192
Aurelien Jarno [Thu, 22 Oct 2009 00:36:27 +0000 (02:36 +0200)]
tcg: increase TCG_MAX_OP_SIZE to 192

This is needed on a MIPS host and a 64-bit cross-endian target.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: initial mips support
Aurelien Jarno [Sat, 17 Oct 2009 12:17:47 +0000 (14:17 +0200)]
tcg: initial mips support

Based on a patch from Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>

A few words about design choices:
* Two registers, at and t0, are reserved for TCG internal use. They are
  useful for bswap and 64-bit ops.
* Most ops supports a constant argument with value 0, which is actually
  mapped to the zero register.
* While the at register is available for constant loading, ops only
  support a limited range of constants. TCG does a better job doing the
  register allocation and constant loading by itself. There are plenty of
  registers available anyway.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: use physical address in lladdr
Aurelien Jarno [Mon, 30 Nov 2009 14:39:54 +0000 (15:39 +0100)]
target-mips: use physical address in lladdr

Currently the ll/sc instructions use the virtual address in both
user and system mode. Use the physical address insteead in system
mode.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: add a function to do virtual -> physical translations
Aurelien Jarno [Mon, 30 Nov 2009 00:39:22 +0000 (01:39 +0100)]
target-mips: add a function to do virtual -> physical translations

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: split code raising MMU exception in a separate function
Aurelien Jarno [Sun, 22 Nov 2009 12:41:18 +0000 (13:41 +0100)]
target-mips: split code raising MMU exception in a separate function

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: factorize load/store code in op_helper.c
Aurelien Jarno [Mon, 30 Nov 2009 14:32:47 +0000 (15:32 +0100)]
target-mips: factorize load/store code in op_helper.c

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix commit a167ba50851cdac2fa36633587e98c5956cd6b18
Aurelien Jarno [Mon, 30 Nov 2009 14:42:59 +0000 (15:42 +0100)]
Fix commit a167ba50851cdac2fa36633587e98c5956cd6b18

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoAdd support for GNU/kFreeBSD
Aurelien Jarno [Sun, 29 Nov 2009 17:00:41 +0000 (18:00 +0100)]
Add support for GNU/kFreeBSD

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoRevert "vga: do not resize the screen on hw_invalidate"
Aurelien Jarno [Fri, 27 Nov 2009 17:42:26 +0000 (18:42 +0100)]
Revert "vga: do not resize the screen on hw_invalidate"

This causes ctrl+alt+u or ctrl+alt+f to not work when windows hasn't been
resized first. Other graphic emulators do resize the screen on
hw_invalidate.

This reverts commit 0bd8246bfec1dfb2eb959f52db535572c0260f4c.

14 years agoMakefile: Fix spelling
Stefan Weil [Tue, 24 Nov 2009 09:20:49 +0000 (10:20 +0100)]
Makefile: Fix spelling

Replace defconfing -> defconfig

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: fix tcg_regset_{set,reset}_reg with more than 32 registers
Aurelien Jarno [Wed, 28 Oct 2009 21:44:34 +0000 (22:44 +0100)]
tcg: fix tcg_regset_{set,reset}_reg with more than 32 registers

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agocpu-all.h: fix cpu_get_real_ticks on mips host
Arnaud Patard [Sat, 11 Apr 2009 14:02:46 +0000 (16:02 +0200)]
cpu-all.h: fix cpu_get_real_ticks on mips host

Fix cpu_get_real_ticks:
- check should be done on __mips and not __mips_isa_rev
- linux kernels >= 2.6.25 are emulating the 2 needed rdhwr functions
  so it's safe to use rdhwr.

This is better than what's currently in but it doesn't mean it works nicely
Some tests needs to be done imho

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user: remove hardcoded value of _NSIG in signal.c
Arnaud Patard [Sun, 29 Mar 2009 23:18:20 +0000 (01:18 +0200)]
linux-user: remove hardcoded value of _NSIG in signal.c

In a bunch of places, 64 is used as value of _NSIG but it's wrong
at least on MIPS were _NSIG is 128.

Based on a patch from Arnaud Patard <arnaud.patard@rtp-net.org>

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg/ppc64,x86_64: fix constraints of op_qemu_st64
Aurelien Jarno [Wed, 4 Nov 2009 22:01:30 +0000 (23:01 +0100)]
tcg/ppc64,x86_64: fix constraints of op_qemu_st64

This op only takes two arguments, not two.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoAdd missing break.
Paul Brook [Tue, 24 Nov 2009 13:10:08 +0000 (13:10 +0000)]
Add missing break.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoUpdate SeaBIOS
Anthony Liguori [Mon, 23 Nov 2009 18:52:29 +0000 (12:52 -0600)]
Update SeaBIOS

This includes the following changes:

  42bc394 Make sure to reenable ata interrupts even on error.
  494dfc6 Move SeaBIOS post/boot stack to avoid conflict with gPXE.
  3133e38 Test for broken gcc -combine on FC12.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoARM atomic ops rewrite
Paul Brook [Sun, 22 Nov 2009 21:35:13 +0000 (21:35 +0000)]
ARM atomic ops rewrite

Implement ARMv6 atomic ops (ldrex/strex) using the same trick as PPC.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoARM RealView I2C
Paul Brook [Fri, 20 Nov 2009 00:45:54 +0000 (00:45 +0000)]
ARM RealView I2C

Add ARM Realview I2C host emulation.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoGPIO I2C rework
Paul Brook [Fri, 20 Nov 2009 23:37:15 +0000 (23:37 +0000)]
GPIO I2C rework

Reqrite bitbanging I2C implementation.  New code improves stop/start
condition handling, and gives more accurate input line level.

Introduce intermediate abstraction layer for I2C bitbanging that
is not connected via a GPIO port.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoDS1338 RTC
Paul Brook [Fri, 20 Nov 2009 00:21:33 +0000 (00:21 +0000)]
DS1338 RTC

Implement MAXIM SD1338 RTC+NVRAM.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoBCD cleanup
Paul Brook [Fri, 20 Nov 2009 00:03:47 +0000 (00:03 +0000)]
BCD cleanup

Combine multiple BCD implementations.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoMakefile dependencies for device configs
Paul Brook [Sun, 22 Nov 2009 16:25:30 +0000 (16:25 +0000)]
Makefile dependencies for device configs

Add makefile dependencies for target specific device configs.
These will copy the default config if none exists, obsoleting the old
configure time code.  If a config already exists but is older than the
default then print a warning.

Also remove config-devices.h.  Code does not and should not care which
devices are being built.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agotarget-mips: fix physical address type in MMU functions
Aurelien Jarno [Sun, 22 Nov 2009 13:37:04 +0000 (14:37 +0100)]
target-mips: fix physical address type in MMU functions

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years ago[WIN32] Enable -k option on Windows too
Hervé Poussineau [Sun, 22 Nov 2009 12:36:11 +0000 (13:36 +0100)]
[WIN32] Enable -k option on Windows too

There is no reason to have it disabled on this platform.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-mips: make CP0_LLAddr register CPU dependent
Aurelien Jarno [Sun, 22 Nov 2009 12:22:54 +0000 (13:22 +0100)]
target-mips: make CP0_LLAddr register CPU dependent

Depending on the CPU, CP0_LLAddr is either read-only or read-write,
and the returned value can be shifted by a variable amount of bits.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
14 years agotarget-mips: rename CP0_LLAddr into lladdr
Aurelien Jarno [Sun, 22 Nov 2009 12:08:14 +0000 (13:08 +0100)]
target-mips: rename CP0_LLAddr into lladdr

The variable CP0_LLAddr represent the full lladdr, not the actual
register value, which is only part of this value and depends on the
CPU.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoAllow build of linuxboot.S with old assemblers
Juergen Lock [Fri, 20 Nov 2009 22:37:57 +0000 (23:37 +0100)]
Allow build of linuxboot.S with old assemblers

In the spirit of ff56954baf9cfab5cbbe18d10b4a09e4a17f39a8, fix the
build of linuxboot.S with old as(1) (as found in some BSD base systems)
by emitting the bytes of the insn it doesn't like instead.

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoAvoid segfault on net_tap_init() failure
Juergen Lock [Fri, 20 Nov 2009 22:23:03 +0000 (23:23 +0100)]
Avoid segfault on net_tap_init() failure

Check for fd == -1 there.

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotap-bsd: handle ifname on FreeBSD hosts
Juergen Lock [Fri, 20 Nov 2009 22:31:55 +0000 (23:31 +0100)]
tap-bsd: handle ifname on FreeBSD hosts

Handle ifname on FreeBSD hosts; if no ifname is given, always start
the search from tap0.  (Simplified/cleaned up version of what has been
in the FreeBSD ports for a long time.)

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix tap breakage on BSD hosts (no IFF_VNET_HDR)
Juergen Lock [Fri, 20 Nov 2009 22:19:53 +0000 (23:19 +0100)]
Fix tap breakage on BSD hosts (no IFF_VNET_HDR)

net/tap-bsd.c was assuming IFF_VNET_HDR was always available, which
I think isn't true on any BSD.

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix OpenBSD build of qemu-io
Blue Swirl [Sat, 21 Nov 2009 09:06:46 +0000 (09:06 +0000)]
Fix OpenBSD build of qemu-io

GCC 3.3.5 generates warnings for static forward declarations of data, so
rearrange code to use static forward declarations of functions instead.

Use <getopt.h> for optind instead of local definition.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoconfigure: Fix spelling in comment and rework the comment
Stefan Weil [Mon, 16 Nov 2009 18:59:18 +0000 (19:59 +0100)]
configure: Fix spelling in comment and rework the comment

* Replace vill -> will.

* Comment was formatted to make it more readable
  and to conform to the coding standard, too.

* Description of foo="" was completed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-io: build on all platforms
Aurelien Jarno [Wed, 18 Nov 2009 15:14:09 +0000 (16:14 +0100)]
qemu-io: build on all platforms

Since c32d766af127f68bb75ba5689f2f5239227bf559, qemu-io should be
portable. It is currently built only on linux and mingw32.

This patch enables qemu-io on all platforms. Tested on FreeBSD.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoslirp: fix use-after-free
Mark McLoughlin [Fri, 20 Nov 2009 18:13:10 +0000 (18:13 +0000)]
slirp: fix use-after-free

460fec67ee introduced a use-after free in slirp.

Cc: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoARM PBX-A9 board support
Paul Brook [Thu, 19 Nov 2009 16:45:21 +0000 (16:45 +0000)]
ARM PBX-A9 board support

Implement ARM RealView PBX-A9 board support.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoARM Cortex-A9 cpu support
Paul Brook [Thu, 19 Nov 2009 16:45:20 +0000 (16:45 +0000)]
ARM Cortex-A9 cpu support

Basic Cortex-A9 support.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoARM FP16 support
Paul Brook [Thu, 19 Nov 2009 16:45:20 +0000 (16:45 +0000)]
ARM FP16 support

Implement the ARM VFP half precision floating point extensions.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agoBuilt network devices once
Paul Brook [Thu, 19 Nov 2009 16:42:45 +0000 (16:42 +0000)]
Built network devices once

Move some generic NICS into libhw, and build them for ARM targets.

Signed-off-by: Paul Brook <paul@codesourcery.com>
14 years agosb16: remove highspeed reset code
malc [Wed, 18 Nov 2009 16:17:03 +0000 (19:17 +0300)]
sb16: remove highspeed reset code

It was never enabled in any of the public builds anyway.

Noticed by Steve Grubb.

Signed-off-by: malc <av1474@comtv.ru>
14 years agoaudio: Remove conditional around sw which can not be NULL
malc [Wed, 18 Nov 2009 16:15:19 +0000 (19:15 +0300)]
audio: Remove conditional around sw which can not be NULL

Noticed by Steve Grubb.

Signed-off-by: malc <av1474@comtv.ru>
14 years agoaudio: link with -lpulse in addition to -lpulse-simple
Aurelien Jarno [Mon, 16 Nov 2009 16:52:03 +0000 (17:52 +0100)]
audio: link with -lpulse in addition to -lpulse-simple

Link with -lpulse in addition to -lpulse-simple, needed when --no-add-needed
is passed to the linker (gold default).

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix typo
Blue Swirl [Tue, 17 Nov 2009 21:27:18 +0000 (21:27 +0000)]
Fix typo

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix mingw32 build
Blue Swirl [Tue, 17 Nov 2009 21:00:38 +0000 (21:00 +0000)]
Fix mingw32 build

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoPrevent configuring for a user emulator on a different type of OS
Blue Swirl [Tue, 17 Nov 2009 20:52:56 +0000 (20:52 +0000)]
Prevent configuring for a user emulator on a different type of OS

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoAdd linuxboot to BLOBS
Alexander Graf [Thu, 12 Nov 2009 20:53:15 +0000 (21:53 +0100)]
Add linuxboot to BLOBS

We should install linuxboot.bin too, so let's add it to the to-be-installed
blobs.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoConvert linux bootrom to external rom and fw_cfg
Alexander Graf [Thu, 12 Nov 2009 20:53:14 +0000 (21:53 +0100)]
Convert linux bootrom to external rom and fw_cfg

We already have a working multiboot implementation that uses fw_cfg to get
its kernel module etc. data in int19 runtime now.

So what's missing is a working linux boot option rom. While at it I figured it
would be a good idea to take the opcode generator out of pc.c and instead use
a proper option rom, like we do with multiboot.

So here it is - an fw_cfg using option rom for -kernel with linux!

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoMove common option rom code to header file
Alexander Graf [Thu, 12 Nov 2009 20:53:13 +0000 (21:53 +0100)]
Move common option rom code to header file

We will have a linux boot option rom soon, so let's take all functionality
that might be useful for both to a header file that both roms can include.

That way we only have to write fw_cfg access code once.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoConvert multiboot to fw_cfg backed data storage
Alexander Graf [Thu, 12 Nov 2009 20:53:12 +0000 (21:53 +0100)]
Convert multiboot to fw_cfg backed data storage

Right now we load the guest kernel to RAM, fire off the BIOS, hope it
doesn't clobber memory and run an option rom that jumps into the kernel.

That breaks with SeaBIOS, as that clears memory. So let's read all
kernel, module etc. data using the fw_cfg interface when in the int19
handler.

This patch implements said mechanism for multiboot.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoIntroduce rom_copy
Alexander Graf [Thu, 12 Nov 2009 20:53:11 +0000 (21:53 +0100)]
Introduce rom_copy

We have several rom helpers currently, but none of them can get us
code that spans several roms into a pointer.

This patch introduces a function that copies over rom contents.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agofw_cfg: change cur_offset to 32 bits
Juan Quintela [Fri, 13 Nov 2009 10:59:20 +0000 (11:59 +0100)]
fw_cfg: change cur_offset to 32 bits

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoUpdate SeaBIOS to latest
Anthony Liguori [Tue, 17 Nov 2009 14:23:40 +0000 (08:23 -0600)]
Update SeaBIOS to latest

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd test suite for json marshalling
Anthony Liguori [Wed, 11 Nov 2009 19:16:03 +0000 (13:16 -0600)]
Add test suite for json marshalling

By reusing the qjson test suite.  After checking that we can demarshal, marshal
again and compared to the expected decoded value.  This doesn't work so well
for floats because they cannot be accurately represented in decimal but we
try our best.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoProvide marshalling mechanism for json
Anthony Liguori [Wed, 11 Nov 2009 18:01:22 +0000 (12:01 -0600)]
Provide marshalling mechanism for json

This introduces qobject_to_json which will convert a QObject to a JSON string
representation.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQDict: Introduce qdict_iter()
Luiz Capitulino [Tue, 13 Oct 2009 16:56:58 +0000 (13:56 -0300)]
QDict: Introduce qdict_iter()

This adds iterator support to QDict, it will be used by the
(to be introduced) QError module.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd a unit test for JSON support
Anthony Liguori [Wed, 11 Nov 2009 16:39:47 +0000 (10:39 -0600)]
Add a unit test for JSON support

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd a QObject JSON wrapper
Anthony Liguori [Wed, 11 Nov 2009 16:42:41 +0000 (10:42 -0600)]
Add a QObject JSON wrapper

This provides a QObject interface for creating QObjects from a JSON expression.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd a JSON parser
Anthony Liguori [Wed, 11 Nov 2009 16:39:23 +0000 (10:39 -0600)]
Add a JSON parser

This is the third and final stage of the JSON parser.  It parses lexical tokens
performing grammar validation and creating the final QObject representation.  It
uses a recursive decent parser.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd a JSON message boundary identifier
Anthony Liguori [Wed, 11 Nov 2009 16:38:59 +0000 (10:38 -0600)]
Add a JSON message boundary identifier

The second stage of our JSON parser is a simple state machine that identifies
individual JSON values by counting the levels of nesting of tokens.  It does
not perform grammar validation.  We use this to emit a full JSON value to the
parser.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>