aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-04-28 16:29:57 +0200
committerDavid 'Digit' Turner <digit@android.com>2011-04-28 16:40:36 +0200
commita65e41529e4e3900372d54859f8c559cf79d953c (patch)
tree5aec32aed00978559ce08fd49ebd0025a58b0e8a /android
parent011467bd501532c47595fa22a099ecf630e5de9f (diff)
downloadexternal_qemu-a65e41529e4e3900372d54859f8c559cf79d953c.zip
external_qemu-a65e41529e4e3900372d54859f8c559cf79d953c.tar.gz
external_qemu-a65e41529e4e3900372d54859f8c559cf79d953c.tar.bz2
Add loopIo_poll() function.
This will be used later by the goldfish network pipe implementation. Change-Id: I70c770efba15b2fd5ef7cc52450aa07163fa21f5
Diffstat (limited to 'android')
-rw-r--r--android/looper-generic.c8
-rw-r--r--android/looper-qemu.c8
-rw-r--r--android/looper.h6
3 files changed, 22 insertions, 0 deletions
diff --git a/android/looper-generic.c b/android/looper-generic.c
index d75fbff..ddc0824 100644
--- a/android/looper-generic.c
+++ b/android/looper-generic.c
@@ -203,6 +203,13 @@ gloopio_dontWantWrite(void* impl)
gloopio_modify(io, io->wanted & ~LOOP_IO_WRITE);
}
+static unsigned
+gloopio_poll(void* impl)
+{
+ GLoopIo* io = impl;
+ return io->ready;
+}
+
static void
gloopio_free(void* impl)
{
@@ -219,6 +226,7 @@ static LoopIoClass gloopio_class = {
gloopio_wantWrite,
gloopio_dontWantRead,
gloopio_dontWantWrite,
+ gloopio_poll,
gloopio_free
};
diff --git a/android/looper-qemu.c b/android/looper-qemu.c
index cce0bfa..5526f5b 100644
--- a/android/looper-qemu.c
+++ b/android/looper-qemu.c
@@ -254,11 +254,19 @@ qloopio_free(void* impl)
qemu_free(io);
}
+static unsigned
+qloopio_poll(void* impl)
+{
+ QLoopIo* io = impl;
+ return io->ready;
+}
+
static const LoopIoClass qlooper_io_class = {
qloopio_wantRead,
qloopio_wantWrite,
qloopio_dontWantRead,
qloopio_dontWantWrite,
+ qloopio_poll,
qloopio_free
};
diff --git a/android/looper.h b/android/looper.h
index d67fdad..923ef09 100644
--- a/android/looper.h
+++ b/android/looper.h
@@ -215,6 +215,7 @@ struct LoopIoClass {
void (*wantWrite)(void* impl);
void (*dontWantRead)(void* impl);
void (*dontWantWrite)(void* impl);
+ unsigned (*poll)(void* impl);
void (*done)(void* impl);
};
@@ -255,6 +256,11 @@ loopIo_dontWantWrite(LoopIo* io)
{
io->clazz->dontWantWrite(io->impl);
}
+AINLINED unsigned
+loopIo_poll(LoopIo* io)
+{
+ return io->clazz->poll(io->impl);
+}
/**********************************************************************
**********************************************************************