diff options
Diffstat (limited to 'platform/linux-generic/include/odp')
-rw-r--r-- | platform/linux-generic/include/odp/plat/spinlock_recursive_types.h | 47 | ||||
-rw-r--r-- | platform/linux-generic/include/odp/spinlock_recursive.h | 28 |
2 files changed, 75 insertions, 0 deletions
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..cae47a4b1 --- /dev/null +++ b/platform/linux-generic/include/odp/plat/spinlock_recursive_types.h @@ -0,0 +1,47 @@ +/* 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 + * ODP recursive spinlock + */ +struct odp_spinlock_recursive_s { + odp_spinlock_t lock; /**< the lock */ + int owner; /**< thread owning the lock */ + uint32_t cnt; /**< recursion count */ +}; + +/** @addtogroup odp_synchronizers + * @{ + */ + +typedef struct odp_spinlock_recursive_s odp_spinlock_recursive_t; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/spinlock_recursive.h b/platform/linux-generic/include/odp/spinlock_recursive.h new file mode 100644 index 000000000..e8a996837 --- /dev/null +++ b/platform/linux-generic/include/odp/spinlock_recursive.h @@ -0,0 +1,28 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP resursive spinlock + */ + +#ifndef ODP_PLAT_SPINLOCK_RECURSIVE_H_ +#define ODP_PLAT_SPINLOCK_RECURSIVE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/plat/spinlock_recursive_types.h> + +#include <odp/api/spinlock_recursive.h> + +#ifdef __cplusplus +} +#endif + +#endif |