diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2019-01-15 13:19:48 +0000 |
---|---|---|
committer | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2019-01-15 13:21:46 +0000 |
commit | f2bffdf543a36ea88197bdda9fa7fafa74ce56d1 (patch) | |
tree | 4e9a25e59763956897f1d374985d21582bf21f22 | |
parent | 8793ed52b9c5f9b8319c7cc5ee7e22ee65ea5b4f (diff) |
fastrpc: add adsprpcd support
Co-developed-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/utils/Makefile.am | 7 | ||||
-rw-r--r-- | src/utils/adsprpcd.c | 35 |
4 files changed, 45 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 9c28e43..8388a96 100644 --- a/configure.ac +++ b/configure.ac @@ -26,5 +26,6 @@ AM_PROG_CC_C_O AC_CONFIG_FILES([ Makefile src/Makefile -src/lib/Makefile]) +src/lib/Makefile +src/utils/Makefile]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 0262e4d..be97404 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1 +1 @@ -SUBDIRS = lib +SUBDIRS = lib utils diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am new file mode 100644 index 0000000..52290e6 --- /dev/null +++ b/src/utils/Makefile.am @@ -0,0 +1,7 @@ +bin_PROGRAMS = adsprpcd + +adsprpcd_SOURCES = adsprpcd.c adsp_default_listener_stub.c + +adsprpcd_CFLAGS = -I$(top_srcdir)/include + +adsprpcd_LDADD = $(top_builddir)/src/lib/libadsprpc.la -lpthread -lm -ldl diff --git a/src/utils/adsprpcd.c b/src/utils/adsprpcd.c new file mode 100644 index 0000000..8b0e001 --- /dev/null +++ b/src/utils/adsprpcd.c @@ -0,0 +1,35 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, Linaro Limited + */ + +#include <stdio.h> +#include <poll.h> +#include <unistd.h> +#include <sys/eventfd.h> +#include "adsp_default_listener.h" +#include "remote.h" + +int main(int argc, const char **argv) +{ + struct pollfd pfd; + remote_handle rh; + eventfd_t event = 0; + + remote_handle_open(ITRANSPORT_PREFIX "attachguestos", &rh); + adsp_default_listener_register(); + remote_handle_open(ITRANSPORT_PREFIX "geteventfd", &pfd.fd); + + pfd.events = POLLIN; + pfd.revents = 0; + while (1) { + poll(&pfd, 1, -1); + + eventfd_read(pfd.fd, &event); + if (event) + break; + } + + return 0; +} |