20 Commits
Author SHA1 Message Date
Guido Günther da7a3742ab rpcd: Map -h to help
This allows to get usage information without a non-zero exit status.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2026-09-15 10:21:41 +02:00
Richard Acayan 598b591ae9 tests: add unit test for hexagonrpc function
The hexagonrpc function is getting very complex and deserves its own
unit test. Add a unit test for the hexagonrpc function.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan ab26a830a6 libhexagonrpc: remove legacy APIs
There is now no user of the interp2 APIs in the source tree.
Remove them.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 605b90ac7e hexagonrpcd: iobuffer: depend on new hexagonrpc header
The iobuffer decoder depends on REMOTE_SCALARS_INBUFS to know the number
of encoded input buffers without knowing the exact length of the encoded
input. Depend on the new hexagonrpc header which is being switched to.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 5218213f66 tests: depend on stdlib and new libhexagonrpc header file
Both the hexagonfs and iobuffer tests need malloc and free. The iobuffer
test also needs REMOTE_SCALARS_MAKE. Include stdlib directly and include
the new libhexagonrpc header file.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 4210f6d851 hexagonrpcd: listener: remove interp2 support
With the remote method definitions converted to interp4, the interp2
definitions are no longer needed. Replace the interp2 definitions with
the interp4 definitions recently added.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 9da2b5ec0c 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 <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 0b2b5d245e hexagonrpcd: interface: switch adsp_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 adsp_listener interface to interp4, split it into a
header and source file, and update the users.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 0390727bca hexagonrpcd: interface: switch apps_mem interface 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 apps_mem interface to interp4, split it into a header
and source file, and add the new definitions to the implementation.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 2469c21ca7 hexagonrpcd: interface: switch apps_std interface 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 add the new definitions to the implementation.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan e53998a12e chrecd: interface: switch chre_slpi interface 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 <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 1dacea0470 libhexagonrpc: interface: switch remotectl interface 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 remotectl interface to interp4, split it into a header
and source file, and update the users.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 8cbdeb5ebf hexagonrpcd: listener: decode interp4 method definitions
To use interp4 method definitions for everything, the reverse tunnel
needs to be updated to understand them. Add support for the new method
definitions, preferring them if present.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 7d71de1ebc hexagonrpcd: iobuffer: use size_t for buffer sizes
The FastRPC peer can encode a 32-bit size for a variable-length
sequence. The members of the sequence can have a size more than 1,
potentially using more than 32 bits. Expand the buffer size to a size_t.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 85d96d4df6 chrecd: use hexagonrpc handle API
The handle API is a high-level interface that puts all error messages in
the same buffer. Use the handle API to open and close the chre_slpi
remote interface for code deduplication.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 034d35a6ed hexagonrpcd: use hexagonrpc handle API for default listener
The handle API is a high-level interface that puts all error messages in
the same buffer. Use the handle API to open and close the
adsp_default_listener remote interface.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 4fd9efcde2 libhexagonrpc: add remote interface open and close API
The code for opening and closing a remote interface with an error is
duplicated in hexagonrpcd and chrecd. Like the remotectl interface
itself, the error handling is useful for most FastRPC applications. Add
a new API for opening and closing remote interfaces with error checking.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan ea3e58d9e6 libhexagonrpc: add version 4 of method definition format
The current method definition format has a few issues. There is no way
to represent `apps_std_mkdir(in string dir, in long long mode)` because
it has a sequence before a fixed-length argument. The fixed-length
arguments are passed in 4-byte units, making large fixed-length arrays
awkward. Sequences of sequences cannot be represented.

Add a new version of the remote method definition to support more
methods, with sequences of sequences, mixed input and output arguments,
and fixed-length data structures greater than 32 bits.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan 78e2a94251 fastrpc: hexagonrpcd: listener: support more than 31 methods
When there are more than 31 methods in a remote interface, an extended
method ID is added to the primary input buffer when the ID is greater
than 30. Select the method from the primary input buffer when the ID is
greater than 30 in the reverse tunnel.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
Richard Acayan daab6ff190 fastrpc: libhexagonrpc: add error API
When the kernel side of FastRPC fails, the return value is -1 and errno
is set. When the remote side of FastRPC fails, the return value is an
AEE error code. It is not specialized for the reverse tunnel. Add an
error API that can convert the return value to a string-based error.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2026-08-24 17:40:17 -04:00
46 changed files with 2530 additions and 961 deletions

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
/*
* Context Hub Runtime Environment interface - method definitions
*
* Copyright (C) 2025 HexagonRPC Contributors
*
* This file is part of HexagonRPC.
*
* HexagonRPC 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 <https://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <libhexagonrpc/hexagonrpc.h>
const struct hrpc_method_def_interp4 chre_slpi_start_thread_def = {
.msg_id = 0,
.n_args = 0,
.args = NULL,
.n_inner_types = 0,
.inner_types = NULL,
};
const struct hrpc_method_def_interp4 chre_slpi_wait_on_thread_exit_def = {
.msg_id = 1,
.n_args = 0,
.args = NULL,
.n_inner_types = 0,
.inner_types = NULL,
};
+41
View File
@@ -0,0 +1,41 @@
/*
* Context Hub Runtime Environment interface - API
*
* Copyright (C) 2025 HexagonRPC Contributors
*
* This file is part of HexagonRPC.
*
* HexagonRPC 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 <https://www.gnu.org/licenses/>.
*/
#ifndef INTERFACE_CHRE_SLPI_H
#define INTERFACE_CHRE_SLPI_H
#include <stdint.h>
#include <libhexagonrpc/hexagonrpc.h>
extern struct hrpc_method_def_interp4 chre_slpi_start_thread_def;
static inline int chre_slpi_start_thread(int fd, uint32_t hdl)
{
return hexagonrpc(&chre_slpi_start_thread_def, fd, hdl);
}
extern struct hrpc_method_def_interp4 chre_slpi_wait_on_thread_exit_def;
static inline int chre_slpi_wait_on_thread_exit(int fd, uint32_t hdl)
{
return hexagonrpc(&chre_slpi_wait_on_thread_exit_def, fd, hdl);
}
#endif /* INTERFACE_CHRE_SLPI_H */
-30
View File
@@ -1,30 +0,0 @@
/*
* Context Hub Runtime Environment interface
*
* 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 <https://www.gnu.org/licenses/>.
*/
#ifndef INTERFACE_CHRE_SLPI_DEF
#define INTERFACE_CHRE_SLPI_DEF
#include <libhexagonrpc/interface.h>
HEXAGONRPC_DEFINE_REMOTE_METHOD(0, chre_slpi_start_thread, 0, 0, 0, 0)
HEXAGONRPC_DEFINE_REMOTE_METHOD(1, chre_slpi_wait_on_thread_exit, 0, 0, 0, 0)
#endif /* INTERFACE_CHRE_SLPI_DEF */
+11 -74
View File
@@ -20,105 +20,42 @@
*/
#include <errno.h>
#include <libhexagonrpc/fastrpc.h>
#include <libhexagonrpc/interfaces/remotectl.def>
#include <libhexagonrpc/handle.h>
#include <libhexagonrpc/session.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "interfaces/chre_slpi.def"
/* TODO move these to libhexagonrpc since most clients use them */
static int remotectl_open(int fd, char *name, struct fastrpc_context **ctx, void (*err_cb)(const char *err))
{
uint32_t handle;
int32_t dlret;
char err[256];
int ret;
ret = fastrpc2(&remotectl_open_def, fd, REMOTECTL_HANDLE,
strlen(name) + 1, name,
&handle,
&dlret,
256, err);
if (ret == -1) {
err_cb(strerror(errno));
return ret;
}
if (dlret == -5) {
err_cb(err);
return dlret;
}
*ctx = fastrpc_create_context(fd, handle);
return ret;
}
static int remotectl_close(struct fastrpc_context *ctx, void (*err_cb)(const char *err))
{
uint32_t dlret;
char err[256];
int ret;
ret = fastrpc2(&remotectl_close_def, ctx->fd, REMOTECTL_HANDLE,
ctx->handle,
&dlret,
256, err);
if (ret == -1) {
err_cb(strerror(errno));
return ret;
}
fastrpc_destroy_context(ctx);
return ret;
}
static void remotectl_err(const char *err)
{
fprintf(stderr, "Could not remotectl: %s\n", err);
}
static int chre_slpi_start_thread(struct fastrpc_context *ctx)
{
return fastrpc(&chre_slpi_start_thread_def, ctx);
}
static int chre_slpi_wait_on_thread_exit(struct fastrpc_context *ctx)
{
return fastrpc(&chre_slpi_wait_on_thread_exit_def, ctx);
}
#include "interface/chre_slpi.h"
int main()
{
struct fastrpc_context *ctx;
uint32_t hdl;
char err[256];
int fd, ret;
fd = hexagonrpc_fd_from_env();
if (fd == -1)
return 1;
ret = remotectl_open(fd, "chre_slpi", &ctx, remotectl_err);
if (ret)
ret = hexagonrpc_open(fd, "chre_slpi", &hdl, 256, err);
if (ret) {
fprintf(stderr, "Could not open CHRE remote interface: %s\n", err);
return 1;
}
ret = chre_slpi_start_thread(ctx);
ret = chre_slpi_start_thread(fd, hdl);
if (ret) {
fprintf(stderr, "Could not start CHRE\n");
goto err;
}
ret = chre_slpi_wait_on_thread_exit(ctx);
ret = chre_slpi_wait_on_thread_exit(fd, hdl);
if (ret) {
fprintf(stderr, "Could not wait for CHRE thread\n");
goto err;
}
err:
remotectl_close(ctx, remotectl_err);
hexagonrpc_close(fd, hdl);
}
+1 -1
View File
@@ -1,5 +1,5 @@
executable('chrecd',
'interfaces.c',
'interface/chre_slpi.c',
'main.c',
c_args : cflags,
include_directories : include,
+5 -7
View File
@@ -20,15 +20,15 @@
*/
#include <inttypes.h>
#include <libhexagonrpc/error.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <misc/fastrpc.h>
#include <sys/ioctl.h>
#include "aee_error.h"
#include "apps_mem.h"
#include "interfaces/apps_mem.def"
#include "interface/apps_mem.h"
#include "listener.h"
// See fastrpc.git/src/apps_mem_imp.c
@@ -71,11 +71,9 @@ static uint32_t apps_mem_request_map64(void *data,
mmap.size = first_in->len;
ret = ioctl(ctx->fd, FASTRPC_IOCTL_MMAP, &mmap);
if (ret == -1) {
perror("Memory map failed");
return AEE_EFAILED;
} else if (ret) {
fprintf(stderr, "Memory map failed: %s\n", aee_strerror[ret]);
if (ret) {
fprintf(stderr, "Memory map failed: %s\n",
hexagonrpc_strerror(ret));
return ret;
}
+2 -2
View File
@@ -20,15 +20,15 @@
*/
#include <errno.h>
#include <libhexagonrpc/error.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "aee_error.h"
#include "interfaces/apps_std.def"
#include "hexagonfs.h"
#include "interface/apps_std.h"
#include "iobuffer.h"
#include "listener.h"
+5
View File
@@ -4,6 +4,8 @@
hexagonrpcd - Server for FastRPC remote procedure calls from Qualcomm DSPs
.SH SYNOPSIS
\fBhexagonrpcd\fP [\fIoptions\&.\&.\&.\fP] -f \fIDEVICE
.PP
\fBhexagonrpcd\fP -h
.SH DESCRIPTION
Server for FastRPC remote procedure calls from Qualcomm DSPs\&.
.PP
@@ -25,6 +27,9 @@ Root directory of served files (default: /usr/share/qcom/)
.TP
\fB\-s\fP
Attach to sensorspd
.TP
\fB\-h\fP
Print help and exit
.PP
.SH NOTES
@@ -1,11 +1,11 @@
/*
* FastRPC interface list for building method definitions
* FastRPC reverse tunnel registration interface - method definitions
*
* Copyright (C) 2023 The Sensor Shell Contributors
* Copyright (C) 2025 HexagonRPC Contributors
*
* This file is part of sensh.
* This file is part of HexagonRPC.
*
* Sensh is free software: you can redistribute it and/or modify
* HexagonRPC 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.
@@ -19,6 +19,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#define HEXAGONRPC_BUILD_METHOD_DEFINITIONS 1
#include <stdint.h>
#include <libhexagonrpc/hexagonrpc.h>
#include "interfaces/chre_slpi.def"
const struct hrpc_method_def_interp4 adsp_default_listener_register_def = {
.msg_id = 0,
.n_args = 0,
.args = NULL,
.n_inner_types = 0,
.inner_types = NULL,
};
@@ -0,0 +1,34 @@
/*
* FastRPC reverse tunnel registration interface - API
*
* Copyright (C) 2025 HexagonRPC Contributors
*
* This file is part of HexagonRPC.
*
* HexagonRPC 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 <https://www.gnu.org/licenses/>.
*/
#ifndef INTERFACE_ADSP_DEFAULT_LISTENER_H
#define INTERFACE_ADSP_DEFAULT_LISTENER_H
#include <stdint.h>
#include <libhexagonrpc/hexagonrpc.h>
extern struct hrpc_method_def_interp4 adsp_default_listener_register_def;
static inline int adsp_default_listener_register(int fd, uint32_t hdl)
{
return hexagonrpc(&adsp_default_listener_register_def, fd, hdl);
}
#endif /* INTERFACE_ADSP_DEFAULT_LISTENER_H */
+50
View File
@@ -0,0 +1,50 @@
/*
* FastRPC reverse tunnel main interface - method definitions
*
* Copyright (C) 2025 HexagonRPC Contributors
*
* This file is part of HexagonRPC.
*
* HexagonRPC 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 <https://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <libhexagonrpc/hexagonrpc.h>
const struct hrpc_method_def_interp4 adsp_listener_init2_def = {
.msg_id = 3,
.n_args = 0,
.args = NULL,
.n_inner_types = 0,
.inner_types = NULL,
};
struct hrpc_arg_def_interp4 adsp_listener_next2_args[] = {
{ HRPC_ARG_WORD, sizeof(uint32_t) },
{ HRPC_ARG_WORD, sizeof(uint32_t) },
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB_SEQ, sizeof(char) },
};
const struct hrpc_method_def_interp4 adsp_listener_next2_def = {
.msg_id = 4,
.n_args = HRPC_ARRAY_SIZE(adsp_listener_next2_args),
.args = adsp_listener_next2_args,
.n_inner_types = 0,
.inner_types = NULL,
};
+54
View File
@@ -0,0 +1,54 @@
/*
* FastRPC reverse tunnel main interface - API
*
* Copyright (C) 2025 HexagonRPC Contributors
*
* This file is part of HexagonRPC.
*
* HexagonRPC 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 <https://www.gnu.org/licenses/>.
*/
#ifndef INTERFACE_ADSP_LISTENER_H
#define INTERFACE_ADSP_LISTENER_H
#include <stdint.h>
#include <libhexagonrpc/hexagonrpc.h>
#define ADSP_LISTENER 3
extern struct hrpc_method_def_interp4 adsp_listener_init2_def;
static inline int adsp_listener_init2(int fd)
{
return hexagonrpc(&adsp_listener_init2_def, fd, ADSP_LISTENER);
}
extern struct hrpc_method_def_interp4 adsp_listener_next2_def;
static inline int adsp_listener_next2(int fd,
uint32_t ret_rctx,
uint32_t ret_res,
uint32_t ret_outbufs_len, const char *ret_outbufs,
uint32_t *rctx,
uint32_t *handle,
uint32_t *sc,
uint32_t *inbufs_len,
uint32_t inbufs_size, char *inbufs)
{
return hexagonrpc(&adsp_listener_next2_def, fd, ADSP_LISTENER,
ret_rctx, ret_res,
ret_outbufs_len, (const void *) ret_outbufs,
rctx, handle, sc, inbufs_len,
inbufs_size, (void *) inbufs);
}
#endif /* INTERFACE_ADSP_LISTENER_H */
+42
View File
@@ -0,0 +1,42 @@
/*
* FastRPC memory mapping interface - method definitions
*
* Copyright (C) 2025 HexagonRPC Contributors
*
* This file is part of HexagonRPC.
*
* HexagonRPC 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 <https://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <libhexagonrpc/hexagonrpc.h>
static struct hrpc_arg_def_interp4 apps_mem_request_map64_args[] = {
{ HRPC_ARG_WORD, sizeof(uint32_t) },
{ HRPC_ARG_WORD, sizeof(uint32_t) },
{ HRPC_ARG_WORD, sizeof(uint32_t) },
{ HRPC_ARG_WORD, sizeof(uint32_t) },
{ HRPC_ARG_WORD, sizeof(uint64_t) },
{ HRPC_ARG_WORD, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
};
const struct hrpc_method_def_interp4 apps_mem_request_map64_def = {
.msg_id = 2,
.n_args = HRPC_ARRAY_SIZE(apps_mem_request_map64_args),
.args = apps_mem_request_map64_args,
.n_inner_types = 0,
.inner_types = NULL,
};
@@ -1,11 +1,11 @@
/*
* FastRPC interface list for building common method definitions
* FastRPC memory mapping interface - API
*
* Copyright (C) 2023 The Sensor Shell Contributors
* Copyright (C) 2025 HexagonRPC Contributors
*
* This file is part of sensh.
* This file is part of HexagonRPC.
*
* Sensh is free software: you can redistribute it and/or modify
* HexagonRPC 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.
@@ -19,6 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#define HEXAGONRPC_BUILD_METHOD_DEFINITIONS 1
#ifndef INTERFACE_APPS_MEM_H
#define INTERFACE_APPS_MEM_H
#include <libhexagonrpc/interfaces/remotectl.def>
#include <libhexagonrpc/hexagonrpc.h>
extern struct hrpc_method_def_interp4 apps_mem_request_map64_def;
#endif /* INTERFACE_APPS_MEM_H */
+184
View File
@@ -0,0 +1,184 @@
/*
* FastRPC operating system interface - method definitions
*
* Copyright (C) 2025 HexagonRPC Contributors
*
* This file is part of HexagonRPC.
*
* HexagonRPC 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 <https://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <libhexagonrpc/hexagonrpc.h>
static struct hrpc_arg_def_interp4 apps_std_freopen_args[] = {
{ HRPC_ARG_WORD, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB_SEQ, sizeof(char) },
};
const struct hrpc_method_def_interp4 apps_std_freopen_def = {
.msg_id = 1,
.n_args = HRPC_ARRAY_SIZE(apps_std_freopen_args),
.args = apps_std_freopen_args,
.n_inner_types = 0,
.inner_types = NULL,
};
static struct hrpc_arg_def_interp4 apps_std_fflush_args[] = {
{ HRPC_ARG_WORD, sizeof(uint32_t) },
};
const struct hrpc_method_def_interp4 apps_std_fflush_def = {
.msg_id = 2,
.n_args = HRPC_ARRAY_SIZE(apps_std_fflush_args),
.args = apps_std_fflush_args,
.n_inner_types = 0,
.inner_types = NULL,
};
static struct hrpc_arg_def_interp4 apps_std_fclose_args[] = {
{ HRPC_ARG_WORD, sizeof(uint32_t) },
};
const struct hrpc_method_def_interp4 apps_std_fclose_def = {
.msg_id = 3,
.n_args = HRPC_ARRAY_SIZE(apps_std_fclose_args),
.args = apps_std_fclose_args,
.n_inner_types = 0,
.inner_types = NULL,
};
static struct hrpc_arg_def_interp4 apps_std_fread_args[] = {
{ HRPC_ARG_WORD, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB_SEQ, sizeof(char) },
};
const struct hrpc_method_def_interp4 apps_std_fread_def = {
.msg_id = 4,
.n_args = HRPC_ARRAY_SIZE(apps_std_fread_args),
.args = apps_std_fread_args,
.n_inner_types = 0,
.inner_types = NULL,
};
static struct hrpc_arg_def_interp4 apps_std_fseek_args[] = {
{ HRPC_ARG_WORD, sizeof(uint32_t) },
{ HRPC_ARG_WORD, sizeof(uint32_t) },
{ HRPC_ARG_WORD, sizeof(uint32_t) },
};
const struct hrpc_method_def_interp4 apps_std_fseek_def = {
.msg_id = 9,
.n_args = HRPC_ARRAY_SIZE(apps_std_fseek_args),
.args = apps_std_fseek_args,
.n_inner_types = 0,
.inner_types = NULL,
};
static struct hrpc_arg_def_interp4 apps_std_fopen_with_env_args[] = {
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
};
const struct hrpc_method_def_interp4 apps_std_fopen_with_env_def = {
.msg_id = 19,
.n_args = HRPC_ARRAY_SIZE(apps_std_fopen_with_env_args),
.args = apps_std_fopen_with_env_args,
.n_inner_types = 0,
.inner_types = NULL,
};
static struct hrpc_arg_def_interp4 apps_std_opendir_args[] = {
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
};
const struct hrpc_method_def_interp4 apps_std_opendir_def = {
.msg_id = 26,
.n_args = HRPC_ARRAY_SIZE(apps_std_opendir_args),
.args = apps_std_opendir_args,
.n_inner_types = 0,
.inner_types = NULL,
};
static struct hrpc_arg_def_interp4 apps_std_closedir_args[] = {
{ HRPC_ARG_WORD, sizeof(uint64_t) },
};
const struct hrpc_method_def_interp4 apps_std_closedir_def = {
.msg_id = 27,
.n_args = HRPC_ARRAY_SIZE(apps_std_closedir_args),
.args = apps_std_closedir_args,
.n_inner_types = 0,
.inner_types = NULL,
};
static struct hrpc_arg_def_interp4 apps_std_readdir_args[] = {
{ HRPC_ARG_WORD, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(char) * 256 },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
};
const struct hrpc_method_def_interp4 apps_std_readdir_def = {
.msg_id = 28,
.n_args = HRPC_ARRAY_SIZE(apps_std_readdir_args),
.args = apps_std_readdir_args,
.n_inner_types = 0,
.inner_types = NULL,
};
static struct hrpc_arg_def_interp4 apps_std_mkdir_args[] = {
{ HRPC_ARG_BLOB, sizeof(char) },
{ HRPC_ARG_WORD, sizeof(uint32_t) },
};
const struct hrpc_method_def_interp4 apps_std_mkdir_def = {
.msg_id = 29,
.n_args = HRPC_ARRAY_SIZE(apps_std_mkdir_args),
.args = apps_std_mkdir_args,
.n_inner_types = 0,
.inner_types = NULL,
};
static struct hrpc_arg_def_interp4 apps_std_stat_args[] = {
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
};
const struct hrpc_method_def_interp4 apps_std_stat_def = {
.msg_id = 31,
.n_args = HRPC_ARRAY_SIZE(apps_std_stat_args),
.args = apps_std_stat_args,
.n_inner_types = 0,
.inner_types = NULL,
};
+39
View File
@@ -0,0 +1,39 @@
/*
* FastRPC operating system interface - API
*
* Copyright (C) 2025 HexagonRPC Contributors
*
* This file is part of HexagonRPC.
*
* HexagonRPC 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 <https://www.gnu.org/licenses/>.
*/
#ifndef INTERFACE_APPS_STD_H
#define INTERFACE_APPS_STD_H
#include <libhexagonrpc/hexagonrpc.h>
extern struct hrpc_method_def_interp4 apps_std_freopen_def;
extern struct hrpc_method_def_interp4 apps_std_fflush_def;
extern struct hrpc_method_def_interp4 apps_std_fclose_def;
extern struct hrpc_method_def_interp4 apps_std_fread_def;
extern struct hrpc_method_def_interp4 apps_std_fseek_def;
extern struct hrpc_method_def_interp4 apps_std_fopen_with_env_def;
extern struct hrpc_method_def_interp4 apps_std_opendir_def;
extern struct hrpc_method_def_interp4 apps_std_closedir_def;
extern struct hrpc_method_def_interp4 apps_std_readdir_def;
extern struct hrpc_method_def_interp4 apps_std_mkdir_def;
extern struct hrpc_method_def_interp4 apps_std_stat_def;
#endif /* INTERFACE_APPS_STD_H */
-27
View File
@@ -1,27 +0,0 @@
/*
* FastRPC interface list for building 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 <https://www.gnu.org/licenses/>.
*/
#define HEXAGONRPC_BUILD_METHOD_DEFINITIONS 1
#include "interfaces/adsp_default_listener.def"
#include "interfaces/apps_mem.def"
#include "interfaces/apps_std.def"
#include "interfaces/adsp_listener.def"
@@ -1,29 +0,0 @@
/*
* FastRPC reverse tunnel registration interface
*
* 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 <https://www.gnu.org/licenses/>.
*/
#ifndef INTERFACE_ADSP_DEFAULT_LISTENER_DEF
#define INTERFACE_ADSP_DEFAULT_LISTENER_DEF
#include <libhexagonrpc/interface.h>
HEXAGONRPC_DEFINE_REMOTE_METHOD(0, adsp_default_listener_register, 0, 0, 0, 0)
#endif /* INTERFACE_ADSP_DEFAULT_LISTENER_DEF */
-32
View File
@@ -1,32 +0,0 @@
/*
* FastRPC reverse tunnel main interface
*
* 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 <https://www.gnu.org/licenses/>.
*/
#ifndef INTERFACE_ADSP_LISTENER_DEF
#define INTERFACE_ADSP_LISTENER_DEF
#include <libhexagonrpc/interface.h>
#define ADSP_LISTENER_HANDLE 3
HEXAGONRPC_DEFINE_REMOTE_METHOD(3, adsp_listener_init2, 0, 0, 0, 0)
HEXAGONRPC_DEFINE_REMOTE_METHOD(4, adsp_listener_next2, 2, 1, 4, 1)
#endif /* INTERFACE_ADSP_LISTENER_DEF */
-29
View File
@@ -1,29 +0,0 @@
/*
* FastRPC operating system interface
*
* Copyright (C) 2024 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 <https://www.gnu.org/licenses/>.
*/
#ifndef INTERFACE_APPS_MEM_DEF
#define INTERFACE_APPS_MEM_DEF
#include <libhexagonrpc/interface.h>
HEXAGONRPC_DEFINE_REMOTE_METHOD(2, apps_mem_request_map64, 8, 0, 4, 0)
#endif /* INTERFACE_APPS_MEM_DEF */
Loaded 20 of 46 files, more files were not shown because too many files have changed in this diff. Show more