summaryrefslogtreecommitdiff
path: root/source/components
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2016-08-01 21:20:41 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2016-08-01 21:20:41 +0000
commit8bc6ab62dbdb3e8b0d2253e0440f6f58ac9afd3d (patch)
treeb2316b6fda5368bb277671853a71b2a758582b05 /source/components
parent4d46bb7749ef0cf25eb2b25f2d7324023cb754b4 (diff)
downloadsrc-test2-8bc6ab62dbdb3e8b0d2253e0440f6f58ac9afd3d.tar.gz
src-test2-8bc6ab62dbdb3e8b0d2253e0440f6f58ac9afd3d.zip
Notes
Diffstat (limited to 'source/components')
-rw-r--r--source/components/debugger/dbfileio.c19
-rw-r--r--source/components/tables/tbfadt.c10
-rw-r--r--source/components/tables/tbutils.c2
-rw-r--r--source/components/tables/tbxface.c4
-rw-r--r--source/components/tables/tbxfload.c4
-rw-r--r--source/components/tables/tbxfroot.c4
-rw-r--r--source/components/utilities/utbuffer.c26
-rw-r--r--source/components/utilities/utdebug.c30
-rw-r--r--source/components/utilities/utinit.c2
-rw-r--r--source/components/utilities/utpredef.c2
-rw-r--r--source/components/utilities/utprint.c121
-rw-r--r--source/components/utilities/uttrack.c4
-rw-r--r--source/components/utilities/utxface.c2
-rw-r--r--source/components/utilities/utxfinit.c6
14 files changed, 145 insertions, 91 deletions
diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c
index e90a138e5c88..6e97689c0ff1 100644
--- a/source/components/debugger/dbfileio.c
+++ b/source/components/debugger/dbfileio.c
@@ -46,15 +46,15 @@
#include "accommon.h"
#include "acdebug.h"
#include "actables.h"
-#include <stdio.h>
-#ifdef ACPI_APPLICATION
-#include "acapps.h"
-#endif
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
+#ifdef ACPI_APPLICATION
+#include "acapps.h"
+
+
#ifdef ACPI_DEBUGGER
/*******************************************************************************
*
@@ -73,8 +73,6 @@ AcpiDbCloseDebugFile (
void)
{
-#ifdef ACPI_APPLICATION
-
if (AcpiGbl_DebugFile)
{
fclose (AcpiGbl_DebugFile);
@@ -83,7 +81,6 @@ AcpiDbCloseDebugFile (
AcpiOsPrintf ("Debug output file %s closed\n",
AcpiGbl_DbDebugFilename);
}
-#endif
}
@@ -104,8 +101,6 @@ AcpiDbOpenDebugFile (
char *Name)
{
-#ifdef ACPI_APPLICATION
-
AcpiDbCloseDebugFile ();
AcpiGbl_DebugFile = fopen (Name, "w+");
if (!AcpiGbl_DebugFile)
@@ -118,8 +113,6 @@ AcpiDbOpenDebugFile (
strncpy (AcpiGbl_DbDebugFilename, Name,
sizeof (AcpiGbl_DbDebugFilename));
AcpiGbl_DbOutputToFile = TRUE;
-
-#endif
}
#endif
@@ -169,8 +162,7 @@ AcpiDbLoadTables (
return (Status);
}
- fprintf (stderr,
- "Acpi table [%4.4s] successfully installed and loaded\n",
+ AcpiOsPrintf ("Acpi table [%4.4s] successfully installed and loaded\n",
Table->Signature);
TableListHead = TableListHead->Next;
@@ -178,3 +170,4 @@ AcpiDbLoadTables (
return (AE_OK);
}
+#endif
diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c
index 51eb49b42acf..ba49633701d4 100644
--- a/source/components/tables/tbfadt.c
+++ b/source/components/tables/tbfadt.c
@@ -516,17 +516,19 @@ AcpiTbConvertFadt (
/*
- * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
+ * For ACPI 1.0 FADTs (revision 1), ensure that reserved fields which
* should be zero are indeed zero. This will workaround BIOSs that
* inadvertently place values in these fields.
*
* The ACPI 1.0 reserved fields that will be zeroed are the bytes located
* at offset 45, 55, 95, and the word located at offset 109, 110.
*
- * Note: The FADT revision value is unreliable. Only the length can be
- * trusted.
+ * Note: The FADT revision value is unreliable because of BIOS errors.
+ * The table length is instead used as the final word on the version.
+ *
+ * Note: FADT revision 3 is the ACPI 2.0 version of the FADT.
*/
- if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V2_SIZE)
+ if (AcpiGbl_FADT.Header.Length <= ACPI_FADT_V3_SIZE)
{
AcpiGbl_FADT.PreferredProfile = 0;
AcpiGbl_FADT.PstateControl = 0;
diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c
index 5fc07b76e0fb..85b9c3e4c561 100644
--- a/source/components/tables/tbutils.c
+++ b/source/components/tables/tbutils.c
@@ -273,7 +273,7 @@ AcpiTbGetRootTableEntry (
*
******************************************************************************/
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
AcpiTbParseRootTable (
ACPI_PHYSICAL_ADDRESS RsdpAddress)
{
diff --git a/source/components/tables/tbxface.c b/source/components/tables/tbxface.c
index 8c0caaee75e6..4c8c065cf373 100644
--- a/source/components/tables/tbxface.c
+++ b/source/components/tables/tbxface.c
@@ -103,7 +103,7 @@ AcpiAllocateRootTable (
*
******************************************************************************/
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
AcpiInitializeTables (
ACPI_TABLE_DESC *InitialTableArray,
UINT32 InitialTableCount,
@@ -179,7 +179,7 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeTables)
*
******************************************************************************/
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
AcpiReallocateRootTable (
void)
{
diff --git a/source/components/tables/tbxfload.c b/source/components/tables/tbxfload.c
index 645b9d57acdd..9fc26bdad1be 100644
--- a/source/components/tables/tbxfload.c
+++ b/source/components/tables/tbxfload.c
@@ -65,7 +65,7 @@
*
******************************************************************************/
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
AcpiLoadTables (
void)
{
@@ -300,7 +300,7 @@ UnlockAndExit:
*
******************************************************************************/
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
AcpiInstallTable (
ACPI_PHYSICAL_ADDRESS Address,
BOOLEAN Physical)
diff --git a/source/components/tables/tbxfroot.c b/source/components/tables/tbxfroot.c
index aaa24c470f65..2c7bce78763f 100644
--- a/source/components/tables/tbxfroot.c
+++ b/source/components/tables/tbxfroot.c
@@ -156,7 +156,7 @@ AcpiTbValidateRsdp (
*
******************************************************************************/
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
AcpiFindRootPointer (
ACPI_PHYSICAL_ADDRESS *TableAddress)
{
@@ -262,7 +262,7 @@ AcpiFindRootPointer (
return_ACPI_STATUS (AE_NOT_FOUND);
}
-ACPI_EXPORT_SYMBOL (AcpiFindRootPointer)
+ACPI_EXPORT_SYMBOL_INIT (AcpiFindRootPointer)
/*******************************************************************************
diff --git a/source/components/utilities/utbuffer.c b/source/components/utilities/utbuffer.c
index 863055f7375d..19c670796929 100644
--- a/source/components/utilities/utbuffer.c
+++ b/source/components/utilities/utbuffer.c
@@ -264,7 +264,7 @@ AcpiUtDumpBufferToFile (
if (!Buffer)
{
- AcpiUtFilePrintf (File, "Null Buffer Pointer in DumpBuffer!\n");
+ fprintf (File, "Null Buffer Pointer in DumpBuffer!\n");
return;
}
@@ -279,7 +279,7 @@ AcpiUtDumpBufferToFile (
{
/* Print current offset */
- AcpiUtFilePrintf (File, "%6.4X: ", (BaseOffset + i));
+ fprintf (File, "%6.4X: ", (BaseOffset + i));
/* Print 16 hex chars */
@@ -289,7 +289,7 @@ AcpiUtDumpBufferToFile (
{
/* Dump fill spaces */
- AcpiUtFilePrintf (File, "%*s", ((Display * 2) + 1), " ");
+ fprintf (File, "%*s", ((Display * 2) + 1), " ");
j += Display;
continue;
}
@@ -299,28 +299,28 @@ AcpiUtDumpBufferToFile (
case DB_BYTE_DISPLAY:
default: /* Default is BYTE display */
- AcpiUtFilePrintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]);
+ fprintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]);
break;
case DB_WORD_DISPLAY:
ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
- AcpiUtFilePrintf (File, "%04X ", Temp32);
+ fprintf (File, "%04X ", Temp32);
break;
case DB_DWORD_DISPLAY:
ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
- AcpiUtFilePrintf (File, "%08X ", Temp32);
+ fprintf (File, "%08X ", Temp32);
break;
case DB_QWORD_DISPLAY:
ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
- AcpiUtFilePrintf (File, "%08X", Temp32);
+ fprintf (File, "%08X", Temp32);
ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]);
- AcpiUtFilePrintf (File, "%08X ", Temp32);
+ fprintf (File, "%08X ", Temp32);
break;
}
@@ -331,29 +331,29 @@ AcpiUtDumpBufferToFile (
* Print the ASCII equivalent characters but watch out for the bad
* unprintable ones (printable chars are 0x20 through 0x7E)
*/
- AcpiUtFilePrintf (File, " ");
+ fprintf (File, " ");
for (j = 0; j < 16; j++)
{
if (i + j >= Count)
{
- AcpiUtFilePrintf (File, "\n");
+ fprintf (File, "\n");
return;
}
BufChar = Buffer[(ACPI_SIZE) i + j];
if (isprint (BufChar))
{
- AcpiUtFilePrintf (File, "%c", BufChar);
+ fprintf (File, "%c", BufChar);
}
else
{
- AcpiUtFilePrintf (File, ".");
+ fprintf (File, ".");
}
}
/* Done with that line. */
- AcpiUtFilePrintf (File, "\n");
+ fprintf (File, "\n");
i += 16;
}
diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c
index 6a298d175b34..10785399d7d5 100644
--- a/source/components/utilities/utdebug.c
+++ b/source/components/utilities/utdebug.c
@@ -708,33 +708,3 @@ AcpiTracePoint (
ACPI_EXPORT_SYMBOL (AcpiTracePoint)
#endif
-
-
-#ifdef ACPI_APPLICATION
-/*******************************************************************************
- *
- * FUNCTION: AcpiLogError
- *
- * PARAMETERS: Format - Printf format field
- * ... - Optional printf arguments
- *
- * RETURN: None
- *
- * DESCRIPTION: Print error message to the console, used by applications.
- *
- ******************************************************************************/
-
-void ACPI_INTERNAL_VAR_XFACE
-AcpiLogError (
- const char *Format,
- ...)
-{
- va_list Args;
-
- va_start (Args, Format);
- (void) AcpiUtFileVprintf (ACPI_FILE_ERR, Format, Args);
- va_end (Args);
-}
-
-ACPI_EXPORT_SYMBOL (AcpiLogError)
-#endif
diff --git a/source/components/utilities/utinit.c b/source/components/utilities/utinit.c
index 03c3e510b82d..c3da33d06cbb 100644
--- a/source/components/utilities/utinit.c
+++ b/source/components/utilities/utinit.c
@@ -226,7 +226,7 @@ AcpiUtInitGlobals (
AcpiGbl_NextOwnerIdOffset = 0;
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
AcpiGbl_OsiMutex = NULL;
- AcpiGbl_MaxLoopIterations = 0xFFFF;
+ AcpiGbl_MaxLoopIterations = ACPI_MAX_LOOP_COUNT;
/* Hardware oriented */
diff --git a/source/components/utilities/utpredef.c b/source/components/utilities/utpredef.c
index 0f6658ecf7f8..ced72a7331a3 100644
--- a/source/components/utilities/utpredef.c
+++ b/source/components/utilities/utpredef.c
@@ -196,8 +196,6 @@ AcpiUtGetExpectedReturnTypes (
******************************************************************************/
#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
-#include <stdio.h>
-#include <string.h>
/* Local prototypes */
diff --git a/source/components/utilities/utprint.c b/source/components/utilities/utprint.c
index e01f1734a94f..7d4c48939aeb 100644
--- a/source/components/utilities/utprint.c
+++ b/source/components/utilities/utprint.c
@@ -416,7 +416,7 @@ AcpiUtFormatNumber (
/*******************************************************************************
*
- * FUNCTION: AcpiUtVsnprintf
+ * FUNCTION: vsnprintf
*
* PARAMETERS: String - String with boundary
* Size - Boundary of the string
@@ -430,7 +430,7 @@ AcpiUtFormatNumber (
******************************************************************************/
int
-AcpiUtVsnprintf (
+vsnprintf (
char *String,
ACPI_SIZE Size,
const char *Format,
@@ -713,7 +713,7 @@ AcpiUtVsnprintf (
/*******************************************************************************
*
- * FUNCTION: AcpiUtSnprintf
+ * FUNCTION: snprintf
*
* PARAMETERS: String - String with boundary
* Size - Boundary of the string
@@ -726,7 +726,7 @@ AcpiUtVsnprintf (
******************************************************************************/
int
-AcpiUtSnprintf (
+snprintf (
char *String,
ACPI_SIZE Size,
const char *Format,
@@ -737,7 +737,38 @@ AcpiUtSnprintf (
va_start (Args, Format);
- Length = AcpiUtVsnprintf (String, Size, Format, Args);
+ Length = vsnprintf (String, Size, Format, Args);
+ va_end (Args);
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: sprintf
+ *
+ * PARAMETERS: String - String with boundary
+ * Format, ... - Standard printf format
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a string.
+ *
+ ******************************************************************************/
+
+int
+sprintf (
+ char *String,
+ const char *Format,
+ ...)
+{
+ va_list Args;
+ int Length;
+
+
+ va_start (Args, Format);
+ Length = vsnprintf (String, ACPI_UINT32_MAX, Format, Args);
va_end (Args);
return (Length);
@@ -747,7 +778,69 @@ AcpiUtSnprintf (
#ifdef ACPI_APPLICATION
/*******************************************************************************
*
- * FUNCTION: AcpiUtFileVprintf
+ * FUNCTION: vprintf
+ *
+ * PARAMETERS: Format - Standard printf format
+ * Args - Argument list
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to stdout using argument list pointer.
+ *
+ ******************************************************************************/
+
+int
+vprintf (
+ const char *Format,
+ va_list Args)
+{
+ ACPI_CPU_FLAGS Flags;
+ int Length;
+
+
+ Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
+ Length = vsnprintf (AcpiGbl_PrintBuffer,
+ sizeof (AcpiGbl_PrintBuffer), Format, Args);
+
+ (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, ACPI_FILE_OUT);
+ AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: printf
+ *
+ * PARAMETERS: Format, ... - Standard printf format
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to stdout.
+ *
+ ******************************************************************************/
+
+int
+printf (
+ const char *Format,
+ ...)
+{
+ va_list Args;
+ int Length;
+
+
+ va_start (Args, Format);
+ Length = vprintf (Format, Args);
+ va_end (Args);
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: vfprintf
*
* PARAMETERS: File - File descriptor
* Format - Standard printf format
@@ -760,8 +853,8 @@ AcpiUtSnprintf (
******************************************************************************/
int
-AcpiUtFileVprintf (
- ACPI_FILE File,
+vfprintf (
+ FILE *File,
const char *Format,
va_list Args)
{
@@ -770,10 +863,10 @@ AcpiUtFileVprintf (
Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
- Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
+ Length = vsnprintf (AcpiGbl_PrintBuffer,
sizeof (AcpiGbl_PrintBuffer), Format, Args);
- (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
+ (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, File);
AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
return (Length);
@@ -782,7 +875,7 @@ AcpiUtFileVprintf (
/*******************************************************************************
*
- * FUNCTION: AcpiUtFilePrintf
+ * FUNCTION: fprintf
*
* PARAMETERS: File - File descriptor
* Format, ... - Standard printf format
@@ -794,8 +887,8 @@ AcpiUtFileVprintf (
******************************************************************************/
int
-AcpiUtFilePrintf (
- ACPI_FILE File,
+fprintf (
+ FILE *File,
const char *Format,
...)
{
@@ -804,7 +897,7 @@ AcpiUtFilePrintf (
va_start (Args, Format);
- Length = AcpiUtFileVprintf (File, Format, Args);
+ Length = vfprintf (File, Format, Args);
va_end (Args);
return (Length);
diff --git a/source/components/utilities/uttrack.c b/source/components/utilities/uttrack.c
index 9efa9d6ec75d..2902e2c8b6fa 100644
--- a/source/components/utilities/uttrack.c
+++ b/source/components/utilities/uttrack.c
@@ -107,14 +107,12 @@ AcpiUtCreateList (
ACPI_MEMORY_LIST *Cache;
- Cache = AcpiOsAllocate (sizeof (ACPI_MEMORY_LIST));
+ Cache = AcpiOsAllocateZeroed (sizeof (ACPI_MEMORY_LIST));
if (!Cache)
{
return (AE_NO_MEMORY);
}
- memset (Cache, 0, sizeof (ACPI_MEMORY_LIST));
-
Cache->ListName = ListName;
Cache->ObjectSize = ObjectSize;
diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c
index a8452c32955b..ff91886466a3 100644
--- a/source/components/utilities/utxface.c
+++ b/source/components/utilities/utxface.c
@@ -63,7 +63,7 @@
*
******************************************************************************/
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
AcpiTerminate (
void)
{
diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c
index 2a518bc82d99..7d7758815869 100644
--- a/source/components/utilities/utxfinit.c
+++ b/source/components/utilities/utxfinit.c
@@ -72,7 +72,7 @@ AeDoObjectOverrides (
*
******************************************************************************/
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
AcpiInitializeSubsystem (
void)
{
@@ -151,7 +151,7 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeSubsystem)
*
******************************************************************************/
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
AcpiEnableSubsystem (
UINT32 Flags)
{
@@ -263,7 +263,7 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiEnableSubsystem)
*
******************************************************************************/
-ACPI_STATUS
+ACPI_STATUS ACPI_INIT_FUNCTION
AcpiInitializeObjects (
UINT32 Flags)
{