> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FastRPC Remote

**Header:** `inc/remote.h`

## Structures

### `domain`

Domain type for multi-domain RPC calls.

**Members**

<ParamField path="id" type="int">
  Domain ID.
</ParamField>

<ParamField path="uri" type="char">
  URI for remote\_handle\_open.
</ParamField>

### `remote_buf`

32-bit Remote buffer parameter for RPC calls

**Members**

<ParamField path="pv" type="void *" />

<ParamField path="nLen" type="size_t">
  Address of a remote buffer.
</ParamField>

### `remote_buf64`

64-bit Remote buffer parameter for RPC calls

**Members**

<ParamField path="pv" type="uint64_t" />

<ParamField path="nLen" type="int64_t">
  Address of a remote buffer.
</ParamField>

### `remote_dma_handle`

32-bit Remote DMA handle parameter for RPC calls

**Members**

<ParamField path="fd" type="int32_t" />

<ParamField path="offset" type="uint32_t">
  File descriptor of a remote buffer.
</ParamField>

### `remote_dma_handle64`

64-bit Remote DMA handle parameter for RPC calls

**Members**

<ParamField path="fd" type="int32_t" />

<ParamField path="offset" type="uint32_t">
  File descriptor of a remote buffer.
</ParamField>

<ParamField path="len" type="uint32_t">
  Offset of the file descriptor.
</ParamField>

### `remote_arg`

32-bit Remote Arg structure for RPC calls

**Members**

<ParamField path="buf" type="remote_buf" />

<ParamField path="h" type="remote_handle">
  32-bit remote buffer
</ParamField>

<ParamField path="h64" type="remote_handle64">
  non-domains remote handle
</ParamField>

<ParamField path="dma" type="remote_dma_handle">
  multi-domains remote handle
</ParamField>

### `remote_arg64`

64-bit Remote Arg structure for RPC calls

**Members**

<ParamField path="buf" type="remote_buf64" />

<ParamField path="h" type="remote_handle">
  64-bit remote buffer
</ParamField>

<ParamField path="h64" type="remote_handle64">
  non-domains remote handle
</ParamField>

<ParamField path="dma" type="remote_dma_handle64">
  multi-domains remote handle
</ParamField>

### `fastrpc_async_callback`

Async call back response type, input structure.

**Members**

<ParamField path="fn" type="void(*">
  Callback function for async notification.
</ParamField>

<ParamField path="context" type="void *">
  Current context to identify the callback.
</ParamField>

### `fastrpc_async_descriptor`

Async descriptor to submit async job.

**Members**

<ParamField path="type" type="enum fastrpc_async_notify_type" />

<ParamField path="jobid" type="fastrpc_async_jobid">
  Async response type.
</ParamField>

<ParamField path="cb" type="fastrpc_async_callback_t">
  Job id of Async job queued to DSP.
</ParamField>

### `remote_rpc_control_latency`

Structure used for request ID DSPRPC\_CONTROL\_LATENCY in remote handle control interface.

**Members**

<ParamField path="enable" type="uint32_t">
  Enable latency optimization techniques to meet requested latency.
</ParamField>

<ParamField path="latency" type="uint32_t">
  Latency in microseconds.
</ParamField>

### `remote_dsp_capability`

**Members**

<ParamField path="domain" type="uint32_t" />

<ParamField path="attribute_ID" type="uint32_t" />

<ParamField path="capability" type="uint32_t" />

### `remote_rpc_control_wakelock`

Structure used for request ID DSPRPC\_CONTROL\_WAKELOCK in remote handle control interface.

**Members**

<ParamField path="enable" type="uint32_t" />

### `remote_rpc_get_domain`

Structure used for request ID DSPRPC\_GET\_DOMAIN in remote handle control interface.

**Members**

<ParamField path="domain" type="int" />

### `remote_control_custom_path`

Structure used for request IDs DSPRPC\_SET\_PATH and DSPRPC\_GET\_PATH in remote handle control interface.

**Members**

<ParamField path="value_size" type="int32_t" />

<ParamField path="path" type="const char *">
  value size including NULL char
</ParamField>

<ParamField path="value" type="char *">
  key used for storing the path
</ParamField>

### `remote_rpc_thread_params`

Structure used for request ID FASTRPC\_THREAD\_PARAMS in remote session control interface.

**Members**

<ParamField path="domain" type="int" />

<ParamField path="prio" type="int">
  Remote subsystem domain ID, pass -1 to set params for all domains.
</ParamField>

<ParamField path="stack_size" type="int">
  User thread priority (1 to 255), pass -1 to use default.
</ParamField>

### `remote_rpc_control_unsigned_module`

Structure used for request ID DSPRPC\_CONTROL\_UNSIGNED\_MODULE in remote session control interface.

**Members**

<ParamField path="domain" type="int" />

<ParamField path="enable" type="int">
  Remote subsystem domain ID, -1 to set params for all domains.
</ParamField>

### `remote_rpc_relative_thread_priority`

Structure used for request ID FASTRPC\_RELATIVE\_THREAD\_PRIORITY in remote session control interface.

**Members**

<ParamField path="domain" type="int" />

<ParamField path="relative_thread_priority" type="int">
  Remote subsystem domain ID, pass -1 to update priority for all domains.
</ParamField>

### `remote_rpc_process_clean_params`

When a remote invocation does not return, then call "remote\_session\_control" with FASTRPC\_REMOTE\_PROCESS\_KILL requestID and the appropriate remote domain ID.

**Members**

<ParamField path="domain" type="int" />

### `remote_rpc_session_close`

Structure used for request ID FASTRPC\_SESSION\_CLOSE in remote session control interface.

**Members**

<ParamField path="domain" type="int" />

### `remote_rpc_control_pd_dump`

Structure used for request ID FASTRPC\_CONTROL\_PD\_DUMP in remote session control interface This is used to enable/disable PD dump for userPDs on the DSP.

**Members**

<ParamField path="domain" type="int" />

<ParamField path="enable" type="int">
  Remote subsystem domain ID, -1 to set params for all domains.
</ParamField>

### `remote_process_type`

Structure for remote\_session\_control, used with FASTRPC\_REMOTE\_PROCESS\_TYPE request ID to query the type of PD running defined by enum fastrpc\_process\_type.

**Members**

<ParamField path="domain" type="int" />

<ParamField path="process_type" type="int" />

### `remote_rpc_notif_register`

Structure for remote\_session\_control, used with FASTRPC\_REGISTER\_STATUS\_NOTIFICATIONS request ID to receive status notifications of the user PD on the DSP.

**Members**

<ParamField path="context" type="void *" />

<ParamField path="domain" type="int" />

<ParamField path="notifier_fn" type="fastrpc_notif_fn_t" />

### `remote_rpc_pd_initmem_size`

Structure used for request ID FASTRPC\_PD\_INITMEM\_SIZE in remote session control interface.

**Members**

<ParamField path="domain" type="int" />

<ParamField path="pd_initmem_size" type="uint32_t">
  Remote subsystem domain ID, pass -1 to set params for all domains.
</ParamField>

### `remote_rpc_reserve_new_session`

Structure for remote\_session\_control, used with FASTRPC\_RESERVE\_SESSION request ID to reserve new fastrpc session of the user PD on the DSP.

**Members**

<ParamField path="domain_name" type="char *" />

<ParamField path="domain_name_len" type="uint32_t" />

<ParamField path="session_name" type="char *" />

<ParamField path="session_name_len" type="uint32_t" />

<ParamField path="effective_domain_id" type="uint32_t" />

<ParamField path="session_id" type="uint32_t" />

### `remote_rpc_effective_domain_id`

Structure for remote\_session\_control, used with FASTRPC\_GET\_EFFECTIVE\_DOMAIN\_ID request ID to get effective domain id of fastrpc session on the user PD of the DSP.

**Members**

<ParamField path="domain_name" type="char *" />

<ParamField path="domain_name_len" type="uint32_t" />

<ParamField path="session_id" type="uint32_t" />

<ParamField path="effective_domain_id" type="uint32_t" />

### `remote_rpc_get_uri`

Structure for remote\_session\_control, used with FASTRPC\_GET\_URI request ID to get the URI needed to load the module in the fastrpc user PD on the DSP.

**Members**

<ParamField path="domain_name" type="char *" />

<ParamField path="domain_name_len" type="uint32_t" />

<ParamField path="session_id" type="uint32_t" />

<ParamField path="module_uri" type="char *" />

<ParamField path="module_uri_len" type="uint32_t" />

<ParamField path="uri" type="char *" />

<ParamField path="uri_len" type="uint32_t" />

### `fastrpc_context_create`

**Members**

<ParamField path="effec_domain_ids" type="uint32_t *" />

<ParamField path="num_domain_ids" type="uint32_t" />

<ParamField path="flags" type="uint64_t" />

<ParamField path="ctx" type="uint64_t" />

### `fastrpc_context_destroy`

**Members**

<ParamField path="ctx" type="uint64_t" />

<ParamField path="flags" type="uint64_t" />

## Functions

### `remote_handle_open`

Opens a remote handle to a DSP module for FastRPC communication.

NOTE: This function should not be called directly from applications. It is automatically called by the stub functions generated by the QAIC compiler from IDL files. Applications should use the generated stub functions instead.

This function creates a handle to communicate with a module running on the DSP. The handle can be used to invoke remote functions defined in the module's IDL interface.

Example URIs: "uri:libexample.so;\_domain=adsp" "uri:libfoo.so;\_domain=cdsp;\_session=1;\_trace=2"

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_handle_open(__QAIC_IN_CHAR const char *name, __QAIC_OUT remote_handle *ph) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="name" type="__QAIC_IN_CHAR const char *">
  \[in] URI of the module to open, found in the auto-generated header file. Format: "uri:module\[;option1=value1]\[;option2=value2]..."
</ParamField>

<ParamField path="ph" type="__QAIC_OUT remote_handle *">
  \[out] Pointer to store the opened remote handle. This handle should be used in subsequent remote\_handle\_invoke() calls and must be closed using remote\_handle\_close() when no longer needed.
</ParamField>

**Returns**

0 on success, otherwise error code:
AEE\_EINVALIDFORMAT: Invalid URI format
AEE\_EUNSUPPORTED: Domain or module not supported
AEE\_ENOSUCH: Module not found
AEE\_EBADPARM: Invalid parameters (NULL pointers)
AEE\_ENOMEMORY: Not enough memory
AEE\_ECONNREFUSED: Connection to DSP failed
AEE\_EVERSION: Version mismatch when \_modver or \_sgver specified

### `remote_handle64_open`

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_handle64_open(__QAIC_IN_CHAR const char *name, __QAIC_OUT remote_handle64 *ph) __QAIC_REMOTE_ATTRIBUTE
```

### `remote_handle_invoke`

Invokes a remote function on the DSP through a FastRPC handle.

NOTE: This function should not be called directly from applications. It is automatically called by the stub functions generated by the QAIC compiler from IDL files. Applications should use the generated stub functions instead.

This function invokes a remote function defined in the module's IDL interface using the handle opened via remote\_handle\_open().

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_handle_invoke(__QAIC_IN remote_handle h, __QAIC_IN uint32_t dwScalars, __QAIC_IN remote_arg *pra) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="h" type="__QAIC_IN remote_handle">
  \[in] Remote handle obtained from remote\_handle\_open()
</ParamField>

<ParamField path="dwScalars" type="__QAIC_IN uint32_t">
  \[in] Scalar value encoding the number and types of arguments:
  REMOTE\_SCALARS\_INBUFS(sc): Number of input buffers
  REMOTE\_SCALARS\_OUTBUFS(sc): Number of output buffers

  REMOTE\_SCALARS\_INHANDLES(sc): Number of input handles
  REMOTE\_SCALARS\_OUTHANDLES(sc): Number of output handles
</ParamField>

<ParamField path="pra" type="__QAIC_IN remote_arg *">
  \[in] Array of remote\_arg structures containing the arguments in order:
  Input buffers
  Output buffers
  Input handles

  Output handles Each remote\_arg contains:

  buf.pv: Pointer to buffer data
  buf.nLen: Length of buffer in bytes
</ParamField>

**Returns**

0 on success, otherwise error code:
AEE\_EBADPARM: Invalid parameters (NULL pointers)
AEE\_EINVALIDHANDLE: Invalid remote handle
AEE\_EUNSUPPORTED: Operation not supported
AEE\_ENOMEMORY: Not enough memory
AEE\_ECONNREFUSED: Connection to DSP failed
AEE\_ETIMEOUT: RPC call timed out

### `remote_handle64_invoke`

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_handle64_invoke(__QAIC_IN remote_handle64 h, __QAIC_IN uint32_t dwScalars, __QAIC_IN remote_arg *pra) __QAIC_REMOTE_ATTRIBUTE
```

### `remote_handle_close`

Closes a remote handle previously opened with remote\_handle\_open()

This function closes the remote handle and frees any associated resources. The handle becomes invalid after this call and should not be used again.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_handle_close(__QAIC_IN remote_handle h) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="h" type="__QAIC_IN remote_handle">
  \[in] Remote handle to close, obtained from remote\_handle\_open()
</ParamField>

**Returns**

0 on success, otherwise error code:
AEE\_EINVALIDHANDLE: Invalid remote handle
AEE\_EBUSY: Handle is still in use by pending operations
AEE\_EFAILED: Internal error occurred during cleanup

### `remote_handle64_close`

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_handle64_close(__QAIC_IN remote_handle64 h) __QAIC_REMOTE_ATTRIBUTE
```

### `remote_handle_control`

Sets control parameters for remote handle operations.

This function allows configuring various control parameters for remote handle operations like latency requirements, wake lock control, domain info etc.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_handle_control(__QAIC_IN uint32_t req, __QAIC_IN_LEN(datalen) void *data, __QAIC_IN uint32_t datalen) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="req" type="__QAIC_IN uint32_t">
  \[in] Request ID specifying the control parameter to set, defined in enum handle\_control\_req\_id:
  DSPRPC\_CONTROL\_LATENCY: Configure latency requirements
  DSPRPC\_CONTROL\_WAKELOCK: Enable/disable wake lock control
  DSPRPC\_GET\_DOMAIN: Get domain ID for a handle See handle\_control\_req\_id enum for full list
</ParamField>

<ParamField path="data" type="__QAIC_IN_LEN(datalen) void *">
  \[in] Pointer to request-specific data structure containing parameters:
  For DSPRPC\_CONTROL\_LATENCY: struct remote\_rpc\_control\_latency
  For DSPRPC\_CONTROL\_WAKELOCK: struct remote\_rpc\_control\_wakelock
  For DSPRPC\_GET\_DOMAIN: struct remote\_rpc\_get\_domain Structure must match the request ID
</ParamField>

<ParamField path="datalen" type="__QAIC_IN uint32_t">
  \[in] Size of the data structure in bytes
</ParamField>

**Returns**

0 on success, otherwise error code:
AEE\_EBADPARM: Invalid parameters (NULL data pointer, invalid datalen)
AEE\_EUNSUPPORTED: Request ID not supported
AEE\_EFAILED: Internal error occurred
Request-specific error codes

### `remote_handle64_control`

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_handle64_control(__QAIC_IN remote_handle64 h, __QAIC_IN uint32_t req, __QAIC_IN_LEN(datalen) void *data, __QAIC_IN uint32_t datalen) __QAIC_REMOTE_ATTRIBUTE
```

### `remote_session_control`

Sets control parameters for remote sessions.

This function allows configuring various control parameters for remote sessions like process lifecycle, thread parameters, session management etc.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_session_control(__QAIC_IN uint32_t req, __QAIC_IN_LEN(datalen) void *data, __QAIC_IN uint32_t datalen) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="req" type="__QAIC_IN uint32_t">
  \[in] Request ID specifying the control parameter to set, defined in enum session\_control\_req\_id:
  FASTRPC\_THREAD\_PARAMS: Set thread priority and stack size
  FASTRPC\_REMOTE\_PROCESS\_KILL: Kill remote process
  FASTRPC\_SESSION\_CLOSE: Close all open handles for a domain
  FASTRPC\_RESERVE\_NEW\_SESSION: Reserve a new FastRPC session See session\_control\_req\_id enum for full list
</ParamField>

<ParamField path="data" type="__QAIC_IN_LEN(datalen) void *">
  \[in] Pointer to request-specific data structure containing parameters:
  For FASTRPC\_THREAD\_PARAMS: struct remote\_rpc\_thread\_params
  For FASTRPC\_REMOTE\_PROCESS\_KILL: struct remote\_rpc\_process\_kill
  For FASTRPC\_RESERVE\_NEW\_SESSION: struct remote\_rpc\_control\_session Structure must match the request ID
</ParamField>

<ParamField path="datalen" type="__QAIC_IN uint32_t">
  \[in] Size of the data structure in bytes
</ParamField>

**Returns**

0 on success, otherwise error code:
AEE\_EBADPARM: Invalid parameters (NULL data pointer, invalid datalen)
AEE\_ENOSUCH: Process/session not found
AEE\_EINVALIDDOMAIN: Invalid domain ID specified
Other error codes returned from FastRPC framework

### `remote_handle_invoke_async`

Invokes a remote handle asynchronously.

This function allows asynchronous invocation of remote methods, providing non-blocking execution and callback mechanisms.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_handle_invoke_async(__QAIC_IN remote_handle h, __QAIC_IN fastrpc_async_descriptor_t *desc, __QAIC_IN uint32_t dwScalars, __QAIC_IN remote_arg *pra) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="h" type="__QAIC_IN remote_handle">
  \[in] Remote handle obtained from remote\_handle\_open()
</ParamField>

<ParamField path="desc" type="__QAIC_IN fastrpc_async_descriptor_t *">
  \[in] Async descriptor containing:
  type: Type of async job (FASTRPC\_ASYNC\_NO\_SYNC, FASTRPC\_ASYNC\_CALLBACK)
  context: User context passed to callback
  cb: Callback function and arguments (for FASTRPC\_ASYNC\_CALLBACK type) See fastrpc\_async\_descriptor\_t for details
</ParamField>

<ParamField path="dwScalars" type="__QAIC_IN uint32_t">
  \[in] Method invocation parameters encoded as scalar value:
  Number of input/output buffers
  Number of input/output handles Use REMOTE\_SCALARS\_\* macros to decode
</ParamField>

<ParamField path="pra" type="__QAIC_IN remote_arg *">
  \[in] Array of remote\_arg structures containing:
  Input buffers
  Output buffers
  Input handles
  Output handles Output buffers must be allocated via rpcmem\_alloc() or registered as ION buffers using register\_buf()
</ParamField>

**Returns**

0 on success, otherwise error code:
AEE\_EBADPARM: Invalid parameters
AEE\_EUNSUPPORTED: Async operations not supported
AEE\_ENOSUCH: Invalid handle
Other error codes from FastRPC framework

### `remote_handle64_invoke_async`

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_handle64_invoke_async(__QAIC_IN remote_handle64 h, __QAIC_IN fastrpc_async_descriptor_t *desc, __QAIC_IN uint32_t dwScalars, __QAIC_IN remote_arg *pra) __QAIC_REMOTE_ATTRIBUTE
```

### `fastrpc_async_get_status`

Gets the status and result of an asynchronous FastRPC job.

This function allows checking the completion status of an asynchronous FastRPC job and retrieving its result. It can be configured to wait for job completion with different timeout behaviors.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() fastrpc_async_get_status(__QAIC_IN fastrpc_async_jobid jobid, __QAIC_IN int timeout_us, __QAIC_OUT int *result)
```

**Parameters**

<ParamField path="jobid" type="__QAIC_IN fastrpc_async_jobid">
  \[in] Job ID returned by remote\_handle\_invoke\_async() when submitting the asynchronous job
</ParamField>

<ParamField path="timeout_us" type="__QAIC_IN int">
  \[in] Timeout value in microseconds:
  0: Returns immediately with current status/result
  Positive value: Waits up to specified microseconds for completion
  Negative value: Waits indefinitely until job completes
</ParamField>

<ParamField path="result" type="__QAIC_OUT int *">
  \[out] Pointer to store the job result:
  0 if job completed successfully
  Error code if job failed Only valid when function returns 0 (job completed)
</ParamField>

**Returns**

0 on success (job completed), otherwise error code:
AEE\_EBUSY: Job is still pending and not completed within timeout
AEE\_EBADPARM: Invalid job ID provided
AEE\_EFAILED: Internal FastRPC framework error

### `fastrpc_release_async_job`

Releases resources associated with an asynchronous FastRPC job.

This function must be called after an asynchronous job completes to free associated resources and cleanup internal state. It should only be called after receiving job completion status either through:
Callback notification (for FASTRPC\_ASYNC\_CALLBACK jobs)
Polling via fastrpc\_async\_get\_status() (for FASTRPC\_ASYNC\_POLL jobs)

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() fastrpc_release_async_job(__QAIC_IN fastrpc_async_jobid jobid)
```

**Parameters**

<ParamField path="jobid" type="__QAIC_IN fastrpc_async_jobid">
  \[in] Job ID returned by remote\_handle\_invoke\_async() when submitting the asynchronous job
</ParamField>

**Returns**

0 on success, otherwise error code:
AEE\_EBUSY: Job is still pending and has not completed yet
AEE\_EBADPARM: Invalid job ID provided
AEE\_EFAILED: Internal FastRPC framework error

### `remote_mmap`

DEPRECATED: Use fastrpc\_mmap() instead.

Maps memory to the remote domain. This function is limited to 32-bit addresses and provides basic mapping functionality without cache configuration control.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_mmap(__QAIC_IN int fd, __QAIC_IN uint32_t flags, __QAIC_IN uint32_t vaddrin, __QAIC_IN int size, __QAIC_OUT uint32_t *vaddrout) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="fd" type="__QAIC_IN int">
  \[in] File descriptor associated with the memory to be mapped. Must be a valid DMA buffer file descriptor.
</ParamField>

<ParamField path="flags" type="__QAIC_IN uint32_t">
  \[in] Mapping flags. Currently only REMOTE\_MAP\_MEM\_STATIC is supported.
</ParamField>

<ParamField path="vaddrin" type="__QAIC_IN uint32_t">
  \[in] Input virtual address on CPU side. Must be the address returned by mmap() when mapping the DMA fd.
</ParamField>

<ParamField path="size" type="__QAIC_IN int">
  \[in] Size of buffer in bytes to map. Must be page aligned (4KB).
</ParamField>

<ParamField path="vaddrout" type="__QAIC_OUT uint32_t *">
  \[out] Pointer to store the mapped address on remote domain.
</ParamField>

**Returns**

0 on success, error code on failure: AEE\_EBADPARM - Invalid parameters AEE\_EFAILED - Internal mapping failure

### `remote_munmap`

DEPRECATED: Use fastrpc\_munmap() instead.

Unmaps memory previously mapped using remote\_mmap() from the remote domain. This function is limited to 32-bit addresses.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_munmap(__QAIC_IN uint32_t vaddrout, __QAIC_IN int size) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="vaddrout" type="__QAIC_IN uint32_t">
  \[in] Remote virtual address returned by remote\_mmap()
</ParamField>

<ParamField path="size" type="__QAIC_IN int">
  \[in] Size of buffer to unmap in bytes. Must match the size used in remote\_mmap(). Partial unmapping is not supported.
</ParamField>

**Returns**

0 on success, error code on failure: AEE\_EBADPARM - Invalid parameters AEE\_EFAILED - Internal unmapping failure AEE\_EBUSY - Memory is still in use and cannot be unmapped

### `remote_mem_map`

DEPRECATED: Use fastrpc\_mmap() instead.

Maps memory to a specific remote domain process. This function provides more control over domain selection compared to remote\_mmap().

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_mem_map(__QAIC_IN int domain, __QAIC_IN int fd, __QAIC_IN int flags, __QAIC_IN uint64_t virtAddr, __QAIC_IN size_t size, __QAIC_OUT uint64_t *remoteVirtAddr) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="domain" type="__QAIC_IN int">
  \[in] DSP domain ID to map memory to. Use -1 for default domain based on linked library (lib(a/m/s/c)dsprpc.so). Valid domains: ADSP\_DOMAIN\_ID, MDSP\_DOMAIN\_ID, SDSP\_DOMAIN\_ID, CDSP\_DOMAIN\_ID, GDSP\_DOMAIN\_ID
</ParamField>

<ParamField path="fd" type="__QAIC_IN int">
  \[in] File descriptor of DMA memory to map
</ParamField>

<ParamField path="flags" type="__QAIC_IN int">
  \[in] Mapping flags from enum remote\_mem\_map\_flags
</ParamField>

<ParamField path="virtAddr" type="__QAIC_IN uint64_t">
  \[in] Virtual address of buffer on CPU side
</ParamField>

<ParamField path="size" type="__QAIC_IN size_t">
  \[in] Size of buffer in bytes to map
</ParamField>

<ParamField path="remoteVirtAddr" type="__QAIC_OUT uint64_t *">
  \[out] Pointer to store the mapped address on remote domain
</ParamField>

**Returns**

0 on success, error code on failure: AEE\_EBADPARM - Invalid parameters AEE\_EFAILED - Internal mapping failure

### `remote_mem_unmap`

DEPRECATED: Use fastrpc\_munmap() instead.

Unmaps memory previously mapped using remote\_mem\_map() from a specific remote domain process.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_mem_unmap(__QAIC_IN int domain, __QAIC_IN uint64_t remoteVirtAddr, __QAIC_IN size_t size) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="domain" type="__QAIC_IN int">
  \[in] DSP domain ID to unmap memory from. Use -1 for default domain. Must match domain used in remote\_mem\_map().
</ParamField>

<ParamField path="remoteVirtAddr" type="__QAIC_IN uint64_t">
  \[in] Remote virtual address returned by remote\_mem\_map()
</ParamField>

<ParamField path="size" type="__QAIC_IN size_t">
  \[in] Size of buffer in bytes to unmap. Must match size used in remote\_mem\_map().
</ParamField>

**Returns**

0 on success, error code on failure: AEE\_EBADPARM - Invalid parameters AEE\_EFAILED - Internal unmapping failure AEE\_EBUSY - Memory is still in use and cannot be unmapped

### `remote_mmap64`

DEPRECATED: Use fastrpc\_mmap() instead.

Maps memory to the remote domain with 64-bit address support. This is the 64-bit version of remote\_mmap().

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_mmap64(__QAIC_IN int fd, __QAIC_IN uint32_t flags, __QAIC_IN __QAIC_INT64PTR vaddrin, __QAIC_IN int64_t size, __QAIC_OUT __QAIC_INT64PTR *vaddrout) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="fd" type="__QAIC_IN int">
  \[in] File descriptor associated with the memory to be mapped
</ParamField>

<ParamField path="flags" type="__QAIC_IN uint32_t">
  \[in] Mapping flags. Currently only REMOTE\_MAP\_MEM\_STATIC is supported.
</ParamField>

<ParamField path="vaddrin" type="__QAIC_IN __QAIC_INT64PTR">
  \[in] Input virtual address on CPU side (64-bit)
</ParamField>

<ParamField path="size" type="__QAIC_IN int64_t">
  \[in] Size of buffer in bytes to map
</ParamField>

<ParamField path="vaddrout" type="__QAIC_OUT __QAIC_INT64PTR *">
  \[out] Pointer to store the mapped address on remote domain (64-bit)
</ParamField>

**Returns**

0 on success, error code on failure: AEE\_EBADPARM - Invalid parameters AEE\_EFAILED - Internal mapping failure

### `remote_munmap64`

DEPRECATED: Use fastrpc\_munmap() instead.

Unmaps memory previously mapped using remote\_mmap64() from the remote domain. This is the 64-bit version of remote\_munmap().

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_munmap64(__QAIC_IN __QAIC_INT64PTR vaddrout, __QAIC_IN int64_t size) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="vaddrout" type="__QAIC_IN __QAIC_INT64PTR">
  \[in] Remote virtual address returned by remote\_mmap64()
</ParamField>

<ParamField path="size" type="__QAIC_IN int64_t">
  \[in] Size of buffer to unmap in bytes. Must match size used in remote\_mmap64().
</ParamField>

**Returns**

0 on success, error code on failure: AEE\_EBADPARM - Invalid parameters AEE\_EFAILED - Internal unmapping failure AEE\_EBUSY - Memory is still in use and cannot be unmapped

### `fastrpc_mmap`

fastrpc\_mmap Creates a mapping on remote process for a DMA buffer with file descriptor.

New fastrpc session will be opened if not already opened for the domain. This API maps the buffer with RW- permission and CACHE WRITEBACK configuration. Driver will clean cache when buffer is passed in a FastRPC call.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() fastrpc_mmap(__QAIC_IN int domain, __QAIC_IN int fd, __QAIC_IN void *addr, __QAIC_IN int offset, __QAIC_IN size_t length, __QAIC_IN enum fastrpc_map_flags flags) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="domain" type="__QAIC_IN int">
  \[in] DSP domain ID of a fastrpc session. Use -1 for default domain based on linked library. Valid domains are ADSP\_DOMAIN\_ID, MDSP\_DOMAIN\_ID, SDSP\_DOMAIN\_ID, CDSP\_DOMAIN\_ID, or GDSP\_DOMAIN\_ID.
</ParamField>

<ParamField path="fd" type="__QAIC_IN int">
  \[in] DMA memory file descriptor obtained from dma\_alloc\_fd() or similar DMA allocation APIs.
</ParamField>

<ParamField path="addr" type="__QAIC_IN void *">
  \[in] Virtual address of the buffer on CPU side. Must be the same address returned by mmap() when mapping the DMA fd.
</ParamField>

<ParamField path="offset" type="__QAIC_IN int">
  \[in] Offset from the beginning of the buffer. Must be page aligned (4KB).
</ParamField>

<ParamField path="length" type="__QAIC_IN size_t">
  \[in] Size of buffer in bytes to map. Must be page aligned (4KB).
</ParamField>

<ParamField path="flags" type="__QAIC_IN enum fastrpc_map_flags">
  \[in] Controls mapping functionality on DSP. See enum fastrpc\_map\_flags for valid flags: FASTRPC\_MAP\_CACHE\_WRITEBACK - Map with writeback cache configuration (default) FASTRPC\_MAP\_CACHE\_WRITETHROUGH - Map with writethrough cache configuration FASTRPC\_MAP\_CACHE\_UNCACHED - Map as uncached memory FASTRPC\_MAP\_CACHE\_NONCACHED - Map as non-cached memory
</ParamField>

**Returns**

0 on success, error code on failure: AEE\_EALREADY - Buffer already mapped. Multiple mappings for same buffer not supported. AEE\_EBADPARM - Invalid parameters (null pointers, unaligned sizes, etc) AEE\_EFAILED - Failed to map buffer (internal driver error) AEE\_ENOMEMORY - Out of memory in driver AEE\_EUNSUPPORTED - API not supported on target DSP

### `fastrpc_munmap`

fastrpc\_munmap Removes a mapping created by fastrpc\_mmap() for a DMA buffer on the remote process.

The mapping must be removed before closing the DMA file descriptor.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() fastrpc_munmap(__QAIC_IN int domain, __QAIC_IN int fd, __QAIC_IN void *addr, __QAIC_IN size_t length) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="domain" type="__QAIC_IN int">
  \[in] DSP domain ID of a fastrpc session. Use -1 for default domain based on linked library. Valid domains are ADSP\_DOMAIN\_ID, MDSP\_DOMAIN\_ID, SDSP\_DOMAIN\_ID, CDSP\_DOMAIN\_ID, or GDSP\_DOMAIN\_ID.
</ParamField>

<ParamField path="fd" type="__QAIC_IN int">
  \[in] DMA memory file descriptor that was used to create the mapping.
</ParamField>

<ParamField path="addr" type="__QAIC_IN void *">
  \[in] Virtual address of the buffer on CPU side. Must match the address used in fastrpc\_mmap().
</ParamField>

<ParamField path="length" type="__QAIC_IN size_t">
  \[in] Size of buffer in bytes to unmap. Must match the length used in fastrpc\_mmap().
</ParamField>

**Returns**

0 on success, error code on failure: AEE\_EBADPARM - Invalid parameters (null pointers, unaligned sizes, etc) AEE\_EINVALIDFD - No mapping found for the specified file descriptor AEE\_EFAILED - Failed to unmap buffer (internal driver error) AEE\_EUNSUPPORTED - API not supported on target DSP

### `remote_register_buf`

remote\_register\_buf/remote\_register\_buf\_attr Register a file descriptor for a buffer to enable zero-copy sharing with DSP via SMMU.

These functions are thread-safe and can be called from multiple threads concurrently. However, registering/deregistering the same buffer from different threads simultaneously is not supported and will lead to undefined behavior.

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN void __QAIC_REMOTE() remote_register_buf(__QAIC_IN_LEN(size) void *buf, __QAIC_IN int size, __QAIC_IN int fd) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="buf" type="__QAIC_IN_LEN(size) void *">
  \[in] Virtual address of the buffer to register. Must be a valid mapped address.
</ParamField>

<ParamField path="size" type="__QAIC_IN int">
  \[in] Size of the buffer in bytes. Must be > 0 and \< 2GB.
</ParamField>

<ParamField path="fd" type="__QAIC_IN int">
  \[in] File descriptor for the buffer. Use -1 to deregister a previously registered buffer.
</ParamField>

<ParamField path="attr" type="">
  \[in] (remote\_register\_buf\_attr only) Buffer attributes: 0 - Non-coherent mapping (cached) 1 - Coherent mapping (uncached)
</ParamField>

**Returns**

void. Check errno for error details: EINVAL - Invalid parameters (null buf, size=0, etc) ENOMEM - Out of memory in driver EBADF - Invalid file descriptor EBUSY - Buffer already registered ENOSYS - API not supported on this platform

### `remote_register_buf_attr`

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN void __QAIC_REMOTE() remote_register_buf_attr(__QAIC_IN_LEN(size) void *buf, __QAIC_IN int size, __QAIC_IN int fd, __QAIC_IN int attr) __QAIC_REMOTE_ATTRIBUTE
```

### `remote_register_buf_attr2`

remote\_register\_buf\_attr2 Register a file descriptor for a buffer to enable zero-copy sharing with DSP via SMMU.

This version supports 64-bit buffer sizes, unlike remote\_register\_buf/remote\_register\_buf\_attr.

This function is thread-safe and can be called from multiple threads concurrently. However, registering/deregistering the same buffer from different threads simultaneously is not supported and will lead to undefined behavior.

Some older versions of libcdsprpc.so lack this function, so users should set this symbol as weak: #pragma weak remote\_register\_buf\_attr2

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN void __QAIC_REMOTE() remote_register_buf_attr2(__QAIC_IN_LEN(size) void *buf, __QAIC_IN size_t size, __QAIC_IN int fd, __QAIC_IN int attr) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="buf" type="__QAIC_IN_LEN(size) void *">
  \[in] Virtual address of the buffer to register. Must be a valid mapped address.
</ParamField>

<ParamField path="size" type="__QAIC_IN size_t">
  \[in] Size of the buffer in bytes. Must be > 0.
</ParamField>

<ParamField path="fd" type="__QAIC_IN int">
  \[in] File descriptor for the buffer. Use -1 to deregister a previously registered buffer.
</ParamField>

<ParamField path="attr" type="__QAIC_IN int">
  \[in] Buffer attributes: 0 - Non-coherent mapping (cached) 1 - Coherent mapping (uncached) 2 - No mapping, buffer used as identifier only
</ParamField>

**Returns**

void. Check errno for error details: EINVAL - Invalid parameters (null buf, size=0, etc) ENOMEM - Out of memory in driver EBADF - Invalid file descriptor EBUSY - Buffer already registered ENOSYS - API not supported on this platform

### `remote_register_dma_handle`

remote\_register\_dma\_handle/remote\_register\_dma\_handle\_attr Register a DMA handle with FastRPC to enable zero-copy sharing of ION memory with DSP via SMMU.

This API is only valid on Android systems with ION-allocated memory.

This function is thread-safe and can be called from multiple threads concurrently. However, registering/deregistering the same buffer from different threads simultaneously is not supported and will lead to undefined behavior.

Some versions of libadsprpc.so lack this function, so users should set these symbols as weak: #pragma weak remote\_register\_dma\_handle #pragma weak remote\_register\_dma\_handle\_attr

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_register_dma_handle(__QAIC_IN int fd, __QAIC_IN uint32_t len) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="fd" type="__QAIC_IN int">
  \[in] File descriptor for the ION buffer. Use -1 to deregister a previously registered buffer.
</ParamField>

<ParamField path="len" type="__QAIC_IN uint32_t">
  \[in] Size of the buffer in bytes. Must be > 0.
</ParamField>

<ParamField path="attr" type="">
  \[in] (remote\_register\_dma\_handle\_attr only) Buffer attributes: 0 - Non-coherent mapping (cached) 1 - Coherent mapping (uncached) 2 - No mapping, buffer used as identifier only
</ParamField>

**Returns**

0 on success, -1 on failure. Check errno for error details: EINVAL - Invalid parameters (fd \< -1, len = 0, etc) ENOMEM - Out of memory in driver EBADF - Invalid file descriptor EBUSY - Buffer already registered ENOSYS - API not supported on this platform

### `remote_register_dma_handle_attr`

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN int __QAIC_REMOTE() remote_register_dma_handle_attr(__QAIC_IN int fd, __QAIC_IN uint32_t len, __QAIC_IN uint32_t attr) __QAIC_REMOTE_ATTRIBUTE
```

### `remote_register_fd`

remote\_register\_fd Register a file descriptor with FastRPC to enable zero-copy sharing of memory with DSP.

This API is useful when users have a file descriptor but no virtual address mapping.

The function creates a PROT\_NONE mapping that cannot be accessed directly, but serves as an identifier for the buffer in FastRPC calls. The mapping is used internally by the RPC layer to share the buffer with DSP.

This API has a 2GB size limitation. For larger buffers, use remote\_register\_fd2().

This function is thread-safe and can be called from multiple threads concurrently. However, registering/deregistering the same buffer from different threads simultaneously is not supported and will lead to undefined behavior.

Some versions of libadsprpc.so lack this function, so users should set this symbol as weak: #pragma weak remote\_register\_fd

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN void *__QAIC_REMOTE() remote_register_fd(__QAIC_IN int fd, __QAIC_IN int size) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="fd" type="__QAIC_IN int">
  \[in] File descriptor for the buffer. Must be a valid file descriptor.
</ParamField>

<ParamField path="size" type="__QAIC_IN int">
  \[in] Size of the buffer in bytes. Must be > 0 and \< 2GB.
</ParamField>

**Returns**

On success, returns a virtual address that can be used in FastRPC calls. On failure, returns (void\*)-1. Check errno for error details: EINVAL - Invalid parameters (fd \< 0, size = 0 or size >= 2GB) ENOMEM - Out of memory in driver EBADF - Invalid file descriptor EBUSY - Buffer already registered ENOSYS - API not supported on this platform

### `remote_register_fd2`

remote\_register\_fd2 Register a file descriptor with FastRPC to enable zero-copy sharing of memory with DSP.

This API is useful when users have a file descriptor but no virtual address mapping. Unlike remote\_register\_fd(), this function supports buffers larger than 2GB.

The function creates a PROT\_NONE mapping that cannot be accessed directly, but serves as an identifier for the buffer in FastRPC calls. The mapping is used internally by the RPC layer to share the buffer with DSP.

This function is thread-safe and can be called from multiple threads concurrently. However, registering/deregistering the same buffer from different threads simultaneously is not supported and will lead to undefined behavior.

Some versions of libadsprpc.so lack this function, so users should set this symbol as weak: #pragma weak remote\_register\_fd2

```cpp theme={null}
__QAIC_REMOTE_EXPORT __QAIC_RETURN void *__QAIC_REMOTE() remote_register_fd2(__QAIC_IN int fd, __QAIC_IN size_t size) __QAIC_REMOTE_ATTRIBUTE
```

**Parameters**

<ParamField path="fd" type="__QAIC_IN int">
  \[in] File descriptor for the buffer. Must be a valid file descriptor.
</ParamField>

<ParamField path="size" type="__QAIC_IN size_t">
  \[in] Size of the buffer in bytes. Must be > 0.
</ParamField>

**Returns**

On success, returns a virtual address that can be used in FastRPC calls. On failure, returns (void\*)-1. Check errno for error details: EINVAL - Invalid parameters (fd \< 0, size = 0) ENOMEM - Out of memory in driver EBADF - Invalid file descriptor EBUSY - Buffer already registered ENOSYS - API not supported on this platform

## Type Definitions

### `domain_t`

Domain type for multi-domain RPC calls.

```cpp theme={null}
typedef struct domain domain_t
```

### `remote_handle`

Remote handle parameter for RPC calls.

```cpp theme={null}
typedef uint32_t remote_handle
```

### `remote_handle64`

Remote handle parameter for multi-domain RPC calls.

```cpp theme={null}
typedef uint64_t remote_handle64
```

### `fastrpc_async_jobid`

Job id of Async job queued to DSP.

```cpp theme={null}
typedef uint64_t fastrpc_async_jobid
```

### `fastrpc_async_callback_t`

Async call back response type, input structure.

```cpp theme={null}
typedef struct fastrpc_async_callback fastrpc_async_callback_t
```

### `fastrpc_async_descriptor_t`

Async descriptor to submit async job.

```cpp theme={null}
typedef struct fastrpc_async_descriptor fastrpc_async_descriptor_t
```

### `fastrpc_capability`

```cpp theme={null}
typedef struct remote_dsp_capability fastrpc_capability
```

### `remote_rpc_get_domain_t`

Structure used for request ID DSPRPC\_GET\_DOMAIN in remote handle control interface.

```cpp theme={null}
typedef struct remote_rpc_get_domain remote_rpc_get_domain_t
```

### `remote_rpc_process_exception`

Structure used for request ID FASTRPC\_REMOTE\_PROCESS\_EXCEPTION in remote session control interface This is used to trigger exception in the userPDs running on the DSP.

```cpp theme={null}
typedef struct remote_rpc_process_clean_params remote_rpc_process_exception
```

### `remote_rpc_status_flags_t`

DSP user PD status notification flags Status flags for the user PD on the DSP returned by the status notification function.

```cpp theme={null}
typedef enum remote_rpc_status_flags remote_rpc_status_flags_t
```

### `fastrpc_notif_fn_t`

fastrpc\_notif\_fn\_t Notification call back function

```cpp theme={null}
typedef int(* fastrpc_notif_fn_t
```

### `remote_rpc_notif_register_t`

Structure for remote\_session\_control, used with FASTRPC\_REGISTER\_STATUS\_NOTIFICATIONS request ID to receive status notifications of the user PD on the DSP.

```cpp theme={null}
typedef struct remote_rpc_notif_register remote_rpc_notif_register_t
```

### `remote_rpc_reserve_new_session_t`

Structure for remote\_session\_control, used with FASTRPC\_RESERVE\_SESSION request ID to reserve new fastrpc session of the user PD on the DSP.

```cpp theme={null}
typedef struct remote_rpc_reserve_new_session remote_rpc_reserve_new_session_t
```

### `remote_rpc_effective_domain_id_t`

Structure for remote\_session\_control, used with FASTRPC\_GET\_EFFECTIVE\_DOMAIN\_ID request ID to get effective domain id of fastrpc session on the user PD of the DSP.

```cpp theme={null}
typedef struct remote_rpc_effective_domain_id remote_rpc_effective_domain_id_t
```

### `remote_rpc_get_uri_t`

Structure for remote\_session\_control, used with FASTRPC\_GET\_URI request ID to get the URI needed to load the module in the fastrpc user PD on the DSP.

```cpp theme={null}
typedef struct remote_rpc_get_uri remote_rpc_get_uri_t
```

### `fastrpc_context_create`

```cpp theme={null}
typedef struct fastrpc_context_create fastrpc_context_create
```

### `fastrpc_context_destroy`

```cpp theme={null}
typedef struct fastrpc_context_destroy fastrpc_context_destroy
```

## Enumerations

### `fastrpc_async_notify_type`

Async response type.

#### Values

| Name                     | Value | Description                                           |
| ------------------------ | ----- | ----------------------------------------------------- |
| `FASTRPC_ASYNC_NO_SYNC`  |       |                                                       |
| `FASTRPC_ASYNC_CALLBACK` |       | No notification required.                             |
| `FASTRPC_ASYNC_POLL`     |       | Callback notification using fastrpc\_async\_callback. |

### `remote_rpc_latency_flags`

Flags used in struct remote\_rpc\_control\_latency for request ID DSPRPC\_CONTROL\_LATENCY in remote handle control interface.

#### Values

| Name               | Value | Description                                                                                            |
| ------------------ | ----- | ------------------------------------------------------------------------------------------------------ |
| `RPC_DISABLE_QOS`  |       |                                                                                                        |
| `RPC_PM_QOS`       |       | Control cpu low power modes based on RPC activity in 100 ms window.                                    |
| `RPC_ADAPTIVE_QOS` |       | DSP driver predicts completion time of a method and send CPU wake up signal to reduce wake up latency. |
| `RPC_POLL_QOS`     |       | After sending invocation to DSP, CPU will enter polling mode instead of waiting for a glink response.  |

### `remote_dsp_attributes`

Different types of DSP capabilities queried via remote\_handle\_control using DSPRPC\_GET\_DSP\_INFO request id.

#### Values

| Name                          | Value | Description                                              |
| ----------------------------- | ----- | -------------------------------------------------------- |
| `DOMAIN_SUPPORT`              |       |                                                          |
| `UNSIGNED_PD_SUPPORT`         |       | Check if DSP supported: supported = 1, unsupported = 0.  |
| `HVX_SUPPORT_64B`             |       | DSP unsigned PD support: supported = 1, unsupported = 0. |
| `HVX_SUPPORT_128B`            |       | Number of HVX 64B support.                               |
| `VTCM_PAGE`                   |       | Number of HVX 128B support.                              |
| `VTCM_COUNT`                  |       | Max page size allocation possible in VTCM.               |
| `ARCH_VER`                    |       | Number of page\_size blocks available.                   |
| `HMX_SUPPORT_DEPTH`           |       | Hexagon processor architecture version.                  |
| `HMX_SUPPORT_SPATIAL`         |       | HMX Support Depth.                                       |
| `ASYNC_FASTRPC_SUPPORT`       |       | HMX Support Spatial.                                     |
| `STATUS_NOTIFICATION_SUPPORT` |       | Async FastRPC Support.                                   |
| `MCID_MULTICAST`              |       | DSP User PD status notification Support.                 |

### `handle_control_req_id`

Request IDs for remote handle control interface.

#### Values

| Name                         | Value | Description                                                                       |
| ---------------------------- | ----- | --------------------------------------------------------------------------------- |
| `DSPRPC_RESERVED`            |       |                                                                                   |
| `DSPRPC_CONTROL_LATENCY`     |       | Reserved.                                                                         |
| `DSPRPC_GET_DSP_INFO`        |       | Request ID to enable/disable QOS.                                                 |
| `DSPRPC_CONTROL_WAKELOCK`    |       | Request ID to get dsp capabilites from kernel and Hexagon.                        |
| `DSPRPC_GET_DOMAIN`          |       | Request ID to enable wakelock for the given domain.                               |
| `DSPRPC_SET_PATH`            |       | Request ID to get the default domain or domain associated to an exisiting handle. |
| `DSPRPC_GET_PATH`            |       | Request ID to add a custom path to the hash table.                                |
| `DSPRPC_SMMU_SUPPORT`        |       | Request ID to read a custom path to the hash table.                               |
| `DSPRPC_KALLOC_SUPPORT`      |       | Request ID to check smmu support by kernel.                                       |
| `DSPRPC_PM`                  |       | Request ID to check kalloc support by kernel.                                     |
| `DSPRPC_RPC_POLL`            |       | Request ID to awake PM.                                                           |
| `DSPRPC_ASYNC_WAKE`          |       | Request ID to update polling mode in kernel.                                      |
| `DSPRPC_NOTIF_WAKE`          |       | Request ID to exit async thread.                                                  |
| `DSPRPC_REMOTE_PROCESS_KILL` |       | Request ID to exit notif thread.                                                  |
| `DSPRPC_SET_MODE`            |       | Request ID to kill remote process.                                                |

### `fastrpc_process_type`

Process types Return values for FASTRPC\_REMOTE\_PROCESS\_TYPE control req ID for remote\_handle\_control Return values denote the type of process on remote subsystem.

#### Values

| Name                    | Value | Description                   |
| ----------------------- | ----- | ----------------------------- |
| `PROCESS_TYPE_SIGNED`   |       |                               |
| `PROCESS_TYPE_UNSIGNED` |       | Signed PD running on the DSP. |

### `remote_rpc_status_flags`

DSP user PD status notification flags Status flags for the user PD on the DSP returned by the status notification function.

#### Values

| Name                         | Value | Description                           |
| ---------------------------- | ----- | ------------------------------------- |
| `FASTRPC_USER_PD_UP`         |       |                                       |
| `FASTRPC_USER_PD_EXIT`       |       | DSP user process is up.               |
| `FASTRPC_USER_PD_FORCE_KILL` |       | DSP user process exited.              |
| `FASTRPC_USER_PD_EXCEPTION`  |       | DSP user process forcefully killed.   |
| `FASTRPC_DSP_SSR`            |       | Exception in the user process of DSP. |

### `session_control_req_id`

Request IDs for remote session control interface.

#### Values

| Name                                    | Value | Description                                                                            |
| --------------------------------------- | ----- | -------------------------------------------------------------------------------------- |
| `FASTRPC_RESERVED_1`                    |       |                                                                                        |
| `FASTRPC_THREAD_PARAMS`                 |       | Reserved.                                                                              |
| `DSPRPC_CONTROL_UNSIGNED_MODULE`        |       | Set thread parameters like priority and stack size.                                    |
| `FASTRPC_RESERVED_2`                    |       | Handle the unsigned module offload request, to be called before remote\_handle\_open() |
| `FASTRPC_RELATIVE_THREAD_PRIORITY`      |       | Reserved.                                                                              |
| `FASTRPC_RESERVED_3`                    |       | To increase/decrease default thread priority.                                          |
| `FASTRPC_REMOTE_PROCESS_KILL`           |       | Reserved.                                                                              |
| `FASTRPC_SESSION_CLOSE`                 |       | Kill remote process.                                                                   |
| `FASTRPC_CONTROL_PD_DUMP`               |       | Close all open handles of requested domain.                                            |
| `FASTRPC_REMOTE_PROCESS_EXCEPTION`      |       | Enable PD dump feature.                                                                |
| `FASTRPC_REMOTE_PROCESS_TYPE`           |       | Trigger Exception in the remote process.                                               |
| `FASTRPC_REGISTER_STATUS_NOTIFICATIONS` |       | Query type of process defined by enum fastrpc\_process\_type.                          |
| `FASTRPC_PD_INITMEM_SIZE`               |       | Enable DSP User process status notifications.                                          |
| `FASTRPC_RESERVE_NEW_SESSION`           |       | Set signed userpd initial memory size                                                  |
| `FASTRPC_GET_EFFECTIVE_DOMAIN_ID`       |       | Reserve new FastRPC session.                                                           |
| `FASTRPC_GET_URI`                       |       | Get effective domain ID of a FastRPC session.                                          |
| `FASTRPC_MAX_THREAD_PARAM`              |       | Creates the URI needed to load a module in the DSP User PD.                            |
| `FASTRPC_CONTEXT_CREATE`                |       | Set max thread value for unsigned PD.                                                  |
| `FASTRPC_CONTEXT_DESTROY`               |       | Create or attaches to remote session(s) on one or more domains.                        |

### `remote_mem_map_flags`

Memory map control flags for using with remote\_mem\_map() and remote\_mem\_unmap()

#### Values

| Name                    | Value | Description                                                                              |
| ----------------------- | ----- | ---------------------------------------------------------------------------------------- |
| `REMOTE_MAP_MEM_STATIC` |       | Create static memory map on remote process with default cache configuration (writeback). |

### `fastrpc_map_flags`

for fastrpc\_mmap and fastrpc\_munmap

#### Values

| Name                      | Value | Description                                                                                         |
| ------------------------- | ----- | --------------------------------------------------------------------------------------------------- |
| `FASTRPC_MAP_STATIC`      |       | Map memory pages with RW- permission and CACHE WRITEBACK.                                           |
| `FASTRPC_MAP_RESERVED`    |       | Reserved for compatibility with deprecated flag.                                                    |
| `FASTRPC_MAP_FD`          |       | Map memory pages with RW- permission and CACHE WRITEBACK.                                           |
| `FASTRPC_MAP_FD_DELAYED`  |       | Mapping delayed until user calls HAP\_mmap() and HAP\_munmap() functions on DSP.                    |
| `FASTRPC_MAP_RESERVED_4`  |       | Reserved for compatibility.                                                                         |
| `FASTRPC_MAP_RESERVED_5`  |       |                                                                                                     |
| `FASTRPC_MAP_RESERVED_6`  |       |                                                                                                     |
| `FASTRPC_MAP_RESERVED_7`  |       |                                                                                                     |
| `FASTRPC_MAP_RESERVED_8`  |       |                                                                                                     |
| `FASTRPC_MAP_RESERVED_9`  |       |                                                                                                     |
| `FASTRPC_MAP_RESERVED_10` |       |                                                                                                     |
| `FASTRPC_MAP_RESERVED_11` |       |                                                                                                     |
| `FASTRPC_MAP_RESERVED_12` |       |                                                                                                     |
| `FASTRPC_MAP_RESERVED_13` |       |                                                                                                     |
| `FASTRPC_MAP_RESERVED_14` |       |                                                                                                     |
| `FASTRPC_MAP_RESERVED_15` |       |                                                                                                     |
| `FASTRPC_MAP_FD_NOMAP`    |       | This flag is used to skip CPU mapping, otherwise behaves similar to FASTRPC\_MAP\_FD\_DELAYED flag. |

## Macros

### `__QAIC_REMOTE`

```c theme={null}
#define __QAIC_REMOTE ff
```

### `__QAIC_REMOTE_EXPORT`

\_\_QAIC\_REMOTE

```c theme={null}
#define __QAIC_REMOTE_EXPORT 
```

### `__QAIC_RETURN`

\_WIN32 \_\_QAIC\_REMOTE\_EXPORT

```c theme={null}
#define __QAIC_RETURN 
```

### `__QAIC_IN`

\_WIN32 \_\_QAIC\_RETURN

```c theme={null}
#define __QAIC_IN 
```

### `__QAIC_IN_CHAR`

\_WIN32 \_\_QAIC\_IN

```c theme={null}
#define __QAIC_IN_CHAR 
```

### `__QAIC_IN_LEN`

\_WIN32 \_\_QAIC\_IN\_CHAR

```c theme={null}
#define __QAIC_IN_LEN 
```

### `__QAIC_OUT`

\_WIN32 \_\_QAIC\_IN\_LEN

```c theme={null}
#define __QAIC_OUT 
```

### `__QAIC_INT64PTR`

\_WIN32 \_\_QAIC\_OUT

```c theme={null}
#define __QAIC_INT64PTR uint64_t
```

### `__QAIC_REMOTE_ATTRIBUTE`

\_WIN32 \_\_QAIC\_INT64PTR

```c theme={null}
#define __QAIC_REMOTE_ATTRIBUTE 
```

### `REMOTE_SCALARS_METHOD_ATTR`

\_\_QAIC\_REMOTE\_ATTRIBUTE

```c theme={null}
#define REMOTE_SCALARS_METHOD_ATTR (((dwScalars) >> 29) & 0x7)
```

### `REMOTE_SCALARS_METHOD`

Retrieves method index from the scalars parameter.

```c theme={null}
#define REMOTE_SCALARS_METHOD (((dwScalars) >> 24) & 0x1f)
```

### `REMOTE_SCALARS_INBUFS`

Retrieves number of input buffers from the scalars parameter.

```c theme={null}
#define REMOTE_SCALARS_INBUFS (((dwScalars) >> 16) & 0x0ff)
```

### `REMOTE_SCALARS_OUTBUFS`

Retrieves number of output buffers from the scalars parameter.

```c theme={null}
#define REMOTE_SCALARS_OUTBUFS (((dwScalars) >> 8) & 0x0ff)
```

### `REMOTE_SCALARS_INHANDLES`

Retrieves number of input handles from the scalars parameter.

```c theme={null}
#define REMOTE_SCALARS_INHANDLES (((dwScalars) >> 4) & 0x0f)
```

### `REMOTE_SCALARS_OUTHANDLES`

Retrieves number of output handles from the scalars parameter.

```c theme={null}
#define REMOTE_SCALARS_OUTHANDLES ((dwScalars) & 0x0f)
```

### `REMOTE_SCALARS_MAKEX`

Makes the scalar using the method attr, index and number of io buffers and handles.

```c theme={null}
#define REMOTE_SCALARS_MAKEX ((((uint32_t)   (nAttr) &  0x7) << 29) | \
           (((uint32_t) (nMethod) & 0x1f) << 24) | \
           (((uint32_t)     (nIn) & 0xff) << 16) | \
           (((uint32_t)    (nOut) & 0xff) <<  8) | \
           (((uint32_t)    (noIn) & 0x0f) <<  4) | \
            ((uint32_t)   (noOut) & 0x0f))
```

### `REMOTE_SCALARS_MAKE`

```c theme={null}
#define REMOTE_SCALARS_MAKE REMOTE_SCALARS_MAKEX(0,nMethod,nIn,nOut,0,0)
```

### `REMOTE_SCALARS_LENGTH`

Retrieves number of io buffers and handles.

```c theme={null}
#define REMOTE_SCALARS_LENGTH (REMOTE_SCALARS_INBUFS(sc) +\
                                   REMOTE_SCALARS_OUTBUFS(sc) +\
                                   REMOTE_SCALARS_INHANDLES(sc) +\
                                   REMOTE_SCALARS_OUTHANDLES(sc))
```

### `ADSP_DOMAIN_ID`

Defines the domain IDs for supported DSPs.

```c theme={null}
#define ADSP_DOMAIN_ID 0
```

### `MDSP_DOMAIN_ID`

```c theme={null}
#define MDSP_DOMAIN_ID 1
```

### `SDSP_DOMAIN_ID`

```c theme={null}
#define SDSP_DOMAIN_ID 2
```

### `CDSP_DOMAIN_ID`

```c theme={null}
#define CDSP_DOMAIN_ID 3
```

### `CDSP1_DOMAIN_ID`

```c theme={null}
#define CDSP1_DOMAIN_ID 4
```

### `ADSP_DOMAIN_NAME`

Supported Domain Names.

```c theme={null}
#define ADSP_DOMAIN_NAME "adsp"
```

### `MDSP_DOMAIN_NAME`

```c theme={null}
#define MDSP_DOMAIN_NAME "mdsp"
```

### `SDSP_DOMAIN_NAME`

```c theme={null}
#define SDSP_DOMAIN_NAME "sdsp"
```

### `CDSP_DOMAIN_NAME`

```c theme={null}
#define CDSP_DOMAIN_NAME "cdsp"
```

### `CDSP1_DOMAIN_NAME`

```c theme={null}
#define CDSP1_DOMAIN_NAME "cdsp1"
```

### `GDSP0_DOMAIN_NAME`

```c theme={null}
#define GDSP0_DOMAIN_NAME "gdsp0"
```

### `GDSP1_DOMAIN_NAME`

```c theme={null}
#define GDSP1_DOMAIN_NAME "gdsp1"
```

### `ADSP_DOMAIN`

Defines to prepare URI for multi-domain calls.

```c theme={null}
#define ADSP_DOMAIN "&_dom=adsp"
```

### `MDSP_DOMAIN`

```c theme={null}
#define MDSP_DOMAIN "&_dom=mdsp"
```

### `SDSP_DOMAIN`

```c theme={null}
#define SDSP_DOMAIN "&_dom=sdsp"
```

### `CDSP_DOMAIN`

```c theme={null}
#define CDSP_DOMAIN "&_dom=cdsp"
```

### `CDSP1_DOMAIN`

```c theme={null}
#define CDSP1_DOMAIN "&_dom=cdsp1"
```

### `GDSP0_DOMAIN`

```c theme={null}
#define GDSP0_DOMAIN "&_dom=gdsp0"
```

### `GDSP1_DOMAIN`

```c theme={null}
#define GDSP1_DOMAIN "&_dom=gdsp1"
```

### `ITRANSPORT_PREFIX`

Internal transport prefix.

```c theme={null}
#define ITRANSPORT_PREFIX "'\":;./\\"
```

### `MAX_DOMAIN_URI_SIZE`

Maximum length of URI for remote\_handle\_open() calls.

```c theme={null}
#define MAX_DOMAIN_URI_SIZE 12
```

### `FASTRPC_WAKELOCK_CONTROL_SUPPORTED`

Macro for backward compatibility.

```c theme={null}
#define FASTRPC_WAKELOCK_CONTROL_SUPPORTED 1
```

### `FASTRPC_ATTR_NONE`

Attributes for remote\_register\_buf\_attr.

```c theme={null}
#define FASTRPC_ATTR_NONE 0          /** No attribute to set.*/
```

### `FASTRPC_ATTR_NON_COHERENT`

```c theme={null}
#define FASTRPC_ATTR_NON_COHERENT 2          /** Attribute to map a buffer as dma non-coherent,
                                                 Driver perform cache maintenance.*/
```

### `FASTRPC_ATTR_COHERENT`

```c theme={null}
#define FASTRPC_ATTR_COHERENT 4          /** Attribute to map a buffer as dma coherent,
                                                 Driver skips cache maintenenace
                                                 It will be ignored if a device is marked as dma-coherent in device tree.*/
```

### `FASTRPC_ATTR_KEEP_MAP`

```c theme={null}
#define FASTRPC_ATTR_KEEP_MAP 8          /** Attribute to keep the buffer persistant
                                                 until unmap is called explicitly.*/
```

### `FASTRPC_ATTR_NOMAP`

```c theme={null}
#define FASTRPC_ATTR_NOMAP 16         /** Attribute for secure buffers to skip
                                                 smmu mapping in fastrpc driver*/
```

### `FASTRPC_ATTR_FORCE_NOFLUSH`

```c theme={null}
#define FASTRPC_ATTR_FORCE_NOFLUSH 32         /** Attribute to map buffer such that flush by driver is skipped for that particular buffer
                                                 client has to perform cache maintenance*/
```

### `FASTRPC_ATTR_FORCE_NOINVALIDATE`

```c theme={null}
#define FASTRPC_ATTR_FORCE_NOINVALIDATE 64    /** Attribute to map buffer such that invalidate by driver is skipped for that particular buffer
                                                 client has to perform cache maintenance */
```

### `FASTRPC_ATTR_TRY_MAP_STATIC`

```c theme={null}
#define FASTRPC_ATTR_TRY_MAP_STATIC 128       /** Attribute for persistent mapping a buffer
                                                 to remote DSP process during buffer registration
                                                 with FastRPC driver. This buffer will be automatically
                                                 mapped during fastrpc session open and unmapped either
                                                 at unregister or session close. FastRPC library tries
                                                 to map buffers and ignore errors in case of failure.
                                                 pre-mapping a buffer reduces the FastRPC latency.
                                                 This flag is recommended only for buffers used with
                                                 latency critical rpc calls */
```

### `REMOTE_MODE_PARALLEL`

REMOTE\_MODE\_PARALLEL used with remote\_set\_mode This is the default mode for the driver.

```c theme={null}
#define REMOTE_MODE_PARALLEL 0
```

### `REMOTE_MODE_SERIAL`

REMOTE\_MODE\_SERIAL used with remote\_set\_mode When operating in SERIAL mode the driver will invalidate output buffers before calling into the dsp.

```c theme={null}
#define REMOTE_MODE_SERIAL 1
```
