acmacros.h (85756) | acmacros.h (87031) |
---|---|
1/****************************************************************************** 2 * 3 * Name: acmacros.h - C macros for the entire subsystem. | 1/****************************************************************************** 2 * 3 * Name: acmacros.h - C macros for the entire subsystem. |
4 * $Revision: 97 $ | 4 * $Revision: 100 $ |
5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. --- 303 unchanged lines hidden (view full) --- 316#define ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) 317 318/* 319 * Bitmask creation 320 * Bit positions start at zero. 321 * MASK_BITS_ABOVE creates a mask starting AT the position and above 322 * MASK_BITS_BELOW creates a mask starting one bit BELOW the position 323 */ | 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. --- 303 unchanged lines hidden (view full) --- 316#define ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) 317 318/* 319 * Bitmask creation 320 * Bit positions start at zero. 321 * MASK_BITS_ABOVE creates a mask starting AT the position and above 322 * MASK_BITS_BELOW creates a mask starting one bit BELOW the position 323 */ |
324#define MASK_BITS_ABOVE(position) (~(((UINT32)(-1)) << ((UINT32) (position)))) 325#define MASK_BITS_BELOW(position) (((UINT32)(-1)) << ((UINT32) (position))) | 324#define MASK_BITS_ABOVE(position) (~(((ACPI_INTEGER)(-1)) << ((UINT32) (position)))) 325#define MASK_BITS_BELOW(position) (((ACPI_INTEGER)(-1)) << ((UINT32) (position))) |
326 327 328/* Macros for GAS addressing */ 329 330#ifndef _IA16 331 332#define ACPI_PCI_DEVICE_MASK (UINT64) 0x0000FFFF00000000 333#define ACPI_PCI_FUNCTION_MASK (UINT64) 0x00000000FFFF0000 --- 9 unchanged lines hidden (view full) --- 343 344#define ACPI_PCI_FUNCTION(a) (UINT16) ((a) & 0xFFFF0000) 345#define ACPI_PCI_DEVICE(a) (UINT16) ((a) & 0x0000FFFF) 346#define ACPI_PCI_REGISTER(a) (UINT16) ((a) & 0x0000FFFF) 347 348#endif 349 350/* | 326 327 328/* Macros for GAS addressing */ 329 330#ifndef _IA16 331 332#define ACPI_PCI_DEVICE_MASK (UINT64) 0x0000FFFF00000000 333#define ACPI_PCI_FUNCTION_MASK (UINT64) 0x00000000FFFF0000 --- 9 unchanged lines hidden (view full) --- 343 344#define ACPI_PCI_FUNCTION(a) (UINT16) ((a) & 0xFFFF0000) 345#define ACPI_PCI_DEVICE(a) (UINT16) ((a) & 0x0000FFFF) 346#define ACPI_PCI_REGISTER(a) (UINT16) ((a) & 0x0000FFFF) 347 348#endif 349 350/* |
351 * An ACPI_HANDLE (which is actually an ACPI_NAMESPACE_NODE *) can appear in some contexts, 352 * such as on apObjStack, where a pointer to an ACPI_OPERAND_OBJECT can also | 351 * An ACPI_NAMESPACE_NODE * can appear in some contexts, 352 * where a pointer to an ACPI_OPERAND_OBJECT can also |
353 * appear. This macro is used to distinguish them. 354 * 355 * The DataType field is the first field in both structures. 356 */ 357#define VALID_DESCRIPTOR_TYPE(d,t) (((ACPI_NAMESPACE_NODE *)d)->DataType == t) 358 359 360/* Macro to test the object type */ --- 19 unchanged lines hidden (view full) --- 380 (((UINT8 *)(a) >= (UINT8 *)(b + 1)) &&\ 381 ((UINT8 *)(a) < ((UINT8 *)b + b->Length))) 382#endif 383 384/* 385 * Macros for the master AML opcode table 386 */ 387#ifdef ACPI_DEBUG | 353 * appear. This macro is used to distinguish them. 354 * 355 * The DataType field is the first field in both structures. 356 */ 357#define VALID_DESCRIPTOR_TYPE(d,t) (((ACPI_NAMESPACE_NODE *)d)->DataType == t) 358 359 360/* Macro to test the object type */ --- 19 unchanged lines hidden (view full) --- 380 (((UINT8 *)(a) >= (UINT8 *)(b + 1)) &&\ 381 ((UINT8 *)(a) < ((UINT8 *)b + b->Length))) 382#endif 383 384/* 385 * Macros for the master AML opcode table 386 */ 387#ifdef ACPI_DEBUG |
388#define ACPI_OP(Name,PArgs,IArgs,Class,Type,Flags) {PArgs,IArgs,Flags,Class,Type,Name} | 388#define ACPI_OP(Name,PArgs,IArgs,ObjType,Class,Type,Flags) {Name,PArgs,IArgs,Flags,ObjType,Class,Type} |
389#else | 389#else |
390#define ACPI_OP(Name,PArgs,IArgs,Class,Type,Flags) {PArgs,IArgs,Flags,Class,Type} | 390#define ACPI_OP(Name,PArgs,IArgs,ObjType,Class,Type,Flags) {PArgs,IArgs,Flags,ObjType,Class,Type} |
391#endif 392 393#define ARG_TYPE_WIDTH 5 394#define ARG_1(x) ((UINT32)(x)) 395#define ARG_2(x) ((UINT32)(x) << (1 * ARG_TYPE_WIDTH)) 396#define ARG_3(x) ((UINT32)(x) << (2 * ARG_TYPE_WIDTH)) 397#define ARG_4(x) ((UINT32)(x) << (3 * ARG_TYPE_WIDTH)) 398#define ARG_5(x) ((UINT32)(x) << (4 * ARG_TYPE_WIDTH)) --- 277 unchanged lines hidden --- | 391#endif 392 393#define ARG_TYPE_WIDTH 5 394#define ARG_1(x) ((UINT32)(x)) 395#define ARG_2(x) ((UINT32)(x) << (1 * ARG_TYPE_WIDTH)) 396#define ARG_3(x) ((UINT32)(x) << (2 * ARG_TYPE_WIDTH)) 397#define ARG_4(x) ((UINT32)(x) << (3 * ARG_TYPE_WIDTH)) 398#define ARG_5(x) ((UINT32)(x) << (4 * ARG_TYPE_WIDTH)) --- 277 unchanged lines hidden --- |