> -----Original Message-----
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Maxim
> Uvarov
> Sent: Monday, February 27, 2017 6:09 PM
> To: Marco Varlese <marco.varl...@suse.com>; lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] Compilation error of ODP on Linux x86_64 platform
> 
> On 02/27/17 19:05, Marco Varlese wrote:
> > On Mon, 2017-02-27 at 18:52 +0300, Maxim Uvarov wrote:
> >
> > [nip]
> >> maybe just define it as:
> >>
> >> #define ODP_CPUMASK_SIZE __CPU_SETSIZE
> >> ?
> > First of all, I don't think it's appropriate to set it to __CPU_SETSIZE
> but it
> > should be (at most) the one exposed by one level up header (e.g.
> sched.h).
> >
> > However, if we do what you propose... what is the purpose of having
> > ODP_CPUMASK_SIZE in the first place then?
> >
> > I'd say we could remove that ODP define and ASSERT altogether at that
> point?
> >
> 
> I think so. Define is used for string. And right size for that string
> can be calculated under odp_init_global() with memory allocation.
> 
> ./platform/linux-generic/include/odp/api/plat/cpumask_types.h:#define
> ODP_CPUMASK_STR_SIZE ((ODP_CPUMASK_SIZE + 3) / 4 + 3)
> ./platform/linux-generic/include/odp/api/plat/cpumask_types.h:        uint8_t
> _u8[ODP_CPUMASK_SIZE / 8];
>

/**
 * @def ODP_CPUMASK_SIZE
 * Maximum cpumask size, this definition limits the number of individual CPUs
 * that can be accessed in this system.
 */

It cannot be removed, it's part of API. Just need to find a way to set it to 
CPU_SETSIZE (on Linux systems). ODP API spec is OS agnostic. The same 
application code should run also on non-Linux implementations (e.g. ODP API 
spec cannot refer to CPU_SETSIZE). The assert is needed as long as 
ODP_CPUMASK_SIZE value is not set from CPU_SETSIZE.

-Petri 




Reply via email to