Skip to content

Commit 09a72e2

Browse files
committed
hexagonrpcd: interface: switch adsp_default_listener to interp4
The new interp4 definitions add support for more remote methods with sequences of multi-byte data, sequences of sequences, plain integers interleaved with sequences, and constant-size data other than 32-bit integers. The new definitions are complex and can't fit in a simple macro. Switch the chre_slpi interface to interp4, split it into a header and source file, and update the users. Signed-off-by: Richard Acayan <[email protected]>
1 parent 060c279 commit 09a72e2

File tree

5 files changed

+49
-43
lines changed

5 files changed

+49
-43
lines changed
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* FastRPC interface list for building method definitions
2+
* FastRPC reverse tunnel registration interface - method definitions
33
*
4-
* Copyright (C) 2023 The Sensor Shell Contributors
4+
* Copyright (C) 2025 HexagonRPC Contributors
55
*
6-
* This file is part of sensh.
6+
* This file is part of HexagonRPC.
77
*
8-
* Sensh is free software: you can redistribute it and/or modify
8+
* HexagonRPC is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
1010
* the Free Software Foundation, either version 3 of the License, or
1111
* (at your option) any later version.
@@ -19,6 +19,13 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*/
2121

22-
#define HEXAGONRPC_BUILD_METHOD_DEFINITIONS 1
22+
#include <stdint.h>
23+
#include <libhexagonrpc/hexagonrpc.h>
2324

24-
#include "interfaces/adsp_default_listener.def"
25+
const struct hrpc_method_def_interp4 adsp_default_listener_register_def = {
26+
.msg_id = 0,
27+
.n_args = 0,
28+
.args = NULL,
29+
.n_inner_types = 0,
30+
.inner_types = NULL,
31+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* FastRPC reverse tunnel registration interface - API
3+
*
4+
* Copyright (C) 2025 HexagonRPC Contributors
5+
*
6+
* This file is part of HexagonRPC.
7+
*
8+
* HexagonRPC is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef INTERFACE_ADSP_DEFAULT_LISTENER_H
23+
#define INTERFACE_ADSP_DEFAULT_LISTENER_H
24+
25+
#include <stdint.h>
26+
#include <libhexagonrpc/hexagonrpc.h>
27+
28+
extern struct hrpc_method_def_interp4 adsp_default_listener_register_def;
29+
static inline int adsp_default_listener_register(int fd, uint32_t hdl)
30+
{
31+
return hexagonrpc(&adsp_default_listener_register_def, fd, hdl);
32+
}
33+
34+
#endif /* INTERFACE_ADSP_DEFAULT_LISTENER_H */

hexagonrpcd/interfaces/adsp_default_listener.def

Lines changed: 0 additions & 29 deletions
This file was deleted.

hexagonrpcd/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
executable('hexagonrpcd',
22
'apps_mem.c',
33
'apps_std.c',
4-
'interfaces.c',
4+
'interface/adsp_default_listener.c',
55
'interface/adsp_listener.c',
66
'interface/apps_mem.c',
77
'interface/apps_std.c',

hexagonrpcd/rpcd.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <errno.h>
2323
#include <fcntl.h>
2424
#include <libhexagonrpc/error.h>
25-
#include <libhexagonrpc/fastrpc.h>
2625
#include <libhexagonrpc/handle.h>
2726
#include <libhexagonrpc/interface/remotectl.h>
2827
#include <libhexagonrpc/session.h>
@@ -40,16 +39,11 @@
4039
#include "apps_mem.h"
4140
#include "apps_std.h"
4241
#include "hexagonfs.h"
43-
#include "interfaces/adsp_default_listener.def"
42+
#include "interface/adsp_default_listener.h"
4443
#include "listener.h"
4544
#include "localctl.h"
4645
#include "rpcd_builder.h"
4746

48-
static int adsp_default_listener_register(int fd, uint32_t handle)
49-
{
50-
return fastrpc2(&adsp_default_listener_register_def, fd, handle);
51-
}
52-
5347
static int register_fastrpc_listener(int fd)
5448
{
5549
uint32_t hdl;

0 commit comments

Comments
 (0)