Renamed Osd interfaces, renamed header files

date	2000.06.23.21.48.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 20:39:04 +00:00
parent 3f9610f36c
commit d612bc33f3
4 changed files with 167 additions and 333 deletions

View File

@ -145,17 +145,17 @@ extern char *Filename;
*/
typedef struct Region
{
UINT32 Address;
UINT32 Length;
void *Buffer;
void *NextRegion;
UINT32 Address;
UINT32 Length;
void *Buffer;
void *NextRegion;
} REGION;
typedef struct DebugRegions
{
UINT32 NumberOfRegions;
REGION *RegionList;
UINT32 NumberOfRegions;
REGION *RegionList;
} DEBUG_REGIONS;
@ -176,7 +176,6 @@ typedef union ptr_ovl
} PTR_OVL;
#define GET_SEGMENT(ptr) ((UINT16)(_segment)(ptr))
#define GET_OFFSET(ptr) ((UINT16)(UINT32) (ptr))
#define GET_PHYSICAL_ADDRESS(ptr) (((((UINT32)GET_SEGMENT(ptr)) << 4)) + GET_OFFSET(ptr))
@ -188,7 +187,7 @@ typedef union ptr_ovl
#define TEST_OUTPUT_LEVEL(lvl) if ((lvl) & OutputLevel)
#define OSD_PRINT(lvl,fp) TEST_OUTPUT_LEVEL(lvl) {\
AcpiOsdPrintf PARAM_LIST(fp);}
AcpiOsPrintf PARAM_LIST(fp);}
int
getopt (
@ -264,5 +263,4 @@ ACPI_STATUS
AdDisplayStatistics (void);
#endif /* _ADCOMMON */

View File

@ -124,12 +124,10 @@
#include <stdio.h>
#define _COMPONENT PARSER
MODULE_NAME ("aeexec");
ACPI_GENERIC_OP *AcpiGbl_ParsedNamespaceRoot;
ACPI_GENERIC_OP *root;
UINT8 *AmlPtr;
@ -137,7 +135,7 @@ UINT32 AcpiAmlLength;
UINT8 *DsdtPtr;
UINT32 AcpiDsdtLength;
DEBUG_REGIONS Regions;
DEBUG_REGIONS Regions;
/******************************************************************************
@ -149,7 +147,7 @@ DEBUG_REGIONS Regions;
* RETURN: Status
*
* DESCRIPTION: Test handler - Handles some dummy regions via memory that can
* be manipulated in Ring 3.
* be manipulated in Ring 3.
*
*****************************************************************************/
@ -162,42 +160,42 @@ RegionHandler (
void *Context)
{
ACPI_OBJECT_INTERNAL *RegionObject = (ACPI_OBJECT_INTERNAL *)Context;
UINT32 BaseAddress;
UINT32 Length;
BOOLEAN BufferExists;
REGION *RegionElement;
ACPI_OBJECT_INTERNAL *RegionObject = (ACPI_OBJECT_INTERNAL *)Context;
UINT32 BaseAddress;
UINT32 Length;
BOOLEAN BufferExists;
REGION *RegionElement;
void *BufferValue;
UINT32 ByteWidth;
printf ("Received an OpRegion request\n");
/*
* If the object is not a region, simply return
*/
if (RegionObject->Region.Type != ACPI_TYPE_REGION)
{
return AE_OK;
}
/*
* If the object is not a region, simply return
*/
if (RegionObject->Region.Type != ACPI_TYPE_REGION)
{
return AE_OK;
}
/*
* Find the region's address space and length before searching
* the linked list.
*/
BaseAddress = RegionObject->Region.Address;
Length = RegionObject->Region.Length;
/*
* Find the region's address space and length before searching
* the linked list.
*/
BaseAddress = RegionObject->Region.Address;
Length = RegionObject->Region.Length;
/*
* Search through the linked list for this region's buffer
*/
/*
* Search through the linked list for this region's buffer
*/
BufferExists = FALSE;
RegionElement = Regions.RegionList;
if (0 != Regions.NumberOfRegions)
{
{
while (!BufferExists && RegionElement)
{
{
if (RegionElement->Address == BaseAddress &&
RegionElement->Length == Length)
{
@ -207,60 +205,60 @@ RegionHandler (
{
RegionElement = RegionElement->NextRegion;
}
}
}
}
}
/*
* If the Region buffer does not exist, create it now
*/
if (FALSE == BufferExists)
{
/*
* Do the memory allocations first
*/
RegionElement = AcpiOsdAllocate (sizeof(REGION));
if (!RegionElement)
{
return AE_NO_MEMORY;
}
/*
* If the Region buffer does not exist, create it now
*/
if (FALSE == BufferExists)
{
/*
* Do the memory allocations first
*/
RegionElement = AcpiOsAllocate (sizeof(REGION));
if (!RegionElement)
{
return AE_NO_MEMORY;
}
RegionElement->Buffer = AcpiOsdAllocate (Length);
if (!RegionElement->Buffer)
{
AcpiOsdFree (RegionElement);
return AE_NO_MEMORY;
}
RegionElement->Buffer = AcpiOsAllocate (Length);
if (!RegionElement->Buffer)
{
AcpiOsFree (RegionElement);
return AE_NO_MEMORY;
}
RegionElement->Address = BaseAddress;
RegionElement->Length = Length;
MEMSET(RegionElement->Buffer, 0, Length);
RegionElement->Address = BaseAddress;
RegionElement->NextRegion = NULL;
RegionElement->Length = Length;
MEMSET(RegionElement->Buffer, 0, Length);
RegionElement->NextRegion = NULL;
/*
* Increment the number of regions and put this one
* at the head of the list as it will probably get accessed
* more often anyway.
*/
Regions.NumberOfRegions += 1;
/*
* Increment the number of regions and put this one
* at the head of the list as it will probably get accessed
* more often anyway.
*/
Regions.NumberOfRegions += 1;
if (NULL != Regions.RegionList)
{
RegionElement->NextRegion = Regions.RegionList->NextRegion;
}
Regions.RegionList = RegionElement;
}
/*
* The buffer exists and is pointed to by RegionElement.
* We now need to verify the request is valid and perform the operation.
Regions.RegionList = RegionElement;
}
/*
* The buffer exists and is pointed to by RegionElement.
* We now need to verify the request is valid and perform the operation.
*
* NOTE: RegionElement->Length is in bytes, therefore it is multiplied by
* the bitwidth of a byte.
*/
*/
if ((Address + BitWidth) > (RegionElement->Address + (RegionElement->Length * 8)))
{
return AE_BUFFER_OVERFLOW;
@ -363,7 +361,7 @@ NotifyHandler (
printf ("**** Method Error 0x%X: Results not equal\n", Value);
if (DebugFile)
{
AcpiOsdPrintf ("**** Method Error: Results not equal\n");
AcpiOsPrintf ("**** Method Error: Results not equal\n");
}
break;
@ -372,7 +370,7 @@ NotifyHandler (
printf ("**** Method Error: Incorrect numeric result\n");
if (DebugFile)
{
AcpiOsdPrintf ("**** Method Error: Incorrect numeric result\n");
AcpiOsPrintf ("**** Method Error: Incorrect numeric result\n");
}
break;
@ -381,7 +379,7 @@ NotifyHandler (
printf ("**** Method Error: An operand was overwritten\n");
if (DebugFile)
{
AcpiOsdPrintf ("**** Method Error: An operand was overwritten\n");
AcpiOsPrintf ("**** Method Error: An operand was overwritten\n");
}
break;
@ -390,7 +388,7 @@ NotifyHandler (
printf ("**** Received a notify, value 0x%X\n", Value);
if (DebugFile)
{
AcpiOsdPrintf ("**** Received a notify, value 0x%X\n", Value);
AcpiOsPrintf ("**** Received a notify, value 0x%X\n", Value);
}
break;
}
@ -439,12 +437,12 @@ AeInstallHandlers (void)
}
}
/*
* Initialize the global Region Handler space
* MCW 3/23/00
*/
Regions.NumberOfRegions = 0;
Regions.RegionList = NULL;
/*
* Initialize the global Region Handler space
* MCW 3/23/00
*/
Regions.NumberOfRegions = 0;
Regions.RegionList = NULL;
return Status;
}
@ -518,7 +516,6 @@ AdSecondPassParse (
}
/******************************************************************************
*
* FUNCTION: AdGetTables
@ -544,5 +541,3 @@ xxxAdGetTables (
}

View File

@ -118,7 +118,6 @@
#include <string.h>
#include "acpi.h"
#include "acapi.h"
#include "amlcode.h"
#include "parser.h"
#include "tables.h"
@ -162,7 +161,6 @@ usage (void)
}
/******************************************************************************
*
* FUNCTION: main
@ -187,8 +185,8 @@ main (
/* Init globals */
Buffer = malloc (BUFFER_SIZE);
DebugLevel = DEBUG_DEFAULT & (~TRACE_TABLES);
DebugLayer = 0xFFFFFFFF;
AcpiDbgLevel = DEBUG_DEFAULT & (~TRACE_TABLES);
AcpiDbgLayer = 0xFFFFFFFF;
printf ("ACPI AML Execution/Debug Utility ");
@ -220,8 +218,8 @@ main (
break;
case 'l':
DebugLevel = strtoul (optarg, NULL, 0);
printf ("Debug Level: %lX\n", DebugLevel);
AcpiDbgLevel = strtoul (optarg, NULL, 0);
printf ("Debug Level: %lX\n", AcpiDbgLevel);
break;
case 'o':
@ -236,7 +234,7 @@ main (
usage();
return -1;
}
/* Init ACPI and start debugger thread */

View File

@ -1,8 +1,7 @@
/******************************************************************************
*
*
* Module Name: asmain - Main module for the acpi source processor utility
* $Revision: 1.40 $
*
*****************************************************************************/
@ -10,8 +9,8 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
* All rights reserved.
* Some or all of this work - Copyright (c) 1999, Intel Corp. All rights
* reserved.
*
* 2. License
*
@ -39,9 +38,9 @@
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
@ -49,11 +48,11 @@
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
@ -87,7 +86,7 @@
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
@ -117,13 +116,11 @@
#include "acpisrc.h"
#include "acapps.h"
/* Globals */
UINT32 Gbl_Tabs = 0;
UINT32 Gbl_MissingBraces = 0;
UINT32 Gbl_NonAnsiComments = 0;
UINT32 Gbl_Files = 0;
UINT32 Gbl_WhiteLines = 0;
@ -137,9 +134,7 @@ char *Gbl_FileBuffer;
UINT32 Gbl_FileSize;
BOOLEAN Gbl_VerboseMode = FALSE;
BOOLEAN Gbl_BatchMode = FALSE;
BOOLEAN Gbl_DebugStatementsMode = FALSE;
BOOLEAN Gbl_MadeChanges = FALSE;
BOOLEAN Gbl_Overwrite = FALSE;
/******************************************************************************
@ -149,46 +144,50 @@ BOOLEAN Gbl_Overwrite = FALSE;
******************************************************************************/
ACPI_STRING_TABLE StandardDataTypes[] = {
/* Declarations first */
"UINT32_BIT ", "unsigned int", REPLACE_SUBSTRINGS,
"UINT32_BIT ", "unsigned int",
"UINT32 ", "unsigned int", REPLACE_SUBSTRINGS,
"UINT16 ", "unsigned short", REPLACE_SUBSTRINGS,
"UINT8 ", "unsigned char", REPLACE_SUBSTRINGS,
"BOOLEAN ", "unsigned char", REPLACE_SUBSTRINGS,
"UINT32 ", "unsigned int",
"UINT16 ", "unsigned short",
"UINT8 ", "unsigned char",
"BOOLEAN ", "unsigned char",
/* Now do embedded typecasts */
"UINT32", "unsigned int", REPLACE_SUBSTRINGS,
"UINT16", "unsigned short", REPLACE_SUBSTRINGS,
"UINT8", "unsigned char", REPLACE_SUBSTRINGS,
"BOOLEAN", "unsigned char", REPLACE_SUBSTRINGS,
"UINT32", "unsigned int",
"UINT16", "unsigned short",
"UINT8", "unsigned char",
"BOOLEAN", "unsigned char",
"INT32 ", "int ", REPLACE_SUBSTRINGS,
"INT32", "int", REPLACE_SUBSTRINGS,
"INT16", "short", REPLACE_SUBSTRINGS,
"INT8", "char", REPLACE_SUBSTRINGS,
"INT32 ", "int ",
"INT32", "int",
"INT16", "short",
"INT8", "char",
/* Put back anything we broke (such as anything with _INT32_ in it) */
"_int_", "_INT32_", REPLACE_SUBSTRINGS,
"_unsigned int_", "_UINT32_", REPLACE_SUBSTRINGS,
NULL, NULL, 0
"_int_", "_INT32_",
"_unsigned int_", "_UINT32_",
NULL, NULL
};
/******************************************************************************
*
* Linux-specific translation tables
*
******************************************************************************/
char LinuxHeader[] =
char LinuxHeader[] =
"/*\n"
" * Copyright (C) 2000 - 2002, R. Byron Moore\n"
" * Copyright (C) 2000 R. Byron Moore\n"
" *\n"
" * This program is free software; you can redistribute it and/or modify\n"
" * it under the terms of the GNU General Public License as published by\n"
@ -206,162 +205,37 @@ char LinuxHeader[] =
" */\n";
ACPI_STRING_TABLE LinuxDataTypes[] = {
/* Declarations first */
"UINT32_BIT ", "u32 ", REPLACE_WHOLE_WORD,
"UINT32_BIT ", "u32 ",
"UINT64 ", "u64 ", REPLACE_WHOLE_WORD,
"UINT32 ", "u32 ", REPLACE_WHOLE_WORD,
"UINT16 ", "u16 ", REPLACE_WHOLE_WORD,
"UINT8 ", "u8 ", REPLACE_WHOLE_WORD,
"BOOLEAN ", "u8 ", REPLACE_WHOLE_WORD,
"UINT32 ", "u32 ",
"UINT16 ", "u16 ",
"UINT8 ", "u8 ",
"BOOLEAN ", "u8 ",
/* Now do embedded typecasts */
"UINT64", "u64", REPLACE_WHOLE_WORD,
"UINT32", "u32", REPLACE_WHOLE_WORD,
"UINT16", "u16", REPLACE_WHOLE_WORD,
"UINT8", "u8", REPLACE_WHOLE_WORD,
"BOOLEAN", "u8", REPLACE_WHOLE_WORD,
"UINT32", "u32",
"UINT16", "u16",
"UINT8", "u8",
"BOOLEAN", "u8",
"INT64 ", "s64 ", REPLACE_WHOLE_WORD,
"INT64", "s64", REPLACE_WHOLE_WORD,
"INT32 ", "s32 ", REPLACE_WHOLE_WORD,
"INT32", "s32", REPLACE_WHOLE_WORD,
"INT16 ", "s16 ", REPLACE_WHOLE_WORD,
"INT8 ", "s8 ", REPLACE_WHOLE_WORD,
"INT16", "s16", REPLACE_WHOLE_WORD,
"INT8", "s8", REPLACE_WHOLE_WORD,
"INT32 ", "s32 ",
"INT32", "s32",
"INT16 ", "s16 ",
"INT8 ", "s8 ",
"INT16", "s16",
"INT8", "s8",
/* Put back anything we broke (such as anything with _INTxx_ in it) */
/* Put back anything we broke (such as anything with _INT32_ in it) */
/* No longer needed?
"_s32_", "_INT32_", REPLACE_SUBSTRINGS,
"_u32_", "_UINT32_", REPLACE_SUBSTRINGS,
"_s16_", "_INT16_", REPLACE_SUBSTRINGS,
"_u16_", "_UINT16_", REPLACE_SUBSTRINGS,
"_s8_", "_INT8_", REPLACE_SUBSTRINGS,
"_u8_", "_UINT8_", REPLACE_SUBSTRINGS,
*/
NULL, NULL, 0};
ACPI_IDENTIFIER_TABLE LinuxLowerCase[] = {
/*"ACPI_IO_ADDRESS ", "acpi_io_address ",*/
/*"ACPI_PHYSICAL_ADDRESS ", "acpi_physical_address ",*/
/*"NATIVE_UINT ", "native_uint ",*/
/*"NATIVE_INT ", "native_int ",*/
/*"NATIVE_CHAR ", "native_char ",*/
"ACPI_ADR_SPACE_HANDLER",
"ACPI_ADR_SPACE_SETUP",
"ACPI_BUFFER",
"ACPI_BUS_ATTRIBUTE",
"ACPI_COMMON_FACS",
"ACPI_COMMON_STATE",
"ACPI_CONTROL_STATE",
"ACPI_DEBUG_MEM_BLOCK",
"ACPI_DEBUG_MEM_HEADER",
"ACPI_DEBUG_PRINT_INFO",
"ACPI_DEVICE_ID",
"ACPI_DEVICE_INFO",
"ACPI_DEVICE_WALK_INFO",
"ACPI_EVENT_HANDLER",
"ACPI_EVENT_STATUS",
"ACPI_EVENT_TYPE",
"ACPI_FIELD_INFO",
"ACPI_FIXED_EVENT_INFO",
"ACPI_GENERIC_ADDRESS",
"ACPI_GENERIC_STATE",
"ACPI_GET_DEVICES_INFO",
"ACPI_GPE_HANDLER",
"ACPI_GPE_LEVEL_INFO",
"ACPI_GPE_REGISTERS",
"ACPI_HANDLE",
"ACPI_INTEGER",
"ACPI_INIT_WALK_INFO",
"ACPI_IO_ATTRIBUTE",
"ACPI_MEM_SPACE_CONTEXT",
"ACPI_MEMORY_ATTRIBUTE",
"ACPI_MUTEX",
"ACPI_MUTEX_INFO",
"ACPI_NAME",
"ACPI_NAMESPACE_NODE",
"ACPI_NAMESTRING_INFO",
"ACPI_NOTIFY_HANDLER",
"ACPI_NOTIFY_INFO",
"ACPI_OBJ_INFO_HEADER",
"ACPI_OBJECT",
"ACPI_OBJECT_LIST",
"ACPI_OBJECT_TYPE",
"ACPI_OBJECT_TYPE8",
"ACPI_OPCODE_INFO",
"ACPI_OPERAND_OBJECT",
"ACPI_OWNER_ID",
"ACPI_PARSE_DOWNWARDS",
"ACPI_PARSE_OBJECT",
"ACPI_PARSE_STATE",
"ACPI_PARSE_UPWARDS",
"ACPI_PARSE_VALUE",
"ACPI_PARSE2_OBJECT",
"ACPI_PCI_ID",
"ACPI_PKG_INFO",
"ACPI_PKG_STATE",
"ACPI_PSCOPE_STATE",
"ACPI_RESOURCE",
"ACPI_RESOURCE_ADDRESS16",
"ACPI_RESOURCE_ADDRESS32",
"ACPI_RESOURCE_ADDRESS64",
"ACPI_RESOURCE_ATTRIBUTE",
"ACPI_RESOURCE_DATA",
"ACPI_RESOURCE_DMA",
"ACPI_RESOURCE_EXT_IRQ",
"ACPI_RESOURCE_FIXED_IO",
"ACPI_RESOURCE_FIXED_MEM32",
"ACPI_RESOURCE_IO",
"ACPI_RESOURCE_IRQ",
"ACPI_RESOURCE_MEM24",
"ACPI_RESOURCE_MEM32",
"ACPI_RESOURCE_SOURCE",
"ACPI_RESOURCE_START_DPF",
"ACPI_RESOURCE_TYPE",
"ACPI_RESOURCE_VENDOR",
"ACPI_RESULT_VALUES",
"ACPI_SCOPE_STATE",
"ACPI_STATUS",
"ACPI_STRING",
"ACPI_SYSTEM_INFO",
"ACPI_TABLE_DESC",
"ACPI_TABLE_HEADER",
"ACPI_TABLE_INFO",
"ACPI_TABLE_TYPE",
"ACPI_TABLE_TYPE",
"ACPI_UPDATE_STATE",
"ACPI_WALK_CALLBACK",
"ACPI_WALK_INFO",
"ACPI_WALK_LIST",
"ACPI_WALK_STATE",
"ACPI_DB_METHOD_INFO",
"FACS_DESCRIPTOR_REV071",
"FACS_DESCRIPTOR_REV1",
"FACS_DESCRIPTOR_REV2",
"FADT_DESCRIPTOR_REV071",
"FADT_DESCRIPTOR_REV1",
"FADT_DESCRIPTOR_REV2",
"ACPI_FIND_CONTEXT",
"ACPI_NS_SEARCH_DATA",
"ACPI_INTERPRETER_MODE",
"ACPI_PCI_ROUTING_TABLE",
"ACPI_PREDEFINED_NAMES",
"UINT64_OVERLAY",
"UINT64_STRUCT",
"XSDT_DESCRIPTOR",
NULL,
"_s32_", "_INT32_",
"_u32_", "_UINT32_",
NULL, NULL
};
@ -383,16 +257,14 @@ ACPI_IDENTIFIER_TABLE LinuxConditionalIdentifiers[] = {
ACPI_CONVERSION_TABLE LinuxConversionTable = {
LinuxHeader,
FLG_NO_CARRIAGE_RETURNS | FLG_LOWERCASE_DIRNAMES,
LinuxLowerCase,
FLG_NO_CARRIAGE_RETURNS,
/* C source files */
LinuxDataTypes,
LinuxLineIdentifiers,
NULL,
(CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES | CVT_CHECK_BRACES | CVT_TRIM_LINES | CVT_BRACES_ON_SAME_LINE |
(CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES | CVT_TRIM_LINES | CVT_BRACES_ON_SAME_LINE |
CVT_MIXED_CASE_TO_UNDERSCORES | CVT_LOWER_CASE_IDENTIFIERS | CVT_REMOVE_DEBUG_MACROS | CVT_TRIM_WHITESPACE |
CVT_REMOVE_EMPTY_BLOCKS | CVT_SPACES_TO_TABS8),
@ -402,11 +274,12 @@ ACPI_CONVERSION_TABLE LinuxConversionTable = {
NULL,
LinuxConditionalIdentifiers,
(CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES | CVT_TRIM_LINES | CVT_MIXED_CASE_TO_UNDERSCORES |
CVT_LOWER_CASE_IDENTIFIERS | CVT_TRIM_WHITESPACE |
CVT_LOWER_CASE_IDENTIFIERS | CVT_TRIM_WHITESPACE |
CVT_REMOVE_EMPTY_BLOCKS| CVT_SPACES_TO_TABS8),
};
/******************************************************************************
*
* Code cleanup translation tables
@ -418,13 +291,13 @@ ACPI_CONVERSION_TABLE CleanupConversionTable = {
NULL,
FLG_DEFAULT_FLAGS,
NULL,
/* C source files */
NULL,
NULL,
NULL,
(CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES | CVT_CHECK_BRACES | CVT_TRIM_LINES | CVT_TRIM_WHITESPACE),
(CVT_COUNT_TABS | CVT_COUNT_NON_ANSI_COMMENTS | CVT_COUNT_LINES | CVT_TRIM_LINES | CVT_TRIM_WHITESPACE),
/* C header files */
@ -439,7 +312,6 @@ ACPI_CONVERSION_TABLE StatsConversionTable = {
NULL,
FLG_NO_FILE_OUTPUT,
NULL,
/* C source files */
@ -457,6 +329,8 @@ ACPI_CONVERSION_TABLE StatsConversionTable = {
};
/******************************************************************************
*
* Customizable translation tables
@ -466,11 +340,8 @@ ACPI_CONVERSION_TABLE StatsConversionTable = {
ACPI_STRING_TABLE CustomReplacements[] = {
"1999 - 2002, Intel Corp", "1999 - 2002, Intel Corp", REPLACE_WHOLE_WORD,
"1999, Intel Corp", "1999 - 2002, Intel Corp", REPLACE_WHOLE_WORD,
" All rights\n * reserved.", "\n * All rights reserved.", REPLACE_WHOLE_WORD,
"Copyright (C) 2000, 2001", "Copyright (C) 2000 - 2002", REPLACE_WHOLE_WORD,
NULL, NULL, 0
"AcpiOsd", "AcpiOs",
NULL, NULL
};
@ -478,7 +349,6 @@ ACPI_CONVERSION_TABLE CustomConversionTable = {
NULL,
FLG_DEFAULT_FLAGS,
NULL,
/* C source files */
@ -496,6 +366,7 @@ ACPI_CONVERSION_TABLE CustomConversionTable = {
};
/******************************************************************************
*
* FUNCTION: AsExaminePaths
@ -539,7 +410,6 @@ AsExaminePaths (
return 0;
}
if (!stricmp (Source, Target))
{
printf ("Target path is the same as the source path, overwrite?\n");
@ -551,8 +421,6 @@ AsExaminePaths (
{
return -1;
}
Gbl_Overwrite = TRUE;
}
else
@ -572,6 +440,7 @@ AsExaminePaths (
}
}
return 0;
}
@ -591,7 +460,6 @@ AsDisplayStats (void)
printf ("\nAcpiSrc statistics:\n\n");
printf ("%6d Files processed\n", Gbl_Files);
printf ("%6d Tabs found\n", Gbl_Tabs);
printf ("%6d Missing if/else braces\n", Gbl_MissingBraces);
printf ("%6d Non-ANSI comments found\n", Gbl_NonAnsiComments);
printf ("%6d Total Lines\n", Gbl_TotalLines);
printf ("%6d Lines of code\n", Gbl_SourceLines);
@ -607,7 +475,7 @@ AsDisplayStats (void)
/******************************************************************************
*
* FUNCTION: AsDisplayUsage
* FUNCTION: AsDisplayUsage
*
* DESCRIPTION: Usage message
*
@ -618,13 +486,11 @@ AsDisplayUsage (void)
{
printf ("\n");
printf ("Usage: acpisrc [-c|l|u] [-dsvy] <SourceDir> <DestinationDir>\n\n");
printf ("Usage: acpisrc [-clsvy] <SourceDir> <DestinationDir>\n\n");
printf ("Where: -c Generate cleaned version of the source\n");
printf (" -l Generate Linux version of the source\n");
printf (" -u Generate Custom source translation\n");
printf ("\n");
printf (" -d Leave debug statements in code\n");
printf (" -s Generate source statistics only\n");
printf (" -u Custom source translation\n");
printf (" -v Verbose mode\n");
printf (" -y Suppress file overwrite prompts\n");
printf ("\n");
@ -640,9 +506,9 @@ AsDisplayUsage (void)
*
******************************************************************************/
int ACPI_SYSTEM_XFACE
int
main (
NATIVE_UINT argc,
NATIVE_UINT argc,
char *argv[])
{
int j;
@ -651,7 +517,7 @@ main (
char *TargetPath;
UINT32 FileType;
printf ("ACPI Source Code Conversion Utility ");
printf ("version [%s]\n", __DATE__);
@ -663,7 +529,7 @@ main (
/* Command line options */
while ((j = AcpiGetopt (argc, argv, "lcsuvyd")) != EOF) switch(j)
while ((j = getopt (argc, argv, "lcsuvy")) != EOF) switch(j)
{
case 'l':
/* Linux code generation */
@ -685,7 +551,7 @@ main (
break;
case 'u':
/* custom conversion */
/* Cleanup code */
printf ("Custom source translation\n");
ConversionTable = &CustomConversionTable;
@ -703,27 +569,14 @@ main (
Gbl_BatchMode = TRUE;
break;
case 'd':
/* Leave debug statements in */
Gbl_DebugStatementsMode = TRUE;
break;
default:
default:
AsDisplayUsage ();
return -1;
}
SourcePath = argv[AcpiGbl_Optind];
if (!SourcePath)
{
printf ("Missing source path\n");
AsDisplayUsage ();
return -1;
}
TargetPath = argv[AcpiGbl_Optind+1];
SourcePath = argv[optind];
TargetPath = argv[optind+1];
if (!ConversionTable)
{
@ -735,16 +588,6 @@ main (
ConversionTable = &StatsConversionTable;
}
else if (!TargetPath)
{
TargetPath = SourcePath;
}
if (Gbl_DebugStatementsMode)
{
ConversionTable->SourceFunctions &= ~CVT_REMOVE_DEBUG_MACROS;
}
/* Check source and target paths and files */
@ -766,14 +609,14 @@ main (
{
/* Process a single file */
/* TBD: Need to differentiate between source and header files !! */
AsProcessOneFile (ConversionTable, NULL, TargetPath, 0, SourcePath, FILE_TYPE_SOURCE);
AsProcessOneFile (ConversionTable, NULL, TargetPath, 0, SourcePath, FILE_TYPE_HEADER);
}
/* Always display final summary and stats */
AsDisplayStats ();
return 0;
return 0;
}