acmacros.h (249663) | acmacros.h (272444) |
---|---|
1/****************************************************************************** 2 * 3 * Name: acmacros.h - C macros for the entire subsystem. 4 * 5 *****************************************************************************/ 6 7/* | 1/****************************************************************************** 2 * 3 * Name: acmacros.h - C macros for the entire subsystem. 4 * 5 *****************************************************************************/ 6 7/* |
8 * Copyright (C) 2000 - 2013, Intel Corp. | 8 * Copyright (C) 2000 - 2014, Intel Corp. |
9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. --- 42 unchanged lines hidden (view full) --- 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)) 65 66/* | 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. --- 42 unchanged lines hidden (view full) --- 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)) 65 66/* |
67 * printf() format helpers | 67 * printf() format helpers. These macros are workarounds for the difficulties 68 * with emitting 64-bit integers and 64-bit pointers with the same code 69 * for both 32-bit and 64-bit hosts. |
68 */ | 70 */ |
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) 73 74#if ACPI_MACHINE_WIDTH == 64 75#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i) | 71#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) 72 73#if ACPI_MACHINE_WIDTH == 64 74#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i) |
75#define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i) 76#define ACPI_PRINTF_UINT "0x%8.8X%8.8X" 77 |
|
76#else | 78#else |
77#define ACPI_FORMAT_NATIVE_UINT(i) 0, (i) | 79#define ACPI_FORMAT_NATIVE_UINT(i) 0, (UINT32) (i) 80#define ACPI_FORMAT_TO_UINT(i) (UINT32) (i) 81#define ACPI_PRINTF_UINT "0x%8.8X" |
78#endif 79 80 81/* 82 * Macros for moving data around to/from buffers that are possibly unaligned. 83 * If the hardware supports the transfer of unaligned data, just do the store. 84 * Otherwise, we have to move one byte at a time. 85 */ --- 324 unchanged lines hidden (view full) --- 410#ifdef ACPI_DEBUGGER 411#define ACPI_DEBUGGER_EXEC(a) a 412#else 413#define ACPI_DEBUGGER_EXEC(a) 414#endif 415 416 417/* | 82#endif 83 84 85/* 86 * Macros for moving data around to/from buffers that are possibly unaligned. 87 * If the hardware supports the transfer of unaligned data, just do the store. 88 * Otherwise, we have to move one byte at a time. 89 */ --- 324 unchanged lines hidden (view full) --- 414#ifdef ACPI_DEBUGGER 415#define ACPI_DEBUGGER_EXEC(a) a 416#else 417#define ACPI_DEBUGGER_EXEC(a) 418#endif 419 420 421/* |
418 * Memory allocation tracking (DEBUG ONLY) 419 */ 420#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__ 421 422#ifndef ACPI_DBG_TRACK_ALLOCATIONS 423 424/* Memory allocation */ 425 426#define ACPI_ALLOCATE(a) AcpiUtAllocate((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) 427#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroed((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) 428#define ACPI_FREE(a) AcpiOsFree(a) 429#define ACPI_MEM_TRACKING(a) 430 431#else 432 433/* Memory allocation */ 434 435#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) 436#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) 437#define ACPI_FREE(a) AcpiUtFreeAndTrack(a, ACPI_MEM_PARAMETERS) 438#define ACPI_MEM_TRACKING(a) a 439 440#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ 441 442 443/* | |
444 * Macros used for ACPICA utilities only 445 */ 446 447/* Generate a UUID */ 448 449#define ACPI_INIT_UUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ 450 (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \ 451 (b) & 0xFF, ((b) >> 8) & 0xFF, \ 452 (c) & 0xFF, ((c) >> 8) & 0xFF, \ 453 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) 454 455#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) 456 457 458#endif /* ACMACROS_H */ | 422 * Macros used for ACPICA utilities only 423 */ 424 425/* Generate a UUID */ 426 427#define ACPI_INIT_UUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \ 428 (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \ 429 (b) & 0xFF, ((b) >> 8) & 0xFF, \ 430 (c) & 0xFF, ((c) >> 8) & 0xFF, \ 431 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) 432 433#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) 434 435 436#endif /* ACMACROS_H */ |