fix: Adjust ranges for Ubuntu 5.4.0-67 kernel
[lttng-modules.git] / lib / bitfield.h
CommitLineData
9f36eaed
MJ
1/* SPDX-License-Identifier: MIT
2 *
b60a2acd 3 * Copyright 2010-2019 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9115fbdc
MD
4 */
5
9f36eaed
MJ
6#ifndef _BABELTRACE_BITFIELD_H
7#define _BABELTRACE_BITFIELD_H
8
b60a2acd 9#include <linux/types.h>
5671a661 10#include <lttng-endian.h>
9115fbdc
MD
11
12#ifndef CHAR_BIT
13#define CHAR_BIT 8
14#endif
15
b60a2acd
MD
16/*
17 * This header strictly follows the C99 standard, except for use of the
18 * compiler-specific __typeof__.
19 */
20
21/*
22 * This bitfield header requires the compiler representation of signed
23 * integers to be two's complement.
24 */
25#if (-1 != ~0)
26#error "bitfield.h requires the compiler representation of signed integers to be two's complement."
27#endif
28
1f611cf7 29#define _bt_is_signed_type(type) ((type) -1 < (type) 1)
b60a2acd
MD
30
31/*
32 * Produce a build-time error if the condition `cond` is non-zero.
33 * Evaluates as a size_t expression.
34 */
35#define _BT_BUILD_ASSERT(cond) \
36 sizeof(struct { int f:(2 * !!(cond) - 1); })
37
38/*
39 * Cast value `v` to an unsigned integer of the same size as `v`.
40 */
41#define _bt_cast_value_to_unsigned(v) \
42 (sizeof(v) == sizeof(uint8_t) ? (uint8_t) (v) : \
43 sizeof(v) == sizeof(uint16_t) ? (uint16_t) (v) : \
44 sizeof(v) == sizeof(uint32_t) ? (uint32_t) (v) : \
45 sizeof(v) == sizeof(uint64_t) ? (uint64_t) (v) : \
46 _BT_BUILD_ASSERT(sizeof(v) <= sizeof(uint64_t)))
47
48/*
49 * Cast value `v` to an unsigned integer type of the size of type `type`
50 * *without* sign-extension.
51 *
52 * The unsigned cast ensures that we're not shifting a negative value,
53 * which is undefined in C. However, this limits the maximum type size
54 * of `type` to 64-bit. Generate a compile-time error if the size of
55 * `type` is larger than 64-bit.
56 */
57#define _bt_cast_value_to_unsigned_type(type, v) \
58 (sizeof(type) == sizeof(uint8_t) ? \
59 (uint8_t) _bt_cast_value_to_unsigned(v) : \
60 sizeof(type) == sizeof(uint16_t) ? \
61 (uint16_t) _bt_cast_value_to_unsigned(v) : \
62 sizeof(type) == sizeof(uint32_t) ? \
63 (uint32_t) _bt_cast_value_to_unsigned(v) : \
64 sizeof(type) == sizeof(uint64_t) ? \
65 (uint64_t) _bt_cast_value_to_unsigned(v) : \
66 _BT_BUILD_ASSERT(sizeof(v) <= sizeof(uint64_t)))
67
68/*
69 * _bt_fill_mask evaluates to a "type" integer with all bits set.
70 */
71#define _bt_fill_mask(type) ((type) ~(type) 0)
72
73/*
74 * Left shift a value `v` of `shift` bits.
75 *
76 * The type of `v` can be signed or unsigned integer.
77 * The value of `shift` must be less than the size of `v` (in bits),
78 * otherwise the behavior is undefined.
79 * Evaluates to the result of the shift operation.
80 *
81 * According to the C99 standard, left shift of a left hand-side signed
82 * type is undefined if it has a negative value or if the result cannot
83 * be represented in the result type. This bitfield header discards the
84 * bits that are left-shifted beyond the result type representation,
85 * which is the behavior of an unsigned type left shift operation.
86 * Therefore, always perform left shift on an unsigned type.
87 *
88 * This macro should not be used if `shift` can be greater or equal than
89 * the bitwidth of `v`. See `_bt_safe_lshift`.
90 */
91#define _bt_lshift(v, shift) \
92 ((__typeof__(v)) (_bt_cast_value_to_unsigned(v) << (shift)))
9115fbdc 93
b60a2acd
MD
94/*
95 * Generate a mask of type `type` with the `length` least significant bits
96 * cleared, and the most significant bits set.
97 */
98#define _bt_make_mask_complement(type, length) \
99 _bt_lshift(_bt_fill_mask(type), length)
9115fbdc 100
b60a2acd
MD
101/*
102 * Generate a mask of type `type` with the `length` least significant bits
103 * set, and the most significant bits cleared.
104 */
105#define _bt_make_mask(type, length) \
106 ((type) ~_bt_make_mask_complement(type, length))
107
108/*
109 * Right shift a value `v` of `shift` bits.
110 *
111 * The type of `v` can be signed or unsigned integer.
112 * The value of `shift` must be less than the size of `v` (in bits),
113 * otherwise the behavior is undefined.
114 * Evaluates to the result of the shift operation.
115 *
116 * According to the C99 standard, right shift of a left hand-side signed
117 * type which has a negative value is implementation defined. This
118 * bitfield header relies on the right shift implementation carrying the
119 * sign bit. If the compiler implementation has a different behavior,
120 * emulate carrying the sign bit.
121 *
122 * This macro should not be used if `shift` can be greater or equal than
123 * the bitwidth of `v`. See `_bt_safe_rshift`.
124 */
125#if ((-1 >> 1) == -1)
126#define _bt_rshift(v, shift) ((v) >> (shift))
127#else
128#define _bt_rshift(v, shift) \
129 ((__typeof__(v)) ((_bt_cast_value_to_unsigned(v) >> (shift)) | \
130 ((v) < 0 ? _bt_make_mask_complement(__typeof__(v), \
131 sizeof(v) * CHAR_BIT - (shift)) : 0)))
132#endif
133
134/*
135 * Right shift a signed or unsigned integer with `shift` value being an
136 * arbitrary number of bits. `v` is modified by this macro. The shift
137 * is transformed into a sequence of `_nr_partial_shifts` consecutive
138 * shift operations, each of a number of bits smaller than the bitwidth
139 * of `v`, ending with a shift of the number of left over bits.
140 */
141#define _bt_safe_rshift(v, shift) \
142do { \
143 unsigned long _nr_partial_shifts = (shift) / (sizeof(v) * CHAR_BIT - 1); \
144 unsigned long _leftover_bits = (shift) % (sizeof(v) * CHAR_BIT - 1); \
145 \
146 for (; _nr_partial_shifts; _nr_partial_shifts--) \
147 (v) = _bt_rshift(v, sizeof(v) * CHAR_BIT - 1); \
148 (v) = _bt_rshift(v, _leftover_bits); \
149} while (0)
150
151/*
152 * Left shift a signed or unsigned integer with `shift` value being an
153 * arbitrary number of bits. `v` is modified by this macro. The shift
154 * is transformed into a sequence of `_nr_partial_shifts` consecutive
155 * shift operations, each of a number of bits smaller than the bitwidth
156 * of `v`, ending with a shift of the number of left over bits.
157 */
158#define _bt_safe_lshift(v, shift) \
159do { \
160 unsigned long _nr_partial_shifts = (shift) / (sizeof(v) * CHAR_BIT - 1); \
161 unsigned long _leftover_bits = (shift) % (sizeof(v) * CHAR_BIT - 1); \
162 \
163 for (; _nr_partial_shifts; _nr_partial_shifts--) \
164 (v) = _bt_lshift(v, sizeof(v) * CHAR_BIT - 1); \
165 (v) = _bt_lshift(v, _leftover_bits); \
166} while (0)
9115fbdc
MD
167
168/*
169 * bt_bitfield_write - write integer to a bitfield in native endianness
170 *
171 * Save integer to the bitfield, which starts at the "start" bit, has "len"
172 * bits.
173 * The inside of a bitfield is from high bits to low bits.
174 * Uses native endianness.
175 * For unsigned "v", pad MSB with 0 if bitfield is larger than v.
176 * For signed "v", sign-extend v if bitfield is larger than v.
177 *
178 * On little endian, bytes are placed from the less significant to the most
179 * significant. Also, consecutive bitfields are placed from lower bits to higher
180 * bits.
181 *
182 * On big endian, bytes are places from most significant to less significant.
183 * Also, consecutive bitfields are placed from higher to lower bits.
184 */
185
bf6a7838 186#define _bt_bitfield_write_le(ptr, type, start, length, v) \
9115fbdc 187do { \
bf6a7838
MD
188 __typeof__(v) _v = (v); \
189 type *_ptr = (void *) (ptr); \
190 unsigned long _start = (start), _length = (length); \
191 type _mask, _cmask; \
192 unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */ \
193 unsigned long _start_unit, _end_unit, _this_unit; \
194 unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
9115fbdc 195 \
bf6a7838 196 if (!_length) \
9115fbdc
MD
197 break; \
198 \
bf6a7838
MD
199 _end = _start + _length; \
200 _start_unit = _start / _ts; \
201 _end_unit = (_end + (_ts - 1)) / _ts; \
9115fbdc
MD
202 \
203 /* Trim v high bits */ \
bf6a7838
MD
204 if (_length < sizeof(_v) * CHAR_BIT) \
205 _v &= _bt_make_mask(__typeof__(_v), _length); \
9115fbdc
MD
206 \
207 /* We can now append v with a simple "or", shift it piece-wise */ \
bf6a7838
MD
208 _this_unit = _start_unit; \
209 if (_start_unit == _end_unit - 1) { \
210 _mask = _bt_make_mask(type, _start % _ts); \
211 if (_end % _ts) \
212 _mask |= _bt_make_mask_complement(type, _end % _ts); \
213 _cmask = _bt_lshift((type) (_v), _start % _ts); \
214 _cmask &= ~_mask; \
215 _ptr[_this_unit] &= _mask; \
216 _ptr[_this_unit] |= _cmask; \
9115fbdc
MD
217 break; \
218 } \
bf6a7838
MD
219 if (_start % _ts) { \
220 _cshift = _start % _ts; \
221 _mask = _bt_make_mask(type, _cshift); \
222 _cmask = _bt_lshift((type) (_v), _cshift); \
223 _cmask &= ~_mask; \
224 _ptr[_this_unit] &= _mask; \
225 _ptr[_this_unit] |= _cmask; \
226 _bt_safe_rshift(_v, _ts - _cshift); \
227 _start += _ts - _cshift; \
228 _this_unit++; \
9115fbdc 229 } \
bf6a7838
MD
230 for (; _this_unit < _end_unit - 1; _this_unit++) { \
231 _ptr[_this_unit] = (type) _v; \
232 _bt_safe_rshift(_v, _ts); \
233 _start += _ts; \
9115fbdc 234 } \
bf6a7838
MD
235 if (_end % _ts) { \
236 _mask = _bt_make_mask_complement(type, _end % _ts); \
237 _cmask = (type) _v; \
238 _cmask &= ~_mask; \
239 _ptr[_this_unit] &= _mask; \
240 _ptr[_this_unit] |= _cmask; \
9115fbdc 241 } else \
bf6a7838 242 _ptr[_this_unit] = (type) _v; \
9115fbdc
MD
243} while (0)
244
bf6a7838 245#define _bt_bitfield_write_be(ptr, type, start, length, v) \
9115fbdc 246do { \
bf6a7838
MD
247 __typeof__(v) _v = (v); \
248 type *_ptr = (void *) (ptr); \
249 unsigned long _start = (start), _length = (length); \
250 type _mask, _cmask; \
251 unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */ \
252 unsigned long _start_unit, _end_unit, _this_unit; \
253 unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
9115fbdc 254 \
bf6a7838 255 if (!_length) \
9115fbdc
MD
256 break; \
257 \
bf6a7838
MD
258 _end = _start + _length; \
259 _start_unit = _start / _ts; \
260 _end_unit = (_end + (_ts - 1)) / _ts; \
9115fbdc
MD
261 \
262 /* Trim v high bits */ \
bf6a7838
MD
263 if (_length < sizeof(_v) * CHAR_BIT) \
264 _v &= _bt_make_mask(__typeof__(_v), _length); \
9115fbdc
MD
265 \
266 /* We can now append v with a simple "or", shift it piece-wise */ \
bf6a7838
MD
267 _this_unit = _end_unit - 1; \
268 if (_start_unit == _end_unit - 1) { \
269 _mask = _bt_make_mask(type, (_ts - (_end % _ts)) % _ts); \
270 if (_start % _ts) \
271 _mask |= _bt_make_mask_complement(type, _ts - (_start % _ts)); \
272 _cmask = _bt_lshift((type) (_v), (_ts - (_end % _ts)) % _ts); \
273 _cmask &= ~_mask; \
274 _ptr[_this_unit] &= _mask; \
275 _ptr[_this_unit] |= _cmask; \
9115fbdc
MD
276 break; \
277 } \
bf6a7838
MD
278 if (_end % _ts) { \
279 _cshift = _end % _ts; \
280 _mask = _bt_make_mask(type, _ts - _cshift); \
281 _cmask = _bt_lshift((type) (_v), _ts - _cshift); \
282 _cmask &= ~_mask; \
283 _ptr[_this_unit] &= _mask; \
284 _ptr[_this_unit] |= _cmask; \
285 _bt_safe_rshift(_v, _cshift); \
286 _end -= _cshift; \
287 _this_unit--; \
9115fbdc 288 } \
bf6a7838
MD
289 for (; (long) _this_unit >= (long) _start_unit + 1; _this_unit--) { \
290 _ptr[_this_unit] = (type) _v; \
291 _bt_safe_rshift(_v, _ts); \
292 _end -= _ts; \
9115fbdc 293 } \
bf6a7838
MD
294 if (_start % _ts) { \
295 _mask = _bt_make_mask_complement(type, _ts - (_start % _ts)); \
296 _cmask = (type) _v; \
297 _cmask &= ~_mask; \
298 _ptr[_this_unit] &= _mask; \
299 _ptr[_this_unit] |= _cmask; \
9115fbdc 300 } else \
bf6a7838 301 _ptr[_this_unit] = (type) _v; \
9115fbdc
MD
302} while (0)
303
304/*
305 * bt_bitfield_write - write integer to a bitfield in native endianness
306 * bt_bitfield_write_le - write integer to a bitfield in little endian
307 * bt_bitfield_write_be - write integer to a bitfield in big endian
308 */
309
310#if (__BYTE_ORDER == __LITTLE_ENDIAN)
311
bf6a7838
MD
312#define bt_bitfield_write(ptr, type, start, length, v) \
313 _bt_bitfield_write_le(ptr, type, start, length, v)
9115fbdc 314
bf6a7838
MD
315#define bt_bitfield_write_le(ptr, type, start, length, v) \
316 _bt_bitfield_write_le(ptr, type, start, length, v)
b60a2acd 317
bf6a7838
MD
318#define bt_bitfield_write_be(ptr, type, start, length, v) \
319 _bt_bitfield_write_be(ptr, unsigned char, start, length, v)
9115fbdc
MD
320
321#elif (__BYTE_ORDER == __BIG_ENDIAN)
322
bf6a7838
MD
323#define bt_bitfield_write(ptr, type, start, length, v) \
324 _bt_bitfield_write_be(ptr, type, start, length, v)
9115fbdc 325
bf6a7838
MD
326#define bt_bitfield_write_le(ptr, type, start, length, v) \
327 _bt_bitfield_write_le(ptr, unsigned char, start, length, v)
b60a2acd 328
bf6a7838
MD
329#define bt_bitfield_write_be(ptr, type, start, length, v) \
330 _bt_bitfield_write_be(ptr, type, start, length, v)
9115fbdc 331
b60a2acd 332#else /* (__BYTE_ORDER == __PDP_ENDIAN) */
9115fbdc
MD
333
334#error "Byte order not supported"
335
336#endif
337
bf6a7838 338#define _bt_bitfield_read_le(ptr, type, start, length, vptr) \
9115fbdc 339do { \
bf6a7838
MD
340 __typeof__(*(vptr)) *_vptr = (vptr); \
341 __typeof__(*_vptr) _v; \
342 type *_ptr = (void *) (ptr); \
343 unsigned long _start = (start), _length = (length); \
344 type _mask, _cmask; \
345 unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */ \
346 unsigned long _start_unit, _end_unit, _this_unit; \
347 unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
9115fbdc 348 \
bf6a7838
MD
349 if (!_length) { \
350 *_vptr = 0; \
9115fbdc
MD
351 break; \
352 } \
353 \
bf6a7838
MD
354 _end = _start + _length; \
355 _start_unit = _start / _ts; \
356 _end_unit = (_end + (_ts - 1)) / _ts; \
9115fbdc 357 \
bf6a7838 358 _this_unit = _end_unit - 1; \
1f611cf7 359 if (_bt_is_signed_type(__typeof__(_v)) \
bf6a7838
MD
360 && (_ptr[_this_unit] & _bt_lshift((type) 1, (_end % _ts ? _end % _ts : _ts) - 1))) \
361 _v = ~(__typeof__(_v)) 0; \
9115fbdc 362 else \
bf6a7838
MD
363 _v = 0; \
364 if (_start_unit == _end_unit - 1) { \
365 _cmask = _ptr[_this_unit]; \
366 _cmask = _bt_rshift(_cmask, _start % _ts); \
367 if ((_end - _start) % _ts) { \
368 _mask = _bt_make_mask(type, _end - _start); \
369 _cmask &= _mask; \
9115fbdc 370 } \
bf6a7838
MD
371 _bt_safe_lshift(_v, _end - _start); \
372 _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
373 *_vptr = _v; \
9115fbdc
MD
374 break; \
375 } \
bf6a7838
MD
376 if (_end % _ts) { \
377 _cshift = _end % _ts; \
378 _mask = _bt_make_mask(type, _cshift); \
379 _cmask = _ptr[_this_unit]; \
380 _cmask &= _mask; \
381 _bt_safe_lshift(_v, _cshift); \
382 _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
383 _end -= _cshift; \
384 _this_unit--; \
9115fbdc 385 } \
bf6a7838
MD
386 for (; (long) _this_unit >= (long) _start_unit + 1; _this_unit--) { \
387 _bt_safe_lshift(_v, _ts); \
388 _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
389 _end -= _ts; \
9115fbdc 390 } \
bf6a7838
MD
391 if (_start % _ts) { \
392 _mask = _bt_make_mask(type, _ts - (_start % _ts)); \
393 _cmask = _ptr[_this_unit]; \
394 _cmask = _bt_rshift(_cmask, _start % _ts); \
395 _cmask &= _mask; \
396 _bt_safe_lshift(_v, _ts - (_start % _ts)); \
397 _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
9115fbdc 398 } else { \
bf6a7838
MD
399 _bt_safe_lshift(_v, _ts); \
400 _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
9115fbdc 401 } \
bf6a7838 402 *_vptr = _v; \
9115fbdc
MD
403} while (0)
404
bf6a7838 405#define _bt_bitfield_read_be(ptr, type, start, length, vptr) \
9115fbdc 406do { \
bf6a7838
MD
407 __typeof__(*(vptr)) *_vptr = (vptr); \
408 __typeof__(*_vptr) _v; \
409 type *_ptr = (void *) (ptr); \
410 unsigned long _start = (start), _length = (length); \
411 type _mask, _cmask; \
412 unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */ \
413 unsigned long _start_unit, _end_unit, _this_unit; \
414 unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
9115fbdc 415 \
bf6a7838
MD
416 if (!_length) { \
417 *_vptr = 0; \
9115fbdc
MD
418 break; \
419 } \
420 \
bf6a7838
MD
421 _end = _start + _length; \
422 _start_unit = _start / _ts; \
423 _end_unit = (_end + (_ts - 1)) / _ts; \
9115fbdc 424 \
bf6a7838 425 _this_unit = _start_unit; \
1f611cf7 426 if (_bt_is_signed_type(__typeof__(_v)) \
bf6a7838
MD
427 && (_ptr[_this_unit] & _bt_lshift((type) 1, _ts - (_start % _ts) - 1))) \
428 _v = ~(__typeof__(_v)) 0; \
9115fbdc 429 else \
bf6a7838
MD
430 _v = 0; \
431 if (_start_unit == _end_unit - 1) { \
432 _cmask = _ptr[_this_unit]; \
433 _cmask = _bt_rshift(_cmask, (_ts - (_end % _ts)) % _ts); \
434 if ((_end - _start) % _ts) { \
435 _mask = _bt_make_mask(type, _end - _start); \
436 _cmask &= _mask; \
9115fbdc 437 } \
bf6a7838
MD
438 _bt_safe_lshift(_v, _end - _start); \
439 _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
440 *_vptr = _v; \
9115fbdc
MD
441 break; \
442 } \
bf6a7838
MD
443 if (_start % _ts) { \
444 _cshift = _start % _ts; \
445 _mask = _bt_make_mask(type, _ts - _cshift); \
446 _cmask = _ptr[_this_unit]; \
447 _cmask &= _mask; \
448 _bt_safe_lshift(_v, _ts - _cshift); \
449 _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
450 _start += _ts - _cshift; \
451 _this_unit++; \
9115fbdc 452 } \
bf6a7838
MD
453 for (; _this_unit < _end_unit - 1; _this_unit++) { \
454 _bt_safe_lshift(_v, _ts); \
455 _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
456 _start += _ts; \
9115fbdc 457 } \
bf6a7838
MD
458 if (_end % _ts) { \
459 _mask = _bt_make_mask(type, _end % _ts); \
460 _cmask = _ptr[_this_unit]; \
461 _cmask = _bt_rshift(_cmask, _ts - (_end % _ts)); \
462 _cmask &= _mask; \
463 _bt_safe_lshift(_v, _end % _ts); \
464 _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
9115fbdc 465 } else { \
bf6a7838
MD
466 _bt_safe_lshift(_v, _ts); \
467 _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
9115fbdc 468 } \
bf6a7838 469 *_vptr = _v; \
9115fbdc
MD
470} while (0)
471
472/*
473 * bt_bitfield_read - read integer from a bitfield in native endianness
474 * bt_bitfield_read_le - read integer from a bitfield in little endian
475 * bt_bitfield_read_be - read integer from a bitfield in big endian
476 */
477
478#if (__BYTE_ORDER == __LITTLE_ENDIAN)
479
bf6a7838
MD
480#define bt_bitfield_read(ptr, type, start, length, vptr) \
481 _bt_bitfield_read_le(ptr, type, start, length, vptr)
9115fbdc 482
bf6a7838
MD
483#define bt_bitfield_read_le(ptr, type, start, length, vptr) \
484 _bt_bitfield_read_le(ptr, type, start, length, vptr)
b60a2acd 485
bf6a7838
MD
486#define bt_bitfield_read_be(ptr, type, start, length, vptr) \
487 _bt_bitfield_read_be(ptr, unsigned char, start, length, vptr)
9115fbdc
MD
488
489#elif (__BYTE_ORDER == __BIG_ENDIAN)
490
bf6a7838
MD
491#define bt_bitfield_read(ptr, type, start, length, vptr) \
492 _bt_bitfield_read_be(ptr, type, start, length, vptr)
9115fbdc 493
bf6a7838
MD
494#define bt_bitfield_read_le(ptr, type, start, length, vptr) \
495 _bt_bitfield_read_le(ptr, unsigned char, start, length, vptr)
b60a2acd 496
bf6a7838
MD
497#define bt_bitfield_read_be(ptr, type, start, length, vptr) \
498 _bt_bitfield_read_be(ptr, type, start, length, vptr)
9115fbdc
MD
499
500#else /* (__BYTE_ORDER == __PDP_ENDIAN) */
501
502#error "Byte order not supported"
503
504#endif
505
506#endif /* _BABELTRACE_BITFIELD_H */
This page took 0.061977 seconds and 4 git commands to generate.