[systemd-devel] kdbus and 32bit architectures

Peeters Simon peeters.simon at gmail.com
Wed Feb 19 18:19:09 PST 2014


2014-02-19 21:03 GMT+01:00 Peeters Simon <peeters.simon at gmail.com>:
> 2014-02-19 20:41 GMT+01:00 Kay Sievers <kay at vrfy.org>:
>> On Wed, Feb 19, 2014 at 8:34 PM, Peeters Simon <peeters.simon at gmail.com> wrote:
>>> This weekend I switched 2 of my devices to kdbus. both running a 32bit
>>> system (my atom based netbook and a beaglebone black)
>>>
>>> while compiling I ran in to trouble on both devices because of missing
>>> division and modulo operations for uint64, both related to bloom.size
>>> in match.c.
>>>
>>> So my question is: is it really necessary for bloom.size to be a
>>> uint64? I can not imagine any use case for bloom sizes exceeding
>>> UINT32_MAX.
>>> I am not sure what the proper fix would be, I temporary fixed this by
>>> casting bloom.size to uint32 where needed, and this works.
>>
>> Try changing it to div_u64()? You find that in other places in the
>> kdbus code too.
>>
>> Send a patch please, if it works.
>
> will do in a minute (have to get my netbook downstairs)
>
>>> I also noted that in kdbus.h (while compiling kdbus itself) ioctl.h
>>> does not get included resulting in missing definitions for _IO() and
>>> family. (at least on arm)
>>
>> Where is it defined on arm? There is an include in kdbus.h.
>
> the problem is that it is "#ifndef __KERNEL__" and I assume that
> __KERNEL__ gets defined when building the module.

both patches attached (sory, didn't bother to try and get git
send-email to answer to the right thread)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-match.c-use-div64_u64-to-devide-trough-bloom.size.patch
Type: text/x-patch
Size: 1280 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140220/3c28632f/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-kdbus.h-include-ioctl.h-also-when-building-the-modul.patch
Type: text/x-patch
Size: 648 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140220/3c28632f/attachment-0003.bin>


More information about the systemd-devel mailing list