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
|
/*
* 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.
*/
#include <cm/engine/api/domain_engine.h>
#include <cm/engine/api/migration_engine.h>
#include <cm/engine/memory/inc/domain.h>
#include <cm/engine/memory/inc/migration.h>
#include <cm/engine/os_adaptation_layer/inc/os_adaptation_layer.h>
PUBLIC EXPORT_SHARED t_cm_error CM_ENGINE_CreateMemoryDomain(
const t_nmf_client_id client,
const t_cm_domain_memory *domain,
t_cm_domain_id *handle
)
{
t_cm_error error;
OSAL_LOCK_API();
error = cm_DM_CreateDomain(client, domain, handle);
OSAL_UNLOCK_API();
return error;
}
PUBLIC EXPORT_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
)
{
t_cm_error error;
OSAL_LOCK_API();
error = cm_DM_CreateDomainScratch(client, parentId, domain, handle);
OSAL_UNLOCK_API();
return error;
}
PUBLIC EXPORT_SHARED t_cm_error CM_ENGINE_DestroyMemoryDomain(
t_cm_domain_id handle)
{
t_cm_error error;
OSAL_LOCK_API();
error = cm_DM_DestroyDomain(handle);
OSAL_UNLOCK_API();
return error;
}
PUBLIC EXPORT_SHARED t_cm_error CM_ENGINE_FlushMemoryDomains(
t_nmf_client_id client)
{
t_cm_error error;
OSAL_LOCK_API();
error = cm_DM_DestroyDomains(client);
OSAL_UNLOCK_API();
return error;
}
PUBLIC EXPORT_SHARED t_cm_error CM_ENGINE_GetDomainCoreId(const t_cm_domain_id domainId, t_nmf_core_id *coreId)
{
t_cm_error error;
OSAL_LOCK_API();
//TODO, scratch
error = cm_DM_CheckDomain(domainId, DOMAIN_NORMAL);
if (error != CM_OK) {
OSAL_UNLOCK_API();
return error;
}
*coreId = cm_DM_GetDomainCoreId(domainId);
OSAL_UNLOCK_API();
return CM_OK;
}
PUBLIC EXPORT_SHARED t_cm_error CM_ENGINE_Migrate(const t_cm_domain_id srcShared, const t_cm_domain_id src, const t_cm_domain_id dst)
{
t_cm_error error;
OSAL_LOCK_API();
error = cm_migrate(srcShared, src, dst);
OSAL_UNLOCK_API();
return error;
}
PUBLIC EXPORT_SHARED t_cm_error CM_ENGINE_Unmigrate(void)
{
t_cm_error error;
OSAL_LOCK_API();
error = cm_unmigrate();
OSAL_UNLOCK_API();
return error;
}
|