Functions | |
static int | HAP_compute_res_attr_init (compute_res_attr_t *attr) |
static int | HAP_compute_res_attr_set_serialize (compute_res_attr_t *attr, unsigned char b_serialize) |
static int | HAP_compute_res_attr_set_vtcm_param (compute_res_attr_t *attr, unsigned int vtcm_size, unsigned char b_single_page) |
static void * | HAP_compute_res_attr_get_vtcm_ptr (compute_res_attr_t *attr) |
static int | HAP_compute_res_attr_set_vtcm_param_v2 (compute_res_attr_t *attr, unsigned int vtcm_size, unsigned int min_page_size, unsigned int min_vtcm_size) |
static int | HAP_compute_res_attr_get_vtcm_ptr_v2 (compute_res_attr_t *attr, void **vtcm_ptr, unsigned int *vtcm_size) |
static int | HAP_compute_res_attr_set_hmx_param (compute_res_attr_t *attr, unsigned char b_enable) |
static int | HAP_compute_res_attr_set_cache_mode (compute_res_attr_t *attr, unsigned char b_enable) |
static int | HAP_compute_res_attr_set_app_type (compute_res_attr_t *attr, unsigned int application_id) |
Manage parameters affecting the requested shared resources
|
inlinestatic |
Reads the VTCM memory pointer from the given attribute structure.
On a successful VTCM resource request placed via HAP_compute_res_acquire() using HAP_compute_res_attr_set_vtcm_param(), a user can invoke this helper function to retrieve the allocated VTCM address by passing the same attribute structure used in the respective HAP_compute_res_acquire() call.
[in] | attr | Pointer to compute the resource attribute structure compute_res_attr_t. |
|
inlinestatic |
On a successful VTCM resource request placed via HAP_compute_res_acquire() or HAP_compute_res_acquire_cached() using HAP_compute_res_attr_set_vtcm_param_v2(), users invoke this helper function to retrieve the allocated VTCM address and size by passing the same attribute structure used in the respective acquire call.
Supported starting with Lahaina.
[in] | attr | Pointer to compute the resource attribute structure compute_res_attr_t. |
[out] | vtcm_ptr | Assigned VTCM address; NULL for no allocation. |
[out] | vtcm_size | Size of the allocated VTCM memory from the assigned pointer. |
|
inlinestatic |
Initializes the attribute structure for a resource request.
The user must call this function before setting any specific resource property via other helper functions.
[in] | attr | Pointer to compute resource attribute structure, compute_res_attr_t. |
|
inlinestatic |
Sets the application ID parameter in the resource structure used to select the appropriate VTCM partition.
If this application ID parameter is not explicitly set, the default partition is selected. The default application ID (0) is set when the attribute structure is initialized. Application IDs are defined in the kernel device tree configuration. If the given ID is not specified in the tree, the primary VTCM partition is selected.
Call this function after HAP_compute_res_attr_init().
Supported starting with Lahaina.
[in] | attr | Pointer to compute the resource attribute structure compute_res_attr_t. |
[in] | application_id | Application ID used to specify the VTCM partition. |
|
inlinestatic |
Sets or resets cacheable mode in the attribute structure.
A cacheable request allows users to allocate and release based on the context ID of the request. On a successful cacheable request via HAP_compute_res_acquire(), users get the same VTCM address and size across calls of HAP_compute_res_acquire_cached() and HAP_compute_res_release_cached() until the context is explicitly released via HAP_compute_res_release().
After a successful cacheable request via HAP_compute_res_acquire(), users can get the assigned VTCM pointer (if requested) by passing the attribute structure to HAP_compute_res_attr_get_vtcm_ptr() for v1 and HAP_compute_res_attr_get_vtcm_ptr_v2() for v2, and they must call HAP_compute_res_acquire_cached() before using the assigned resources.
Supported starting with Lahaina.
[in] | attr | Pointer to compute resource attribute structure, compute_res_attr_t. |
[in] | b_enable | 0 - Do not request cacheable mode (resets option). 1 - Request cacheable mode (sets option). |
|
inlinestatic |
On chipsets with HMX, sets/resets the HMX request parameter in the attribute structure for acquiring the HMX resource.
Call this function after HAP_compute_res_attr_init().
Supported starting with Lahaina.
[in] | attr | Pointer to compute the resource attribute structure, compute_res_attr_t. |
[in] | b_enable | 0 - do not request HMX resource (resets option). 1 - request HMX resource (sets option). |
|
inlinestatic |
Sets or clears the serialization option in the request resource structure.
Serialization allows participating use cases to run with mutually exclusive access to the entire cDSP which helps, for example, in avoiding cache thrashing while trying to run simultaneously on different hardware threads. Participating use cases issue blocking acquires on the serialization resource when ready to run, and each runs in turn when it is granted that resource.
Acquiring the serialization resource only ensures mutual exclusion from other cooperating use cases that also block on acquisition of that resource, it does not guarantee exclusion from concurrent use cases that do not request the serialization resource.
[in] | attr | Pointer to the compute resource attribute structure, compute_res_attr_t. |
[in] | b_serialize | 1 (TRUE) to participate in serialization. 0 (FALSE) otherwise. |
|
inlinestatic |
Sets VTCM request parameters in the provided resource attribute structure.
The user calls this function to request the specified VTCM size in the acquire call. These VTCM request attributes are reset to 0 (no VTCM request) in the resource attribute structure by HAP_compute_res_attr_init().
[in] | attr | Pointer to compute resource attribute structure, compute_res_attr_t. |
[in] | vtcm_size | Size of the VTCM request in bytes; 0 if VTCM allocation is not required. |
[in] | b_single_page | 1 - Requested VTCM size to be allocated in a single page. 0 - No page requirement (allocation can spread across multiple pages. VTCM manager always attempts the best fit). |
|
inlinestatic |
Sets an extended set of VTCM request parameters in the attribute structure, specifically VTCM Size, the minimum required page size, and the minimum required VTCM size.
This function cannot be used with HAP_compute_res_attr_set_vtcm_param(). Call this function after HAP_compute_res_attr_init().
Supported starting with Lahaina.
[in] | attr | Pointer to compute the resource attribute structure, compute_res_attr_t. |
[in] | vtcm_size | Size of the VTCM request in bytes. 0 if VTCM allocation is NOT required. |
[in] | min_page_size | Minimum page size required in bytes. Valid pages include 4 KB, 16 KB, 64 KB, 256 KB, 1 MB, 4 MB, 16 MB. Setting 0 will select best possible fit (least page mappings) |
[in] | min_vtcm_size | Minimum VTCM size in bytes, if the specified size (vtcm_size) is not available. 0 means the size is an absolute requirement. |