summaryrefslogtreecommitdiff
path: root/drivers/staging/nmf-cm/cm/engine/api/domain_engine.h
blob: 7cc6f33ed909081981296c2d303c0c0b8a186cb4 (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
 * 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 SYSCALL API.
 *
 * This file contains the Component Manager SYSCALL API for manipulating domains.
 *
 */

#ifndef __INC_DOMAIN_ENGINE_H
#define __INC_DOMAIN_ENGINE_H

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

/*!
 * \brief Create a domain.
 *
 * Create a memory domain for use in the CM for component instantiation and memory allocation.
 *
 * \param[in]  client Id of the client.
 * \param[in]  domain Description of domain memories.
 * \param[out] handle Idetifier of the created domain
 *
 * \exception CM_INVALID_DOMAIN_DEFINITION
 * \exception CM_INTERNAL_DOMAIN_OVERFLOW
 * \exception CM_OK
 *
 * \return Error code.
 * \ingroup CM_ENGINE_API
 */
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_CreateMemoryDomain(
        const t_nmf_client_id     client,
        const t_cm_domain_memory  *domain,
        t_cm_domain_id            *handle
        );

/*!
 * \brief Create a scratch domain.
 *
 * Create a scratch memory domain. Scratch domains
 * are used to perform overlapping allocations.
 *
 * \param[in]  client Id of the client.
 * \param[in]  parentId Identifier of the parent domain.
 * \param[in]  domain Description of domain memories.
 * \param[out] handle Idetifier of the created domain
 *
 * \exception CM_INVALID_DOMAIN_DEFINITION
 * \exception CM_INTERNAL_DOMAIN_OVERFLOW
 * \exception CM_NO_MORE_MEMORY
 * \exception CM_OK
 *
 * \return Error code.
 * \ingroup CM_ENGINE_API
 */
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_CreateMemoryDomainScratch(
        const t_nmf_client_id      client,
        const t_cm_domain_id       parentId,
        const t_cm_domain_memory  *domain,
        t_cm_domain_id            *handle
        );

/*!
 * \brief Destroy a memory domain.

 * \param[in] handle Domain identifier to destroy.
 *
 * \exception CM_INVALID_DOMAIN_HANDLE
 * \exception CM_OK
 *
 * \return Error code.
 *
 * \ingroup CM_ENGINE_API
 */
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_DestroyMemoryDomain(
        t_cm_domain_id handle);

/*!
 * \brief Destroy all domains belonging to a given client.
 *
 * \param[in] client
 *
 * \return Error code.
 *
 * \ingroup CM_ENGINE_API
 */
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_FlushMemoryDomains(
        t_nmf_client_id client);

/*!
 * \brief Retrieve the coreId for a given domain. Utility.

 * \param[in]  domainId   Domain identifier.
 * \param[out] coreId     Core identifier.
 *
 * \exception CM_INVALID_DOMAIN_HANDLE  Invalid domain handle
 * \exception CM_OK
 *
 * \return Error code.
 *
 * \ingroup CM_ENGINE_API
 */
PUBLIC IMPORT_SHARED t_cm_error CM_ENGINE_GetDomainCoreId(const t_cm_domain_id domainId, t_nmf_core_id *coreId);

#endif /* __INC_DOMAIN_ENGINE_H */