Deleted Added
full compact
acmacros.h (80062) acmacros.h (82367)
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: 80 $
4 * $Revision: 86 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.

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

168#define HIDWORD(l) (0)
169#endif
170
171#define ACPI_GET_ADDRESS(a) ((a).Lo)
172#define ACPI_STORE_ADDRESS(a,b) {(a).Hi=0;(a).Lo=(b);}
173#define ACPI_VALID_ADDRESS(a) ((a).Hi | (a).Lo)
174
175#else
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.

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

168#define HIDWORD(l) (0)
169#endif
170
171#define ACPI_GET_ADDRESS(a) ((a).Lo)
172#define ACPI_STORE_ADDRESS(a,b) {(a).Hi=0;(a).Lo=(b);}
173#define ACPI_VALID_ADDRESS(a) ((a).Hi | (a).Lo)
174
175#else
176#ifdef ACPI_NO_INTEGER64_SUPPORT
176/*
177/*
177 * Full 64-bit address on 32-bit and 64-bit platforms
178 * ACPI_INTEGER is 32-bits, no 64-bit support on this platform
178 */
179#ifndef LODWORD
179 */
180#ifndef LODWORD
181#define LODWORD(l) ((UINT32)(l))
182#endif
183
184#ifndef HIDWORD
185#define HIDWORD(l) (0)
186#endif
187
188#define ACPI_GET_ADDRESS(a) (a)
189#define ACPI_STORE_ADDRESS(a,b) ((a)=(b))
190#define ACPI_VALID_ADDRESS(a) (a)
191
192#else
193
194/*
195 * Full 64-bit address/integer on both 32-bit and 64-bit platforms
196 */
197#ifndef LODWORD
180#define LODWORD(l) ((UINT32)(UINT64)(l))
181#endif
182
183#ifndef HIDWORD
198#define LODWORD(l) ((UINT32)(UINT64)(l))
199#endif
200
201#ifndef HIDWORD
184#define HIDWORD(l) ((UINT32)((((UINT64)(l)) >> 32) & 0xFFFFFFFF))
202#define HIDWORD(l) ((UINT32)(((*(UINT64_STRUCT *)(&l))).Hi))
185#endif
186
187#define ACPI_GET_ADDRESS(a) (a)
188#define ACPI_STORE_ADDRESS(a,b) ((a)=(b))
189#define ACPI_VALID_ADDRESS(a) (a)
190#endif
203#endif
204
205#define ACPI_GET_ADDRESS(a) (a)
206#define ACPI_STORE_ADDRESS(a,b) ((a)=(b))
207#define ACPI_VALID_ADDRESS(a) (a)
208#endif
209#endif
191
192 /*
193 * Extract a byte of data using a pointer. Any more than a byte and we
194 * get into potential aligment issues -- see the STORE macros below
195 */
196#define GET8(addr) (*(UINT8*)(addr))
197
198/* Pointer arithmetic */

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

437 * Error reporting. These versions add callers module and line#. Since
438 * _THIS_MODULE gets compiled out when ACPI_DEBUG isn't defined, only
439 * use it in debug mode.
440 */
441
442#ifdef ACPI_DEBUG
443
444#define REPORT_INFO(fp) {_ReportInfo(_THIS_MODULE,__LINE__,_COMPONENT); \
210
211 /*
212 * Extract a byte of data using a pointer. Any more than a byte and we
213 * get into potential aligment issues -- see the STORE macros below
214 */
215#define GET8(addr) (*(UINT8*)(addr))
216
217/* Pointer arithmetic */

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

456 * Error reporting. These versions add callers module and line#. Since
457 * _THIS_MODULE gets compiled out when ACPI_DEBUG isn't defined, only
458 * use it in debug mode.
459 */
460
461#ifdef ACPI_DEBUG
462
463#define REPORT_INFO(fp) {_ReportInfo(_THIS_MODULE,__LINE__,_COMPONENT); \
445 DebugPrintRaw PARAM_LIST(fp);}
464 AcpiOsPrintf PARAM_LIST(fp);}
446#define REPORT_ERROR(fp) {_ReportError(_THIS_MODULE,__LINE__,_COMPONENT); \
465#define REPORT_ERROR(fp) {_ReportError(_THIS_MODULE,__LINE__,_COMPONENT); \
447 DebugPrintRaw PARAM_LIST(fp);}
466 AcpiOsPrintf PARAM_LIST(fp);}
448#define REPORT_WARNING(fp) {_ReportWarning(_THIS_MODULE,__LINE__,_COMPONENT); \
467#define REPORT_WARNING(fp) {_ReportWarning(_THIS_MODULE,__LINE__,_COMPONENT); \
449 DebugPrintRaw PARAM_LIST(fp);}
468 AcpiOsPrintf PARAM_LIST(fp);}
450
451#else
452
453#define REPORT_INFO(fp) {_ReportInfo("ACPI",__LINE__,_COMPONENT); \
469
470#else
471
472#define REPORT_INFO(fp) {_ReportInfo("ACPI",__LINE__,_COMPONENT); \
454 DebugPrintRaw PARAM_LIST(fp);}
473 AcpiOsPrintf PARAM_LIST(fp);}
455#define REPORT_ERROR(fp) {_ReportError("ACPI",__LINE__,_COMPONENT); \
474#define REPORT_ERROR(fp) {_ReportError("ACPI",__LINE__,_COMPONENT); \
456 DebugPrintRaw PARAM_LIST(fp);}
475 AcpiOsPrintf PARAM_LIST(fp);}
457#define REPORT_WARNING(fp) {_ReportWarning("ACPI",__LINE__,_COMPONENT); \
476#define REPORT_WARNING(fp) {_ReportWarning("ACPI",__LINE__,_COMPONENT); \
458 DebugPrintRaw PARAM_LIST(fp);}
477 AcpiOsPrintf PARAM_LIST(fp);}
459
460#endif
461
462/* Error reporting. These versions pass thru the module and line# */
463
464#define _REPORT_INFO(a,b,c,fp) {_ReportInfo(a,b,c); \
478
479#endif
480
481/* Error reporting. These versions pass thru the module and line# */
482
483#define _REPORT_INFO(a,b,c,fp) {_ReportInfo(a,b,c); \
465 DebugPrintRaw PARAM_LIST(fp);}
484 AcpiOsPrintf PARAM_LIST(fp);}
466#define _REPORT_ERROR(a,b,c,fp) {_ReportError(a,b,c); \
485#define _REPORT_ERROR(a,b,c,fp) {_ReportError(a,b,c); \
467 DebugPrintRaw PARAM_LIST(fp);}
486 AcpiOsPrintf PARAM_LIST(fp);}
468#define _REPORT_WARNING(a,b,c,fp) {_ReportWarning(a,b,c); \
487#define _REPORT_WARNING(a,b,c,fp) {_ReportWarning(a,b,c); \
469 DebugPrintRaw PARAM_LIST(fp);}
488 AcpiOsPrintf PARAM_LIST(fp);}
470
471/* Buffer dump macros */
472
473#define DUMP_BUFFER(a,b) AcpiUtDumpBuffer((UINT8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT)
474
475/*
476 * Debug macros that are conditionally compiled
477 */

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

543#define BREAK_ON_ERROR(lvl)
544#endif
545
546/*
547 * Master debug print macros
548 * Print iff:
549 * 1) Debug print for the current component is enabled
550 * 2) Debug error level or trace level for the print statement is enabled
489
490/* Buffer dump macros */
491
492#define DUMP_BUFFER(a,b) AcpiUtDumpBuffer((UINT8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT)
493
494/*
495 * Debug macros that are conditionally compiled
496 */

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

562#define BREAK_ON_ERROR(lvl)
563#endif
564
565/*
566 * Master debug print macros
567 * Print iff:
568 * 1) Debug print for the current component is enabled
569 * 2) Debug error level or trace level for the print statement is enabled
551 *
552 */
553
570 */
571
554#define TEST_DEBUG_SWITCH(lvl) if (((lvl) & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))
572#define ACPI_DEBUG_PRINT(pl) AcpiUtDebugPrint PARAM_LIST(pl)
573#define ACPI_DEBUG_PRINT_RAW(pl) AcpiUtDebugPrintRaw PARAM_LIST(pl)
555
574
556#define DEBUG_PRINT(lvl,fp) TEST_DEBUG_SWITCH(lvl) {\
557 DebugPrintPrefix (_THIS_MODULE,__LINE__);\
558 DebugPrintRaw PARAM_LIST(fp);\
559 BREAK_ON_ERROR(lvl);}
560
575
561#define DEBUG_PRINTP(lvl,fp) TEST_DEBUG_SWITCH(lvl) {\
562 DebugPrintPrefix (_THIS_MODULE,__LINE__);\
563 DebugPrintRaw ("%s: ",_ProcName);\
564 DebugPrintRaw PARAM_LIST(fp);\
565 BREAK_ON_ERROR(lvl);}
566
567#define DEBUG_PRINT_RAW(lvl,fp) TEST_DEBUG_SWITCH(lvl) {\
568 DebugPrintRaw PARAM_LIST(fp);}
569
570#else
571/*
572 * This is the non-debug case -- make everything go away,
573 * leaving no executable debug code!
574 */
575
576#define MODULE_NAME(name)
577#define _THIS_MODULE ""

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

590#define FUNCTION_STATUS_EXIT(s)
591#define FUNCTION_VALUE_EXIT(s)
592#define DUMP_STACK_ENTRY(a)
593#define DUMP_OPERANDS(a,b,c,d,e)
594#define DUMP_ENTRY(a,b)
595#define DUMP_TABLES(a,b)
596#define DUMP_PATHNAME(a,b,c,d)
597#define DUMP_RESOURCE_LIST(a)
576#else
577/*
578 * This is the non-debug case -- make everything go away,
579 * leaving no executable debug code!
580 */
581
582#define MODULE_NAME(name)
583#define _THIS_MODULE ""

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

596#define FUNCTION_STATUS_EXIT(s)
597#define FUNCTION_VALUE_EXIT(s)
598#define DUMP_STACK_ENTRY(a)
599#define DUMP_OPERANDS(a,b,c,d,e)
600#define DUMP_ENTRY(a,b)
601#define DUMP_TABLES(a,b)
602#define DUMP_PATHNAME(a,b,c,d)
603#define DUMP_RESOURCE_LIST(a)
598#define DEBUG_PRINT(l,f)
599#define DEBUG_PRINTP(l,f)
600#define DEBUG_PRINT_RAW(l,f)
604#define ACPI_DEBUG_PRINT(pl)
605#define ACPI_DEBUG_PRINT_RAW(pl)
601#define BREAK_MSG(a)
602
603#define return_VOID return
604#define return_ACPI_STATUS(s) return(s)
605#define return_VALUE(s) return(s)
606#define return_PTR(s) return(s)
607
608#endif

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

653
654#ifndef ACPI_DBG_TRACK_ALLOCATIONS
655
656/* Memory allocation */
657
658#define ACPI_MEM_ALLOCATE(a) AcpiOsAllocate(a)
659#define ACPI_MEM_CALLOCATE(a) AcpiOsCallocate(a)
660#define ACPI_MEM_FREE(a) AcpiOsFree(a)
606#define BREAK_MSG(a)
607
608#define return_VOID return
609#define return_ACPI_STATUS(s) return(s)
610#define return_VALUE(s) return(s)
611#define return_PTR(s) return(s)
612
613#endif

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

658
659#ifndef ACPI_DBG_TRACK_ALLOCATIONS
660
661/* Memory allocation */
662
663#define ACPI_MEM_ALLOCATE(a) AcpiOsAllocate(a)
664#define ACPI_MEM_CALLOCATE(a) AcpiOsCallocate(a)
665#define ACPI_MEM_FREE(a) AcpiOsFree(a)
666#define ACPI_MEM_TRACKING(a)
661
662
667
668
663#define DECREMENT_OBJECT_METRICS(a)
664#define INCREMENT_OBJECT_METRICS(a)
665#define INITIALIZE_ALLOCATION_METRICS()
666#define DECREMENT_NAME_TABLE_METRICS(a)
667#define INCREMENT_NAME_TABLE_METRICS(a)
668
669#else
670
671/* Memory allocation */
672
673#define ACPI_MEM_ALLOCATE(a) AcpiUtAllocate(a,_COMPONENT,_THIS_MODULE,__LINE__)
674#define ACPI_MEM_CALLOCATE(a) AcpiUtCallocate(a, _COMPONENT,_THIS_MODULE,__LINE__)
675#define ACPI_MEM_FREE(a) AcpiUtFree(a,_COMPONENT,_THIS_MODULE,__LINE__)
669#else
670
671/* Memory allocation */
672
673#define ACPI_MEM_ALLOCATE(a) AcpiUtAllocate(a,_COMPONENT,_THIS_MODULE,__LINE__)
674#define ACPI_MEM_CALLOCATE(a) AcpiUtCallocate(a, _COMPONENT,_THIS_MODULE,__LINE__)
675#define ACPI_MEM_FREE(a) AcpiUtFree(a,_COMPONENT,_THIS_MODULE,__LINE__)
676#define ACPI_MEM_TRACKING(a) a
676
677
677#define INITIALIZE_ALLOCATION_METRICS() \
678 AcpiGbl_CurrentObjectCount = 0; \
679 AcpiGbl_CurrentObjectSize = 0; \
680 AcpiGbl_RunningObjectCount = 0; \
681 AcpiGbl_RunningObjectSize = 0; \
682 AcpiGbl_MaxConcurrentObjectCount = 0; \
683 AcpiGbl_MaxConcurrentObjectSize = 0; \
684 AcpiGbl_CurrentAllocSize = 0; \
685 AcpiGbl_CurrentAllocCount = 0; \
686 AcpiGbl_RunningAllocSize = 0; \
687 AcpiGbl_RunningAllocCount = 0; \
688 AcpiGbl_MaxConcurrentAllocSize = 0; \
689 AcpiGbl_MaxConcurrentAllocCount = 0; \
690 AcpiGbl_CurrentNodeCount = 0; \
691 AcpiGbl_CurrentNodeSize = 0; \
692 AcpiGbl_MaxConcurrentNodeCount = 0
693
694
695#define DECREMENT_OBJECT_METRICS(a) \
696 AcpiGbl_CurrentObjectCount--; \
697 AcpiGbl_CurrentObjectSize -= a
698
699#define INCREMENT_OBJECT_METRICS(a) \
700 AcpiGbl_CurrentObjectCount++; \
701 AcpiGbl_RunningObjectCount++; \
702 if (AcpiGbl_MaxConcurrentObjectCount < AcpiGbl_CurrentObjectCount) \
703 { \
704 AcpiGbl_MaxConcurrentObjectCount = AcpiGbl_CurrentObjectCount; \
705 } \
706 AcpiGbl_RunningObjectSize += a; \
707 AcpiGbl_CurrentObjectSize += a; \
708 if (AcpiGbl_MaxConcurrentObjectSize < AcpiGbl_CurrentObjectSize) \
709 { \
710 AcpiGbl_MaxConcurrentObjectSize = AcpiGbl_CurrentObjectSize; \
711 }
712
713#define DECREMENT_NAME_TABLE_METRICS(a) \
714 AcpiGbl_CurrentNodeCount--; \
715 AcpiGbl_CurrentNodeSize -= (a)
716
717#define INCREMENT_NAME_TABLE_METRICS(a) \
718 AcpiGbl_CurrentNodeCount++; \
719 AcpiGbl_CurrentNodeSize+= (a); \
720 if (AcpiGbl_MaxConcurrentNodeCount < AcpiGbl_CurrentNodeCount) \
721 { \
722 AcpiGbl_MaxConcurrentNodeCount = AcpiGbl_CurrentNodeCount; \
723 }
724#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
725
726
727#endif /* ACMACROS_H */
678#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
679
680
681#endif /* ACMACROS_H */