Overhaul of the NATIVE* types. renamed to ACPI_NATIVE*, eliminated

use of MAX32 and MIN32 types


date	2002.12.16.23.55.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 20:43:23 +00:00
parent 59253303d4
commit 4a38f27a1a
3 changed files with 127 additions and 38 deletions

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: acpisrc.h - Include file for AcpiSrc utility
* $Revision: 1.16 $
* $Revision: 1.17 $
*
*****************************************************************************/
@ -332,7 +332,7 @@ AsRemoveConditionalCompile (
char *Buffer,
char *Keyword);
NATIVE_INT
ACPI_NATIVE_INT
AsProcessTree (
ACPI_CONVERSION_TABLE *ConversionTable,
char *SourcePath,
@ -360,18 +360,18 @@ AsConvertFile (
ACPI_CONVERSION_TABLE *ConversionTable,
char *FileBuffer,
char *Filename,
NATIVE_INT FileType);
ACPI_NATIVE_INT FileType);
NATIVE_INT
ACPI_NATIVE_INT
AsProcessOneFile (
ACPI_CONVERSION_TABLE *ConversionTable,
char *SourcePath,
char *TargetPath,
int MaxPathLength,
char *Filename,
NATIVE_INT FileType);
ACPI_NATIVE_INT FileType);
NATIVE_INT
ACPI_NATIVE_INT
AsCheckForDirectory (
char *SourceDirPath,
char *TargetDirPath,

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: asfile - Main module for the acpi source processor utility
* $Revision: 1.16 $
* $Revision: 1.18 $
*
*****************************************************************************/
@ -127,7 +127,7 @@
*
******************************************************************************/
NATIVE_INT
ACPI_NATIVE_INT
AsProcessTree (
ACPI_CONVERSION_TABLE *ConversionTable,
char *SourcePath,
@ -185,12 +185,11 @@ AsProcessTree (
{
VERBOSE_PRINT (("File: %s\n", FindInfo.name));
AsProcessOneFile (ConversionTable, SourcePath, TargetPath, MaxPathLength, FindInfo.name, FILE_TYPE_SOURCE);
}
}
_findclose (FindHandle);
}
/* Do the C header files */
strcpy (FileSpec, SourcePath);
@ -257,7 +256,6 @@ AsProcessTree (
_findclose (FindHandle);
}
/* Do the subdirectories */
strcpy (FileSpec, SourcePath);
@ -288,12 +286,19 @@ AsProcessTree (
_findclose (FindHandle);
}
free (FileSpec);
return 0;
}
/******************************************************************************
*
* FUNCTION: AsDetectLoneLineFeeds
*
* DESCRIPTION: Find LF without CR.
*
******************************************************************************/
BOOLEAN
AsDetectLoneLineFeeds (
char *Filename,
@ -345,7 +350,7 @@ AsConvertFile (
ACPI_CONVERSION_TABLE *ConversionTable,
char *FileBuffer,
char *Filename,
NATIVE_INT FileType)
ACPI_NATIVE_INT FileType)
{
UINT32 i;
UINT32 Functions;
@ -550,14 +555,14 @@ AsConvertFile (
*
******************************************************************************/
NATIVE_INT
ACPI_NATIVE_INT
AsProcessOneFile (
ACPI_CONVERSION_TABLE *ConversionTable,
char *SourcePath,
char *TargetPath,
int MaxPathLength,
char *Filename,
NATIVE_INT FileType)
ACPI_NATIVE_INT FileType)
{
char *Pathname;
@ -625,7 +630,7 @@ AsProcessOneFile (
*
******************************************************************************/
NATIVE_INT
ACPI_NATIVE_INT
AsCheckForDirectory (
char *SourceDirPath,
char *TargetDirPath,
@ -648,7 +653,6 @@ AsCheckForDirectory (
return -1;
}
SrcPath = calloc (strlen (SourceDirPath) + strlen (FindInfo->name) + 2, 1);
if (!SrcPath)
{
@ -718,7 +722,6 @@ AsGetFile (
* Create a buffer for the entire file
* Add 10% extra to accomodate string replacements
*/
Size = Gbl_StatBuf.st_size;
Buffer = calloc (Size + (Size / 10), 1);
if (!Buffer)
@ -763,7 +766,6 @@ AsGetFile (
}
Size = Gbl_StatBuf.st_size;
/* Read the entire file */
Size = read (FileHandle, Buffer, Size);

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: asmain - Main module for the acpi source processor utility
* $Revision: 1.42 $
* $Revision: 1.45 $
*
*****************************************************************************/
@ -253,20 +253,26 @@ ACPI_IDENTIFIER_TABLE LinuxLowerCase[] = {
/*"ACPI_IO_ADDRESS ", "acpi_io_address ",*/
/*"ACPI_PHYSICAL_ADDRESS ", "acpi_physical_address ",*/
/*"NATIVE_UINT ", "native_uint ",*/
/*"NATIVE_INT ", "native_int ",*/
/*"ACPI_NATIVE_UINT ", "native_uint ",*/
/*"ACPI_NATIVE_INT ", "native_int ",*/
/*"char ", "native_char ",*/
"ACPI_ADR_SPACE_HANDLER",
"ACPI_ADR_SPACE_SETUP",
"ACPI_ADR_SPACE_TYPE",
"ACPI_AML_OPERANDS",
"ACPI_BIT_REGISTER_INFO",
"ACPI_BUFFER",
"ACPI_BUS_ATTRIBUTE",
"ACPI_COMMON_FACS",
"ACPI_COMMON_STATE",
"ACPI_CONTROL_STATE",
"ACPI_CREATE_FIELD_INFO",
"ACPI_DB_METHOD_INFO",
"ACPI_DEBUG_MEM_BLOCK",
"ACPI_DEBUG_MEM_HEADER",
"ACPI_DEBUG_PRINT_INFO",
"ACPI_DESCRIPTOR",
"ACPI_DEVICE_ID",
"ACPI_DEVICE_INFO",
"ACPI_DEVICE_WALK_INFO",
@ -274,43 +280,95 @@ ACPI_IDENTIFIER_TABLE LinuxLowerCase[] = {
"ACPI_EVENT_STATUS",
"ACPI_EVENT_TYPE",
"ACPI_FIELD_INFO",
"ACPI_FIND_CONTEXT",
"ACPI_FIXED_EVENT_HANDLER",
"ACPI_FIXED_EVENT_INFO",
"ACPI_GENERIC_ADDRESS",
"ACPI_GENERIC_STATE",
"ACPI_GET_DEVICES_INFO",
"ACPI_GPE_BLOCK_INFO",
"ACPI_GPE_HANDLER",
"ACPI_GPE_INDEX_INFO",
"ACPI_GPE_LEVEL_INFO",
"ACPI_GPE_NUMBER_INFO",
"ACPI_GPE_REGISTER_INFO",
"ACPI_GPE_REGISTERS",
"ACPI_HANDLE",
"ACPI_INTEGER",
"ACPI_INIT_HANDLER",
"ACPI_INIT_WALK_INFO",
"ACPI_INTEGER",
"ACPI_INTEGRITY_INFO",
"ACPI_INTERPRETER_MODE",
"ACPI_IO_ADDRESS",
"ACPI_IO_ATTRIBUTE",
"ACPI_MEM_SPACE_CONTEXT",
"ACPI_MEMORY_ATTRIBUTE",
"ACPI_MEMORY_LIST",
"ACPI_MUTEX",
"ACPI_MUTEX_HANDLE",
"ACPI_MUTEX_INFO",
"ACPI_NAME",
"ACPI_NAME_UNION",
"ACPI_NAMESPACE_NODE",
"ACPI_NAMESTRING_INFO",
"ACPI_NATIVE_INT",
"ACPI_NATIVE_UINT",
"ACPI_NOTIFY_HANDLER",
"ACPI_NOTIFY_INFO",
"ACPI_NS_SEARCH_DATA",
"ACPI_OBJ_INFO_HEADER",
"ACPI_OBJECT",
"ACPI_OBJECT_ADDR_HANDLER",
"ACPI_OBJECT_BANK_FIELD",
"ACPI_OBJECT_BUFFER",
"ACPI_OBJECT_BUFFER_FIELD",
"ACPI_OBJECT_CACHE_LIST",
"ACPI_OBJECT_COMMON",
"ACPI_OBJECT_DATA",
"ACPI_OBJECT_DEVICE",
"ACPI_OBJECT_EVENT",
"ACPI_OBJECT_EXTRA",
"ACPI_OBJECT_FIELD_COMMON",
"ACPI_OBJECT_HANDLER",
"ACPI_OBJECT_INDEX_FIELD",
"ACPI_OBJECT_INTEGER",
"ACPI_OBJECT_LIST",
"ACPI_OBJECT_METHOD",
"ACPI_OBJECT_MUTEX",
"ACPI_OBJECT_NOTIFY_COMMON",
"ACPI_OBJECT_NOTIFY_HANDLER",
"ACPI_OBJECT_PACKAGE",
"ACPI_OBJECT_POWER_RESOURCE",
"ACPI_OBJECT_PROCESSOR",
"ACPI_OBJECT_REFERENCE",
"ACPI_OBJECT_REGION",
"ACPI_OBJECT_REGION_FIELD",
"ACPI_OBJECT_STRING",
"ACPI_OBJECT_THERMAL_ZONE",
"ACPI_OBJECT_TYPE",
"ACPI_OBJECT_TYPE8",
"ACPI_OP_WALK_INFO",
"ACPI_OPCODE_INFO",
"ACPI_OPERAND_OBJECT",
"ACPI_OWNER_ID",
"ACPI_PARSE_DOWNWARDS",
"ACPI_PARSE_OBJ_ASL",
"ACPI_PARSE_OBJ_COMMON",
"ACPI_PARSE_OBJ_NAMED",
"ACPI_PARSE_OBJECT",
"ACPI_PARSE_STATE",
"ACPI_PARSE_UPWARDS",
"ACPI_PARSE_VALUE",
"ACPI_PARSE2_OBJECT",
"ACPI_PCI_ID",
"ACPI_PCI_ROUTING_TABLE",
"ACPI_PHYSICAL_ADDRESS",
"ACPI_PKG_CALLBACK",
"ACPI_PKG_INFO",
"ACPI_PKG_STATE",
"ACPI_POINTER",
"ACPI_POINTERS",
"ACPI_PREDEFINED_NAMES",
"ACPI_PSCOPE_STATE",
"ACPI_RESOURCE",
"ACPI_RESOURCE_ADDRESS16",
@ -319,6 +377,7 @@ ACPI_IDENTIFIER_TABLE LinuxLowerCase[] = {
"ACPI_RESOURCE_ATTRIBUTE",
"ACPI_RESOURCE_DATA",
"ACPI_RESOURCE_DMA",
"ACPI_RESOURCE_END_TAG",
"ACPI_RESOURCE_EXT_IRQ",
"ACPI_RESOURCE_FIXED_IO",
"ACPI_RESOURCE_FIXED_MEM32",
@ -332,31 +391,61 @@ ACPI_IDENTIFIER_TABLE LinuxLowerCase[] = {
"ACPI_RESOURCE_VENDOR",
"ACPI_RESULT_VALUES",
"ACPI_SCOPE_STATE",
"ACPI_SIGNAL_FATAL_INFO",
"ACPI_SIZE",
"ACPI_STATUS",
"ACPI_STRING",
"ACPI_SYSTEM_INFO",
"ACPI_TABLE_DESC",
"ACPI_TABLE_HEADER",
"ACPI_TABLE_INFO",
"ACPI_TABLE_PTR",
"ACPI_TABLE_TYPE",
"ACPI_TABLE_TYPE",
"ACPI_THREAD_STATE",
"ACPI_UPDATE_STATE",
"ACPI_WALK_CALLBACK",
"ACPI_WALK_INFO",
"ACPI_WALK_LIST",
"ACPI_WALK_STATE",
"ACPI_DB_METHOD_INFO",
"ASL_ANALYSIS_WALK_INFO",
"ASL_DMA_FORMAT_DESC",
"ASL_DWORD_ADDRESS_DESC",
"ASL_END_DEPENDENT_DESC",
"ASL_END_TAG_DESC",
"ASL_ERROR_MSG",
"ASL_EVENT_INFO",
"ASL_EXTENDED_XRUPT_DESC",
"ASL_FILE_INFO",
"ASL_FIXED_IO_PORT_DESC",
"ASL_FIXED_MEMORY_32_DESC",
"ASL_GENERAL_REGISTER_DESC",
"ASL_IO_PORT_DESC",
"ASL_IRQ_FORMAT_DESC",
"ASL_IRQ_NOFLAGS_DESC",
"ASL_LARGE_VENDOR_DESC",
"ASL_LISTING_NODE",
"ASL_MAPPING_ENTRY",
"ASL_MEMORY_24_DESC",
"ASL_MEMORY_32_DESC",
"ASL_METHOD_INFO",
"ASL_QWORD_ADDRESS_DESC",
"ASL_RESERVED_INFO",
"ASL_RESOURCE_DESC",
"ASL_RESOURCE_NODE",
"ASL_SMALL_VENDOR_DESC",
"ASL_START_DEPENDENT_DESC",
"ASL_START_DEPENDENT_NOPRIO_DESC",
"ASL_WALK_CALLBACK",
"ASL_WORD_ADDRESS_DESC",
"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",
"RSDP_DESCRIPTOR",
"UINT32_STRUCT",
"UINT64_OVERLAY",
"UINT64_STRUCT",
"XSDT_DESCRIPTOR",
@ -486,9 +575,12 @@ ACPI_STRING_TABLE CustomReplacements[] = {
"Copyright (C) 2000, 2001", "Copyright (C) 2000 - 2002", REPLACE_WHOLE_WORD,
#endif
"NATIVE CHAR *", "char *", REPLACE_WHOLE_WORD,
"NATIVE CHAR ", "char ", REPLACE_WHOLE_WORD,
"char", "char", REPLACE_WHOLE_WORD,
"ACPI_NATIVE_UINT", "ACPI_NATIVE_UINT", REPLACE_WHOLE_WORD,
"ACPI_NATIVE_UINT *", "ACPI_NATIVE_UINT *", REPLACE_WHOLE_WORD,
"ACPI_NATIVE_UINT", "ACPI_NATIVE_UINT", REPLACE_WHOLE_WORD,
"ACPI_NATIVE_INT", "ACPI_NATIVE_INT", REPLACE_WHOLE_WORD,
"ACPI_NATIVE_INT *", "ACPI_NATIVE_INT *", REPLACE_WHOLE_WORD,
"ACPI_NATIVE_INT", "ACPI_NATIVE_INT", REPLACE_WHOLE_WORD,
NULL, NULL, 0
};
@ -560,7 +652,6 @@ AsExaminePaths (
return 0;
}
if (!stricmp (Source, Target))
{
printf ("Target path is the same as the source path, overwrite?\n");
@ -575,7 +666,6 @@ AsExaminePaths (
Gbl_Overwrite = TRUE;
}
else
{
Status = stat (Target, &Gbl_StatBuf);
@ -663,7 +753,7 @@ AsDisplayUsage (void)
int ACPI_SYSTEM_XFACE
main (
NATIVE_UINT argc,
ACPI_NATIVE_UINT argc,
char *argv[])
{
int j;
@ -755,7 +845,6 @@ main (
printf ("Source code statistics only\n");
ConversionTable = &StatsConversionTable;
}
else if (!TargetPath)
{
TargetPath = SourcePath;
@ -766,7 +855,6 @@ main (
ConversionTable->SourceFunctions &= ~CVT_REMOVE_DEBUG_MACROS;
}
/* Check source and target paths and files */
if (AsExaminePaths (ConversionTable, SourcePath, TargetPath, &FileType))
@ -782,7 +870,6 @@ main (
AsProcessTree (ConversionTable, SourcePath, TargetPath);
}
else
{
/* Process a single file */