Changeset 48197c1 in mainline for uspace/lib/c/include/bitops.h


Ignore:
Timestamp:
2017-06-15T19:04:29Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ce6e001
Parents:
5cbccd4
Message:

xhci: completed register access macros (+tests)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/bitops.h

    r5cbccd4 r48197c1  
    5454#define BIT_RANGE_EXTRACT(type, hi, lo, value) \
    5555    (((value) >> (lo)) & BIT_RRANGE(type, (hi) - (lo) + 1))
     56
     57/** Insert @a value between bits @a hi .. @a lo. */
     58#define BIT_RANGE_INSERT(type, hi, lo, value) \
     59    (((value) & BIT_RRANGE(type, (hi) - (lo) + 1)) << (lo))
    5660
    5761/** Return position of first non-zero bit from left (i.e. [log_2(arg)]).
Note: See TracChangeset for help on using the changeset viewer.