hw/arm/spitz: Avoid clash with Windows header symbol MOD_SHIFT

The Windows headers provided by MinGW define MOD_SHIFT. Avoid
it by using SPITZ_MOD_* for our constants here.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target-arm: Fix errors in writes to generic timer control registers

The code for handling writes to the generic timer control registers
had several bugs:
 * ISTATUS (bit 2) is read-only but we forced it to zero on any write
 * the check for "was IMASK (bit 1) toggled?" incorrectly used '&' where
   it should be '^'
 * the handling of IMASK was inverted: we should set the IRQ if
   ISTATUS is set and IMASK is clear, not if both are set

The combination of these bugs meant that when running a Linux guest
that uses the generic timers we would fairly quickly end up either
forgetting that the timer output should be asserted, or failing to
set the IRQ when the timer was unmasked. The result is that the guest
never gets any more timer interrupts.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1401803208-1281-1-git-send-email-peter.maydell@linaro.org
Cc: qemu-stable@nongnu.org
hw/arm/ranchu: New machine model for 64-bit ARM Android emulator

Add a new machine model for the 64-bit ARM Android emulator.
This is based heavily on the 'virt' machine model, and like
that we also create a device tree to pass to the guest kernel.
The major difference is that this board will have all the
Android-specific devices in it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/display/goldfish_fb: Use our own drawfns rather than milkymist's

Although the milkymist display device is indeed RGB565, it is
bigendian, so we can't actually borrow its drawfn helpers.
Implement our own instead.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/input/goldfish_events.c: Implement goldfish events device

Implement the goldfish 'events' device which provides a variety
of input events including simulated touchscreen and hard buttons.

This is a forward port and revamp of the goldfish/events_device
from the classic Android emulator. Some features from the
classic emulator are not supported:
 * multitouch
 * full keyboard

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/ranchu: Add goldfish events device

Add the goldfish events device to the ranchu board.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
slirp: Give error message if hostfwd_add/remove for unrecognized vlan/stack

If the user specified a (vlan ID, slirp stack name) tuple in a monitor
hostfwd_add/remove command and we can't find it, give the user an
error message rather than silently doing nothing.

This brings this error case in slirp_lookup() into line with the
other two.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
slirp: Honour vlan/stack in hostfwd_remove commands

The hostfwd_add and hostfwd_remove monitor commands allow the user
to optionally specify a vlan/stack tuple. hostfwd_add honours this,
but hostfwd_remove does not (it looks up the tuple but then ignores
the SlirpState it has looked up and always uses the first stack
in the list anyway). Correct this to honour what the user requested.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
slirp: Make slirp_lookup() a public function net_slirp_lookup()

Make slirp_lookup() a public function so other files can look up the
Slirp stack too. We improve the interface a bit so this is practical:
 * use Error arguments to report failures rather than calling
   monitor_printf() directly
 * return a Slirp* rather than a SlirpStack*, since the latter is a type
   local to this source file
 * rename to net_slirp_lookup() to match the other public functions
   in net/slirp.h

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
qemu-char: Add a chr_del_client method to char backends

Add a chr_del_client method to char backends. This makes sense
mostly for TCP, where it means "close the current connection and
then go back to listening for a new one"; the semantics are
as if the remote end had closed the connection.

This could for completeness be supported for other backends
(eg pipe, fd, tty), but this patch only supports it in TCP.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
monitor.c: Add support for Android console

Implement the Android console by hijacking the stock QEMU
monitor and implementing a different command set.

This commit provides the initial minimal framework and
changes to the core monitor code; it implements only the
two commands 'help' and 'kill'.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
android-console: Add support for redir commands

Add support for the redir commands which allow addition, removal
and listing of TCP and UDP port rediroctions.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
android-console: Implement quit

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
android-console: Add KO: prefix to parser syntax error messages

Indirect all the syntax error messages from the command parser
through a function pointer, so the Android console can override
it to put the KO: prefix on them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
android-console: Make 'help' output match the classic emulator

Implement the 'help' command ourselves rather than using the
monitor's usual version, so we can make the output text match the
format of the classic emulator. This might not be necessary but
perhaps external tools are parsing the output to see what commands
are supported.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
.travis.yml: disable IRC notifications
.travis.yml: refactor build steps into script.
android_pipe: import the qemu_pipe/goldfish_pipe code

This brings in the android emulator pipe code from the current aosp-qemu
master branch. So far it's just a comment and hack to get compiling
change:

  - remove dependency on android utils (ANEW/ASTRDUP/AFREE)
  - detach from the goldfish_device bus bits (inc irq raising)
  - import a few helper functions (uint64_set_high/low, goldfish_guest_is_64bit)
  - disable the VM save/restore code
  - use current_cpu for memory translation ops instead of cpu_single_env
  - fix debugging prints using portable formats
  - common code path for translating vaddr->qemu addr*
  - make some debug statments user-visible (unimp and guest errors)

There is a hacking backlink between AndroidPipeState and the PipeDevice
stuff (which should be merged cleanly later) just so we can get back to
->irq when we need to.

* I commonised the code and used contemporary qemu functions. However for
upstream the kernel driver need to move to passing hwaddr's to
QEMU (pref using virt-io mechanisms).
hw/arm/ranchu: add pipe device