From 2c4e1d1763864d547a3ca37cd079819e047982dc Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 11 Mar 2019 11:46:08 +0000 Subject: Re-introduced missing chGuardedPoolGetCounterI(). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_19.1.x@12687 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/oslib/include/chmempools.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'os/oslib/include') diff --git a/os/oslib/include/chmempools.h b/os/oslib/include/chmempools.h index 6e5a45277..427ba9fb1 100644 --- a/os/oslib/include/chmempools.h +++ b/os/oslib/include/chmempools.h @@ -248,6 +248,19 @@ static inline void chGuardedPoolObjectInit(guarded_memory_pool_t *gmp, chGuardedPoolObjectInitAligned(gmp, size, PORT_NATURAL_ALIGN); } +/** + * @brief Gets the count of objects in a guarded memory pool. + * @pre The guarded memory pool must be already been initialized. + * + * @param[in] gmp pointer to a @p guarded_memory_pool_t structure + * + * @iclass + */ +static inline cnt_t chGuardedPoolGetCounterI(guarded_memory_pool_t *gmp) { + + return chSemGetCounterI(&gmp->sem); +} + /** * @brief Allocates an object from a guarded memory pool. * @pre The guarded memory pool must be already been initialized. -- cgit v1.2.3