From 8949140fa66f36d5ce7255bcae8672ed22af30ff Mon Sep 17 00:00:00 2001 From: Richard Acayan Date: Thu, 7 Dec 2023 20:14:43 -0500 Subject: [PATCH] fastrpc: move remotectl interface to libhexagonrpc This is useful for most programs using FastRPC, so it does not make sense to copy the interface every time. Move it to libhexagonrpc, even though it may not be strictly necessary to communicate over FastRPC, since it is common. --- fastrpc/hexagonrpcd/interfaces.c | 1 - fastrpc/hexagonrpcd/listener.c | 2 +- fastrpc/hexagonrpcd/localctl.c | 2 +- fastrpc/hexagonrpcd/rpcd.c | 2 +- .../libhexagonrpc}/interfaces/remotectl.def | 0 fastrpc/libhexagonrpc/interfaces.c | 24 +++++++++++++++++++ fastrpc/libhexagonrpc/meson.build | 3 ++- 7 files changed, 29 insertions(+), 5 deletions(-) rename fastrpc/{hexagonrpcd => include/libhexagonrpc}/interfaces/remotectl.def (100%) create mode 100644 fastrpc/libhexagonrpc/interfaces.c diff --git a/fastrpc/hexagonrpcd/interfaces.c b/fastrpc/hexagonrpcd/interfaces.c index 0e60476..81592a9 100644 --- a/fastrpc/hexagonrpcd/interfaces.c +++ b/fastrpc/hexagonrpcd/interfaces.c @@ -25,4 +25,3 @@ #include "interfaces/apps_std.def" #include "interfaces/adsp_listener.def" #include "interfaces/chre_slpi.def" -#include "interfaces/remotectl.def" diff --git a/fastrpc/hexagonrpcd/listener.c b/fastrpc/hexagonrpcd/listener.c index c7bcb23..9de0a16 100644 --- a/fastrpc/hexagonrpcd/listener.c +++ b/fastrpc/hexagonrpcd/listener.c @@ -21,12 +21,12 @@ #include #include +#include #include #include #include "aee_error.h" #include "interfaces/adsp_listener.def" -#include "interfaces/remotectl.def" #include "iobuffer.h" #include "listener.h" diff --git a/fastrpc/hexagonrpcd/localctl.c b/fastrpc/hexagonrpcd/localctl.c index b74d1e2..3eaef88 100644 --- a/fastrpc/hexagonrpcd/localctl.c +++ b/fastrpc/hexagonrpcd/localctl.c @@ -19,13 +19,13 @@ * along with this program. If not, see . */ +#include #include #include #include #include #include "aee_error.h" -#include "interfaces/remotectl.def" #include "iobuffer.h" #include "listener.h" #include "localctl.h" diff --git a/fastrpc/hexagonrpcd/rpcd.c b/fastrpc/hexagonrpcd/rpcd.c index 0214637..b841fb3 100644 --- a/fastrpc/hexagonrpcd/rpcd.c +++ b/fastrpc/hexagonrpcd/rpcd.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +36,6 @@ #include "hexagonfs.h" #include "interfaces/adsp_default_listener.def" #include "interfaces/chre_slpi.def" -#include "interfaces/remotectl.def" #include "listener.h" #include "localctl.h" #include "rpcd_builder.h" diff --git a/fastrpc/hexagonrpcd/interfaces/remotectl.def b/fastrpc/include/libhexagonrpc/interfaces/remotectl.def similarity index 100% rename from fastrpc/hexagonrpcd/interfaces/remotectl.def rename to fastrpc/include/libhexagonrpc/interfaces/remotectl.def diff --git a/fastrpc/libhexagonrpc/interfaces.c b/fastrpc/libhexagonrpc/interfaces.c new file mode 100644 index 0000000..b1ce1ab --- /dev/null +++ b/fastrpc/libhexagonrpc/interfaces.c @@ -0,0 +1,24 @@ +/* + * FastRPC interface list for building common method definitions + * + * Copyright (C) 2023 The Sensor Shell Contributors + * + * This file is part of sensh. + * + * Sensh is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#define HEXAGONRPC_BUILD_METHOD_DEFINITIONS 1 + +#include diff --git a/fastrpc/libhexagonrpc/meson.build b/fastrpc/libhexagonrpc/meson.build index 684d380..b73f7e5 100644 --- a/fastrpc/libhexagonrpc/meson.build +++ b/fastrpc/libhexagonrpc/meson.build @@ -1,6 +1,7 @@ libhexagonrpc = shared_library('hexagonrpc', - 'fastrpc.c', 'context.c', + 'fastrpc.c', + 'interfaces.c', include_directories : include, install : true )