Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jul 2022 05:09:03 +0200
From:      Marc Veldman <marc@bumblingdork.com>
To:        Eugene Grosbein <eugen@grosbein.net>, freebsd-hackers@freebsd.org
Subject:   Re: Canonical way / best practice for 128-bit integers
Message-ID:  <B2929123-AFAC-4761-A587-E634E6245F0E@bumblingdork.com>
In-Reply-To: <eac1a640-ab55-ffae-66e6-5e3405b0c2e2@grosbein.net>
References:  <86CB4C22-9CAB-4578-8F11-962B4B08F756@bumblingdork.com> <eac1a640-ab55-ffae-66e6-5e3405b0c2e2@grosbein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello Eugene,

> On 9 Jul 2022, at 21:27, Eugene Grosbein <eugen@grosbein.net> wrote:
>=20
> 09.07.2022 23:26, Marc Veldman wrote:
>> Hello,
>>=20
>> I=E2=80=99m working on some bluetooth code, and that involves =
handling 128-bit uuids.
>> There are various ways to handle in the FreeBSD codebase, like in =
sdp.h:
>> Is there any recommended / standard way to handle 128 bit integers in =
a portable way?
>=20
> UUIDs are not integer numbers with arithmetic, so you should not look =
for 128 bit ints, if you need portability.

In Bluetooth, not quite. Bluetooth also has 32-bit and 16-bit =E2=80=9CUUI=
D aliases=E2=80=9D, which can require some
arithmetic/bitshifting.

> For example, 32 bit i386 arch lacks hardware support for 128 bit ints,
> so FreeBSD does not support 128 bit ints with arithmetic for i386
> but it does not mean that you cannot use 128 bit UUIDs there.
>=20
> We have uuid(3) manual for DCE 1.1 compliant UUID type uuid_t and =
functions.

That looks like a good candidate to have a look at.
Thanks!

Best regards,

Marc Veldman




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B2929123-AFAC-4761-A587-E634E6245F0E>