Deleted Added
sdiff udiff text old ( 80062 ) new ( 82367 )
full compact
1/******************************************************************************
2 *
3 * Name: acmacros.h - C macros for the entire subsystem.
4 * $Revision: 80 $
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/*
177 * Full 64-bit address on 32-bit and 64-bit platforms
178 */
179#ifndef LODWORD
180#define LODWORD(l) ((UINT32)(UINT64)(l))
181#endif
182
183#ifndef HIDWORD
184#define HIDWORD(l) ((UINT32)((((UINT64)(l)) >> 32) & 0xFFFFFFFF))
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
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); \
445 DebugPrintRaw PARAM_LIST(fp);}
446#define REPORT_ERROR(fp) {_ReportError(_THIS_MODULE,__LINE__,_COMPONENT); \
447 DebugPrintRaw PARAM_LIST(fp);}
448#define REPORT_WARNING(fp) {_ReportWarning(_THIS_MODULE,__LINE__,_COMPONENT); \
449 DebugPrintRaw PARAM_LIST(fp);}
450
451#else
452
453#define REPORT_INFO(fp) {_ReportInfo("ACPI",__LINE__,_COMPONENT); \
454 DebugPrintRaw PARAM_LIST(fp);}
455#define REPORT_ERROR(fp) {_ReportError("ACPI",__LINE__,_COMPONENT); \
456 DebugPrintRaw PARAM_LIST(fp);}
457#define REPORT_WARNING(fp) {_ReportWarning("ACPI",__LINE__,_COMPONENT); \
458 DebugPrintRaw 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); \
465 DebugPrintRaw PARAM_LIST(fp);}
466#define _REPORT_ERROR(a,b,c,fp) {_ReportError(a,b,c); \
467 DebugPrintRaw PARAM_LIST(fp);}
468#define _REPORT_WARNING(a,b,c,fp) {_ReportWarning(a,b,c); \
469 DebugPrintRaw 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
551 *
552 */
553
554#define TEST_DEBUG_SWITCH(lvl) if (((lvl) & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))
555
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
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)
598#define DEBUG_PRINT(l,f)
599#define DEBUG_PRINTP(l,f)
600#define DEBUG_PRINT_RAW(l,f)
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)
661
662
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__)
676
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 */