aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/build/binary.make4
-rw-r--r--android/build/definitions.make6
-rw-r--r--android/config/Linux/config-host.h1
-rw-r--r--android/config/config.h1
-rw-r--r--android/config/darwin-x86/config-host.h4
-rw-r--r--android/config/linux-x86/config-host.h5
-rw-r--r--android/config/windows/config-host.h3
-rw-r--r--android/console.c9
-rw-r--r--android/main.c63
9 files changed, 71 insertions, 25 deletions
diff --git a/android/build/binary.make b/android/build/binary.make
index 1c75d52..5052dc1 100644
--- a/android/build/binary.make
+++ b/android/build/binary.make
@@ -20,8 +20,8 @@
LOCAL_OBJS_DIR := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE))
LOCAL_OBJECTS :=
LOCAL_CC ?= $(CC)
-LOCAL_C_SOURCES := $(filter %.c,$(LOCAL_SRC_FILES))
-LOCAL_OBJC_SOURCES := $(filter %.m,$(LOCAL_SRC_FILES))
+LOCAL_C_SOURCES := $(filter %.c,$(LOCAL_SRC_FILES) $(LOCAL_GENERATED_SOURCES))
+LOCAL_OBJC_SOURCES := $(filter %.m,$(LOCAL_SRC_FILES) $(LOCAL_GENERATED_SOURCES))
$(foreach src,$(LOCAL_C_SOURCES), \
$(eval $(call compile-c-source,$(src))) \
diff --git a/android/build/definitions.make b/android/build/definitions.make
index 4ba0d07..54d1a8a 100644
--- a/android/build/definitions.make
+++ b/android/build/definitions.make
@@ -123,3 +123,9 @@ $(1):
mkdir -p $(1)
endef
+define transform-generated-source
+@echo "Generated: $(PRIVATE_MODULE) <= $<"
+@mkdir -p $(dir $@)
+$(hide) $(PRIVATE_CUSTOM_TOOL)
+endef
+
diff --git a/android/config/Linux/config-host.h b/android/config/Linux/config-host.h
index 90defbd..cc5e07a 100644
--- a/android/config/Linux/config-host.h
+++ b/android/config/Linux/config-host.h
@@ -6,5 +6,6 @@
#define CONFIG_GDBSTUB 1
#define CONFIG_SLIRP 1
#define QEMU_VERSION "0.8.2"
+#define QEMU_PKGVERSION "Android"
#define CONFIG_SKINS 1
#define CONFIG_UNAME_RELEASE ""
diff --git a/android/config/config.h b/android/config/config.h
index be83607..e2191e3 100644
--- a/android/config/config.h
+++ b/android/config/config.h
@@ -3,6 +3,7 @@
#define CONFIG_QEMU_PREFIX "/usr/gnemul/qemu-arm"
#define TARGET_ARCH "arm"
#define TARGET_ARM 1
+#define TARGET_PHYS_ADDR_BITS 32
#define CONFIG_TRACE 1
#define CONFIG_NAND 1
#define CONFIG_SHAPER 1
diff --git a/android/config/darwin-x86/config-host.h b/android/config/darwin-x86/config-host.h
index aaf0195..23ccb13 100644
--- a/android/config/darwin-x86/config-host.h
+++ b/android/config/darwin-x86/config-host.h
@@ -5,9 +5,11 @@
#define CONFIG_DARWIN 1
#define CONFIG_GDBSTUB 1
#define CONFIG_SLIRP 1
-#define QEMU_VERSION "0.8.2"
+#define QEMU_VERSION "0.10.50"
+#define QEMU_PKGVERSION "Android"
#define O_LARGEFILE 0
#define MAP_ANONYMOUS MAP_ANON
+#define HAVE_IOVEC 1
#define _BSD 1
#define CONFIG_SKINS 1
#define CONFIG_UNAME_RELEASE ""
diff --git a/android/config/linux-x86/config-host.h b/android/config/linux-x86/config-host.h
index 90defbd..7e2ed20 100644
--- a/android/config/linux-x86/config-host.h
+++ b/android/config/linux-x86/config-host.h
@@ -5,6 +5,9 @@
#define HAVE_BYTESWAP_H 1
#define CONFIG_GDBSTUB 1
#define CONFIG_SLIRP 1
-#define QEMU_VERSION "0.8.2"
+#define QEMU_VERSION "0.10.50"
+#define QEMU_PKGVERSION "Android"
#define CONFIG_SKINS 1
#define CONFIG_UNAME_RELEASE ""
+#define CONFIG_IOTHREAD 1
+#define HAVE_IOVEC 1
diff --git a/android/config/windows/config-host.h b/android/config/windows/config-host.h
index 8f9e0d9..6e18a02 100644
--- a/android/config/windows/config-host.h
+++ b/android/config/windows/config-host.h
@@ -5,6 +5,7 @@
#define CONFIG_WIN32 1
#define CONFIG_GDBSTUB 1
#define CONFIG_SLIRP 1
-#define QEMU_VERSION "0.8.2"
+#define QEMU_VERSION "0.10.50"
+#define QEMU_PKGVERSION "Android"
#define CONFIG_SKINS 1
#define CONFIG_UNAME_RELEASE ""
diff --git a/android/console.c b/android/console.c
index a8560f4..ab32213 100644
--- a/android/console.c
+++ b/android/console.c
@@ -37,6 +37,7 @@
#include "android/utils/debug.h"
#include "android/utils/stralloc.h"
#include "tcpdump.h"
+#include "net.h"
#include <stdlib.h>
#include <stdio.h>
@@ -72,8 +73,6 @@
# define D(x) do{}while(0)
#endif
-extern int slirp_inited; /* in vl.c */
-
typedef struct ControlGlobalRec_* ControlGlobal;
typedef struct ControlClientRec_* ControlClient;
@@ -892,9 +891,9 @@ do_redir_add( ControlClient client, char* args )
if ( !args )
goto BadFormat;
- if (!slirp_inited) {
- slirp_inited = 1;
- slirp_init();
+ if (!slirp_is_inited()) {
+ control_write( client, "KO: network emulation disabled\r\n");
+ return -1;
}
len = redir_parse_proto_port( args, &host_port, &host_proto );
diff --git a/android/main.c b/android/main.c
index 104b344..70c13b8 100644
--- a/android/main.c
+++ b/android/main.c
@@ -233,6 +233,29 @@ sdl_set_window_icon( void )
}
}
+/* see http://en.wikipedia.org/wiki/List_of_device_bandwidths or a complete list */
+const NetworkSpeed android_netspeeds[] = {
+ { "gsm", "GSM/CSD", 14400, 14400 },
+ { "hscsd", "HSCSD", 14400, 43200 },
+ { "gprs", "GPRS", 40000, 80000 },
+ { "edge", "EDGE/EGPRS", 118400, 236800 },
+ { "umts", "UMTS/3G", 128000, 1920000 },
+ { "hsdpa", "HSDPA", 348000, 14400000 },
+ { "full", "no limit", 0, 0 },
+ { NULL, NULL, 0, 0 }
+};
+
+const NetworkLatency android_netdelays[] = {
+ /* FIXME: these numbers are totally imaginary */
+ { "gprs", "GPRS", 150, 550 },
+ { "edge", "EDGE/EGPRS", 80, 400 },
+ { "umts", "UMTS/3G", 35, 200 },
+ { "none", "no latency", 0, 0 },
+ { NULL, NULL, 0, 0 }
+};
+
+
+
#define ONE_MB (1024*1024)
@@ -633,13 +656,14 @@ qemulator_setup( QEmulator* emulator )
/* called by the emulated framebuffer device each time the framebuffer
* is resized or rotated */
static void
-sdl_resize(DisplayState *ds, int w, int h)
+sdl_resize(DisplayState *ds)
{
- fprintf(stderr, "weird, sdl_resize being called with framebuffer interface\n");
- exit(1);
+ //fprintf(stderr, "weird, sdl_resize being called with framebuffer interface\n");
+ //exit(1);
}
+/* called periodically to poll for user input events */
static void sdl_refresh(DisplayState *ds)
{
QEmulator* emulator = ds->opaque;
@@ -909,21 +933,30 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
{
QEmulator* emulator = qemulator;
SkinDisplay* disp = skin_layout_get_display(emulator->layout);
-
-// fprintf(stderr,"*** sdl_display_init ***\n");
- ds->opaque = emulator;
+ DisplayChangeListener* dcl;
+ int width, height;
if (disp->rotation & 1) {
- ds->width = disp->rect.size.h;
- ds->height = disp->rect.size.w;
+ width = disp->rect.size.h;
+ height = disp->rect.size.w;
} else {
- ds->width = disp->rect.size.w;
- ds->height = disp->rect.size.h;
+ width = disp->rect.size.w;
+ height = disp->rect.size.h;
}
- ds->dpy_update = sdl_update;
- ds->dpy_resize = sdl_resize;
- ds->dpy_refresh = sdl_refresh;
+ /* Register a display state object for the emulated framebuffer */
+ ds->allocator = &default_allocator;
+ ds->opaque = emulator;
+ ds->surface = qemu_create_displaysurface(ds, width, height);
+ register_displaystate(ds);
+
+ /* Register a change listener for it */
+ dcl = (DisplayChangeListener *) qemu_mallocz(sizeof(DisplayChangeListener));
+ dcl->dpy_update = sdl_update;
+ dcl->dpy_resize = sdl_resize;
+ dcl->dpy_refresh = sdl_refresh;
+ dcl->dpy_text_cursor = NULL;
+ register_displaychangelistener(ds, dcl);
skin_keyboard_enable( emulator->keyboard, 1 );
skin_keyboard_on_command( emulator->keyboard, handle_key_command, emulator );
@@ -2526,7 +2559,7 @@ int main(int argc, char **argv)
qemud_serial = serial++;
if (opts->radio) {
- CharDriverState* cs = qemu_chr_open(opts->radio);
+ CharDriverState* cs = qemu_chr_open("radio",opts->radio,NULL);
if (cs == NULL) {
derror( "unsupported character device specification: %s\n"
"used -help-char-devices for list of available formats\n", opts->radio );
@@ -2542,7 +2575,7 @@ int main(int argc, char **argv)
}
if (opts->gps) {
- CharDriverState* cs = qemu_chr_open(opts->gps);
+ CharDriverState* cs = qemu_chr_open("gps",opts->gps,NULL);
if (cs == NULL) {
derror( "unsupported character device specification: %s\n"
"used -help-char-devices for list of available formats\n", opts->gps );