aboutsummaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-12-07 14:26:59 -0800
committerSan Mehat <san@google.com>2009-12-07 17:16:08 -0800
commit71e736ef90ef644130201742980b275fcca259a5 (patch)
treec914de107066fd2809cb3dd4aa519bf1d0f41918 /hw
parent7ab6d35b98bc279a5fcd36965433a51a3c9aecd9 (diff)
downloadexternal_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.h3
-rw-r--r--hw/goldfish_mmc.c17
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);