diff mbox

linux-generic: ticketlock: add missing doxygen for ticketlock_inlines.h

Message ID 1474571081-6925-1-git-send-email-bill.fischofer@linaro.org
State Accepted
Commit 7af8b884256bbab5070996d7897216ae77b758fe
Headers show

Commit Message

Bill Fischofer Sept. 22, 2016, 7:04 p.m. UTC
Add the missing internal doxygen documentation for the ticketlock_inlines
functions used to accelerate odp-linux even when building with
--enable-abi-compat=yes

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

---
 .../include/odp/api/plat/ticketlock_inlines.h      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

-- 
2.7.4

Comments

Mike Holmes Oct. 14, 2016, 3:03 p.m. UTC | #1
On 22 September 2016 at 15:04, Bill Fischofer <bill.fischofer@linaro.org>
wrote:

> Add the missing internal doxygen documentation for the ticketlock_inlines

> functions used to accelerate odp-linux even when building with

> --enable-abi-compat=yes

>

> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

>


Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org>


> ---

>  .../include/odp/api/plat/ticketlock_inlines.h      | 26

> ++++++++++++++++++++++

>  1 file changed, 26 insertions(+)

>

> diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h

> b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h

> index 957d22e..87432a7 100644

> --- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h

> +++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h

> @@ -18,6 +18,11 @@

>  #include <odp/api/sync.h>

>  #include <odp/api/cpu.h>

>

> +/** @internal

> + * Acquire ticket lock.

> + *

> + * @param ticketlock Pointer to a ticket lock

> + */

>  static inline void _odp_ticketlock_lock(odp_ticketlock_t *ticketlock)

>  {

>         uint32_t ticket;

> @@ -33,6 +38,14 @@ static inline void _odp_ticketlock_lock(odp_ticketlock_t

> *ticketlock)

>                 odp_cpu_pause();

>  }

>

> +/** @internal

> + * Try to acquire ticket lock.

> + *

> + * @param tklock Pointer to a ticket lock

> + *

> + * @retval 1 lock acquired

> + * @retval 0 lock not acquired

> + */

>  static inline int _odp_ticketlock_trylock(odp_ticketlock_t *tklock)

>  {

>         /* We read 'next_ticket' and 'cur_ticket' non-atomically which

> should

> @@ -61,6 +74,11 @@ static inline int _odp_ticketlock_trylock(odp_ticketlock_t

> *tklock)

>         return 0;

>  }

>

> +/** @internal

> + * Release ticket lock

> + *

> + * @param ticketlock Pointer to a ticket lock

> + */

>  static inline void _odp_ticketlock_unlock(odp_ticketlock_t *ticketlock)

>  {

>         /* Release the lock by incrementing 'cur_ticket'. As we are the

> @@ -73,6 +91,14 @@ static inline void _odp_ticketlock_unlock(odp_ticketlock_t

> *ticketlock)

>         odp_atomic_store_rel_u32(&ticketlock->cur_ticket, cur + 1);

>  }

>

> +/** @internal

> + * Check if ticket lock is locked

> + *

> + * @param ticketlock Pointer to a ticket lock

> + *

> + * @retval 1 the lock is busy (locked)

> + * @retval 0 the lock is available (unlocked)

> + */

>  static inline int _odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock)

>  {

>         /* Compare 'cur_ticket' with 'next_ticket'. Ideally we should read

> --

> 2.7.4

>

>



-- 
Mike Holmes
Program Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
Maxim Uvarov Oct. 17, 2016, 1:02 p.m. UTC | #2
Merged,
Maxim.

On 10/14/16 18:03, Mike Holmes wrote:
> On 22 September 2016 at 15:04, Bill Fischofer <bill.fischofer@linaro.org>

> wrote:

>

>> Add the missing internal doxygen documentation for the ticketlock_inlines

>> functions used to accelerate odp-linux even when building with

>> --enable-abi-compat=yes

>>

>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

>>

> Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org>

>

>

>> ---

>>   .../include/odp/api/plat/ticketlock_inlines.h      | 26

>> ++++++++++++++++++++++

>>   1 file changed, 26 insertions(+)

>>

>> diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h

>> b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h

>> index 957d22e..87432a7 100644

>> --- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h

>> +++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h

>> @@ -18,6 +18,11 @@

>>   #include <odp/api/sync.h>

>>   #include <odp/api/cpu.h>

>>

>> +/** @internal

>> + * Acquire ticket lock.

>> + *

>> + * @param ticketlock Pointer to a ticket lock

>> + */

>>   static inline void _odp_ticketlock_lock(odp_ticketlock_t *ticketlock)

>>   {

>>          uint32_t ticket;

>> @@ -33,6 +38,14 @@ static inline void _odp_ticketlock_lock(odp_ticketlock_t

>> *ticketlock)

>>                  odp_cpu_pause();

>>   }

>>

>> +/** @internal

>> + * Try to acquire ticket lock.

>> + *

>> + * @param tklock Pointer to a ticket lock

>> + *

>> + * @retval 1 lock acquired

>> + * @retval 0 lock not acquired

>> + */

>>   static inline int _odp_ticketlock_trylock(odp_ticketlock_t *tklock)

>>   {

>>          /* We read 'next_ticket' and 'cur_ticket' non-atomically which

>> should

>> @@ -61,6 +74,11 @@ static inline int _odp_ticketlock_trylock(odp_ticketlock_t

>> *tklock)

>>          return 0;

>>   }

>>

>> +/** @internal

>> + * Release ticket lock

>> + *

>> + * @param ticketlock Pointer to a ticket lock

>> + */

>>   static inline void _odp_ticketlock_unlock(odp_ticketlock_t *ticketlock)

>>   {

>>          /* Release the lock by incrementing 'cur_ticket'. As we are the

>> @@ -73,6 +91,14 @@ static inline void _odp_ticketlock_unlock(odp_ticketlock_t

>> *ticketlock)

>>          odp_atomic_store_rel_u32(&ticketlock->cur_ticket, cur + 1);

>>   }

>>

>> +/** @internal

>> + * Check if ticket lock is locked

>> + *

>> + * @param ticketlock Pointer to a ticket lock

>> + *

>> + * @retval 1 the lock is busy (locked)

>> + * @retval 0 the lock is available (unlocked)

>> + */

>>   static inline int _odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock)

>>   {

>>          /* Compare 'cur_ticket' with 'next_ticket'. Ideally we should read

>> --

>> 2.7.4

>>

>>

>
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
index 957d22e..87432a7 100644
--- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
@@ -18,6 +18,11 @@ 
 #include <odp/api/sync.h>
 #include <odp/api/cpu.h>
 
+/** @internal
+ * Acquire ticket lock.
+ *
+ * @param ticketlock Pointer to a ticket lock
+ */
 static inline void _odp_ticketlock_lock(odp_ticketlock_t *ticketlock)
 {
 	uint32_t ticket;
@@ -33,6 +38,14 @@  static inline void _odp_ticketlock_lock(odp_ticketlock_t *ticketlock)
 		odp_cpu_pause();
 }
 
+/** @internal
+ * Try to acquire ticket lock.
+ *
+ * @param tklock Pointer to a ticket lock
+ *
+ * @retval 1 lock acquired
+ * @retval 0 lock not acquired
+ */
 static inline int _odp_ticketlock_trylock(odp_ticketlock_t *tklock)
 {
 	/* We read 'next_ticket' and 'cur_ticket' non-atomically which should
@@ -61,6 +74,11 @@  static inline int _odp_ticketlock_trylock(odp_ticketlock_t *tklock)
 	return 0;
 }
 
+/** @internal
+ * Release ticket lock
+ *
+ * @param ticketlock Pointer to a ticket lock
+ */
 static inline void _odp_ticketlock_unlock(odp_ticketlock_t *ticketlock)
 {
 	/* Release the lock by incrementing 'cur_ticket'. As we are the
@@ -73,6 +91,14 @@  static inline void _odp_ticketlock_unlock(odp_ticketlock_t *ticketlock)
 	odp_atomic_store_rel_u32(&ticketlock->cur_ticket, cur + 1);
 }
 
+/** @internal
+ * Check if ticket lock is locked
+ *
+ * @param ticketlock Pointer to a ticket lock
+ *
+ * @retval 1 the lock is busy (locked)
+ * @retval 0 the lock is available (unlocked)
+ */
 static inline int _odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock)
 {
 	/* Compare 'cur_ticket' with 'next_ticket'. Ideally we should read