diff options
author | San Mehat <san@google.com> | 2009-12-07 14:26:59 -0800 |
---|---|---|
committer | San Mehat <san@google.com> | 2009-12-07 17:16:08 -0800 |
commit | 71e736ef90ef644130201742980b275fcca259a5 (patch) | |
tree | c914de107066fd2809cb3dd4aa519bf1d0f41918 /hw | |
parent | 7ab6d35b98bc279a5fcd36965433a51a3c9aecd9 (diff) | |
download | external_qemu-71e736ef90ef644130201742980b275fcca259a5.zip external_qemu-71e736ef90ef644130201742980b275fcca259a5.tar.gz external_qemu-71e736ef90ef644130201742980b275fcca259a5.tar.bz2 |
qemu: android: Add control console support for managing sdcards
Signed-off-by: San Mehat <san@google.com>
qemu: goldfish: Fix compile error introduced in refactoring
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/goldfish_device.h | 3 | ||||
-rw-r--r-- | hw/goldfish_mmc.c | 17 |
2 files changed, 14 insertions, 6 deletions
diff --git a/hw/goldfish_device.h b/hw/goldfish_device.h index 7eb21de..d0739b7 100644 --- a/hw/goldfish_device.h +++ b/hw/goldfish_device.h @@ -49,7 +49,8 @@ void goldfish_battery_display(void (* callback)(void *data, const char* string), void goldfish_mmc_init(uint32_t base, int id); void goldfish_mmc_insert(int id, BlockDriverState* bs); -void goldfish_mmc_remove(int id, BlockDriverState *bs); +void goldfish_mmc_remove(int id); +int goldfish_mmc_is_media_inserted(int id); void *goldfish_switch_add(char *name, uint32_t (*writefn)(void *opaque, uint32_t state), void *writeopaque, int id); void goldfish_switch_set_state(void *opaque, uint32_t state); diff --git a/hw/goldfish_mmc.c b/hw/goldfish_mmc.c index 124f865..8b5c137 100644 --- a/hw/goldfish_mmc.c +++ b/hw/goldfish_mmc.c @@ -560,18 +560,25 @@ static void goldfish_mmc_setbs(struct goldfish_mmc_state* s, BlockDriverState* b void goldfish_mmc_insert(int id, BlockDriverState* bs) { if (id >= GOLDFISH_MMC_MAX) { - fprintf(stderr, "mmc controller %d out of range\n", id); - return; + return -1; } goldfish_mmc_setbs(gDrvState[id], bs); } -void goldfish_mmc_remove(int id, BlockDriverState* bs) +int goldfish_mmc_is_media_inserted(int id) +{ + if (id > GOLDFISH_MMC_MAX) { + return -1; + } + + return (gDrvState[id]->bs != NULL); +} + +void goldfish_mmc_remove(int id) { if (id >= GOLDFISH_MMC_MAX) { - fprintf(stderr, "mmc controller %d out of range\n", id); - return; + return -1; } goldfish_mmc_setbs(gDrvState[id], NULL); |