summaryrefslogtreecommitdiff
path: root/drivers/staging/nmf-cm/cm/engine/api/memory_engine.h
blob: 9f5e25b3ebfe3473a2eebdf8d2941369f0e45d20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
 * Copyright (C) ST-Ericsson SA 2010
 * Author: Jean-Philippe FASSINO <jean-philippe.fassino@stericsson.com> for ST-Ericsson.
 * License terms: GNU General Public License (GPL) version 2.
 */
/*!
 * \brief Public Component Manager Memory User Engine API.
 *
 * This file contains the Component Manager Engine API for manipulating memory.
 *
 */

#ifndef CM_MEMORY_ENGINE_H_
#define CM_MEMORY_ENGINE_H_

#include <cm/engine/memory/inc/domain_type.h>
#include <cm/engine/memory/inc/memory_type.h>

/*!
 * \brief Allocate memory in a Media Processor Core memory
 *
 * \param[in] domainId
 * \param[in] memType
 * \param[in] size
 * \param[in] memAlignment
 * \param[out] pHandle
 *
 * \ingroup CM_ENGINE_API
 */
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_AllocMpcMemory(
        t_cm_domain_id domainId,
        t_nmf_client_id clientId,                                   //!< [in] Client ID (aka PID)
        t_cm_mpc_memory_type memType,
        t_cm_size size,
        t_cm_mpc_memory_alignment memAlignment,
        t_cm_memory_handle *pHandle
        );


/*!
 * \brief Free a MPC memory block.
 *
 * \param[in] handle
 *
 * \ingroup CM_ENGINE_API
 */
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_FreeMpcMemory(t_cm_memory_handle handle);

/*!
 * \brief Get the start address of the MPC memory block seen by the host CPU (physical and logical)
 *
 * The logical system address returned by this method is valid only in kernel space and the physical
 * address is accessible only from kernel space too.
 *
 * \see OSMem "OS Memory management" for seeing an integration example.
 *
 * \param[in] handle
 * \param[out] pSystemAddress
 *
 * \ingroup CM_ENGINE_API
 */
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_GetMpcMemorySystemAddress(
        t_cm_memory_handle handle,
        t_cm_system_address *pSystemAddress);

/*!
 * \brief Get the start address of the memory block seen by the Media Processor Core
 *
 * \param[in] handle
 * \param[out] pMpcAddress
 *
 * \ingroup CM_ENGINE_API
 */
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_GetMpcMemoryMpcAddress(
        t_cm_memory_handle handle,
        t_uint32 *pMpcAddress);

/*!
 * \brief Get the memory status for given memory type of a given Media Processor Core
 *
 * \param[in] domainId
 * \param[in] memType
 * \param[out] pStatus
 *
 * \ingroup CM_ENGINE_API
 */
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_GetMpcMemoryStatus(
        t_cm_domain_id domainId,
        t_cm_mpc_memory_type memType,
        t_cm_allocator_status *pStatus);

#endif /* CM_MEMORY_ENGINE_H_ */