static void PrPushDirective ( int Directive, char *Argument) { DIRECTIVE_INFO *Info; /* Allocate and populate a stack info item */ Info = ACPI_ALLOCATE (sizeof (DIRECTIVE_INFO)); Info->Next = Gbl_DirectiveStack; Info->Directive = Directive; Info->IgnoringThisCodeBlock = Gbl_IgnoringThisCodeBlock; AcpiUtSafeStrncpy (Info->Argument, Argument, MAX_ARGUMENT_LENGTH); DbgPrint (ASL_DEBUG_OUTPUT, "Pr(%.4u) - [%u %s] %*s Pushed [#%s %s]: IgnoreFlag = %s\n", Gbl_CurrentLineNumber, Gbl_IfDepth, Gbl_IgnoringThisCodeBlock ? "I" : "E", Gbl_IfDepth * 4, " ", Gbl_DirectiveInfo[Directive].Name, Argument, Gbl_IgnoringThisCodeBlock ? "TRUE" : "FALSE"); /* Push new item */ Gbl_DirectiveStack = Info; Gbl_IfDepth++; }
void AcpiDbOpenDebugFile ( char *Name) { AcpiDbCloseDebugFile (); AcpiGbl_DebugFile = fopen (Name, "w+"); if (!AcpiGbl_DebugFile) { AcpiOsPrintf ("Could not open debug file %s\n", Name); return; } AcpiOsPrintf ("Debug output file %s opened\n", Name); AcpiUtSafeStrncpy (AcpiGbl_DbDebugFilename, Name, sizeof (AcpiGbl_DbDebugFilename)); AcpiGbl_DbOutputToFile = TRUE; }
void AhFindPredefinedNames ( char *NamePrefix) { UINT32 Length; BOOLEAN Found; char Name[9]; if (!NamePrefix || (NamePrefix[0] == '*')) { Found = AhDisplayPredefinedName (NULL, 0); return; } /* Contruct a local name or name prefix */ AcpiUtStrupr (NamePrefix); if (*NamePrefix == '_') { NamePrefix++; } Name[0] = '_'; AcpiUtSafeStrncpy (&Name[1], NamePrefix, 7); Length = strlen (Name); if (Length > ACPI_NAME_SIZE) { printf ("%.8s: Predefined name must be 4 characters maximum\n", Name); return; } Found = AhDisplayPredefinedName (Name, Length); if (!Found) { printf ("%s, no matching predefined names\n", Name); } }
static ACPI_STATUS AcpiUtTrackAllocation ( ACPI_DEBUG_MEM_BLOCK *Allocation, ACPI_SIZE Size, UINT8 AllocType, UINT32 Component, const char *Module, UINT32 Line) { ACPI_MEMORY_LIST *MemList; ACPI_DEBUG_MEM_BLOCK *Element; ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_TRACE_PTR (UtTrackAllocation, Allocation); if (AcpiGbl_DisableMemTracking) { return_ACPI_STATUS (AE_OK); } MemList = AcpiGbl_GlobalList; Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* * Search the global list for this address to make sure it is not * already present. This will catch several kinds of problems. */ Element = AcpiUtFindAllocation (Allocation); if (Element == Allocation) { ACPI_ERROR ((AE_INFO, "UtTrackAllocation: Allocation (%p) already present in global list!", Allocation)); goto UnlockAndExit; } /* Fill in the instance data */ Allocation->Size = (UINT32) Size; Allocation->AllocType = AllocType; Allocation->Component = Component; Allocation->Line = Line; AcpiUtSafeStrncpy (Allocation->Module, (char *) Module, ACPI_MAX_MODULE_NAME); if (!Element) { /* Insert at list head */ if (MemList->ListHead) { ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous = Allocation; } Allocation->Next = MemList->ListHead; Allocation->Previous = NULL; MemList->ListHead = Allocation; } else { /* Insert after element */ Allocation->Next = Element->Next; Allocation->Previous = Element; if (Element->Next) { (Element->Next)->Previous = Allocation; } Element->Next = Allocation; } UnlockAndExit: Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY); return_ACPI_STATUS (Status); }