You've already forked hexagonrpc
mirror of
https://github.com/linux-msm/hexagonrpc.git
synced 2026-02-25 13:13:52 -08:00
fastrpc: listener: add interface count
Other compilation units do not know how many elements there are in the array. Add a number with the number of interfaces so other compilation units can iterate over every interface.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "fastrpc.h"
|
||||
@@ -29,6 +30,9 @@
|
||||
const struct fastrpc_interface *fastrpc_listener_interfaces[] = {
|
||||
};
|
||||
|
||||
size_t fastrpc_listener_n_interfaces = sizeof(fastrpc_listener_interfaces)
|
||||
/ sizeof(*fastrpc_listener_interfaces);
|
||||
|
||||
static int adsp_listener_init2(int fd)
|
||||
{
|
||||
return fastrpc2(&adsp_listener_init2_def, fd, ADSP_LISTENER_HANDLE);
|
||||
@@ -192,8 +196,7 @@ static int invoke_requested_procedure(uint32_t handle,
|
||||
uint8_t out_count;
|
||||
int ret;
|
||||
|
||||
if (handle >= sizeof(fastrpc_listener_interfaces)
|
||||
/ sizeof(*fastrpc_listener_interfaces)
|
||||
if (handle >= fastrpc_listener_n_interfaces
|
||||
|| REMOTE_SCALARS_METHOD(sc) >= fastrpc_listener_interfaces[handle]->n_procs)
|
||||
return -1;
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef LISTENER_H
|
||||
#define LISTENER_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "fastrpc.h"
|
||||
#include "iobuffer.h"
|
||||
|
||||
@@ -17,6 +19,7 @@ struct fastrpc_interface {
|
||||
};
|
||||
|
||||
extern const struct fastrpc_interface *fastrpc_listener_interfaces[];
|
||||
extern size_t fastrpc_listener_n_interfaces;
|
||||
|
||||
int run_fastrpc_listener(int fd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user