7 Commits
Author SHA1 Message Date
Richard Acayan 3f46980dc9 hexagonrpcd: correct -d default in help text
The name of the DSP defaults to none, but the -d option is wrongly
documented as having a default of "adsp". Correct this in the help text.
2024-04-15 18:35:46 -04:00
Richard Acayan 30fa49eb20 build: add hexagonrpcd_verbose option
There is extra debug logging in the code which can be activated by
`meson configure build -Dc_args=-DHEXAGONRPC_VERBOSE`. This may be
difficult to trigger, since it requires -D twice in the same argument.
Add the hexagonrpcd_verbose option to make it easier to configure the
extra logging.

This can be activated with `-Dhexagonrpcd_verbose=true` and deactivated
with `-Dhexagonrpcd_verbose=false`.
2024-04-11 17:59:03 -04:00
Richard Acayan b7ad1021a2 build: apply default C flags to all targets
The warning flags should be applied to the entire C codebase in order to
help ensure correct code. No extra warnings are emitted by doing this.
2024-04-11 17:45:47 -04:00
Richard Acayan f23297f962 tests: set warning flags
Most subdirectories in this project have all, pedantic, and some extra
warnings enabled. Set this for tests as well, as there is no real
justification otherwise.
2024-04-09 19:18:44 -04:00
Richard Acayan c4c469bd8a tests: iobuffer: convert binary data to unsigned char arrays
Signed character arrays can overflow when specifying values greater than
127. The actual data is not affected, but this can cause compiler
warnings. Use unsigned character arrays so the compiler does not
complain about overflows.
2024-04-09 19:16:04 -04:00
Richard Acayan 6840e1dcfa tests: iobuffer: exit with code 0 on success
This file seems to implicitly return 0 when everything is successful,
but this is unclear when reading it. Explicitly return zero when all
tests are successful.
2024-04-09 19:10:30 -04:00
Richard Acayan aaef8a1e28 hexagonrpcd: use the dsp directory as the default for libraries
This variable represents the subdirectory in the dsp/ directory where
libraries should be searched. This is the argument to the optional `-d`
and is used when creating the filesystem. Initialize it to an empty
string so HexagonFS searches in /usr/share/qcom/dsp/ by default.
2024-04-09 17:05:21 -04:00
8 changed files with 25 additions and 13 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
executable('chrecd',
'interfaces.c',
'main.c',
c_args : ['-Wall', '-Wextra', '-Wpedantic'],
c_args : cflags,
include_directories : include,
install : true,
link_with : libhexagonrpc,
+1 -1
View File
@@ -11,7 +11,7 @@ executable('hexagonrpcd',
'localctl.c',
'rpcd.c',
'rpcd_builder.c',
c_args : ['-Wall', '-Wextra', '-Wpedantic', '-Wno-unused-parameter'],
c_args : cflags,
include_directories : include,
install : true,
link_with : libhexagonrpc,
+2 -2
View File
@@ -132,7 +132,7 @@ static void print_usage(const char *argv0)
printf("Usage: %s [options] -f DEVICE\n\n", argv0);
printf("Server for FastRPC remote procedure calls from Qualcomm DSPs\n\n"
"Options:\n"
"\t-d DSP\t\tDSP name (default: adsp)\n"
"\t-d DSP\t\tDSP name (default: "")\n"
"\t-f DEVICE\tFastRPC device node to attach to\n"
"\t-p PROGRAM\tRun client program with shared file descriptor\n"
"\t-R DIR\t\tRoot directory of served files (default: /usr/share/qcom/)\n"
@@ -237,7 +237,7 @@ int main(int argc, char* argv[])
{
char *fastrpc_node = NULL;
const char *device_dir = "/usr/share/qcom/";
const char *dsp;
const char *dsp = "";
const char **progs;
pid_t *pids;
size_t n_progs = 0;
+1
View File
@@ -3,6 +3,7 @@ libhexagonrpc = shared_library('hexagonrpc',
'fastrpc.c',
'interfaces.c',
'session.c',
c_args : cflags,
include_directories : include,
install : true
)
+6
View File
@@ -3,6 +3,12 @@ project('fastrpc', 'c')
include = include_directories('include')
client_target = get_option('libexecdir') / 'hexagonrpc'
cflags = ['-Wall', '-Wextra', '-Wpedantic', '-Wno-unused-parameter']
if get_option('hexagonrpcd_verbose')
cflags += '-DHEXAGONRPC_VERBOSE'
endif
subdir('libhexagonrpc')
subdir('hexagonrpcd')
subdir('chrecd')
+2
View File
@@ -0,0 +1,2 @@
option('hexagonrpcd_verbose', type : 'boolean', value : true,
description : 'Compile hexagonrpcd with extra logging for each remote method invocation')
+1
View File
@@ -7,6 +7,7 @@ endif
test_iobuffer = executable('test_iobuffer',
'test_iobuffer.c',
'../hexagonrpcd/iobuffer.c',
c_args : cflags,
include_directories : include,
)
+11 -9
View File
@@ -24,7 +24,7 @@
#include "../hexagonrpcd/iobuffer.h"
static const char misaligned_iobufs[] = {
static const unsigned char misaligned_iobufs[] = {
/* inbuf 0 (4 bytes misaligned) */
0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
@@ -58,16 +58,16 @@ static const char misaligned_iobufs[] = {
':', 'D',
};
static char misaligned_decoded0[] = { 0x12, };
static char misaligned_decoded1[] = {
static unsigned char misaligned_decoded0[] = { 0x12, };
static unsigned char misaligned_decoded1[] = {
0x02, 0x46, 0x8A, 0xCF, 0x13, 0x57, 0x9B, 0xDF, 0x04, 0x8C,
};
static char misaligned_decoded2[] = { 'A', 'B', 'C', };
static char misaligned_decoded3[] = { 'F', 'a', 's', 't', };
static char misaligned_decoded4[] = { 'S', 'l', 'o', 'w', '\0', };
static char misaligned_decoded5[] = { 'f', 'a', 's', 't', 'e', 'r', };
static char misaligned_decoded6[] = { 'F', 'a', 's', 't', 'R', 'P', 'C', };
static char misaligned_decoded7[] = { ':', 'D', };
static unsigned char misaligned_decoded2[] = { 'A', 'B', 'C', };
static unsigned char misaligned_decoded3[] = { 'F', 'a', 's', 't', };
static unsigned char misaligned_decoded4[] = { 'S', 'l', 'o', 'w', '\0', };
static unsigned char misaligned_decoded5[] = { 'f', 'a', 's', 't', 'e', 'r', };
static unsigned char misaligned_decoded6[] = { 'F', 'a', 's', 't', 'R', 'P', 'C', };
static unsigned char misaligned_decoded7[] = { ':', 'D', };
static const struct fastrpc_io_buffer misaligned_decoded[] = {
{ .s = 1, .p = misaligned_decoded0, },
@@ -242,4 +242,6 @@ int main(int argc, const char **argv)
ret = test_out_misaligned();
if (ret)
return ret;
return 0;
}