When I am in the sweet spot between the drugs applied utopic delirium and pain I can do things:)
Currently we populate a u64 so I agree we have hardcoded a limit of 64 processors so that should be a new bug - one I expect Tileria might bring up soon :) But as Leo says the code does need 1ULL as written according to the C standard because a "1" defaults to 32 bits and we shift it up to 63 On 16 September 2014 20:29, Rosenboim, Leonid < [email protected]> wrote: > "1 << core" will fail if core >= 32, hence "1ull << core" is needed. > > problem is, this will only work for core_id < 64, but that may not always > be the case, > > e.g. if there are more than 64 cores, or if core number are not contiguous. > > > ------------------------------ > *From:* [email protected] <[email protected]> > on behalf of Bill Fischofer <[email protected]> > *Sent:* Tuesday, September 16, 2014 5:13 PM > *To:* Mike Holmes > *Cc:* [email protected] > *Subject:* Re: [lng-odp] [PATCH] odp_coremask.c: Use 1ULL for 64bit shifts > > Is this necessary? 1 == 1ULL in this context. > > Bill > > PS Glad to see you're coherent/bored enough to be working :) > > On Tuesday, September 16, 2014, Mike Holmes <[email protected]> > wrote: > >> Signed-off-by: Mike Holmes <[email protected]> >> --- >> >> Unless specified "1" is taken as 32bits and core can be upto 63 >> >> platform/linux-generic/odp_coremask.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/platform/linux-generic/odp_coremask.c >> b/platform/linux-generic/odp_coremask.c >> index c55eb72..c7438cc 100644 >> --- a/platform/linux-generic/odp_coremask.c >> +++ b/platform/linux-generic/odp_coremask.c >> @@ -64,7 +64,7 @@ void odp_coremask_set(int core, odp_coremask_t *mask) >> return; >> } >> >> - mask->_u64[0] |= (1 << core); >> + mask->_u64[0] |= (1ULL << core); >> } >> >> void odp_coremask_clr(int core, odp_coremask_t *mask) >> @@ -77,7 +77,7 @@ void odp_coremask_clr(int core, odp_coremask_t *mask) >> return; >> } >> >> - mask->_u64[0] &= ~(1 << core); >> + mask->_u64[0] &= ~(1ULL << core); >> } >> >> >> -- >> 1.9.1 >> >> >> _______________________________________________ >> lng-odp mailing list >> [email protected] >> http://lists.linaro.org/mailman/listinfo/lng-odp >> > -- *Mike Holmes* Linaro Technical Manager / Lead LNG - ODP
_______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
