Deleted Added
full compact
acmacros.h (238381) acmacros.h (239340)
1/******************************************************************************
2 *
3 * Name: acmacros.h - C macros for the entire subsystem.
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.

--- 254 unchanged lines hidden (view full) ---

263 * MASK_BITS_ABOVE creates a mask starting AT the position and above
264 * MASK_BITS_BELOW creates a mask starting one bit BELOW the position
265 */
266#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_UINT64_MAX) << ((UINT32) (position))))
267#define ACPI_MASK_BITS_BELOW(position) ((ACPI_UINT64_MAX) << ((UINT32) (position)))
268
269/* Bitfields within ACPI registers */
270
1/******************************************************************************
2 *
3 * Name: acmacros.h - C macros for the entire subsystem.
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.

--- 254 unchanged lines hidden (view full) ---

263 * MASK_BITS_ABOVE creates a mask starting AT the position and above
264 * MASK_BITS_BELOW creates a mask starting one bit BELOW the position
265 */
266#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_UINT64_MAX) << ((UINT32) (position))))
267#define ACPI_MASK_BITS_BELOW(position) ((ACPI_UINT64_MAX) << ((UINT32) (position)))
268
269/* Bitfields within ACPI registers */
270
271#define ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) ((Val << Pos) & Mask)
272#define ACPI_REGISTER_INSERT_VALUE(Reg, Pos, Mask, Val) Reg = (Reg & (~(Mask))) | ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask)
271#define ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) \
272 ((Val << Pos) & Mask)
273
273
274#define ACPI_INSERT_BITS(Target, Mask, Source) Target = ((Target & (~(Mask))) | (Source & Mask))
274#define ACPI_REGISTER_INSERT_VALUE(Reg, Pos, Mask, Val) \
275 Reg = (Reg & (~(Mask))) | ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask)
275
276
277#define ACPI_INSERT_BITS(Target, Mask, Source) \
278 Target = ((Target & (~(Mask))) | (Source & Mask))
279
280/* Generic bitfield macros and masks */
281
282#define ACPI_GET_BITS(SourcePtr, Position, Mask) \
283 ((*SourcePtr >> Position) & Mask)
284
285#define ACPI_SET_BITS(TargetPtr, Position, Mask, Value) \
286 (*TargetPtr |= ((Value & Mask) << Position))
287
288#define ACPI_1BIT_MASK 0x00000001
289#define ACPI_2BIT_MASK 0x00000003
290#define ACPI_3BIT_MASK 0x00000007
291#define ACPI_4BIT_MASK 0x0000000F
292#define ACPI_5BIT_MASK 0x0000001F
293#define ACPI_6BIT_MASK 0x0000003F
294#define ACPI_7BIT_MASK 0x0000007F
295#define ACPI_8BIT_MASK 0x000000FF
296#define ACPI_16BIT_MASK 0x0000FFFF
297#define ACPI_24BIT_MASK 0x00FFFFFF
298
276/*
277 * An object of type ACPI_NAMESPACE_NODE can appear in some contexts
278 * where a pointer to an object of type ACPI_OPERAND_OBJECT can also
279 * appear. This macro is used to distinguish them.
280 *
281 * The "Descriptor" field is the first field in both structures.
282 */
283#define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType)

--- 257 unchanged lines hidden ---
299/*
300 * An object of type ACPI_NAMESPACE_NODE can appear in some contexts
301 * where a pointer to an object of type ACPI_OPERAND_OBJECT can also
302 * appear. This macro is used to distinguish them.
303 *
304 * The "Descriptor" field is the first field in both structures.
305 */
306#define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType)

--- 257 unchanged lines hidden ---