summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac3
-rw-r--r--src/Makefile.am2
-rw-r--r--src/utils/Makefile.am7
-rw-r--r--src/utils/adsprpcd.c35
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;
+}