Hi,

One more time on these @param in/out tags. I think that "out" tag is not needed 
when implementation writes into an opaque struct. User should not access that 
output directly, but use another (access) function for that. The "out" tag is 
only needed (== relevant to the user) when user can access the output data 
directly.


/**
 * Load value of atomic uint32 variable
 * @note Relaxed memory order, cannot be used for synchronization
 *
 * @param atom Pointer to an atomic uint32 variable
 *
 * @return Value of the variable
 */
static inline uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom)
{
        return __atomic_load_n(&atom->v, __ATOMIC_RELAXED);
}

/**
 * Store value to atomic uint32 variable
 * @note Relaxed memory order, cannot be used for synchronization
 *
 * @param[out] atom Pointer to an atomic uint32 variable

===> "out" not needed here. Both params are input, since user should use 
odp_atomic_load_u32() to read the value.

 * @param val Value to store in the variable
 */
static inline void odp_atomic_store_u32(odp_atomic_u32_t *atom,
                                        uint32_t val)
{
        __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED);
}



/**
 * Shared memory block info
 */
typedef struct odp_shm_info_t {
        const char *name;      /**< Block name */
        void       *addr;      /**< Block address */
        uint64_t    size;      /**< Block size in bytes */
        uint64_t    page_size; /**< Memory page size */
        uint32_t    flags;     /**< ODP_SHM_* flags */
} odp_shm_info_t;

/**
 * Shared memory block info
 *
 * @param[in]  shm   Block handle
 * @param[out] info  Block info pointer for output

===> "out" needed here since the function outputs information to a struct 
specified in the API. 

 *
 * @return 0 on success, otherwise non-zero
 */
int odp_shm_info(odp_shm_t shm, odp_shm_info_t *info);



-Petri



_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to