Print this page
update to acpica-unix2-20140114
update to acpica-unix2-20131218
update to acpica-unix2-20130927
acpica-unix2-20130823
PANKOVs restructure

*** 4,14 **** * be used when running the debugger in Ring 0 (Kernel mode) * ******************************************************************************/ /* ! * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: --- 4,14 ---- * be used when running the debugger in Ring 0 (Kernel mode) * ******************************************************************************/ /* ! * Copyright (C) 2000 - 2014, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met:
*** 49,73 **** #ifdef ACPI_APPLICATION #include "actables.h" #endif #if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER) #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbfileio") - /* - * NOTE: this is here for lack of a better place. It is used in all - * flavors of the debugger, need LCD file - */ - #ifdef ACPI_APPLICATION - #include <stdio.h> - FILE *AcpiGbl_DebugFile = NULL; - #endif - - #ifdef ACPI_DEBUGGER /* Local prototypes */ #ifdef ACPI_APPLICATION --- 49,67 ---- #ifdef ACPI_APPLICATION #include "actables.h" #endif + #ifdef ACPI_ASL_COMPILER + #include "aslcompiler.h" + #endif + #if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER) #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbfileio") #ifdef ACPI_DEBUGGER /* Local prototypes */ #ifdef ACPI_APPLICATION
*** 129,149 **** #ifdef ACPI_APPLICATION AcpiDbCloseDebugFile (); AcpiGbl_DebugFile = fopen (Name, "w+"); ! if (AcpiGbl_DebugFile) { - AcpiOsPrintf ("Debug output file %s opened\n", Name); - ACPI_STRCPY (AcpiGbl_DbDebugFilename, Name); - AcpiGbl_DbOutputToFile = TRUE; - } - else - { AcpiOsPrintf ("Could not open debug file %s\n", Name); } #endif } #endif --- 123,143 ---- #ifdef ACPI_APPLICATION 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); + ACPI_STRNCPY (AcpiGbl_DbDebugFilename, Name, + sizeof (AcpiGbl_DbDebugFilename)); + AcpiGbl_DbOutputToFile = TRUE; + #endif } #endif
*** 269,291 **** return (AE_BAD_HEADER); } fseek (fp, 0, SEEK_SET); ! /* The RSDT and FACS tables do not have standard ACPI headers */ ! if (ACPI_COMPARE_NAME (TableHeader.Signature, "RSD ") || ! ACPI_COMPARE_NAME (TableHeader.Signature, "FACS")) { *TableLength = FileSize; StandardHeader = FALSE; } else { /* Read the table header */ ! if (fread (&TableHeader, 1, sizeof (TableHeader), fp) != sizeof (ACPI_TABLE_HEADER)) { AcpiOsPrintf ("Could not read the table header\n"); return (AE_BAD_HEADER); } --- 263,284 ---- return (AE_BAD_HEADER); } fseek (fp, 0, SEEK_SET); ! /* The RSDP table does not have standard ACPI header */ ! if (ACPI_COMPARE_NAME (TableHeader.Signature, "RSD ")) { *TableLength = FileSize; StandardHeader = FALSE; } else { /* Read the table header */ ! if (fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), fp) != sizeof (ACPI_TABLE_HEADER)) { AcpiOsPrintf ("Could not read the table header\n"); return (AE_BAD_HEADER); }
*** 306,324 **** if (TableHeader.Length > FileSize) { AcpiOsPrintf ( "TableHeader length [0x%X] greater than the input file size [0x%X]\n", TableHeader.Length, FileSize); return (AE_BAD_HEADER); } #ifdef ACPI_OBSOLETE_CODE /* We only support a limited number of table types */ ! if (ACPI_STRNCMP ((char *) TableHeader.Signature, DSDT_SIG, 4) && ! ACPI_STRNCMP ((char *) TableHeader.Signature, PSDT_SIG, 4) && ! ACPI_STRNCMP ((char *) TableHeader.Signature, SSDT_SIG, 4)) { AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n", (char *) TableHeader.Signature); ACPI_DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER)); return (AE_ERROR); --- 299,326 ---- if (TableHeader.Length > FileSize) { AcpiOsPrintf ( "TableHeader length [0x%X] greater than the input file size [0x%X]\n", TableHeader.Length, FileSize); + + #ifdef ACPI_ASL_COMPILER + Status = FlCheckForAscii (fp, NULL, FALSE); + if (ACPI_SUCCESS (Status)) + { + AcpiOsPrintf ("File appears to be ASCII only, must be binary\n", + TableHeader.Length, FileSize); + } + #endif return (AE_BAD_HEADER); } #ifdef ACPI_OBSOLETE_CODE /* We only support a limited number of table types */ ! if (!ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_DSDT) && ! !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_PSDT) && ! !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_SSDT)) { AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n", (char *) TableHeader.Signature); ACPI_DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER)); return (AE_ERROR);
*** 371,381 **** AcpiOsPrintf ("Error - could not read the table file\n"); AcpiOsFree (*Table); *Table = NULL; *TableLength = 0; - return (AE_ERROR); } /******************************************************************************* --- 373,382 ----
*** 469,498 **** ACPI_STATUS AcpiDbReadTableFromFile ( char *Filename, ACPI_TABLE_HEADER **Table) { ! FILE *fp; UINT32 TableLength; ACPI_STATUS Status; /* Open the file */ ! fp = fopen (Filename, "rb"); ! if (!fp) { ! AcpiOsPrintf ("Could not open input file %s\n", Filename); return (AE_ERROR); } /* Get the entire file */ ! fprintf (stderr, "Loading Acpi table from file %s\n", Filename); ! Status = AcpiDbReadTable (fp, Table, &TableLength); ! fclose(fp); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get table from the file\n"); return (Status); } --- 470,508 ---- ACPI_STATUS AcpiDbReadTableFromFile ( char *Filename, ACPI_TABLE_HEADER **Table) { ! FILE *File; ! UINT32 FileSize; UINT32 TableLength; ACPI_STATUS Status; /* Open the file */ ! File = fopen (Filename, "rb"); ! if (!File) { ! perror ("Could not open input file"); return (AE_ERROR); } + /* Get the file size */ + + fseek (File, 0, SEEK_END); + FileSize = (UINT32) ftell (File); + fseek (File, 0, SEEK_SET); + /* Get the entire file */ ! fprintf (stderr, "Loading Acpi table from file %10s - Length %.8u (%06X)\n", ! Filename, FileSize, FileSize); + Status = AcpiDbReadTable (File, Table, &TableLength); + fclose(File); + if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get table from the file\n"); return (Status); }
*** 572,577 **** #endif /* ACPI_APPLICATION */ return (AE_OK); } #endif /* ACPI_DEBUGGER */ - --- 582,586 ----