The option character is being compared to -1, but this -1 is an integer.
With GCC 12.2.1 on aarch64 platforms, the 8-bit character is not
properly sign-extended to 32 bits. Store the option character as an
integer so it is properly sign-extended.
Further investigation is needed to determine whether this is an
optimization bug and what value the 8-bit signed -1 is equal to.
GCC is a bit picky on Alpine Linux and wants `-ljson-c` to be at the end
of the command-line arguments. Move it to the end so the tools can be
built with this requirement.
The open_dirs() function opens common directories that are usually
requested multiple times by the remote processor. When it fails to open
a directory, the failure propagates to the remote processor. Since the
remote processor might not need every directory, silence this failure so
the daemon can serve files unrelated to any missing or inaccessible
directories.
On SDM845, the sensor registry is located at /persist
instead of /mnt/vendor. Add this path as well and point
to the same sensor registry location as on SDM670.
SDM670 uses the ADSP to interact with the sensors over FastRPC.
However, high-end SoCs like SDM845 have a separate SLPI DSP which
has its own FastRPC node e.g. /dev/fastrpc-sdsp.
Add a commandline interface to set the FastRPC node and the attachment
type.
The definition files can be included directly so there is no need for a
header file for each FastRPC interface. While the path to the include
file is changing move these files to a separate directory so the
arbitrary `fastrpc_` prefix isn't reserved for the interfaces.
Defining the static handle numbers is the only special thing that the
interface headers do right now. Move them into the definition files so
the headers can be removed.
It is tedious to add new interfaces if they each need their own C source
files. Move the definitions to a single interfaces.c file that has each
interface on one line to make it easier to add new interfaces.
This macro used for the interfaces in hexagonrpcd are useful for
anything using the fastrpc function. Add the macro in the exported
headers so other applications using libhexagonrpc can define remote
methods easily.
This is sometimes necessary on Linux, but some C libraries define it.
Only redefine O_SEARCH if it is not defined already, otherwise the
existing macro definition can be used.
This debugfs value outputs a number. Sensor configuration matches the
platform against a textual representation for this. Since the registry
generator doesn't convert between these, hardcode this in the example
command so it isn't broken.
The apps_std implementation expects an acdb directory in
/usr/lib/qcom/adsp/avs. This was not obvious when looking in the
hexagonfs files so it was initially left out of the README. Add it now
that this was noticed.
This protocol buffer should have been added a long time ago. Add it now
so sensh can be built again.
Fixes: 368b5330f0 ("sensh: add support for generic sensor event")
This implementation does not try to access a /etc/qcom/sensors
directory. Instead, it looks for these files/directories in /etc/qcom.
Document the directories that this implementation actually searches.
The sensor registry is generated from the configuration on the vendor
partition. Add a registry generator so this registry can be generated,
even without access to the partition of a given device.
The range check does not reject negative file descriptors. A negative
file descriptor accesses the memory before the array of open files.
Avoid this behavior by rejecting negative file descriptors.