Page MenuHomeFreeBSD

linuxkpi: Add bitfield.h
AbandonedPublic

Authored by manu on Oct 5 2020, 1:44 PM.

Details

Reviewers
None
Group Reviewers
linuxkpi
Summary

Import bitfield.h from OpenBSD.

This defines bf_shf which is a wrapper for builting_ffsll and
FIELD_GET which apply a mask to a given value.

Sponsored-by: The FreeBSD Foundation

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

manu requested review of this revision.Oct 5 2020, 1:44 PM

Can I ask you to drop this one?

I don't know why I missed it (or why it didn't conflict).
I probably missed more overlap then when I tried to narrow don't to compile-time conflicts.

I have this one: https://people.freebsd.org/~bz/tmp/bitfield.h ; happy to put up into review as I haven't touched it since July.

In D26681#594661, @bz wrote:

Can I ask you to drop this one?

I don't know why I missed it (or why it didn't conflict).
I probably missed more overlap then when I tried to narrow don't to compile-time conflicts.

I have this one: https://people.freebsd.org/~bz/tmp/bitfield.h ; happy to put up into review as I haven't touched it since July.

It doesn't conflict because drm-kmod uses include from drm-kmod first so if the macros/inline are in the same file in both drm-kmod or base you don't have any problem.
I need the __bf_shf, so please add it in yours and put it in review.

In D26681#594681, @manu wrote:

I need the __bf_shf, so please add it in yours and put it in review.

Done in https://reviews.freebsd.org/D26708

bz@ commited his more complete version.