203 Commits

Author SHA1 Message Date
J. Neuschäfer
93f3467dcf iobuffer: Fix encoding/decoding on big-endian
It is possible (albeit unusual) to boot a big-endian system on a
smartphone, and it's generally good to have portable code.

le32toh and htole32 are a glibc extension that is also implemented by
musl-libc, uclibc-ng, and bionic.

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2025-12-31 16:06:35 +01:00
Achill Gilgenast
c4109b4502 data: Add systemd system services
Signed-off-by: Achill Gilgenast <achill@achill.org>
2025-11-20 15:13:10 +01:00
J. Neuschäfer
5d3cef4e5b CI: Run tests
The tests don't require access to Hexagon hardware, they currently pass,
and running them will provide a better assurance against regressions.

Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
2025-09-22 13:03:46 +02:00
Richard Acayan
23a69640bf tools: make json-c optional
This shouldn't be a requirement to compile anything else. Stop requiring
it for building anything, and assume the user just wants to compile the
main project.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
v0.4.0
2025-08-19 22:30:25 -04:00
Richard Acayan
18e2ca3178 CI: depend on libjson-c-dev
This is a dependency of the newly imported sscregistrygen.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2025-08-19 22:27:14 -04:00
Richard Acayan
ffca60917c meson.build: bump to 0.4.0
No breaking changes

New features:
- man page for hexagonrpcd
- support for FASTRPC_IOCTL_INIT_CREATE with fastrpc_shell_X
- apps_mem interface (mostly allocating memory for now)
- logic for hexagonfs root directory
- sscregistrygen tool to generate sensor registry
- Github CI (successful compilation only)

Fixes:
- Disabled verbose logging by default
- Documented the paths relative to the root directory
- Made apps_std_stat relative to ADSP libs directory
- Fixed unsigned/signed comparison in reverse tunnel
- Declared minimum meson version for meson.options
- Added soversion to the library build

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2025-08-19 22:15:27 -04:00
Richard Acayan
6e1281dc8d tools: add sscregistrygen from sensh
From the sensor shell repository, sscregistrygen is a tool for
generating the sensor registry from the sensor config. It is useful when
the sensor registry is not included in device firmware. Add
sscregistrygen here since it is more directly used by hexagonrpc rather
than sensh.

Link: 23b7681f3f/tools/sscregistrygen.c
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2025-08-19 22:13:32 -04:00
Jens Reidel
948c5d0d37 hexagonrpcd: Guess directory for hexagonfs from compatible
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
2025-08-18 22:49:26 -04:00
Dmitry Baryshkov
e52da43a63 apps_mem: specify int argument to fastrpc_apps_mem_init()
Without this building fails with:

../git/hexagonrpcd/rpcd.c: In function 'start_reverse_tunnel':
../git/hexagonrpcd/rpcd.c:275:21: error: too many arguments to function 'fastrpc_apps_mem_init'; expected 0, have 1
  275 |         ifaces[2] = fastrpc_apps_mem_init(fd);
      |                     ^~~~~~~~~~~~~~~~~~~~~ ~~
In file included from ../git/hexagonrpcd/rpcd.c:38:
../git/hexagonrpcd/apps_mem.h:27:27: note: declared here
   27 | struct fastrpc_interface *fastrpc_apps_mem_init();
      |                           ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2025-05-13 04:59:23 +03:00
Dmitry Baryshkov
6e5f7d9d54 CI: add simple workflow
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2025-05-12 13:32:42 +03:00
Dmitry Baryshkov
9a68ca3abf meson.build: declare minimum meson version
The project uses meson.options rather than meson_options.txt. Document
the minimum meson version that can be used to build the project.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2025-05-12 13:32:42 +03:00
Dmitry Baryshkov
146d0e1dab listener: fix Wsign-compare error
Fix warning / error reported by gcc:

../git/hexagonrpcd/listener.c:115:25: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
         if (inbufs[0].s != 4 * (def->in_nums
                         ^~

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2025-05-12 13:32:42 +03:00
Richard Acayan
2377fd46f0 hexagonrpcd: add apps_mem interface implementation
The apps_mem interface enables the FastRPC shell to load skel ELFs,
such as libhexagon_nn_skel.so.
2025-05-09 19:36:50 -04:00
Richard Acayan
372ca67d7a hexagonrpcd: interfaces: add apps_mem interface
The apps_mem interface is the interface that allows the DSP to map
memory and to allocate more memory. Add a method definition for it.
2025-05-09 19:36:50 -04:00
Richard Acayan
4b1ecd8505 hexagonrpcd: apps_std: perform stat relative to ADSP libs directory
When loading a new skel file, the DSP may access a testsig.so file. This
calls apps_std_fopen_with_env which is relative to a specified
directory, but also apps_std_stat. Since the same "testsig.so"
path is accessed relative to ADSP_LIBRARY_PATH and to the current
working directory, infer that the current working directory should be
ADSP_LIBRARY_PATH.
2025-05-09 19:36:50 -04:00
Richard Acayan
53e347f39d hexagonrpcd.1: add -c option 2025-05-09 19:36:50 -04:00
Richard Acayan
75150d4860 hexagonrpcd: add -c option to start with pd 2025-05-09 19:36:49 -04:00
Richard Acayan
5620db43a7 hexagonrpcd.1: document the paths relative to the root directory
The files shouldn't be installed right in /usr/share/qcom except for
testing. Rather, they should be installed in some device-specific
directory to make packaging easier on some distros. Document the paths
relative to the root directory for served files.
2024-11-05 21:41:35 -05:00
Richard Acayan
0e9e03b37b README: document the paths relative to the root directory
The absolute paths shouldn't be installed right in /usr/share/qcom
except for testing. Document the modifiable directory where served files
are retrieved from and the convention of where this directory should be
located.

Link: https://gitlab.com/flamingradian/sensh/-/issues/1
2024-11-05 21:41:26 -05:00
Alexandre Viard
61bb51bbc9 Use Major.Minor for the lib soversion derived from project version
[richard: rebase and squash; remove leading whitespace in commit message]
2024-11-01 19:15:29 -04:00
Alexandre Viard
ffbc4da830 Add man page for hexagonrpcd
[richard: remove trailing whitespace under -s; squash]
2024-10-21 19:06:54 -04:00
Alex
2415d5f90d Add soversion to the library build 2024-10-16 17:53:03 -04:00
Richard Acayan
7aab0f2c42 meson.options: disable verbose logging by default
Verbose logging can be useful when something goes wrong, but HexagonRPCD
already works well on some devices. Disable verbose logging by default.

Reported by Adrian on the SDM845 Mainline Matrix channel.

Fixes: 30fa49eb20 ("build: add hexagonrpcd_verbose option")
2024-05-16 16:00:13 -04:00
Joel Selvaraj
b7eff23db1 hexagonrpcd/rpcd_builder: introduce /system/vendor mapping
Needed for some Xiaomi phones such as the Poco F1.
Based on https://gitlab.com/sdm670-mainline/hexagonrpc/-/merge_requests/1.
Thanks to the initial work of @longnoserob in the above MR!
v0.3.2
2024-05-14 02:03:35 -05:00
Joel Selvaraj
716e1e27c7 README: add socinfo sysfs mapping to HexagonFS table
Introduced in https://gitlab.com/sdm670-mainline/hexagonrpc/-/merge_requests/2.
2024-05-14 02:03:35 -05:00