148 Commits

Author SHA1 Message Date
Richard Acayan
0b4c7bffaf fastrpc: hexagonrpcd: hexagonfs: mapped: return NULL for empty dirs
The mapped_or_empty file implementation uses NULL to denote when an
empty directory should be in place of a non-existent file. Changing the
pointer to the output has no effect. Change the implementation data to a
NULL pointer so empty directories function properly.
v0.2.1
2023-12-04 19:50:34 -05:00
Richard Acayan
00b5f80608 fastrpc: hexagonrpcd: hexagonfs: initialize is_assigned in from_dirent
The is_assigned attribute should only be true when it is assigned a
numeric ID, otherwise it will not be closed. The from_dirent operations
in the implementations of a file type do not use the calloc() function,
so the is_assigned attribute is uninitialized. Initialize it to zero so
the open file can be closed when requested.
2023-12-04 19:50:24 -05:00
Richard Acayan
9ea9bed77b fastrpc: hexagonrpcd: listener: do not attempt to allocate zero outbufs
The malloc(3p) manual page states that an implementation may choose to
return a non-NULL pointer when the size is zero. This function assumes
that there is an element in the array if the pointer is not NULL. When
the size is zero, skip the allocation and return NULL.
2023-12-04 19:50:11 -05:00
Richard Acayan
23585daf67 qmi: add generated substitute
The qmic utility is rarely packaged in mainstream distributions, making
it inconvenient to set up a working build environment. Add generated
source files to enable compilation without qmic installed.
2023-12-04 19:49:59 -05:00
Richard Acayan
e0d6c2a7ac fastrpc: hexagonrpcd: hexagonfs: remove static root filesystem
The root filesystem is now dynamically constructed in rpcd_builder.c.
Remove this macro-generated filesystem as it is unused and generates a
warning.
v0.2.0
2023-11-27 18:53:31 -05:00
Richard Acayan
329f1ae841 fastrpc: hexagonrpcd: apps_std: remove unused variables
These variables went unused since the input buffer lengths were switched
to the sizes parsed by iobuffer.c, instead of the sizes in the primary
input argument. This makes it unnecessary at times to unpack the primary
input buffer, although the variables were being kept around to document
calling conventions. Remove the variables since they add unnecessary
warnings.

The calling conventions can still be found in the Android implementation
of FastRPC.
2023-11-27 18:53:31 -05:00
Richard Acayan
2358946095 fastrpc: hexagonrpcd: apps_std: include correct headers
This interface implementation no longer opens files directly, but sends
requests to hexagonfs. Hence, fcntl.h and dirent.h are no longer needed.
Also, it uses 32-bit integers from stdint.h.
2023-11-27 18:53:31 -05:00
Richard Acayan
06ef0b17a4 fastrpc: README: remove note about source code directory structure
This has been completed a long time ago.
2023-11-27 18:53:31 -05:00
Richard Acayan
d87d8ffc47 fastrpc: README: mention correct interface listings
The interfaces being created on the reverse tunnel are now dynamically
generated.
2023-11-27 18:53:31 -05:00
Richard Acayan
947f52d779 fastrpc: README: clarify REMOTE_SCALARS_MAKE
This macro is used to generate the 32-bit remote "scalars"/"sc"
argument. Correct the name and link to the definition.
2023-11-27 18:53:31 -05:00
Richard Acayan
4983830139 fastrpc: README: add more usage documentation
The data types for the ioctl wrapper are important, as it has variable
arguments. Document them.

Also mention terminology used in QAIC output to aid in understanding
this project in relation to existing FastRPC implementations.
2023-11-27 18:53:31 -05:00
Richard Acayan
5e04177155 fastrpc: README: document meson build system
The meson.build was added a while ago.
2023-11-27 18:52:44 -05:00
Richard Acayan
ee439dd6cb fastrpc: change copyright line
There are multiple contributors already, and copyright assignment is not
an intended requirement for contributing.
2023-11-27 18:52:18 -05:00
Richard Acayan
b686df88d7 fastrpc: hexagonrpcd: builder: default required directories to empty
The sensor configuration is not required and is normally used just to
generate the sensor registry, but the sensors do not appear unless the
directory is present. The ADSP_LIBRARY_PATH virtual environment variable
may be used when opening absolute paths as a firmware quirk, even if
nothing is read from it. To remove the requirement of empty directories
in the physical filesystem, use the new hexagonfs_mapped_or_empty_ops.
2023-11-27 18:28:06 -05:00
Richard Acayan
ccaa9728d9 fastrpc: hexagonrpcd: hexagonfs: add optionally mapped directories
Some directories are not required for the normal operation of the sensor
firmware, such as the sensor configuration directory. Add support for
directories that are empty if they are not present in the physical
filesystem.
2023-11-27 17:21:03 -05:00
Richard Acayan
f5e05d0e7d fastrpc: README: correct the sensors registry path
The sensors registry path is in /persist/sensors/registry/registry and
not /persist/sensors/registry. Correct this in the README.
2023-08-01 19:09:04 -04:00
Richard Acayan
b6d1f60ae9 fastrpc: hexagonrpcd: document added options in help text
The -R option specifies the root of the files served to the remote
processor (before mapping them to the virtual filesystem). The -d option
specifies the DSP variant, used to select the subdirectory storing the
libraries for the remote processor.
2023-07-27 21:04:15 -04:00
Richard Acayan
ac6b6d61d0 fastrpc: hexagonrpcd: print most help text at once
There are multiple printf statements for each line of the help text.
Each line can be concatenated to one string at compile-time without
impacting readability of the intended output, with the exception of the
first line, with special formatting. Join the rest of the help text into
one printf statement.
2023-07-27 21:00:45 -04:00
Richard Acayan
44d4a818aa fastrpc: README: document new paths 2023-07-27 21:00:37 -04:00
Richard Acayan
2b8875d185 fastrpc: hexagonrpcd: accept path information from command line
Accept the path to files for the remote processor and the subdirectory
with the DSP shared object files on the command line.
2023-07-25 19:05:33 -04:00
Richard Acayan
4fb42aaa79 fastrpc: hexagonrpcd: specify device root path as absolute
The directory that stores the files for the remote processor is
specified relative to /usr/share/qcom. This is arbitrary and confuses
the user into thinking that the path is relative to the current working
directory. Specify it as absolute.
2023-07-25 19:05:28 -04:00
Richard Acayan
d791bb48a0 fastrpc: hexagonrpcd: rework virtual filesystem sources
The virtual filesystem maps to physical files and directories. Move the
location of these physical files and directories according to #1.
2023-07-05 21:59:58 -04:00
Richard Acayan
9d97f21f4a fastrpc: hexagonrpcd: localctl: use inbuf size instead of provided len
The output of the adsp_listener interface provides the size of each
buffer in addition to the length provided to the remote method in the
primary buffer. Use the size of the buffer, which always corresponds to
the size allocated to it, regardless of whether there are consistency
checks.
2023-07-03 19:34:21 -04:00
Richard Acayan
1874e7a109 fastrpc: hexagonrpcd: apps_std: use inbuf size instead of provided len
The output of the adsp_listener interface provides the size of each
buffer in addition to the length provided to the remote method in the
primary buffer. Use the size of the buffer, which always corresponds to
the size allocated to it, regardless of whether there are consistency
checks.
2023-07-03 19:30:08 -04:00
Richard Acayan
aa1cfca7b4 fastrpc: hexagonrpcd: apps_std: make fseek primary input buffer constant
The input buffers are not modified by the implementation of this remote
method. Make the primary input buffer constant.
2023-06-30 21:42:40 -04:00