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

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

45#define __ACMACROS_H__
46
47
48/*
49 * Extract data using a pointer. Any more than a byte and we
50 * get into potential aligment issues -- see the STORE macros below.
51 * Use with care.
52 */
1/******************************************************************************
2 *
3 * Name: acmacros.h - C macros for the entire subsystem.
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.

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

45#define __ACMACROS_H__
46
47
48/*
49 * Extract data using a pointer. Any more than a byte and we
50 * get into potential aligment issues -- see the STORE macros below.
51 * Use with care.
52 */
53#define ACPI_GET8(ptr) *ACPI_CAST_PTR (UINT8, ptr)
54#define ACPI_GET16(ptr) *ACPI_CAST_PTR (UINT16, ptr)
55#define ACPI_GET32(ptr) *ACPI_CAST_PTR (UINT32, ptr)
56#define ACPI_GET64(ptr) *ACPI_CAST_PTR (UINT64, ptr)
57#define ACPI_SET8(ptr) *ACPI_CAST_PTR (UINT8, ptr)
58#define ACPI_SET16(ptr) *ACPI_CAST_PTR (UINT16, ptr)
59#define ACPI_SET32(ptr) *ACPI_CAST_PTR (UINT32, ptr)
60#define ACPI_SET64(ptr) *ACPI_CAST_PTR (UINT64, ptr)
53#define ACPI_CAST8(ptr) ACPI_CAST_PTR (UINT8, (ptr))
54#define ACPI_CAST16(ptr) ACPI_CAST_PTR (UINT16, (ptr))
55#define ACPI_CAST32(ptr) ACPI_CAST_PTR (UINT32, (ptr))
56#define ACPI_CAST64(ptr) ACPI_CAST_PTR (UINT64, (ptr))
57#define ACPI_GET8(ptr) (*ACPI_CAST8 (ptr))
58#define ACPI_GET16(ptr) (*ACPI_CAST16 (ptr))
59#define ACPI_GET32(ptr) (*ACPI_CAST32 (ptr))
60#define ACPI_GET64(ptr) (*ACPI_CAST64 (ptr))
61#define ACPI_SET8(ptr, val) (*ACPI_CAST8 (ptr) = (UINT8) (val))
62#define ACPI_SET16(ptr, val) (*ACPI_CAST16 (ptr) = (UINT16) (val))
63#define ACPI_SET32(ptr, val) (*ACPI_CAST32 (ptr) = (UINT32) (val))
64#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (UINT64) (val))
61
62/*
63 * printf() format helpers
64 */
65
66/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */
67
68#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)

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

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
65
66/*
67 * printf() format helpers
68 */
69
70/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */
71
72#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)

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

295#define ACPI_4BIT_MASK 0x0000000F
296#define ACPI_5BIT_MASK 0x0000001F
297#define ACPI_6BIT_MASK 0x0000003F
298#define ACPI_7BIT_MASK 0x0000007F
299#define ACPI_8BIT_MASK 0x000000FF
300#define ACPI_16BIT_MASK 0x0000FFFF
301#define ACPI_24BIT_MASK 0x00FFFFFF
302
303/* Macros to extract flag bits from position zero */
304
305#define ACPI_GET_1BIT_FLAG(Value) ((Value) & ACPI_1BIT_MASK)
306#define ACPI_GET_2BIT_FLAG(Value) ((Value) & ACPI_2BIT_MASK)
307#define ACPI_GET_3BIT_FLAG(Value) ((Value) & ACPI_3BIT_MASK)
308#define ACPI_GET_4BIT_FLAG(Value) ((Value) & ACPI_4BIT_MASK)
309
310/* Macros to extract flag bits from position one and above */
311
312#define ACPI_EXTRACT_1BIT_FLAG(Field, Position) (ACPI_GET_1BIT_FLAG ((Field) >> Position))
313#define ACPI_EXTRACT_2BIT_FLAG(Field, Position) (ACPI_GET_2BIT_FLAG ((Field) >> Position))
314#define ACPI_EXTRACT_3BIT_FLAG(Field, Position) (ACPI_GET_3BIT_FLAG ((Field) >> Position))
315#define ACPI_EXTRACT_4BIT_FLAG(Field, Position) (ACPI_GET_4BIT_FLAG ((Field) >> Position))
316
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 ---
317/*
318 * An object of type ACPI_NAMESPACE_NODE can appear in some contexts
319 * where a pointer to an object of type ACPI_OPERAND_OBJECT can also
320 * appear. This macro is used to distinguish them.
321 *
322 * The "Descriptor" field is the first field in both structures.
323 */
324#define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType)

--- 257 unchanged lines hidden ---