OSDN Git Service

Fix cacheline detection on FreeBSD/powerpc.
authorJustin Hibbits <chmeeedalf@gmail.com>
Wed, 21 Aug 2019 08:25:46 +0000 (10:25 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 19 Sep 2019 12:42:13 +0000 (14:42 +0200)
commit5ca156cfde0f3821f15988619e51cf3cda99aaa6
treecf44ae7c20a521b6bd0e5bb70cefbcaeab3f819e
parent5c95975d8d904f09733999bf77a5b67abe1d39e0
Fix cacheline detection on FreeBSD/powerpc.

machdep.cacheline_size is an integer, not a long.  Since PowerPC is
big-endian this causes sysctlbyname() to fill in the upper bits of the
argument, rather than the correct 'lower bits' of the word.  Specify the
correct type to fix this.

Fixes: b255b2c8a548 ("util: add cacheinfo")
Signed-off-by: Justin Hibbits <chmeeedalf@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Tested-by: Justin Hibbits <chmeeedalf@gmail.com>
Message-Id: <20190821082546.5252-2-laurent@vivier.eu>
util/cacheinfo.c