android: goldfish_pipe: Remove dependency on AndroidEmu.
This patch refactors the virtual device used to implement the
Android pipe channels in the following ways:
- Rename the source files from "android_pipe.c" to
"goldfish_pipe.c". It is consistent with the naming of
other Android-specific devices, and makes it more
explicit that this is a virtual device, not a service
implementation (e.g. like android_adb.c in the same
directory that was used in the past).
- Remove any includes to AndroidEmu from the virtual device
(e.g. "android/emulation/android_pipe_device.h"). Instead
provide a callback-based interface to be implemented by
the host service (GoldfishPipeServiceOps), and injected
into the device through goldfish_pipe_set_service_ops().
This makes the virtual device much easier to rebase in
the future, as well as makes it upstreamable.
- Provide a new header "include/hw/misc/goldfish_pipe.h"
that contains the declaration for the new interface.
Note that this also defines types with the GoldfishPipe
prefix. This increases type-safety and better documents
usage, compared to the liberal use of void* for what
is now GoldfishHwPipe and GoldfishHostPipe.
- Provide glue code (android_pipe_device.cpp) that connects
the implementation of the generic AndroidEmu pipe service
and the QEMU2-specific virtual device, through the new
qemu_android_pipe_init() function.
- Ensure that qemu_android_pipe_init() is properly called
at emulation setup time.
+ Fixed a minor mis-type (uint32 --> uint32_t) to avoid
future compiler warnings (after the 2.7 rebase).
+ Rename pipe_free() to hwpipe_free() for consistency.
NOTE: This should not change the virtual device's
implementation in any way: no bug fix, no new features.
Change-Id: I1caae14330e036b4076abd3883891885e49e1fe6
7 files changed