Commit bbb3c392 by Tobias Schuele

Merge branch 'development' of https://github.com/siemens/embb into development

parents 19db52cd cfbdcd28
......@@ -36,6 +36,14 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING
RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# Check for clang, masquerade it as GNU
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_COMPILER_IS_GNUCC true)
endif ()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_COMPILER_IS_GNUCXX true)
endif()
## Command line options
#
# The set option will be converted to uppercase letters by cmake!! --> ON/OFF
......
......@@ -58,7 +58,7 @@
EMBB_INLINE int EMBB_CAT2(embb_internal__atomic_compare_and_swap_, \
EMBB_PARAMETER_SIZE_BYTE)(EMBB_CAT2(EMBB_BASE_BASIC_TYPE_SIZE_, EMBB_PARAMETER_SIZE_BYTE) volatile* pointer_to_value, EMBB_CAT2(EMBB_BASE_BASIC_TYPE_SIZE_, EMBB_PARAMETER_SIZE_BYTE) volatile* expected, \
EMBB_CAT2(EMBB_BASE_BASIC_TYPE_SIZE_, EMBB_PARAMETER_SIZE_BYTE) desired) { \
register char result; \
char result; \
__asm__ __volatile__ ("lock cmpxchg" EMBB_ATOMIC_X86_SIZE_SUFFIX\
" %3, %0 \n\t" \
"setz %2 \n\t" \
......
......@@ -59,7 +59,7 @@
EMBB_INLINE EMBB_CAT2(EMBB_BASE_BASIC_TYPE_SIZE_, EMBB_PARAMETER_SIZE_BYTE) \
EMBB_CAT2(embb_internal__atomic_load_, EMBB_PARAMETER_SIZE_BYTE)(EMBB_CAT2(EMBB_BASE_BASIC_TYPE_SIZE_, EMBB_PARAMETER_SIZE_BYTE) volatile* pointer_to_value) { \
/* no fence required for loads */ \
register EMBB_CAT2(EMBB_BASE_BASIC_TYPE_SIZE_, EMBB_PARAMETER_SIZE_BYTE) result; \
EMBB_CAT2(EMBB_BASE_BASIC_TYPE_SIZE_, EMBB_PARAMETER_SIZE_BYTE) result; \
__asm__ __volatile__("mov" EMBB_ATOMIC_X86_SIZE_SUFFIX " %1, %0" \
: "=q" (result) \
: "m" (*pointer_to_value) \
......
......@@ -334,7 +334,7 @@ template <class C, typename R,
Function<R, T1> Bind(
C & obj,
R(C::*func)(T1),
Placeholder::Arg_1 p1) {
Placeholder::Arg_1) {
return Function<R, T1>(obj, func);
}
......@@ -342,7 +342,7 @@ template <typename R,
typename T1>
Function<R, T1> Bind(
R(*func)(T1),
Placeholder::Arg_1 p1) {
Placeholder::Arg_1) {
return Function<R, T1>(func);
}
......
......@@ -422,8 +422,8 @@ template <class C, typename R,
Function<R, T1, T2> Bind(
C & obj,
R(C::*func)(T1, T2),
Placeholder::Arg_1 p1,
Placeholder::Arg_2 p2) {
Placeholder::Arg_1,
Placeholder::Arg_2) {
return Function<R, T1, T2>(obj, func);
}
......@@ -431,8 +431,8 @@ template <typename R,
typename T1, typename T2>
Function<R, T1, T2> Bind(
R(*func)(T1, T2),
Placeholder::Arg_1 p1,
Placeholder::Arg_2 p2) {
Placeholder::Arg_1,
Placeholder::Arg_2) {
return Function<R, T1, T2>(func);
}
......
......@@ -468,9 +468,9 @@ template <class C, typename R,
Function<R, T1, T2, T3> Bind(
C & obj,
R(C::*func)(T1, T2, T3),
Placeholder::Arg_1 p1,
Placeholder::Arg_2 p2,
Placeholder::Arg_3 p3) {
Placeholder::Arg_1,
Placeholder::Arg_2,
Placeholder::Arg_3) {
return Function<R, T1, T2, T3>(obj, func);
}
......@@ -478,9 +478,9 @@ template <typename R,
typename T1, typename T2, typename T3>
Function<R, T1, T2, T3> Bind(
R(*func)(T1, T2, T3),
Placeholder::Arg_1 p1,
Placeholder::Arg_2 p2,
Placeholder::Arg_3 p3) {
Placeholder::Arg_1,
Placeholder::Arg_2,
Placeholder::Arg_3) {
return Function<R, T1, T2, T3>(func);
}
......
......@@ -517,10 +517,10 @@ template <class C, typename R,
Function<R, T1, T2, T3, T4> Bind(
C & obj,
R(C::*func)(T1, T2, T3, T4),
Placeholder::Arg_1 p1,
Placeholder::Arg_2 p2,
Placeholder::Arg_3 p3,
Placeholder::Arg_4 p4) {
Placeholder::Arg_1,
Placeholder::Arg_2,
Placeholder::Arg_3,
Placeholder::Arg_4) {
return Function<R, T1, T2, T3, T4>(obj, func);
}
......@@ -528,10 +528,10 @@ template <typename R,
typename T1, typename T2, typename T3, typename T4>
Function<R, T1, T2, T3, T4> Bind(
R(*func)(T1, T2, T3, T4),
Placeholder::Arg_1 p1,
Placeholder::Arg_2 p2,
Placeholder::Arg_3 p3,
Placeholder::Arg_4 p4) {
Placeholder::Arg_1,
Placeholder::Arg_2,
Placeholder::Arg_3,
Placeholder::Arg_4) {
return Function<R, T1, T2, T3, T4>(func);
}
......
......@@ -567,11 +567,11 @@ template <class C, typename R,
Function<R, T1, T2, T3, T4, T5> Bind(
C & obj,
R(C::*func)(T1, T2, T3, T4, T5),
Placeholder::Arg_1 p1,
Placeholder::Arg_2 p2,
Placeholder::Arg_3 p3,
Placeholder::Arg_4 p4,
Placeholder::Arg_5 p5) {
Placeholder::Arg_1,
Placeholder::Arg_2,
Placeholder::Arg_3,
Placeholder::Arg_4,
Placeholder::Arg_5) {
return Function<R, T1, T2, T3, T4, T5>(obj, func);
}
......@@ -579,11 +579,11 @@ template <typename R,
typename T1, typename T2, typename T3, typename T4, typename T5>
Function<R, T1, T2, T3, T4, T5> Bind(
R(*func)(T1, T2, T3, T4, T5),
Placeholder::Arg_1 p1,
Placeholder::Arg_2 p2,
Placeholder::Arg_3 p3,
Placeholder::Arg_4 p4,
Placeholder::Arg_5 p5) {
Placeholder::Arg_1,
Placeholder::Arg_2,
Placeholder::Arg_3,
Placeholder::Arg_4,
Placeholder::Arg_5) {
return Function<R, T1, T2, T3, T4, T5>(func);
}
......
......@@ -497,7 +497,7 @@ function make_functionN(arg_cnt)
local bound_param_list_c = ""
for i = 1, arg_cnt, 1 do
bound_param_list_c = bound_param_list_c..",\n Placeholder::Arg_"..i.." p"..i
bound_param_list_c = bound_param_list_c..",\n Placeholder::Arg_"..i
end
file:write(CR_templ.."\n")
......
......@@ -97,18 +97,18 @@ FixedSizeList<ElementT>::~FixedSizeList() {
template< typename GuardType >
bool HazardPointerThreadEntry<GuardType>::IsActive() {
return (is_active == 1);
return is_active;
}
template< typename GuardType >
bool HazardPointerThreadEntry<GuardType>::TryReserve() {
int expected = 0;
return is_active.CompareAndSwap(expected, 1);
bool expected = false;
return is_active.CompareAndSwap(expected, true);
}
template< typename GuardType >
void HazardPointerThreadEntry<GuardType>::Deactivate() {
is_active = 0;
is_active = false;
}
template< typename GuardType >
......@@ -198,10 +198,7 @@ GuardPointer(int guardNumber, GuardType pointerToGuard) {
template< typename GuardType >
void HazardPointerThreadEntry<GuardType>::SetActive(bool active) {
if (active == true)
is_active = 1;
else
is_active = 0;
is_active = active;
}
template< typename GuardType >
......
......@@ -201,7 +201,7 @@ class HazardPointerThreadEntry {
* signal that it is leaving. If a thread has left, the other threads are
* responsible for cleaning up its retired list.
*/
embb::base::Atomic< int > is_active;
embb::base::Atomic< bool > is_active;
/**
* The guarded pointer of this thread, has size \c guard_per_thread.
......
......@@ -99,7 +99,7 @@ GetIndexOfObject(const T &obj) const {
template<class T, typename ValuePool, class ObjectAllocator>
T* ObjectPool<T, ValuePool, ObjectAllocator>::AllocateRaw() {
int val;
bool val;
int allocated_index = p.Allocate(val);
if (allocated_index == -1) {
return NULL;
......@@ -128,7 +128,7 @@ void ObjectPool<T, ValuePool, ObjectAllocator>::Free(T* obj) {
int index = GetIndexOfObject(*obj);
obj->~T();
p.Free(1, index);
p.Free(true, index);
}
template<class T, typename ValuePool, class ObjectAllocator>
......
......@@ -105,7 +105,7 @@ class LockFreeMPMCQueueNode {
* which stores the elements.
*/
template< typename T,
typename ValuePool = embb::containers::LockFreeTreeValuePool < int, 0 >
typename ValuePool = embb::containers::LockFreeTreeValuePool < bool, false >
>
class LockFreeMPMCQueue {
private:
......
......@@ -170,7 +170,7 @@ class LockFreeStackNode {
* which stores the elements.
*/
template< typename T,
typename ValuePool = embb::containers::LockFreeTreeValuePool < int, 0 > >
typename ValuePool = embb::containers::LockFreeTreeValuePool < bool, false > >
class LockFreeStack {
private:
/**
......
......@@ -55,7 +55,7 @@ namespace containers {
*/
template<class T,
typename ValuePool =
embb::containers::WaitFreeArrayValuePool< int, 0 >,
embb::containers::WaitFreeArrayValuePool< bool, false >,
class ObjectAllocator = embb::base::Allocator<T> >
class ObjectPool {
private:
......@@ -87,9 +87,9 @@ class ObjectPool {
class ReturningTrueIterator {
public:
typedef ReturningTrueIterator self_type;
typedef int value_type;
typedef int& reference;
typedef int* pointer;
typedef bool value_type;
typedef bool& reference;
typedef bool* pointer;
typedef std::forward_iterator_tag iterator_category;
typedef int difference_type;
explicit ReturningTrueIterator(size_t count_value);
......@@ -102,7 +102,7 @@ class ObjectPool {
private:
size_t count_value;
int ret_value;
bool ret_value;
};
bool IsContained(const T &obj) const;
......
......@@ -63,8 +63,8 @@ PT_MAIN("Data Structures C++") {
embb::containers::LockFreeStack<int> >);
PT_RUN(embb::containers::test::ObjectPoolTest
<embb::containers::LockFreeTreeValuePool<int COMMA 0 > >);
<embb::containers::LockFreeTreeValuePool<bool COMMA false > >);
PT_RUN(embb::containers::test::ObjectPoolTest
<embb::containers::WaitFreeArrayValuePool<int COMMA 0> >);
<embb::containers::WaitFreeArrayValuePool<bool COMMA false> >);
}
......@@ -60,11 +60,7 @@ struct embb_mtapi_action_struct {
embb_atomic_int num_tasks;
};
/**
* Action type
* \memberof embb_mtapi_action_struct
*/
typedef struct embb_mtapi_action_struct embb_mtapi_action_t;
#include <embb_mtapi_action_t_fwd.h>
/**
* Default constructor.
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MTAPI_C_SRC_EMBB_MTAPI_ACTION_T_FWD_H_
#define MTAPI_C_SRC_EMBB_MTAPI_ACTION_T_FWD_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Action type
* \memberof embb_mtapi_action_struct
*/
typedef struct embb_mtapi_action_struct embb_mtapi_action_t;
/**
* Action pool type.
* \memberof embb_mtapi_action_pool_struct
*/
typedef struct embb_mtapi_action_pool_struct embb_mtapi_action_pool_t;
#ifdef __cplusplus
}
#endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_ACTION_T_FWD_H_
......@@ -40,7 +40,7 @@ extern "C" {
/* ---- FORWARD DECLARATIONS ----------------------------------------------- */
typedef struct embb_mtapi_node_struct embb_mtapi_node_t;
#include <embb_mtapi_node_t_fwd.h>
/* ---- CLASS DECLARATION -------------------------------------------------- */
......@@ -61,11 +61,7 @@ struct embb_mtapi_group_struct {
embb_mtapi_task_queue_t queue;
};
/**
* Group type
* \memberof embb_mtapi_group_struct
*/
typedef struct embb_mtapi_group_struct embb_mtapi_group_t;
#include <embb_mtapi_group_t_fwd.h>
/**
* Default constructor.
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MTAPI_C_SRC_EMBB_MTAPI_GROUP_T_FWD_H_
#define MTAPI_C_SRC_EMBB_MTAPI_GROUP_T_FWD_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Group type
* \memberof embb_mtapi_group_struct
*/
typedef struct embb_mtapi_group_struct embb_mtapi_group_t;
/**
* Group pool type.
* \memberof embb_mtapi_group_pool_struct
*/
typedef struct embb_mtapi_group_pool_struct embb_mtapi_group_pool_t;
#ifdef __cplusplus
}
#endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_GROUP_T_FWD_H_
......@@ -36,8 +36,8 @@ extern "C" {
/* ---- FORWARD DECLARATIONS ----------------------------------------------- */
typedef struct embb_mtapi_node_struct embb_mtapi_node_t;
typedef struct embb_mtapi_action_struct embb_mtapi_action_t;
#include <embb_mtapi_node_t_fwd.h>
#include <embb_mtapi_action_t_fwd.h>
/* ---- CLASS DECLARATION -------------------------------------------------- */
......@@ -58,11 +58,7 @@ struct embb_mtapi_job_struct {
mtapi_action_hndl_t* actions;
};
/**
* Job type.
* \memberof embb_mtapi_job_struct
*/
typedef struct embb_mtapi_job_struct embb_mtapi_job_t;
#include <embb_mtapi_job_t_fwd.h>
/**
* Constructs the global job list.
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MTAPI_C_SRC_EMBB_MTAPI_JOB_T_FWD_H_
#define MTAPI_C_SRC_EMBB_MTAPI_JOB_T_FWD_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Job type.
* \memberof embb_mtapi_job_struct
*/
typedef struct embb_mtapi_job_struct embb_mtapi_job_t;
#ifdef __cplusplus
}
#endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_JOB_T_FWD_H_
......@@ -39,12 +39,12 @@ extern "C" {
/* ---- FORWARD DECLARATIONS ----------------------------------------------- */
typedef struct embb_mtapi_job_struct embb_mtapi_job_t;
typedef struct embb_mtapi_scheduler_struct embb_mtapi_scheduler_t;
typedef struct embb_mtapi_action_pool_struct embb_mtapi_action_pool_t;
typedef struct embb_mtapi_group_pool_struct embb_mtapi_group_pool_t;
typedef struct embb_mtapi_task_pool_struct embb_mtapi_task_pool_t;
typedef struct embb_mtapi_queue_pool_struct embb_mtapi_queue_pool_t;
#include <embb_mtapi_job_t_fwd.h>
#include <embb_mtapi_scheduler_t_fwd.h>
#include <embb_mtapi_action_t_fwd.h>
#include <embb_mtapi_group_t_fwd.h>
#include <embb_mtapi_task_t_fwd.h>
#include <embb_mtapi_queue_t_fwd.h>
/* ---- CLASS DECLARATION -------------------------------------------------- */
......@@ -73,11 +73,7 @@ struct embb_mtapi_node_struct {
mtapi_affinity_t affinity_all;
};
/**
* Node type.
* \memberof embb_mtapi_node_struct
*/
typedef struct embb_mtapi_node_struct embb_mtapi_node_t;
#include <embb_mtapi_node_t_fwd.h>
/**
* Checks if the node singleton was initialized already.
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MTAPI_C_SRC_EMBB_MTAPI_NODE_T_FWD_H_
#define MTAPI_C_SRC_EMBB_MTAPI_NODE_T_FWD_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Node type.
* \memberof embb_mtapi_node_struct
*/
typedef struct embb_mtapi_node_struct embb_mtapi_node_t;
#ifdef __cplusplus
}
#endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_NODE_T_FWD_H_
......@@ -45,11 +45,6 @@ struct embb_mtapi_##TYPE##_pool_struct \
embb_mtapi_##TYPE##_t * storage; \
}; \
\
/** TYPE pool type.
\memberof embb_mtapi_##TYPE##_pool_struct
*/ \
typedef struct embb_mtapi_##TYPE##_pool_struct embb_mtapi_##TYPE##_pool_t; \
\
/** operator new with configurable capacity.
\memberof embb_mtapi_##TYPE##_pool_struct
*/ \
......
......@@ -40,7 +40,7 @@ extern "C" {
/* ---- FORWARD DECLARATIONS ----------------------------------------------- */
typedef struct embb_mtapi_task_queue_struct embb_mtapi_task_queue_t;
#include <embb_mtapi_task_queue_t_fwd.h>
/* ---- CLASS DECLARATION -------------------------------------------------- */
......@@ -63,11 +63,7 @@ struct embb_mtapi_queue_struct {
mtapi_affinity_t ordered_affinity;
};
/**
* Queue type.
* \memberof embb_mtapi_queue_struct
*/
typedef struct embb_mtapi_queue_struct embb_mtapi_queue_t;
#include <embb_mtapi_queue_t_fwd.h>
/**
* Default constructor.
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MTAPI_C_SRC_EMBB_MTAPI_QUEUE_T_FWD_H_
#define MTAPI_C_SRC_EMBB_MTAPI_QUEUE_T_FWD_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Queue type.
* \memberof embb_mtapi_queue_struct
*/
typedef struct embb_mtapi_queue_struct embb_mtapi_queue_t;
/**
* Queue pool type.
* \memberof embb_mtapi_queue_pool_struct
*/
typedef struct embb_mtapi_queue_pool_struct embb_mtapi_queue_pool_t;
#ifdef __cplusplus
}
#endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_QUEUE_T_FWD_H_
......@@ -39,10 +39,10 @@ extern "C" {
/* ---- FORWARD DECLARATIONS ----------------------------------------------- */
typedef struct embb_mtapi_queue_struct embb_mtapi_queue_t;
typedef struct embb_mtapi_thread_context_struct embb_mtapi_thread_context_t;
typedef struct embb_mtapi_task_struct embb_mtapi_task_t;
typedef struct embb_mtapi_node_struct embb_mtapi_node_t;
#include <embb_mtapi_queue_t_fwd.h>
#include <embb_mtapi_thread_context_t_fwd.h>
#include <embb_mtapi_task_t_fwd.h>
#include <embb_mtapi_node_t_fwd.h>
typedef int (embb_mtapi_scheduler_worker_func_t)(void * args);
/* ---- CLASS DECLARATION -------------------------------------------------- */
......@@ -87,11 +87,7 @@ struct embb_mtapi_scheduler_struct {
embb_atomic_int affine_task_counter;
};
/**
* Scheduler type.
* \memberof embb_mtapi_scheduler_struct
*/
typedef struct embb_mtapi_scheduler_struct embb_mtapi_scheduler_t;
#include <embb_mtapi_scheduler_t_fwd.h>
/**
* The default worker thread function used by the scheduler. Implements
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MTAPI_C_SRC_EMBB_MTAPI_SCHEDULER_T_FWD_H_
#define MTAPI_C_SRC_EMBB_MTAPI_SCHEDULER_T_FWD_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Scheduler type.
* \memberof embb_mtapi_scheduler_struct
*/
typedef struct embb_mtapi_scheduler_struct embb_mtapi_scheduler_t;
#ifdef __cplusplus
}
#endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_SCHEDULER_T_FWD_H_
......@@ -36,8 +36,8 @@ extern "C" {
/* ---- FORWARD DECLARATIONS ----------------------------------------------- */
typedef struct embb_mtapi_thread_context_struct embb_mtapi_thread_context_t;
typedef struct embb_mtapi_task_struct embb_mtapi_task_t;
#include <embb_mtapi_thread_context_t_fwd.h>
#include <embb_mtapi_task_t_fwd.h>
/* ---- CLASS DECLARATION -------------------------------------------------- */
......@@ -55,11 +55,7 @@ struct embb_mtapi_task_context_struct {
embb_mtapi_thread_context_t* thread_context;
};
/**
* Task context type.
* \memberof embb_mtapi_task_context_struct
*/
typedef struct embb_mtapi_task_context_struct embb_mtapi_task_context_t;
#include <embb_mtapi_task_context_t_fwd.h>
/**
* Constructor from a thread_context and a task.
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MTAPI_C_SRC_EMBB_MTAPI_TASK_CONTEXT_T_FWD_H_
#define MTAPI_C_SRC_EMBB_MTAPI_TASK_CONTEXT_T_FWD_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Task context type.
* \memberof embb_mtapi_task_context_struct
*/
typedef struct embb_mtapi_task_context_struct embb_mtapi_task_context_t;
#ifdef __cplusplus
}
#endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_TASK_CONTEXT_T_FWD_H_
......@@ -40,7 +40,7 @@ extern "C" {
/* ---- FORWARD DECLARATIONS ----------------------------------------------- */
typedef struct embb_mtapi_task_struct embb_mtapi_task_t;
#include <embb_mtapi_task_t_fwd.h>
/* ---- CLASS DECLARATION -------------------------------------------------- */
......@@ -60,11 +60,7 @@ struct embb_mtapi_task_queue_struct {
embb_mtapi_spinlock_t lock;
};
/**
* Task queue type.
* \memberof embb_mtapi_task_queue_struct
*/
typedef struct embb_mtapi_task_queue_struct embb_mtapi_task_queue_t;
#include <embb_mtapi_task_queue_t_fwd.h>
/**
* Default constructor.
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MTAPI_C_SRC_EMBB_MTAPI_TASK_QUEUE_T_FWD_H_
#define MTAPI_C_SRC_EMBB_MTAPI_TASK_QUEUE_T_FWD_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Task queue type.
* \memberof embb_mtapi_task_queue_struct
*/
typedef struct embb_mtapi_task_queue_struct embb_mtapi_task_queue_t;
#ifdef __cplusplus
}
#endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_TASK_QUEUE_T_FWD_H_
......@@ -40,8 +40,7 @@ extern "C" {
/* ---- FORWARD DECLARATIONS ----------------------------------------------- */
typedef struct embb_mtapi_task_context_struct embb_mtapi_task_context_t;
typedef struct embb_mtapi_task_pool_struct embb_mtapi_task_pool_t;
#include <embb_mtapi_task_context_t_fwd.h>
/* ---- CLASS DECLARATION -------------------------------------------------- */
......@@ -73,11 +72,7 @@ struct embb_mtapi_task_struct {
mtapi_status_t error_code;
};
/**
* Task type.
* \memberof embb_mtapi_task_struct
*/
typedef struct embb_mtapi_task_struct embb_mtapi_task_t;
#include <embb_mtapi_task_t_fwd.h>
/**
* Pooled operator new.
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MTAPI_C_SRC_EMBB_MTAPI_TASK_T_FWD_H_
#define MTAPI_C_SRC_EMBB_MTAPI_TASK_T_FWD_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Task type.
* \memberof embb_mtapi_task_struct
*/
typedef struct embb_mtapi_task_struct embb_mtapi_task_t;
/**
* Task pool type.
* \memberof embb_mtapi_task_pool_struct
*/
typedef struct embb_mtapi_task_pool_struct embb_mtapi_task_pool_t;
#ifdef __cplusplus
}
#endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_TASK_T_FWD_H_
......@@ -36,7 +36,7 @@ extern "C" {
/* ---- FORWARD DECLARATIONS ----------------------------------------------- */
typedef struct embb_mtapi_task_struct embb_mtapi_task_t;
#include <embb_mtapi_task_t_fwd.h>
/* ---- TYPE DEFINITIONS --------------------------------------------------- */
......
......@@ -39,9 +39,9 @@ extern "C" {
/* ---- FORWARD DECLARATIONS ----------------------------------------------- */
typedef struct embb_mtapi_task_queue_struct embb_mtapi_task_queue_t;
typedef struct embb_mtapi_node_struct embb_mtapi_node_t;
typedef struct embb_mtapi_scheduler_struct embb_mtapi_scheduler_t;
#include <embb_mtapi_task_queue_t_fwd.h>
#include <embb_mtapi_node_t_fwd.h>
#include <embb_mtapi_scheduler_t_fwd.h>
/* ---- CLASS DECLARATION -------------------------------------------------- */
......@@ -68,11 +68,7 @@ struct embb_mtapi_thread_context_struct {
mtapi_status_t status;
};
/**
* Thread context type.
* \memberof embb_mtapi_thread_context_struct
*/
typedef struct embb_mtapi_thread_context_struct embb_mtapi_thread_context_t;
#include <embb_mtapi_thread_context_t_fwd.h>
/**
* Constructor using attributes from node and a given core number.
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MTAPI_C_SRC_EMBB_MTAPI_THREAD_CONTEXT_T_FWD_H_
#define MTAPI_C_SRC_EMBB_MTAPI_THREAD_CONTEXT_T_FWD_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* Thread context type.
* \memberof embb_mtapi_thread_context_struct
*/
typedef struct embb_mtapi_thread_context_struct embb_mtapi_thread_context_t;
#ifdef __cplusplus
}
#endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_THREAD_CONTEXT_T_FWD_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment