Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f45a930e
authored
Feb 24, 2015
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_c: fixed minor bugs
parent
7a2f4425
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
11 deletions
+13
-11
mtapi_c/src/embb_mtapi_action_t.c
+1
-0
mtapi_c/src/embb_mtapi_id_pool_t.c
+3
-3
mtapi_c/src/embb_mtapi_job_t.c
+5
-5
mtapi_c/src/embb_mtapi_pool_template-inl.h
+3
-3
mtapi_c/src/embb_mtapi_queue_t.c
+1
-0
No files found.
mtapi_c/src/embb_mtapi_action_t.c
View file @
f45a930e
...
...
@@ -412,6 +412,7 @@ void mtapi_action_enable(
embb_mtapi_action_pool_get_storage_for_handle
(
node
->
action_pool
,
action
);
local_action
->
enabled
=
MTAPI_TRUE
;
local_status
=
MTAPI_SUCCESS
;
}
else
{
local_status
=
MTAPI_ERR_ACTION_INVALID
;
}
...
...
mtapi_c/src/embb_mtapi_id_pool_t.c
View file @
f45a930e
...
...
@@ -37,12 +37,12 @@ void embb_mtapi_id_pool_initialize(
that
->
capacity
=
capacity
;
that
->
id_buffer
=
(
mtapi_uint_t
*
)
embb_mtapi_alloc_allocate
(
sizeof
(
mtapi_uint_t
)
*
(
capacity
));
embb_mtapi_alloc_allocate
(
sizeof
(
mtapi_uint_t
)
*
(
capacity
+
1
));
that
->
id_buffer
[
0
]
=
EMBB_MTAPI_IDPOOL_INVALID_ID
;
for
(
ii
=
1
;
ii
<
capacity
;
ii
++
)
{
for
(
ii
=
1
;
ii
<
=
capacity
;
ii
++
)
{
that
->
id_buffer
[
ii
]
=
ii
;
}
that
->
ids_available
=
capacity
-
1
;
that
->
ids_available
=
capacity
;
that
->
put_id_position
=
0
;
that
->
get_id_position
=
1
;
embb_mtapi_spinlock_initialize
(
&
that
->
lock
);
...
...
mtapi_c/src/embb_mtapi_job_t.c
View file @
f45a930e
...
...
@@ -40,9 +40,9 @@
mtapi_boolean_t
embb_mtapi_job_initialize_list
(
embb_mtapi_node_t
*
node
)
{
node
->
job_list
=
(
embb_mtapi_job_t
*
)
embb_mtapi_alloc_allocate
(
sizeof
(
embb_mtapi_job_t
)
*
node
->
attributes
.
max_jobs
);
sizeof
(
embb_mtapi_job_t
)
*
(
node
->
attributes
.
max_jobs
+
1
)
);
mtapi_uint_t
ii
;
for
(
ii
=
0
;
ii
<
node
->
attributes
.
max_jobs
;
ii
++
)
{
for
(
ii
=
0
;
ii
<
=
node
->
attributes
.
max_jobs
;
ii
++
)
{
embb_mtapi_job_initialize
(
&
node
->
job_list
[
ii
],
node
->
attributes
.
max_actions_per_job
);
node
->
job_list
[
ii
].
handle
.
id
=
ii
;
...
...
@@ -53,7 +53,7 @@ mtapi_boolean_t embb_mtapi_job_initialize_list(embb_mtapi_node_t * node) {
void
embb_mtapi_job_finalize_list
(
embb_mtapi_node_t
*
node
)
{
mtapi_uint_t
ii
;
for
(
ii
=
0
;
ii
<
node
->
attributes
.
max_jobs
;
ii
++
)
{
for
(
ii
=
0
;
ii
<
=
node
->
attributes
.
max_jobs
;
ii
++
)
{
embb_mtapi_job_finalize
(
&
node
->
job_list
[
ii
]);
node
->
job_list
[
ii
].
handle
.
id
=
0
;
}
...
...
@@ -69,7 +69,7 @@ mtapi_boolean_t embb_mtapi_job_is_handle_valid(
mtapi_job_hndl_t
handle
)
{
assert
(
MTAPI_NULL
!=
node
);
return
((
0
<
handle
.
id
)
&&
(
handle
.
id
<
node
->
attributes
.
max_jobs
)
&&
(
handle
.
id
<
=
node
->
attributes
.
max_jobs
)
&&
(
node
->
job_list
[
handle
.
id
].
handle
.
tag
==
handle
.
tag
))
?
MTAPI_TRUE
:
MTAPI_FALSE
;
}
...
...
@@ -87,7 +87,7 @@ mtapi_boolean_t embb_mtapi_job_is_id_valid(
embb_mtapi_node_t
*
node
,
mtapi_job_id_t
id
)
{
assert
(
MTAPI_NULL
!=
node
);
return
((
0
<
id
)
&&
(
id
<
node
->
attributes
.
max_jobs
))
?
return
((
0
<
id
)
&&
(
id
<
=
node
->
attributes
.
max_jobs
))
?
MTAPI_TRUE
:
MTAPI_FALSE
;
}
...
...
mtapi_c/src/embb_mtapi_pool_template-inl.h
View file @
f45a930e
...
...
@@ -60,8 +60,8 @@ mtapi_boolean_t embb_mtapi_##TYPE##_pool_initialize( \
assert(MTAPI_NULL != that); \
embb_mtapi_id_pool_initialize(&that->id_pool, capacity); \
that->storage = (embb_mtapi_##TYPE##_t*)embb_mtapi_alloc_allocate( \
sizeof(embb_mtapi_##TYPE##_t)*
capacity
); \
for (ii = 0; ii < capacity; ii++) { \
sizeof(embb_mtapi_##TYPE##_t)*
(capacity + 1)
); \
for (ii = 0; ii <
=
capacity; ii++) { \
that->storage[ii].handle.id = EMBB_MTAPI_IDPOOL_INVALID_ID; \
that->storage[ii].handle.tag = 0; \
} \
...
...
@@ -102,7 +102,7 @@ mtapi_boolean_t embb_mtapi_##TYPE##_pool_is_handle_valid( \
mtapi_##TYPE##_hndl_t handle) { \
assert(MTAPI_NULL != that); \
return ((0 < handle.id) && \
(handle.id < that->id_pool.capacity) && \
(handle.id <
=
that->id_pool.capacity) && \
(that->storage[handle.id].handle.tag == handle.tag)) ? \
MTAPI_TRUE : MTAPI_FALSE; \
} \
...
...
mtapi_c/src/embb_mtapi_queue_t.c
View file @
f45a930e
...
...
@@ -200,6 +200,7 @@ mtapi_queue_hndl_t mtapi_queue_create(
queue
->
queue_id
=
queue_id
;
queue_hndl
=
queue
->
handle
;
}
else
{
embb_mtapi_queue_pool_deallocate
(
node
->
queue_pool
,
queue
);
local_status
=
MTAPI_ERR_JOB_INVALID
;
}
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment