diff options
Diffstat (limited to 'platform/linux-generic/include/odp/plat')
9 files changed, 120 insertions, 55 deletions
diff --git a/platform/linux-generic/include/odp/plat/atomic_types.h b/platform/linux-generic/include/odp/plat/atomic_types.h index 3cdcab8bd..0f6c353a1 100644 --- a/platform/linux-generic/include/odp/plat/atomic_types.h +++ b/platform/linux-generic/include/odp/plat/atomic_types.h @@ -62,18 +62,10 @@ struct odp_atomic_u32_s { }) #endif -/** @addtogroup odp_synchronizers - * @{ - */ - typedef struct odp_atomic_u64_s odp_atomic_u64_t; typedef struct odp_atomic_u32_s odp_atomic_u32_t; -/** - * @} - */ - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/include/odp/plat/barrier_types.h b/platform/linux-generic/include/odp/plat/barrier_types.h index c8c978dca..b8e1d97bb 100644 --- a/platform/linux-generic/include/odp/plat/barrier_types.h +++ b/platform/linux-generic/include/odp/plat/barrier_types.h @@ -30,16 +30,8 @@ struct odp_barrier_s { odp_atomic_u32_t bar; /**< Barrier counter */ }; -/** @addtogroup odp_synchronizers - * @{ - */ - typedef struct odp_barrier_s odp_barrier_t; -/** - * @} - */ - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h b/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h new file mode 100644 index 000000000..474751cf0 --- /dev/null +++ b/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h @@ -0,0 +1,38 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP recursive read/write lock + */ + +#ifndef ODP_RWLOCK_RECURSIVE_TYPES_H_ +#define ODP_RWLOCK_RECURSIVE_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/rwlock.h> +#include <odp/std_types.h> +#include <odp/thread.h> + +/** @internal */ +struct odp_rwlock_recursive_s { + odp_rwlock_t lock; /**< the lock */ + int wr_owner; /**< write owner thread */ + uint32_t wr_cnt; /**< write recursion count */ + uint8_t rd_cnt[ODP_THREAD_COUNT_MAX]; /**< read recursion count */ +}; + +typedef struct odp_rwlock_recursive_s odp_rwlock_recursive_t; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/rwlock_types.h b/platform/linux-generic/include/odp/plat/rwlock_types.h index bd46e5722..35d65decb 100644 --- a/platform/linux-generic/include/odp/plat/rwlock_types.h +++ b/platform/linux-generic/include/odp/plat/rwlock_types.h @@ -20,10 +20,7 @@ extern "C" { #include <odp/atomic.h> -/** - * @internal - * ODP rwlock - */ +/** @internal */ struct odp_rwlock_s { odp_atomic_u32_t cnt; /**< lock count 0 lock not taken @@ -31,16 +28,8 @@ struct odp_rwlock_s { >0 read lock(s) taken */ }; -/** @addtogroup odp_synchronizers - * @{ - */ - typedef struct odp_rwlock_s odp_rwlock_t; -/** - * @} - */ - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/include/odp/plat/spinlock_recursive_types.h b/platform/linux-generic/include/odp/plat/spinlock_recursive_types.h new file mode 100644 index 000000000..2809277bd --- /dev/null +++ b/platform/linux-generic/include/odp/plat/spinlock_recursive_types.h @@ -0,0 +1,36 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP recursive spinlock + */ + +#ifndef ODP_SPINLOCK_RECURSIVE_TYPES_H_ +#define ODP_SPINLOCK_RECURSIVE_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/spinlock.h> +#include <odp/std_types.h> + +/** @internal */ +struct odp_spinlock_recursive_s { + odp_spinlock_t lock; /**< the lock */ + int owner; /**< thread owning the lock */ + uint32_t cnt; /**< recursion count */ +}; + +typedef struct odp_spinlock_recursive_s odp_spinlock_recursive_t; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/spinlock_types.h b/platform/linux-generic/include/odp/plat/spinlock_types.h index 83d306b5b..3e0231d1d 100644 --- a/platform/linux-generic/include/odp/plat/spinlock_types.h +++ b/platform/linux-generic/include/odp/plat/spinlock_types.h @@ -20,25 +20,13 @@ extern "C" { #include <odp/std_types.h> -/** - * @internal - * ODP spinlock - */ +/** @internal */ struct odp_spinlock_s { char lock; /**< lock flag, should match odp_atomic_flag_t */ }; - -/** @addtogroup odp_synchronizers - * @{ - */ - typedef struct odp_spinlock_s odp_spinlock_t; -/** - * @} - */ - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/include/odp/plat/thread_types.h b/platform/linux-generic/include/odp/plat/thread_types.h new file mode 100644 index 000000000..33af45983 --- /dev/null +++ b/platform/linux-generic/include/odp/plat/thread_types.h @@ -0,0 +1,34 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP thread + */ + +#ifndef ODP_THREAD_TYPES_H_ +#define ODP_THREAD_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odp_thread + * @{ + */ + +#define ODP_THREAD_COUNT_MAX 128 + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/ticketlock_types.h b/platform/linux-generic/include/odp/plat/ticketlock_types.h index be9308556..73f970542 100644 --- a/platform/linux-generic/include/odp/plat/ticketlock_types.h +++ b/platform/linux-generic/include/odp/plat/ticketlock_types.h @@ -20,25 +20,14 @@ extern "C" { #include <odp/atomic.h> -/** - * @internal - * ODP ticketlock - */ +/** @internal */ struct odp_ticketlock_s { odp_atomic_u32_t next_ticket; /**< Next ticket */ odp_atomic_u32_t cur_ticket; /**< Current ticket */ }; -/** @addtogroup odp_synchronizers - * @{ - */ - typedef struct odp_ticketlock_s odp_ticketlock_t; -/** - * @} - */ - #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/include/odp/plat/time_types.h b/platform/linux-generic/include/odp/plat/time_types.h index 9ba1508c7..14c35f0bf 100644 --- a/platform/linux-generic/include/odp/plat/time_types.h +++ b/platform/linux-generic/include/odp/plat/time_types.h @@ -21,9 +21,16 @@ extern "C" { * @{ **/ -typedef uint64_t odp_time_t; +/** + * @internal Time structure used to isolate linux-generic implementation from + * the linux timespec structure, which is dependent on _POSIX_C_SOURCE level. + */ +typedef struct odp_time_t { + int64_t tv_sec; /**< @internal Seconds */ + int64_t tv_nsec; /**< @internal Nanoseconds */ +} odp_time_t; -#define ODP_TIME_NULL ((odp_time_t)0) +#define ODP_TIME_NULL ((odp_time_t){0, 0}) /** * @} |