2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2022 Oxide Computer Company
19 #include <sys/types.h>
26 * A bunch of routines to make working with bits and registers easier. This is
27 * designed to be a replacement for the BITX macro and provide additional error
28 * handling. See bitx64(9F), bitdel64(9F), and bitset64(9F) for more
32 extern uint8_t bitx8(uint8_t, uint_t
, uint_t
);
33 extern uint16_t bitx16(uint16_t, uint_t
, uint_t
);
34 extern uint32_t bitx32(uint32_t, uint_t
, uint_t
);
35 extern uint64_t bitx64(uint64_t, uint_t
, uint_t
);
37 extern uint8_t bitset8(uint8_t, uint_t
, uint_t
, uint8_t);
38 extern uint16_t bitset16(uint16_t, uint_t
, uint_t
, uint16_t);
39 extern uint32_t bitset32(uint32_t, uint_t
, uint_t
, uint32_t);
40 extern uint64_t bitset64(uint64_t, uint_t
, uint_t
, uint64_t);
42 extern uint64_t bitdel64(uint64_t, uint_t
, uint_t
);
48 #endif /* _SYS_BITEXT_H */