.. | .. |
---|
5 | 5 | * propagate the unknown bits such that the tnum result represents all the |
---|
6 | 6 | * possible results for possible values of the operands. |
---|
7 | 7 | */ |
---|
| 8 | + |
---|
| 9 | +#ifndef _LINUX_TNUM_H |
---|
| 10 | +#define _LINUX_TNUM_H |
---|
| 11 | + |
---|
8 | 12 | #include <linux/types.h> |
---|
9 | 13 | |
---|
10 | 14 | struct tnum { |
---|
.. | .. |
---|
81 | 85 | int tnum_strn(char *str, size_t size, struct tnum a); |
---|
82 | 86 | /* Format a tnum as tristate binary expansion */ |
---|
83 | 87 | int tnum_sbin(char *str, size_t size, struct tnum a); |
---|
| 88 | + |
---|
| 89 | +/* Returns the 32-bit subreg */ |
---|
| 90 | +struct tnum tnum_subreg(struct tnum a); |
---|
| 91 | +/* Returns the tnum with the lower 32-bit subreg cleared */ |
---|
| 92 | +struct tnum tnum_clear_subreg(struct tnum a); |
---|
| 93 | +/* Returns the tnum with the lower 32-bit subreg set to value */ |
---|
| 94 | +struct tnum tnum_const_subreg(struct tnum a, u32 value); |
---|
| 95 | +/* Returns true if 32-bit subreg @a is a known constant*/ |
---|
| 96 | +static inline bool tnum_subreg_is_const(struct tnum a) |
---|
| 97 | +{ |
---|
| 98 | + return !(tnum_subreg(a)).mask; |
---|
| 99 | +} |
---|
| 100 | + |
---|
| 101 | +#endif /* _LINUX_TNUM_H */ |
---|