sdk/emulator/qemu.git
15 years agofix use after free
Glauber Costa [Fri, 25 Sep 2009 12:30:57 +0000 (08:30 -0400)]
fix use after free

We are using the vs structure when it was just freed. Classic use after free,
fix it.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agounbreak usb pass-through on linux.
Gerd Hoffmann [Fri, 25 Sep 2009 14:55:28 +0000 (16:55 +0200)]
unbreak usb pass-through on linux.

Changes:
  * Re-add the 'dev->fd = fd;' line which the qdev patches dropped
    by mistake.
  * call qdev_init() so the newly created usb device is plugged into
    a usb port and thus actually visible to the guest.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoclean: remove ide/*.o files on clean
Juan Quintela [Mon, 21 Sep 2009 13:10:55 +0000 (15:10 +0200)]
clean: remove ide/*.o files on clean

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoARM host: fix generated blocks linking
Laurent Desnogues [Mon, 21 Sep 2009 12:27:59 +0000 (14:27 +0200)]
ARM host: fix generated blocks linking

This patch fixes the linking of generated blocks on an ARM host.
No need to say this brings a very nice speedup :-)

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoFix spelling in comment
Stefan Weil [Thu, 17 Sep 2009 17:06:53 +0000 (19:06 +0200)]
Fix spelling in comment

replace Convery -> Convert

Cc: Paul Brook <paul@codesourcery.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoSuppress some variants of English in comments
Stefan Weil [Thu, 24 Sep 2009 15:53:10 +0000 (17:53 +0200)]
Suppress some variants of English in comments

Replace surpress, supress by suppress.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agosparc64-8bit-asi
Igor V. Kovalenko [Wed, 23 Sep 2009 19:39:51 +0000 (23:39 +0400)]
sparc64-8bit-asi

Sparc64 alternate space load/store helpers expect 8 bit ASI value,
while wrasi implementation sign-extends ASI operand causing
for example 0x80 to appear as 0xFFFFFF80. Resulting value falls
out of switch in helpers and causes obscure load/store faults.

- correct wrasi by masking lower 8 bits of xor result
- use lower 8 bits of ASI register in helpers

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agotarget-mips: remove MAX_OP_PER_INSTR workaround
Aurelien Jarno [Tue, 22 Sep 2009 21:29:44 +0000 (23:29 +0200)]
target-mips: remove MAX_OP_PER_INSTR workaround

Now that MAX_OP_PER_INSTR has been increased to a safer value, removed
the target-mips specific workaround.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoexec-all.h: increase OPC_BUF_SIZE
Aurelien Jarno [Tue, 22 Sep 2009 21:31:04 +0000 (23:31 +0200)]
exec-all.h: increase OPC_BUF_SIZE

Increase OPC_BUF_SIZE to compensate the MAX_OP_PER_INSTR's increase.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoexec-all.h: increase MAX_OP_PER_INSTR to 96 from 64
Aurelien Jarno [Tue, 22 Sep 2009 21:26:21 +0000 (23:26 +0200)]
exec-all.h: increase MAX_OP_PER_INSTR to 96 from 64

The x86_64 ror instruction on a 32-bit host can generate up to 77 TCG
ops. Some more space should be left for opc that are added at the end
of the translation.

Thanks to Laurent Desnogues for the debugging help.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoThis files are compiled in libqemu.a now
Juan Quintela [Tue, 22 Sep 2009 23:07:15 +0000 (01:07 +0200)]
This files are compiled in libqemu.a now

This fixes compilation of linux-user with today qemu, please apply.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoFix device tree compile broken by ca20cf32ab3d945155141ef737f5d08ebb373e1d
Blue Swirl [Tue, 22 Sep 2009 17:51:36 +0000 (17:51 +0000)]
Fix device tree compile broken by ca20cf32ab3d945155141ef737f5d08ebb373e1d

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix Sparse warning about invalid access past the end of 'mode'
Blue Swirl [Mon, 21 Sep 2009 20:21:53 +0000 (20:21 +0000)]
Fix Sparse warning about invalid access past the end of 'mode'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix Sparse warning about obsolete struct initializer
Blue Swirl [Mon, 21 Sep 2009 19:50:05 +0000 (19:50 +0000)]
Fix Sparse warning about obsolete struct initializer

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoExport tables properly to avoid a Sparse warning
Blue Swirl [Mon, 21 Sep 2009 18:40:57 +0000 (18:40 +0000)]
Export tables properly to avoid a Sparse warning

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoAdd 'static' to please Sparse
Blue Swirl [Mon, 21 Sep 2009 18:39:26 +0000 (18:39 +0000)]
Add 'static' to please Sparse

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix Sparse warnings about using plain integer as NULL pointer
Blue Swirl [Mon, 21 Sep 2009 18:11:34 +0000 (18:11 +0000)]
Fix Sparse warnings about using plain integer as NULL pointer

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix user targets broken by 96e132e24ee5a693069e83b6a981693588b088c1
Blue Swirl [Mon, 21 Sep 2009 15:24:07 +0000 (15:24 +0000)]
Fix user targets broken by 96e132e24ee5a693069e83b6a981693588b088c1

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoCompile host-utils only once
Blue Swirl [Sun, 20 Sep 2009 19:20:05 +0000 (19:20 +0000)]
Compile host-utils only once

See also facd2857783d58387885ad7cb1e4a8386f241738 and
34005a0060c176b3025a9e7c5d064615a9f80325.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoCompile TCG runtime library only once
Blue Swirl [Sun, 20 Sep 2009 19:06:34 +0000 (19:06 +0000)]
Compile TCG runtime library only once

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix spelling in comment
Stefan Weil [Sun, 20 Sep 2009 18:48:23 +0000 (20:48 +0200)]
Fix spelling in comment

registrs -> registers

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoCompile ne2000 only once
Blue Swirl [Sun, 20 Sep 2009 16:19:32 +0000 (16:19 +0000)]
Compile ne2000 only once

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoioports: remove unused env parameter and compile only once
Blue Swirl [Sun, 20 Sep 2009 16:05:47 +0000 (16:05 +0000)]
ioports: remove unused env parameter and compile only once

The CPU state parameter is not used, remove it and adjust callers. Now we
can compile ioport.c once for all targets.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoCompile msix only once
Blue Swirl [Sun, 20 Sep 2009 15:35:55 +0000 (15:35 +0000)]
Compile msix only once

Get page size in device init.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoCompile loader only once
Blue Swirl [Sun, 20 Sep 2009 14:58:02 +0000 (14:58 +0000)]
Compile loader only once

Callers must pass ELF machine, byte swapping and symbol LSB clearing
information to ELF loader. A.out loader needs page size information, pass
that too as a parameter.

Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw.

Adjust callers. Also use target_phys_addr_t instead of target_ulong for
addresses: loader addresses aren't virtual.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoCompile qemu-config only once
Blue Swirl [Sun, 20 Sep 2009 08:28:29 +0000 (08:28 +0000)]
Compile qemu-config only once

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoCompile wdt_i6300esb only once
Blue Swirl [Sun, 20 Sep 2009 08:02:28 +0000 (08:02 +0000)]
Compile wdt_i6300esb only once

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix mingw32 compile
Blue Swirl [Sun, 20 Sep 2009 07:51:06 +0000 (07:51 +0000)]
Fix mingw32 compile

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoProbe for fdatasync()
Blue Swirl [Sun, 20 Sep 2009 06:56:26 +0000 (06:56 +0000)]
Probe for fdatasync()

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoPPC: make system bus parent of PCI bus
Blue Swirl [Sat, 19 Sep 2009 17:59:10 +0000 (17:59 +0000)]
PPC: make system bus parent of PCI bus

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix indentation
Stefan Weil [Sat, 19 Sep 2009 09:39:29 +0000 (11:39 +0200)]
Fix indentation

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoESP: convert to VMState
Blue Swirl [Sat, 19 Sep 2009 15:44:50 +0000 (15:44 +0000)]
ESP: convert to VMState

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agotarget-alpha: fix extlh instruction
Vince Weaver [Thu, 17 Sep 2009 19:28:52 +0000 (15:28 -0400)]
target-alpha: fix extlh instruction

The extlh instruction on Alpha currently doesn't work properly.
It's a combination of a cut/paste bug (16 where it should be 32) as well
as a "shift by 64" bug.

Signed-off-by: Vince Weaver <vince@csl.cornell.edu>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-ppc: optimize slw/srw/sld/srd
Aurelien Jarno [Fri, 18 Sep 2009 14:56:30 +0000 (16:56 +0200)]
target-ppc: optimize slw/srw/sld/srd

Remove a temp local variable and a jump by computing a mask with shifts.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoaudio: use correct email address
malc [Fri, 18 Sep 2009 07:52:45 +0000 (11:52 +0400)]
audio: use correct email address

Signed-off-by: malc <av1474@comtv.ru>
15 years agoaudio: internal API change
malc [Fri, 18 Sep 2009 07:37:39 +0000 (11:37 +0400)]
audio: internal API change

pcm_ops.run_out now takes number of live samples (which will be always
greater than zero) as a second argument, every driver was calling
audio_pcm_hw_get_live_out anyway with exception of fmod which used
audio_pcm_hw_get_live_out2 for no good reason.

Signed-off-by: malc <av1474@comtv.ru>
15 years agosdlaudio: use correct function names in sdl_XXX calls
malc [Fri, 18 Sep 2009 07:19:00 +0000 (11:19 +0400)]
sdlaudio: use correct function names in sdl_XXX calls

Signed-off-by: malc <av1474@comtv.ru>
15 years agooss: use audio_pcm_hw_clip_out
malc [Fri, 18 Sep 2009 06:59:54 +0000 (10:59 +0400)]
oss: use audio_pcm_hw_clip_out

Signed-off-by: malc <av1474@comtv.ru>
15 years agoalsa: use audio_pcm_hw_clip_out
malc [Fri, 18 Sep 2009 06:59:50 +0000 (10:59 +0400)]
alsa: use audio_pcm_hw_clip_out

Signed-off-by: malc <av1474@comtv.ru>
15 years agoaudio: introduce audio_pcm_hw_clip_out helper function
malc [Fri, 18 Sep 2009 06:59:38 +0000 (10:59 +0400)]
audio: introduce audio_pcm_hw_clip_out helper function

Signed-off-by: malc <av1474@comtv.ru>
15 years agoaudio: use muldiv64 where it makes sense
malc [Fri, 18 Sep 2009 04:16:03 +0000 (08:16 +0400)]
audio: use muldiv64 where it makes sense

Signed-off-by: malc <av1474@comtv.ru>
15 years agocoreaudio: fix sloppy "posixification" by 1ea879e5580f63414693655fcf0328559cdce138
malc [Fri, 18 Sep 2009 04:06:01 +0000 (08:06 +0400)]
coreaudio: fix sloppy "posixification" by 1ea879e5580f63414693655fcf0328559cdce138

Signed-off-by: malc <av1474@comtv.ru>
15 years agotcg: fix size of local variables in tcg_gen_bswap64_i64
Stefan Weil [Sat, 5 Sep 2009 16:54:10 +0000 (18:54 +0200)]
tcg: fix size of local variables in tcg_gen_bswap64_i64

t0, t1 must be 64 bit values, not 32 bit.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoqemu serial: lost tx irqs (affecting FreeBSD's new uart(4) driver)
Juergen Lock [Sat, 12 Sep 2009 16:52:22 +0000 (18:52 +0200)]
qemu serial: lost tx irqs (affecting FreeBSD's new uart(4) driver)

Well one problem seems to be the rx condition,
        ... if ((s->ier & UART_IER_RDI) && (s->lsr & UART_LSR_DR))
is not enough to trigger an irq, yet still causes the following
conditions not to be checked anymore at all.

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Acked-by: Jan Kiszka <jan.kiszka@web.de>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agofix typo in configure --help
Andre Przywara [Wed, 16 Sep 2009 12:29:07 +0000 (14:29 +0200)]
fix typo in configure --help

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoescc: fix IRQ routing, broken by 6c319c82223a1766c5d64a20051e5c6ab7b53951
Aurelien Jarno [Tue, 15 Sep 2009 22:13:15 +0000 (00:13 +0200)]
escc: fix IRQ routing, broken by 6c319c82223a1766c5d64a20051e5c6ab7b53951

The logic of Zilog makes channel B the first device and channel A the
second one.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoide/isa: convert to qdev.
Gerd Hoffmann [Tue, 15 Sep 2009 20:05:00 +0000 (20:05 +0000)]
ide/isa: convert to qdev.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoide/pci: convert to qdev.
Gerd Hoffmann [Tue, 15 Sep 2009 20:04:24 +0000 (20:04 +0000)]
ide/pci: convert to qdev.

With this patch applied ide drives (when attached to a pci adapter) can
be created via -device, like this:

  -drive if=none,id=mydisk,file=/path/to/disk.img
  -device ide-drive,drive=mydisk,bus=ide.0,unit=0

Note that creating a master on ide1 doesn't work that way.  That is a
side effect of qemu creating a cdrom automagically even if you don't
ask for it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoide/pci: fix indention
Gerd Hoffmann [Tue, 15 Sep 2009 20:00:53 +0000 (20:00 +0000)]
ide/pci: fix indention

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoide/qdev: add ide bus.
Gerd Hoffmann [Tue, 15 Sep 2009 19:23:34 +0000 (19:23 +0000)]
ide/qdev: add ide bus.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosplit away drive init from ide_init2()
Gerd Hoffmann [Tue, 15 Sep 2009 19:23:30 +0000 (19:23 +0000)]
split away drive init from ide_init2()

This allows the ide bus being initialized without drives attached
and the drives being attached and initialization later on as
separate step.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosupport media=cdrom for if=none
Gerd Hoffmann [Tue, 15 Sep 2009 19:23:28 +0000 (19:23 +0000)]
support media=cdrom for if=none

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoqdev/pci: add pci_create_noinit()
Gerd Hoffmann [Tue, 15 Sep 2009 19:23:25 +0000 (19:23 +0000)]
qdev/pci: add pci_create_noinit()

Like pci_create_simple() but doesn't call qdev_init(), so one can
set properties before initializing the device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agomips malta: ensure that the serial ports are associated with a device
Aurelien Jarno [Mon, 14 Sep 2009 23:17:57 +0000 (01:17 +0200)]
mips malta: ensure that the serial ports are associated with a device

The serial ports should be present even if associated with a null device
as some firmware wants to initialize them.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agohw/serial: don't create a char device if none is specified
Aurelien Jarno [Mon, 14 Sep 2009 23:16:28 +0000 (01:16 +0200)]
hw/serial: don't create a char device if none is specified

When creating null devices, there is no way to ensure the unicity of
the labels. Bail out with an error message instead.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agocurses: save 250MB of memory
Aurelien Jarno [Mon, 14 Sep 2009 22:21:35 +0000 (00:21 +0200)]
curses: save 250MB of memory

Don't call curses_resize() at the end of curses_display_init() as height
and width are not yet defined. It will be called later by code from
vl.c.

This save 250MB of memory when using -curses.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoRevert "Open chr device for all serial ports"
Aurelien Jarno [Mon, 14 Sep 2009 21:49:43 +0000 (23:49 +0200)]
Revert "Open chr device for all serial ports"

This reverts commit 55338f1dd4648d78ee130d83a92f1059ff1f3887.

15 years agoFix breakage by f80237d45032fbc429aba3b597175fb544a11378 for ISA-less targets
Blue Swirl [Mon, 14 Sep 2009 18:34:54 +0000 (18:34 +0000)]
Fix breakage by f80237d45032fbc429aba3b597175fb544a11378 for ISA-less targets

Move ISA bus to HW library.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoOpen chr device for all serial ports
Aurelien Jarno [Mon, 14 Sep 2009 17:30:16 +0000 (19:30 +0200)]
Open chr device for all serial ports

Now that labels must be unique, the chr devices can't be opened anymore
within the serial port code (in case they are not already opened in
vl.c), as they end up with the same label. Instead opened so
non-assigned one directly in vl.c, with a different label.

This make MIPS Malta board emulation working again.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-mips: fix single-stepping
Nathan Froyd [Tue, 14 Jul 2009 15:33:11 +0000 (08:33 -0700)]
target-mips: fix single-stepping

Single-stepping branches on MIPS didn't work right, because the
generation of EXCP_DEBUG happened after the generation of the code to
exit the current TB.  That is, given the code:

    bne v0,v1,target
    nop
    ...
  target:
    addu v0,v0,v1
  1:

when you single-stepped through the NOP, execution wouldn't actually
halt until you reached the label `1'.

This patch corrects that and also changes single-stepping so that a
branch and its delay slot are executed as one instruction for the
purposes of single-stepping.  This behavior is comparable to what other
MIPS tools (e.g. MIPSsim with MDI) do.  GDB avoids placing breakpoints
in branch delay slots, so this change doesn't break anything on the GDB
side.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agounbreak ppc/prep
Gerd Hoffmann [Mon, 14 Sep 2009 15:49:24 +0000 (17:49 +0200)]
unbreak ppc/prep

Changes:
  * added isa bus, hooked up to the system bus. Not sure this is correct,
    but 'info pci' lists lists no pci-isa bridge in the machine ...).
  * switches the default cpu to one which actually works.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoAdd an ISA bus version of m48t59
Blue Swirl [Mon, 14 Sep 2009 15:33:28 +0000 (15:33 +0000)]
Add an ISA bus version of m48t59

Many thanks to Gerd Hoffmann for finding and fixing a bug in the initial
version.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix Linux task preemption on Versatile board
Daniel Jacobowitz [Sun, 13 Sep 2009 13:54:41 +0000 (09:54 -0400)]
Fix Linux task preemption on Versatile board

Recent versions of the Linux kernel will not preempt CPU-intensive
tasks unless the clock used by sched_clock() works.  On -M versatilepb
that's the 24MHz timer in the system controller.  It's a very simple
timer, so implement it.

Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agopflash_cfi01: Correct debug build, no functional changes.
Edgar E. Iglesias [Mon, 14 Sep 2009 08:44:26 +0000 (10:44 +0200)]
pflash_cfi01: Correct debug build, no functional changes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
15 years agone2000-isa: Do not free memory owned by qdev
malc [Mon, 14 Sep 2009 05:20:45 +0000 (09:20 +0400)]
ne2000-isa: Do not free memory owned by qdev

Signed-off-by: malc <av1474@comtv.ru>
15 years agoalsa: Use proper value when testing returned events in alsa_poll_handler
malc [Sun, 13 Sep 2009 23:53:25 +0000 (03:53 +0400)]
alsa: Use proper value when testing returned events in alsa_poll_handler

Signed-off-by: malc <av1474@comtv.ru>
15 years agoalsa/oss: Remove fd transfer handlers before closing oss/alsa fd/handle
malc [Sun, 13 Sep 2009 23:51:48 +0000 (03:51 +0400)]
alsa/oss: Remove fd transfer handlers before closing oss/alsa fd/handle

Signed-off-by: malc <av1474@comtv.ru>
15 years agoconfigure: change "found" to "find"
Sebastian Herbszt [Sun, 13 Sep 2009 19:32:54 +0000 (21:32 +0200)]
configure: change "found" to "find"

Change "ERROR: configure was not able to found it" to
"ERROR: configure was not able to find it".

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoRevert "Fix Sparc/Linux host breakage by df70204db53e3611af986f434e74a882bce190ca"
Blue Swirl [Sun, 13 Sep 2009 19:38:48 +0000 (19:38 +0000)]
Revert "Fix Sparc/Linux host breakage by df70204db53e3611af986f434e74a882bce190ca"

This reverts commit 91b40c5be84a478e98c0416325844a7f66d0efae.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix sparc.ld
Blue Swirl [Sun, 13 Sep 2009 19:38:43 +0000 (19:38 +0000)]
Fix sparc.ld

Makes 91b40c5be84a478e98c0416325844a7f66d0efae unnecessary.

Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoaudio: Fix typo that broke QEMU_AUDIO_ADC_TRY_POLL
Jan Kiszka [Sun, 13 Sep 2009 18:24:46 +0000 (22:24 +0400)]
audio: Fix typo that broke QEMU_AUDIO_ADC_TRY_POLL

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: malc <av1474@comtv.ru>
15 years agoFix Sparc/Linux host breakage by df70204db53e3611af986f434e74a882bce190ca
Blue Swirl [Sun, 13 Sep 2009 13:33:05 +0000 (13:33 +0000)]
Fix Sparc/Linux host breakage by df70204db53e3611af986f434e74a882bce190ca

While i386, x86_64 and Sparc64/OpenBSD still worked after
df70204db53e3611af986f434e74a882bce190ca, Sparc32 and Sparc64 Linux hosts
broke.

Partially revert the commit: make the restored code conditional to
!CONFIG_USER_PIE.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoSparc64: make system bus parent of PCI bus
Blue Swirl [Sun, 13 Sep 2009 08:32:40 +0000 (08:32 +0000)]
Sparc64: make system bus parent of PCI bus

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agox86: move a declaration to header
Blue Swirl [Sun, 13 Sep 2009 08:32:39 +0000 (08:32 +0000)]
x86: move a declaration to header

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agox86: add 'const'
Blue Swirl [Sun, 13 Sep 2009 08:32:37 +0000 (08:32 +0000)]
x86: add 'const'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agooss: Simplify mmap code
malc [Sun, 13 Sep 2009 04:47:30 +0000 (08:47 +0400)]
oss: Simplify mmap code

Signed-off-by: malc <av1474@comtv.ru>
15 years agooss: OSS v4 support
malc [Sun, 13 Sep 2009 04:17:47 +0000 (08:17 +0400)]
oss: OSS v4 support

a. Use SNDCTL_DSP_POLICY instead of SNDCTL_DSP_SETFRAGMENT
b. Add ability to open device in exclusive mode, thus bypassing vmix

Signed-off-by: malc <av1474@comtv.ru>
15 years agoi386: Drop redundant kvm_enabled test
Jan Kiszka [Sat, 12 Sep 2009 14:50:07 +0000 (16:50 +0200)]
i386: Drop redundant kvm_enabled test

cpu_synchronize_state already does this.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoMake string arrays used to convert numbers to strings when DEBUG_EEPRO100 is enabled...
Reimar Döffinger [Sat, 12 Sep 2009 15:20:24 +0000 (15:20 +0000)]
Make string arrays used to convert numbers to strings when DEBUG_EEPRO100 is enabled const.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix xen build after sys-queue renaming
Jan Kiszka [Sat, 12 Sep 2009 15:00:28 +0000 (15:00 +0000)]
Fix xen build after sys-queue renaming

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoAdd configure option to compile user targets as PIE
Kirill A. Shutemov [Fri, 11 Sep 2009 23:17:55 +0000 (02:17 +0300)]
Add configure option to compile user targets as PIE

Build uset targers as true PIE if user want to keep qemu
self-virtualizable.

v5:
  - Split into to patches: drop link hack and add PIE support
  - do not build PIE by default and drop toolchain check

v4:
  - Add test for toolchain if it has proper PIE support

v3:
  - One more pice of the hack was removed
  - Description updated

v2:
  - Add configure options do enable/disable PIE for usermode targets.
    Disabling can be useful if you build uswing toolchain which has
    broken PIE support. PIE for usermode targets enabled by default.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix text relocations in linux-user targets
Kirill A. Shutemov [Fri, 11 Sep 2009 23:17:54 +0000 (02:17 +0300)]
Fix text relocations in linux-user targets

There is a link hack in linux-user which produces an executable that
looks like PIE, but always has text relocations since all object files
isn't position-independent (compiled without -fpic/-fpie). Dynamic loader
has to do more work to load a binary with text relocations.

The best way to keep this functionality is to build a true PIE without
text relocations.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoDo not link usermode targets with libhw*.a
Kirill A. Shutemov [Fri, 11 Sep 2009 23:17:53 +0000 (02:17 +0300)]
Do not link usermode targets with libhw*.a

Usermode targets are hardware-independed.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoWork around OpenSolaris sys/regset.h namespace pollution
Blue Swirl [Sat, 12 Sep 2009 12:36:11 +0000 (12:36 +0000)]
Work around OpenSolaris sys/regset.h namespace pollution

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix signedness warnings on OpenSolaris
Blue Swirl [Sat, 12 Sep 2009 12:36:09 +0000 (12:36 +0000)]
Fix signedness warnings on OpenSolaris

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoAdd #defines needed by OpenSolaris, fix breakage by the #defines
Blue Swirl [Sat, 12 Sep 2009 12:36:04 +0000 (12:36 +0000)]
Add #defines needed by OpenSolaris, fix breakage by the #defines

We need to define _XOPEN_SOURCE and __EXTENSIONS__ macros in order to get
CMSG_ and TIOCWIN macros defined. But then _POSIX_C_SOURCE gets defined, which
is (incorrectly) used as an indicator for existence of posix_memalign() in osdep.c.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix OpenSolaris build breaking typos
Blue Swirl [Sat, 12 Sep 2009 12:33:07 +0000 (12:33 +0000)]
Fix OpenSolaris build breaking typos

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoAdd 'static'
Blue Swirl [Sat, 12 Sep 2009 09:58:51 +0000 (09:58 +0000)]
Add 'static'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix a Sparse warning about redefinition of offsetof()
Blue Swirl [Sat, 12 Sep 2009 09:58:46 +0000 (09:58 +0000)]
Fix a Sparse warning about redefinition of offsetof()

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoFix sys-queue.h conflict for good
Blue Swirl [Sat, 12 Sep 2009 07:36:22 +0000 (07:36 +0000)]
Fix sys-queue.h conflict for good

Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,
f40d753718c72693c5f520f0d9899f6e50395e94,
96555a96d724016e13190b28cffa3bc929ac60dc and
3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile.

Solution: Avoid the conflict entirely by renaming the functions and the
file. Revert the previous hacks.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoTry to fix BSD breakage by 806b60248218bd5f74a8b070f5a99a864e8e51c6
Blue Swirl [Sat, 12 Sep 2009 06:19:16 +0000 (06:19 +0000)]
Try to fix BSD breakage by 806b60248218bd5f74a8b070f5a99a864e8e51c6

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoInclude sys-queue.h early to override system queue definitions on BSD
Blue Swirl [Sat, 12 Sep 2009 06:19:15 +0000 (06:19 +0000)]
Include sys-queue.h early to override system queue definitions on BSD

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoUnbreak BSD: use qemu_fdatasync instead of fdatasync
Blue Swirl [Sat, 12 Sep 2009 06:19:14 +0000 (06:19 +0000)]
Unbreak BSD: use qemu_fdatasync instead of fdatasync

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoUse proper format conversion specifier when printing size_t value
malc [Fri, 11 Sep 2009 23:18:18 +0000 (03:18 +0400)]
Use proper format conversion specifier when printing size_t value

And untabify this while we are at it.

Signed-off-by: malc <av1474@comtv.ru>
15 years agoaudio: remove lsbindex/popcount in favour of host-utils's ctz32
malc [Fri, 11 Sep 2009 22:39:29 +0000 (02:39 +0400)]
audio: remove lsbindex/popcount in favour of host-utils's ctz32

Signed-off-by: malc <av1474@comtv.ru>
15 years agoalsa: poll mode handling
malc [Fri, 11 Sep 2009 22:29:25 +0000 (02:29 +0400)]
alsa: poll mode handling

Signed-off-by: malc <av1474@comtv.ru>
15 years agooss: poll mode handling
malc [Fri, 11 Sep 2009 22:29:16 +0000 (02:29 +0400)]
oss: poll mode handling

Signed-off-by: malc <av1474@comtv.ru>
15 years agoaudio: poll mode infrastructure
malc [Fri, 11 Sep 2009 22:28:45 +0000 (02:28 +0400)]
audio: poll mode infrastructure

Signed-off-by: malc <av1474@comtv.ru>
15 years agogus: Do not manually free the state, qdev does it for us
malc [Fri, 11 Sep 2009 06:27:41 +0000 (10:27 +0400)]
gus: Do not manually free the state, qdev does it for us

Signed-off-by: malc <av1474@comtv.ru>
15 years agooss: Unbreak mmaping the ability to mmap oss fd on Linux
malc [Fri, 11 Sep 2009 06:13:55 +0000 (10:13 +0400)]
oss: Unbreak mmaping the ability to mmap oss fd on Linux

Signed-off-by: malc <av1474@comtv.ru>