2019-07-25 14:58:31 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
misc: fastrpc: Add support for context Invoke method
This patch adds support to compute context invoke method on the
remote processor (DSP).
This involves setting up the functions input and output arguments,
input and output handles and mapping the dmabuf fd for the
argument/handle buffers.
The below diagram depicts invocation of a single method where the
client and objects reside on different processors. An object could
expose multiple methods which can be grouped together and referred
to as an interface.
,--------, ,------, ,-----------, ,------, ,--------,
| | method | | | | | | method | |
| Client |------->| Stub |->| Transport |->| Skel |------->| Object |
| | | | | | | | | |
`--------` `------` `-----------` `------` `--------`
Client: Linux user mode process that initiates the remote invocation
Stub: Auto generated code linked in with the user mode process that
takes care of marshaling parameters
Transport: Involved in carrying an invocation from a client to an
object. This involves two portions: 1) FastRPC Linux
kernel driver that receives the remote invocation, queues
them up and then waits for the response after signaling the
remote side. 2) Service running on the remote side that
dequeues the messages from the queue and dispatches them for
processing.
Skel: Auto generated code that takes care of un-marshaling
parameters
Object: Method implementation
Most of the work is derived from various downstream Qualcomm kernels.
Credits to various Qualcomm authors who have contributed to this code.
Specially Tharun Kumar Merugu <mtharu@codeaurora.org>
Co-developed-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-09 00:11:25 +07:00
|
|
|
|
|
|
|
#ifndef __QCOM_FASTRPC_H__
|
|
|
|
#define __QCOM_FASTRPC_H__
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
2019-02-09 00:11:27 +07:00
|
|
|
#define FASTRPC_IOCTL_ALLOC_DMA_BUFF _IOWR('R', 1, struct fastrpc_alloc_dma_buf)
|
|
|
|
#define FASTRPC_IOCTL_FREE_DMA_BUFF _IOWR('R', 2, __u32)
|
misc: fastrpc: Add support for context Invoke method
This patch adds support to compute context invoke method on the
remote processor (DSP).
This involves setting up the functions input and output arguments,
input and output handles and mapping the dmabuf fd for the
argument/handle buffers.
The below diagram depicts invocation of a single method where the
client and objects reside on different processors. An object could
expose multiple methods which can be grouped together and referred
to as an interface.
,--------, ,------, ,-----------, ,------, ,--------,
| | method | | | | | | method | |
| Client |------->| Stub |->| Transport |->| Skel |------->| Object |
| | | | | | | | | |
`--------` `------` `-----------` `------` `--------`
Client: Linux user mode process that initiates the remote invocation
Stub: Auto generated code linked in with the user mode process that
takes care of marshaling parameters
Transport: Involved in carrying an invocation from a client to an
object. This involves two portions: 1) FastRPC Linux
kernel driver that receives the remote invocation, queues
them up and then waits for the response after signaling the
remote side. 2) Service running on the remote side that
dequeues the messages from the queue and dispatches them for
processing.
Skel: Auto generated code that takes care of un-marshaling
parameters
Object: Method implementation
Most of the work is derived from various downstream Qualcomm kernels.
Credits to various Qualcomm authors who have contributed to this code.
Specially Tharun Kumar Merugu <mtharu@codeaurora.org>
Co-developed-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-09 00:11:25 +07:00
|
|
|
#define FASTRPC_IOCTL_INVOKE _IOWR('R', 3, struct fastrpc_invoke)
|
2019-02-09 00:11:26 +07:00
|
|
|
#define FASTRPC_IOCTL_INIT_ATTACH _IO('R', 4)
|
|
|
|
#define FASTRPC_IOCTL_INIT_CREATE _IOWR('R', 5, struct fastrpc_init_create)
|
2019-10-09 21:41:19 +07:00
|
|
|
#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)
|
|
|
|
#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)
|
misc: fastrpc: Add support for context Invoke method
This patch adds support to compute context invoke method on the
remote processor (DSP).
This involves setting up the functions input and output arguments,
input and output handles and mapping the dmabuf fd for the
argument/handle buffers.
The below diagram depicts invocation of a single method where the
client and objects reside on different processors. An object could
expose multiple methods which can be grouped together and referred
to as an interface.
,--------, ,------, ,-----------, ,------, ,--------,
| | method | | | | | | method | |
| Client |------->| Stub |->| Transport |->| Skel |------->| Object |
| | | | | | | | | |
`--------` `------` `-----------` `------` `--------`
Client: Linux user mode process that initiates the remote invocation
Stub: Auto generated code linked in with the user mode process that
takes care of marshaling parameters
Transport: Involved in carrying an invocation from a client to an
object. This involves two portions: 1) FastRPC Linux
kernel driver that receives the remote invocation, queues
them up and then waits for the response after signaling the
remote side. 2) Service running on the remote side that
dequeues the messages from the queue and dispatches them for
processing.
Skel: Auto generated code that takes care of un-marshaling
parameters
Object: Method implementation
Most of the work is derived from various downstream Qualcomm kernels.
Credits to various Qualcomm authors who have contributed to this code.
Specially Tharun Kumar Merugu <mtharu@codeaurora.org>
Co-developed-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-09 00:11:25 +07:00
|
|
|
|
|
|
|
struct fastrpc_invoke_args {
|
|
|
|
__u64 ptr;
|
|
|
|
__u64 length;
|
|
|
|
__s32 fd;
|
|
|
|
__u32 reserved;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct fastrpc_invoke {
|
|
|
|
__u32 handle;
|
|
|
|
__u32 sc;
|
|
|
|
__u64 args;
|
|
|
|
};
|
|
|
|
|
2019-02-09 00:11:26 +07:00
|
|
|
struct fastrpc_init_create {
|
|
|
|
__u32 filelen; /* elf file length */
|
|
|
|
__s32 filefd; /* fd for the file */
|
|
|
|
__u32 attrs;
|
|
|
|
__u32 siglen;
|
|
|
|
__u64 file; /* pointer to elf file */
|
|
|
|
};
|
|
|
|
|
2019-02-09 00:11:27 +07:00
|
|
|
struct fastrpc_alloc_dma_buf {
|
|
|
|
__s32 fd; /* fd */
|
|
|
|
__u32 flags; /* flags to map with */
|
|
|
|
__u64 size; /* size */
|
|
|
|
};
|
|
|
|
|
2019-10-09 21:41:19 +07:00
|
|
|
struct fastrpc_req_mmap {
|
|
|
|
__s32 fd;
|
|
|
|
__u32 flags; /* flags for dsp to map with */
|
|
|
|
__u64 vaddrin; /* optional virtual address */
|
|
|
|
__u64 size; /* size */
|
|
|
|
__u64 vaddrout; /* dsp virtual address */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct fastrpc_req_munmap {
|
|
|
|
__u64 vaddrout; /* address to unmap */
|
|
|
|
__u64 size; /* size */
|
|
|
|
};
|
|
|
|
|
misc: fastrpc: Add support for context Invoke method
This patch adds support to compute context invoke method on the
remote processor (DSP).
This involves setting up the functions input and output arguments,
input and output handles and mapping the dmabuf fd for the
argument/handle buffers.
The below diagram depicts invocation of a single method where the
client and objects reside on different processors. An object could
expose multiple methods which can be grouped together and referred
to as an interface.
,--------, ,------, ,-----------, ,------, ,--------,
| | method | | | | | | method | |
| Client |------->| Stub |->| Transport |->| Skel |------->| Object |
| | | | | | | | | |
`--------` `------` `-----------` `------` `--------`
Client: Linux user mode process that initiates the remote invocation
Stub: Auto generated code linked in with the user mode process that
takes care of marshaling parameters
Transport: Involved in carrying an invocation from a client to an
object. This involves two portions: 1) FastRPC Linux
kernel driver that receives the remote invocation, queues
them up and then waits for the response after signaling the
remote side. 2) Service running on the remote side that
dequeues the messages from the queue and dispatches them for
processing.
Skel: Auto generated code that takes care of un-marshaling
parameters
Object: Method implementation
Most of the work is derived from various downstream Qualcomm kernels.
Credits to various Qualcomm authors who have contributed to this code.
Specially Tharun Kumar Merugu <mtharu@codeaurora.org>
Co-developed-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-09 00:11:25 +07:00
|
|
|
#endif /* __QCOM_FASTRPC_H__ */
|