Commit Graph

134 Commits

Author SHA1 Message Date
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
Richard Acayan
4e2d1d46c6 fastrpc: hexagonrpcd: apps_std: make seek table constant
This is a read-only lookup table and is not modified during runtime.
Make it constant.

Also remove excessive empty lines.
2023-06-30 21:42:40 -04:00
Richard Acayan
3becf15c7a fastrpc: hexagonrpcd: apps_std: move fread method primary parameters
The only named structs for parameters in the primary input and output
buffers are for the fread remote method. Move them to the the place
where they are used, consistent with the other remote method
implementations.
2023-06-30 21:42:40 -04:00
Richard Acayan
3bf791122f fastrpc: hexagonrpcd: hexagonfs: do not store file descriptor array
The file descriptor array maps file descriptors to their corresponding
file descriptions, and is in static storage. Since there is range
checking for file descriptors, there is still a benefit to having access
to the file descriptor array. Accept the array as a parameter.

In the future, this parameter can be removed in secondary functions if
needed.
2023-06-30 21:42:40 -04:00
Richard Acayan
ea226ef7b9 fastrpc: hexagonrpcd: apps_std: open directories on initialization
The apps_std interface stores file descriptors in static variables,
opening them when needed, and configures HexagonFS with a hardcoded root
directory. Configure HexagonFS and open the file descriptors in
initialization instead.
2023-06-30 21:42:40 -04:00
Richard Acayan
77ff6338be fastrpc: hexagonrpcd: hexagonfs: receive root directory argument
The root directory should not be hardcoded by hexagonfs, but the user of
it. Receive the root directory entry as an argument to the function that
opens the root directory.
2023-06-30 21:42:40 -04:00
Richard Acayan
1e83c7316e fastrpc: hexagonrpcd: localctl: use interface list from context
Now that the context is being initialized, use the interface list stored
in it.
2023-06-30 21:42:40 -04:00
Richard Acayan
3af581489d fastprc: hexagonrpcd: dynamically initialize interfaces
Some interfaces need to be configured before they can function.
Dynamically initialize the interfaces so there can be code to configure
them.
2023-06-30 21:42:40 -04:00
Richard Acayan
36bff0f541 fastrpc: hexagonrpcd: localctl: add context initialization
This interface depends on static variables to function properly. Add
code to initialize a context with the required data.

Do not use the context yet because it is not always initialized.
2023-06-30 21:42:40 -04:00
Richard Acayan
0ed58012fa fastrpc: hexagonrpcd: listener: move interfaces to listener user
The reverse tunnel finds interfaces in a static variable. As a
consequence, the interfaces cannot be customized by the user of the
reverse tunnel. Move the interfaces to the user of the listener.
2023-06-30 21:42:40 -04:00
Richard Acayan
cd8a751732 fastrpc: hexagonrpcd: listener: declare procedure array as pointer
As an variable-length array within a struct, the procedure array is not
included in the sizeof() macro and cannot be trivially copied. Declare
it as a pointer to an array of procedures so the local fastrpc interface
definitions have a predictable size.
2023-06-30 21:42:40 -04:00
Richard Acayan
9946564fe9 fastrpc: hexagonrpcd: add interface contexts
Some interfaces preserve their states between invocations in static
storage. This is not ideal, as interfaces cannot be initialized with
information from the user of the reverse tunnel. Add support for
interface-defined contexts.
2023-06-30 21:42:40 -04:00
Richard Acayan
4a5f23e5d9 fastrpc: hexgaonrpcd: hexagonfs: remove offset property
This property should only be defined for file operations that need it.
Remove it from the common hexagonfs_fd struct and expect each file
operations to add it in the data pointer if necessary.
2023-06-05 18:07:46 -04:00
Richard Acayan
7dfd7d778c fastrpc: hexagonrpcd: hexagonfs: mapped: set functions to static
These functions are only referenced in the same compilation unit to
define file operations. Set these functions to static so they don't get
exported directly for no reason.
2023-06-05 18:07:40 -04:00
Richard Acayan
23b7681f3f tools: sscregistrygen: actually check the soc_id
The hardware platform was checked in the above code. Check the SoC
identifier here, instead of checking the hardware platform against the
command-line SoC identifier.
v0.1.0
2023-05-22 17:11:36 -04:00