Skip to content

Commit e93906a

Browse files
committed
hexagonrpcd: interface: switch apps_std interface to interp4
1 parent a9e337f commit e93906a

File tree

6 files changed

+234
-49
lines changed

6 files changed

+234
-49
lines changed

hexagonrpcd/apps_std.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#include <sys/stat.h>
2828
#include <unistd.h>
2929

30-
#include "interfaces/apps_std.def"
3130
#include "hexagonfs.h"
31+
#include "interface/apps_std.h"
3232
#include "iobuffer.h"
3333
#include "listener.h"
3434

@@ -408,23 +408,23 @@ static const struct fastrpc_function_impl apps_std_procs[] = {
408408
{ .def = NULL, .impl = NULL, },
409409
{ .def = NULL, .impl = NULL, },
410410
{
411-
.def = &apps_std_fflush_def,
411+
.def4 = &apps_std_fflush_def,
412412
.impl = apps_std_fflush,
413413
},
414414
{
415-
.def = &apps_std_fclose_def,
415+
.def4 = &apps_std_fclose_def,
416416
.impl = apps_std_fclose,
417417
},
418418
{
419-
.def = &apps_std_fread_def,
419+
.def4 = &apps_std_fread_def,
420420
.impl = apps_std_fread,
421421
},
422422
{ .def = NULL, .impl = NULL, },
423423
{ .def = NULL, .impl = NULL, },
424424
{ .def = NULL, .impl = NULL, },
425425
{ .def = NULL, .impl = NULL, },
426426
{
427-
.def = &apps_std_fseek_def,
427+
.def4 = &apps_std_fseek_def,
428428
.impl = apps_std_fseek,
429429
},
430430
{ .def = NULL, .impl = NULL, },
@@ -437,7 +437,7 @@ static const struct fastrpc_function_impl apps_std_procs[] = {
437437
{ .def = NULL, .impl = NULL, },
438438
{ .def = NULL, .impl = NULL, },
439439
{
440-
.def = &apps_std_fopen_with_env_def,
440+
.def4 = &apps_std_fopen_with_env_def,
441441
.impl = apps_std_fopen_with_env,
442442
},
443443
{ .def = NULL, .impl = NULL, },
@@ -447,21 +447,21 @@ static const struct fastrpc_function_impl apps_std_procs[] = {
447447
{ .def = NULL, .impl = NULL, },
448448
{ .def = NULL, .impl = NULL, },
449449
{
450-
.def = &apps_std_opendir_def,
450+
.def4 = &apps_std_opendir_def,
451451
.impl = apps_std_opendir,
452452
},
453453
{
454-
.def = &apps_std_closedir_def,
454+
.def4 = &apps_std_closedir_def,
455455
.impl = apps_std_closedir,
456456
},
457457
{
458-
.def = &apps_std_readdir_def,
458+
.def4 = &apps_std_readdir_def,
459459
.impl = apps_std_readdir,
460460
},
461461
{ .def = NULL, .impl = NULL, },
462462
{ .def = NULL, .impl = NULL, },
463463
{
464-
.def = &apps_std_stat_def,
464+
.def4 = &apps_std_stat_def,
465465
.impl = apps_std_stat,
466466
},
467467
};

hexagonrpcd/interface/apps_std.c

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
/*
2+
* FastRPC operating system interface - method definitions
3+
*
4+
* Copyright (C) 2025 HexagonRPC Contributors
5+
*
6+
* This file is part of HexagonRPC.
7+
*
8+
* HexagonRPC is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#include <stdint.h>
23+
#include <libhexagonrpc/hexagonrpc.h>
24+
25+
static struct hrpc_arg_def_interp4 apps_std_freopen_args[] = {
26+
{ HRPC_ARG_WORD, sizeof(uint32_t) },
27+
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
28+
{ HRPC_ARG_OUT_BLOB_SEQ, sizeof(char) },
29+
};
30+
31+
struct hrpc_method_def_interp4 apps_std_freopen_def = {
32+
.msg_id = 1,
33+
.n_args = HRPC_ARRAY_SIZE(apps_std_freopen_args),
34+
.args = apps_std_freopen_args,
35+
.n_inner_types = 0,
36+
.inner_types = NULL,
37+
};
38+
39+
static struct hrpc_arg_def_interp4 apps_std_fflush_args[] = {
40+
{ HRPC_ARG_WORD, sizeof(uint32_t) },
41+
};
42+
43+
struct hrpc_method_def_interp4 apps_std_fflush_def = {
44+
.msg_id = 2,
45+
.n_args = HRPC_ARRAY_SIZE(apps_std_fflush_args),
46+
.args = apps_std_fflush_args,
47+
.n_inner_types = 0,
48+
.inner_types = NULL,
49+
};
50+
51+
static struct hrpc_arg_def_interp4 apps_std_fclose_args[] = {
52+
{ HRPC_ARG_WORD, sizeof(uint32_t) },
53+
};
54+
55+
struct hrpc_method_def_interp4 apps_std_fclose_def = {
56+
.msg_id = 3,
57+
.n_args = HRPC_ARRAY_SIZE(apps_std_fclose_args),
58+
.args = apps_std_fclose_args,
59+
.n_inner_types = 0,
60+
.inner_types = NULL,
61+
};
62+
63+
static struct hrpc_arg_def_interp4 apps_std_fread_args[] = {
64+
{ HRPC_ARG_WORD, sizeof(uint32_t) },
65+
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
66+
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
67+
{ HRPC_ARG_OUT_BLOB_SEQ, sizeof(char) },
68+
};
69+
70+
struct hrpc_method_def_interp4 apps_std_fread_def = {
71+
.msg_id = 4,
72+
.n_args = HRPC_ARRAY_SIZE(apps_std_fread_args),
73+
.args = apps_std_fread_args,
74+
.n_inner_types = 0,
75+
.inner_types = NULL,
76+
};
77+
78+
static struct hrpc_arg_def_interp4 apps_std_fseek_args[] = {
79+
{ HRPC_ARG_WORD, sizeof(uint32_t) },
80+
{ HRPC_ARG_WORD, sizeof(uint32_t) },
81+
{ HRPC_ARG_WORD, sizeof(uint32_t) },
82+
};
83+
84+
struct hrpc_method_def_interp4 apps_std_fseek_def = {
85+
.msg_id = 9,
86+
.n_args = HRPC_ARRAY_SIZE(apps_std_fseek_args),
87+
.args = apps_std_fseek_args,
88+
.n_inner_types = 0,
89+
.inner_types = NULL,
90+
};
91+
92+
static struct hrpc_arg_def_interp4 apps_std_fopen_with_env_args[] = {
93+
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
94+
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
95+
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
96+
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
97+
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
98+
};
99+
100+
struct hrpc_method_def_interp4 apps_std_fopen_with_env_def = {
101+
.msg_id = 19,
102+
.n_args = HRPC_ARRAY_SIZE(apps_std_fopen_with_env_args),
103+
.args = apps_std_fopen_with_env_args,
104+
.n_inner_types = 0,
105+
.inner_types = NULL,
106+
};
107+
108+
static struct hrpc_arg_def_interp4 apps_std_opendir_args[] = {
109+
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
110+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
111+
};
112+
113+
struct hrpc_method_def_interp4 apps_std_opendir_def = {
114+
.msg_id = 26,
115+
.n_args = HRPC_ARRAY_SIZE(apps_std_opendir_args),
116+
.args = apps_std_opendir_args,
117+
.n_inner_types = 0,
118+
.inner_types = NULL,
119+
};
120+
121+
static struct hrpc_arg_def_interp4 apps_std_closedir_args[] = {
122+
{ HRPC_ARG_WORD, sizeof(uint64_t) },
123+
};
124+
125+
struct hrpc_method_def_interp4 apps_std_closedir_def = {
126+
.msg_id = 27,
127+
.n_args = HRPC_ARRAY_SIZE(apps_std_closedir_args),
128+
.args = apps_std_closedir_args,
129+
.n_inner_types = 0,
130+
.inner_types = NULL,
131+
};
132+
133+
static struct hrpc_arg_def_interp4 apps_std_readdir_args[] = {
134+
{ HRPC_ARG_WORD, sizeof(uint64_t) },
135+
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
136+
{ HRPC_ARG_OUT_BLOB, sizeof(char) * 256 },
137+
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
138+
};
139+
140+
struct hrpc_method_def_interp4 apps_std_readdir_def = {
141+
.msg_id = 28,
142+
.n_args = HRPC_ARRAY_SIZE(apps_std_readdir_args),
143+
.args = apps_std_readdir_args,
144+
.n_inner_types = 0,
145+
.inner_types = NULL,
146+
};
147+
148+
static struct hrpc_arg_def_interp4 apps_std_mkdir_args[] = {
149+
{ HRPC_ARG_BLOB, sizeof(char) },
150+
{ HRPC_ARG_WORD, sizeof(uint32_t) },
151+
};
152+
153+
struct hrpc_method_def_interp4 apps_std_mkdir_def = {
154+
.msg_id = 29,
155+
.n_args = HRPC_ARRAY_SIZE(apps_std_mkdir_args),
156+
.args = apps_std_mkdir_args,
157+
.n_inner_types = 0,
158+
.inner_types = NULL,
159+
};
160+
161+
static struct hrpc_arg_def_interp4 apps_std_stat_args[] = {
162+
{ HRPC_ARG_BLOB_SEQ, sizeof(char) },
163+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
164+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
165+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
166+
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
167+
{ HRPC_ARG_OUT_BLOB, sizeof(uint32_t) },
168+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
169+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
170+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
171+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
172+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
173+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
174+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
175+
{ HRPC_ARG_OUT_BLOB, sizeof(uint64_t) },
176+
};
177+
178+
struct hrpc_method_def_interp4 apps_std_stat_def = {
179+
.msg_id = 31,
180+
.n_args = HRPC_ARRAY_SIZE(apps_std_stat_args),
181+
.args = apps_std_stat_args,
182+
.n_inner_types = 0,
183+
.inner_types = NULL,
184+
};

hexagonrpcd/interface/apps_std.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* FastRPC operating system interface - API
3+
*
4+
* Copyright (C) 2025 HexagonRPC Contributors
5+
*
6+
* This file is part of HexagonRPC.
7+
*
8+
* HexagonRPC is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef INTERFACE_APPS_STD_H
23+
#define INTERFACE_APPS_STD_H
24+
25+
#include <libhexagonrpc/hexagonrpc.h>
26+
27+
extern struct hrpc_method_def_interp4 apps_std_freopen_def;
28+
extern struct hrpc_method_def_interp4 apps_std_fflush_def;
29+
extern struct hrpc_method_def_interp4 apps_std_fclose_def;
30+
extern struct hrpc_method_def_interp4 apps_std_fread_def;
31+
extern struct hrpc_method_def_interp4 apps_std_fseek_def;
32+
extern struct hrpc_method_def_interp4 apps_std_fopen_with_env_def;
33+
extern struct hrpc_method_def_interp4 apps_std_opendir_def;
34+
extern struct hrpc_method_def_interp4 apps_std_closedir_def;
35+
extern struct hrpc_method_def_interp4 apps_std_readdir_def;
36+
extern struct hrpc_method_def_interp4 apps_std_mkdir_def;
37+
extern struct hrpc_method_def_interp4 apps_std_stat_def;
38+
39+
#endif /* INTERFACE_APPS_STD_H */

hexagonrpcd/interfaces.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@
2323

2424
#include "interfaces/adsp_default_listener.def"
2525
#include "interfaces/apps_mem.def"
26-
#include "interfaces/apps_std.def"
2726
#include "interfaces/adsp_listener.def"

hexagonrpcd/interfaces/apps_std.def

Lines changed: 0 additions & 38 deletions
This file was deleted.

hexagonrpcd/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ executable('hexagonrpcd',
22
'apps_mem.c',
33
'apps_std.c',
44
'interfaces.c',
5+
'interface/apps_std.c',
56
'hexagonfs.c',
67
'hexagonfs_mapped.c',
78
'hexagonfs_plat_subtype_name.c',

0 commit comments

Comments
 (0)