diff options
author | David 'Digit' Turner <digit@google.com> | 2009-09-14 14:32:27 -0700 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-09-14 14:32:27 -0700 |
commit | 5d8f37ad78fc66901af50c762029a501561f3b23 (patch) | |
tree | 206790f8f21000850a98c4f9590a79e779106278 /android/main.c | |
parent | cd059b15f2c7df69f4a087bd66900eb172e41d1c (diff) | |
download | external_qemu-5d8f37ad78fc66901af50c762029a501561f3b23.zip external_qemu-5d8f37ad78fc66901af50c762029a501561f3b23.tar.gz external_qemu-5d8f37ad78fc66901af50c762029a501561f3b23.tar.bz2 |
Merge upstream QEMU 10.0.50 into the Android source tree.
This change integrates many changes from the upstream QEMU sources.
Its main purpose is to enable correct ARMv6 and ARMv7 support to the
Android emulator. Due to the nature of the upstream code base, this
unfortunately also required changes to many other parts of the source.
Note that to ensure easier integrations in the future, some source files
and directories that have heavy Android-specific customization have been
renamed with an -android suffix. The original files are still there for
easier integration tracking, but *never* compiled. For example:
net.c net-android.c
qemu-char.c qemu-char-android.c
slirp/ slirp-android/
etc...
Tested on linux-x86, darwin-x86 and windows host machines.
Diffstat (limited to 'android/main.c')
-rw-r--r-- | android/main.c | 63 |
1 files changed, 48 insertions, 15 deletions
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 ); |