Rename nameseg length macro/define for clarity

ACPI_NAME_SIZE changed to ACPI_NAMESEG_SIZE
This clarifies that this is the length of an individual
nameseg, not the length of a generic namestring/namepath.
Improves understanding of the code.
This commit is contained in:
Robert Moore 2019-02-22 07:46:57 -08:00
parent 92ec0935f2
commit 24870bd9e7
38 changed files with 82 additions and 82 deletions

View File

@ -585,7 +585,7 @@ AcValidateTableHeader (
* These fields must be ASCII: OemId, OemTableId, AslCompilerId.
* We allow a NULL terminator in OemId and OemTableId.
*/
for (i = 0; i < ACPI_NAME_SIZE; i++)
for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
{
if (!ACPI_IS_ASCII ((UINT8) TableHeader.AslCompilerId[i]))
{

View File

@ -459,7 +459,7 @@ AdDisassembleOneTable (
*/
if (AcpiGbl_CaptureComments)
{
strncpy (Table->Signature, AcpiGbl_TableSig, ACPI_NAME_SIZE);
strncpy (Table->Signature, AcpiGbl_TableSig, ACPI_NAMESEG_SIZE);
}
#endif

View File

@ -822,10 +822,10 @@ AcpiGetTagPathname (
* end up in the final compiled AML, it's just an appearance issue for the
* disassembled code.
*/
PathnameEnd = Pathname + (RequiredSize - ACPI_NAME_SIZE - 1);
PathnameEnd = Pathname + (RequiredSize - ACPI_NAMESEG_SIZE - 1);
ACPI_COPY_NAMESEG (PathnameEnd, ResourceNode->Name.Ascii);
PathnameEnd += ACPI_NAME_SIZE;
PathnameEnd += ACPI_NAMESEG_SIZE;
*PathnameEnd = '.';
PathnameEnd++;
@ -871,7 +871,7 @@ static void
AcpiDmUpdateResourceName (
ACPI_NAMESPACE_NODE *ResourceNode)
{
char Name[ACPI_NAME_SIZE];
char Name[ACPI_NAMESEG_SIZE];
/* Ignore if a unique name has already been assigned */

View File

@ -563,14 +563,14 @@ ApCheckForGpeNameConflict (
{
ACPI_PARSE_OBJECT *NextOp;
UINT32 GpeNumber;
char Name[ACPI_NAME_SIZE + 1];
char Target[ACPI_NAME_SIZE];
char Name[ACPI_NAMESEG_SIZE + 1];
char Target[ACPI_NAMESEG_SIZE];
/* Need a null-terminated string version of NameSeg */
ACPI_MOVE_32_TO_32 (Name, &Op->Asl.NameSeg);
Name[ACPI_NAME_SIZE] = 0;
Name[ACPI_NAMESEG_SIZE] = 0;
/*
* For a GPE method:

View File

@ -813,7 +813,7 @@ NamePathTail [.]{NameSeg}
{NameSeg} { char *s;
count (0);
s=UtLocalCacheCalloc (ACPI_NAME_SIZE + 1);
s=UtLocalCacheCalloc (ACPI_NAMESEG_SIZE + 1);
if (strcmp (AslCompilertext, "\\"))
{
/*

View File

@ -703,7 +703,7 @@ LdNamespace1Begin (
/* However, this is an error -- operand to Scope must exist */
if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE)
if (strlen (Op->Asl.ExternalName) == ACPI_NAMESEG_SIZE)
{
AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
Op->Asl.ExternalName);
@ -1096,7 +1096,7 @@ LdNamespace2Begin (
{
/* Standalone NameSeg vs. NamePath */
if (strlen (Arg->Asl.ExternalName) == ACPI_NAME_SIZE)
if (strlen (Arg->Asl.ExternalName) == ACPI_NAMESEG_SIZE)
{
AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
Arg->Asl.ExternalName);

View File

@ -258,7 +258,7 @@ LsAmlOffsetWalk (
/* Get offset of last nameseg and the actual data */
NamepathOffset = AslGbl_CurrentAmlOffset + Length +
(Op->Asl.FinalAmlLength - ACPI_NAME_SIZE);
(Op->Asl.FinalAmlLength - ACPI_NAMESEG_SIZE);
DataOffset = AslGbl_CurrentAmlOffset + Length +
Op->Asl.FinalAmlLength;
@ -323,7 +323,7 @@ LsAmlOffsetWalk (
/* Get offset of last nameseg and the actual data */
NamepathOffset = AslGbl_CurrentAmlOffset + Length +
(NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE);
(NextOp->Asl.FinalAmlLength - ACPI_NAMESEG_SIZE);
DataOffset = AslGbl_CurrentAmlOffset + Length +
(NextOp->Asl.FinalAmlLength + 1);
@ -370,7 +370,7 @@ LsAmlOffsetWalk (
/* Get offset of last nameseg and the actual data (flags byte) */
NamepathOffset = AslGbl_CurrentAmlOffset + Length +
(NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE);
(NextOp->Asl.FinalAmlLength - ACPI_NAMESEG_SIZE);
DataOffset = AslGbl_CurrentAmlOffset + Length +
NextOp->Asl.FinalAmlLength;
@ -394,7 +394,7 @@ LsAmlOffsetWalk (
/* Get offset of last nameseg and the actual data (PBlock address) */
NamepathOffset = AslGbl_CurrentAmlOffset + Length +
(NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE);
(NextOp->Asl.FinalAmlLength - ACPI_NAMESEG_SIZE);
DataOffset = AslGbl_CurrentAmlOffset + Length +
(NextOp->Asl.FinalAmlLength + 1);
@ -419,7 +419,7 @@ LsAmlOffsetWalk (
/* Get offset of last nameseg */
NamepathOffset = AslGbl_CurrentAmlOffset + Length +
(NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE);
(NextOp->Asl.FinalAmlLength - ACPI_NAMESEG_SIZE);
LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, 0,
Op->Asl.ParseOpName, 0, (UINT8) 0, Op->Asl.AmlOpcode);

View File

@ -1087,13 +1087,13 @@ OpnDoDefinitionBlock (
if (Child->Asl.Value.String)
{
AslGbl_TableSignature = Child->Asl.Value.String;
if (strlen (AslGbl_TableSignature) != ACPI_NAME_SIZE)
if (strlen (AslGbl_TableSignature) != ACPI_NAMESEG_SIZE)
{
AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child,
"Length must be exactly 4 characters");
}
for (i = 0; i < ACPI_NAME_SIZE; i++)
for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
{
if (!isalnum ((int) AslGbl_TableSignature[i]))
{

View File

@ -241,7 +241,7 @@ OptSearchToRoot (
* not match, and we cannot use this optimization.
*/
Path = &(((char *) TargetPath->Pointer)[
TargetPath->Length - ACPI_NAME_SIZE]);
TargetPath->Length - ACPI_NAMESEG_SIZE]);
ScopeInfo.Scope.Node = CurrentNode;
/* Lookup the NameSeg using SEARCH_PARENT (search-to-root) */
@ -275,7 +275,7 @@ OptSearchToRoot (
/* We must allocate a new string for the name (TargetPath gets deleted) */
*NewPath = UtLocalCacheCalloc (ACPI_NAME_SIZE + 1);
*NewPath = UtLocalCacheCalloc (ACPI_NAMESEG_SIZE + 1);
strcpy (*NewPath, Path);
if (strncmp (*NewPath, "_T_", 3))
@ -343,7 +343,7 @@ OptBuildShortestPath (
* can possibly have in common. (To optimize, we have to have at least 1)
*
* Note: The external NamePath string lengths are always a multiple of 5
* (ACPI_NAME_SIZE + separator)
* (ACPI_NAMESEG_SIZE + separator)
*/
MaxCommonSegments = TargetPath->Length / ACPI_PATH_SEGMENT_LENGTH;
if (CurrentPath->Length < TargetPath->Length)
@ -713,7 +713,7 @@ OptOptimizeNamePath (
* to be any possibility that it can be optimized to a shorter string
*/
AmlNameStringLength = strlen (AmlNameString);
if (AmlNameStringLength <= ACPI_NAME_SIZE)
if (AmlNameStringLength <= ACPI_NAMESEG_SIZE)
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
"NAMESEG %4.4s\n", AmlNameString));

View File

@ -752,7 +752,7 @@ UtPadNameWithUnderscores (
UINT32 i;
for (i = 0; (i < ACPI_NAME_SIZE); i++)
for (i = 0; (i < ACPI_NAMESEG_SIZE); i++)
{
if (*NameSeg)
{

View File

@ -708,7 +708,7 @@ XfNamespaceLocateBegin (
* We didn't find the name reference by path -- we can qualify this
* a little better before we print an error message
*/
if (strlen (Path) == ACPI_NAME_SIZE)
if (strlen (Path) == ACPI_NAMESEG_SIZE)
{
/* A simple, one-segment ACPI name */
@ -770,7 +770,7 @@ XfNamespaceLocateBegin (
* doesn't exist or just can't be reached. However, we
* can differentiate between a NameSeg vs. NamePath.
*/
if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE)
if (strlen (Op->Asl.ExternalName) == ACPI_NAMESEG_SIZE)
{
AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
Op->Asl.ExternalName);

View File

@ -346,7 +346,7 @@ DtCreateOneTemplateFile (
* 2) Signature must be a recognized ACPI table
* 3) There must be a template associated with the signature
*/
if (strlen (Signature) != ACPI_NAME_SIZE)
if (strlen (Signature) != ACPI_NAMESEG_SIZE)
{
fprintf (stderr,
"%s: Invalid ACPI table signature "

View File

@ -557,7 +557,7 @@ AcpiDbFindNameInNamespace (
char *AcpiNamePtr = AcpiName;
if (strlen (NameArg) > ACPI_NAME_SIZE)
if (strlen (NameArg) > ACPI_NAMESEG_SIZE)
{
AcpiOsPrintf ("Name must be no longer than 4 characters\n");
return (AE_OK);

View File

@ -199,8 +199,8 @@ AcpiDmDumpName (
/* Remove all trailing underscores from the name */
Length = ACPI_NAME_SIZE;
for (i = (ACPI_NAME_SIZE - 1); i != 0; i--)
Length = ACPI_NAMESEG_SIZE;
for (i = (ACPI_NAMESEG_SIZE - 1); i != 0; i--)
{
if (NewName[i] == '_')
{
@ -378,7 +378,7 @@ AcpiDmNamestring (
AcpiOsPrintf (".");
}
Name += ACPI_NAME_SIZE;
Name += ACPI_NAMESEG_SIZE;
}
}

View File

@ -447,7 +447,7 @@ AcpiEvMatchGpeMethod (
ACPI_STATUS Status;
UINT32 GpeNumber;
UINT8 TempGpeNumber;
char Name[ACPI_NAME_SIZE + 1];
char Name[ACPI_NAMESEG_SIZE + 1];
UINT8 Type;
@ -468,7 +468,7 @@ AcpiEvMatchGpeMethod (
* 1) Extract the method name and null terminate it
*/
ACPI_MOVE_32_TO_32 (Name, &MethodNode->Name.Integer);
Name[ACPI_NAME_SIZE] = 0;
Name[ACPI_NAMESEG_SIZE] = 0;
/* 2) Name must begin with an underscore */

View File

@ -207,11 +207,11 @@ AcpiExAllocateNameString (
{
/* Special case for root */
SizeNeeded = 1 + (ACPI_NAME_SIZE * NumNameSegs) + 2 + 1;
SizeNeeded = 1 + (ACPI_NAMESEG_SIZE * NumNameSegs) + 2 + 1;
}
else
{
SizeNeeded = PrefixCount + (ACPI_NAME_SIZE * NumNameSegs) + 2 + 1;
SizeNeeded = PrefixCount + (ACPI_NAMESEG_SIZE * NumNameSegs) + 2 + 1;
}
/*
@ -310,7 +310,7 @@ AcpiExNameSegment (
}
for (Index = 0;
(Index < ACPI_NAME_SIZE) && (AcpiUtValidNameChar (*AmlAddress, 0));
(Index < ACPI_NAMESEG_SIZE) && (AcpiUtValidNameChar (*AmlAddress, 0));
Index++)
{
CharBuf[Index] = *AmlAddress++;

View File

@ -851,7 +851,7 @@ AcpiNsLookup (
/* Point to next name segment and make this node current */
Path += ACPI_NAME_SIZE;
Path += ACPI_NAMESEG_SIZE;
CurrentNode = ThisNode;
}

View File

@ -236,7 +236,7 @@ AcpiNsPrintPathname (
AcpiOsPrintf ("?");
}
Pathname += ACPI_NAME_SIZE;
Pathname += ACPI_NAMESEG_SIZE;
NumSegments--;
if (NumSegments)
{

View File

@ -274,7 +274,7 @@ AcpiNsHandleToName (
NodeName = AcpiUtGetNodeName (Node);
ACPI_COPY_NAMESEG (Buffer->Pointer, NodeName);
((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0;
((char *) Buffer->Pointer) [ACPI_NAMESEG_SIZE] = 0;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%4.4s\n", (char *) Buffer->Pointer));
return_ACPI_STATUS (AE_OK);
@ -374,7 +374,7 @@ AcpiNsBuildNormalizedPath (
BOOLEAN NoTrailing)
{
UINT32 Length = 0, i;
char Name[ACPI_NAME_SIZE];
char Name[ACPI_NAMESEG_SIZE];
BOOLEAN DoNoTrailing;
char c, *Left, *Right;
ACPI_NAMESPACE_NODE *NextNode;
@ -657,7 +657,7 @@ AcpiNsNormalizePathname (
{
/* Do one nameseg at a time */
for (i = 0; (i < ACPI_NAME_SIZE) && *InputPath; i++)
for (i = 0; (i < ACPI_NAMESEG_SIZE) && *InputPath; i++)
{
if ((i == 0) || (*InputPath != '_')) /* First char is allowed to be underscore */
{

View File

@ -169,7 +169,7 @@ ACPI_STATUS (*ACPI_REPAIR_FUNCTION) (
typedef struct acpi_repair_info
{
char Name[ACPI_NAME_SIZE];
char Name[ACPI_NAMESEG_SIZE];
ACPI_REPAIR_FUNCTION RepairFunction;
} ACPI_REPAIR_INFO;

View File

@ -351,7 +351,7 @@ AcpiNsGetInternalNameLength (
}
}
Info->Length = (ACPI_NAME_SIZE * Info->NumSegments) +
Info->Length = (ACPI_NAMESEG_SIZE * Info->NumSegments) +
4 + Info->NumCarats;
Info->NextExternalChar = NextExternalChar;
@ -443,7 +443,7 @@ AcpiNsBuildInternalName (
for (; NumSegments; NumSegments--)
{
for (i = 0; i < ACPI_NAME_SIZE; i++)
for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
{
if (ACPI_IS_PATH_SEPARATOR (*ExternalName) ||
(*ExternalName == 0))
@ -472,7 +472,7 @@ AcpiNsBuildInternalName (
/* Move on the next segment */
ExternalName++;
Result += ACPI_NAME_SIZE;
Result += ACPI_NAMESEG_SIZE;
}
/* Terminate the string */
@ -725,8 +725,8 @@ AcpiNsExternalizeName (
&InternalName[NamesIndex]);
AcpiUtRepairName (&(*ConvertedName)[j]);
j += ACPI_NAME_SIZE;
NamesIndex += ACPI_NAME_SIZE;
j += ACPI_NAMESEG_SIZE;
NamesIndex += ACPI_NAMESEG_SIZE;
}
}

View File

@ -314,21 +314,21 @@ AcpiPsGetNextNamestring (
/* Two name segments */
End += 1 + (2 * ACPI_NAME_SIZE);
End += 1 + (2 * ACPI_NAMESEG_SIZE);
break;
case AML_MULTI_NAME_PREFIX:
/* Multiple name segments, 4 chars each, count in next byte */
End += 2 + (*(End + 1) * ACPI_NAME_SIZE);
End += 2 + (*(End + 1) * ACPI_NAMESEG_SIZE);
break;
default:
/* Single name segment */
End += ACPI_NAME_SIZE;
End += ACPI_NAMESEG_SIZE;
break;
}
@ -708,7 +708,7 @@ AcpiPsGetNextField (
ACPI_MOVE_32_TO_32 (&Name, ParserState->Aml);
AcpiPsSetName (Field, Name);
ParserState->Aml += ACPI_NAME_SIZE;
ParserState->Aml += ACPI_NAMESEG_SIZE;
ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState);

View File

@ -217,7 +217,7 @@ AcpiTbFindTable (
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
{
if (memcmp (&(AcpiGbl_RootTableList.Tables[i].Signature),
Header.Signature, ACPI_NAME_SIZE))
Header.Signature, ACPI_NAMESEG_SIZE))
{
/* Not the requested table */
@ -245,7 +245,7 @@ AcpiTbFindTable (
/* Check for table match on all IDs */
if (!memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->Signature,
Header.Signature, ACPI_NAME_SIZE) &&
Header.Signature, ACPI_NAMESEG_SIZE) &&
(!OemId[0] ||
!memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->OemId,
Header.OemId, ACPI_OEM_ID_SIZE)) &&

View File

@ -225,10 +225,10 @@ AcpiTbCleanupTableHeader (
memcpy (OutHeader, Header, sizeof (ACPI_TABLE_HEADER));
AcpiTbFixString (OutHeader->Signature, ACPI_NAME_SIZE);
AcpiTbFixString (OutHeader->Signature, ACPI_NAMESEG_SIZE);
AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE);
AcpiTbFixString (OutHeader->OemTableId, ACPI_OEM_TABLE_ID_SIZE);
AcpiTbFixString (OutHeader->AslCompilerId, ACPI_NAME_SIZE);
AcpiTbFixString (OutHeader->AslCompilerId, ACPI_NAMESEG_SIZE);
}

View File

@ -176,7 +176,7 @@ AcpiUtValidNameseg (
/* Validate each character in the signature */
for (i = 0; i < ACPI_NAME_SIZE; i++)
for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
{
if (!AcpiUtValidNameChar (Name[i], i))
{

View File

@ -416,7 +416,7 @@ AcpiUtGetNodeName (
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) Object;
/* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */
/* Must return a string of exactly 4 characters == ACPI_NAMESEG_SIZE */
if (!Object)
{

View File

@ -312,7 +312,7 @@ AcpiUtRepairName (
/* Check each character in the name */
for (i = 0; i < ACPI_NAME_SIZE; i++)
for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
{
if (AcpiUtValidNameChar (Name[i], i))
{

View File

@ -480,7 +480,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
*/
typedef struct acpi_name_info
{
char Name[ACPI_NAME_SIZE];
char Name[ACPI_NAMESEG_SIZE];
UINT16 ArgumentList;
UINT8 ExpectedBtypes;
@ -568,7 +568,7 @@ typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
typedef struct acpi_simple_repair_info
{
char Name[ACPI_NAME_SIZE];
char Name[ACPI_NAMESEG_SIZE];
UINT32 UnexpectedBtypes;
UINT32 PackageIndex;
ACPI_OBJECT_CONVERTER ObjectConverter;

View File

@ -213,14 +213,14 @@
typedef struct acpi_table_header
{
char Signature[ACPI_NAME_SIZE]; /* ASCII table signature */
char Signature[ACPI_NAMESEG_SIZE]; /* ASCII table signature */
UINT32 Length; /* Length of table in bytes, including this header */
UINT8 Revision; /* ACPI Specification minor version number */
UINT8 Checksum; /* To make sum of entire table == 0 */
char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
UINT32 OemRevision; /* OEM revision number */
char AslCompilerId[ACPI_NAME_SIZE]; /* ASCII ASL compiler vendor ID */
char AslCompilerId[ACPI_NAMESEG_SIZE]; /* ASCII ASL compiler vendor ID */
UINT32 AslCompilerRevision; /* ASL compiler version */
} ACPI_TABLE_HEADER;

View File

@ -520,7 +520,7 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS;
/* Names within the namespace are 4 bytes long */
#define ACPI_NAME_SIZE 4
#define ACPI_NAMESEG_SIZE 4 /* Fixed by ACPI spec */
#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
#define ACPI_PATH_SEPARATOR '.'
@ -669,8 +669,8 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_COMPARE_NAMESEG(a,b) (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b)))
#define ACPI_COPY_NAMESEG(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src)))
#else
#define ACPI_COMPARE_NAMESEG(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
#define ACPI_COPY_NAMESEG(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))
#define ACPI_COMPARE_NAMESEG(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAMESEG_SIZE))
#define ACPI_COPY_NAMESEG(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAMESEG_SIZE))
#endif
/* Support for the special RSDP signature (8 characters) */
@ -680,7 +680,7 @@ typedef UINT64 ACPI_INTEGER;
/* Support for OEMx signature (x can be any character) */
#define ACPI_IS_OEM_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_OEM_NAME, 3) &&\
strnlen (a, ACPI_NAME_SIZE) == ACPI_NAME_SIZE)
strnlen (a, ACPI_NAMESEG_SIZE) == ACPI_NAMESEG_SIZE)
/*
* Algorithm to obtain access bit width.

View File

@ -167,7 +167,7 @@ typedef struct osl_table_info
{
struct osl_table_info *Next;
UINT32 Instance;
char Signature[ACPI_NAME_SIZE];
char Signature[ACPI_NAMESEG_SIZE];
} OSL_TABLE_INFO;

View File

@ -167,7 +167,7 @@ typedef struct osl_table_info
{
struct osl_table_info *Next;
UINT32 Instance;
char Signature[ACPI_NAME_SIZE];
char Signature[ACPI_NAMESEG_SIZE];
} OSL_TABLE_INFO;
@ -1277,7 +1277,7 @@ OslListCustomizedTables (
{
void *TableDir;
UINT32 Instance;
char TempName[ACPI_NAME_SIZE];
char TempName[ACPI_NAMESEG_SIZE];
char *Filename;
ACPI_STATUS Status = AE_OK;
@ -1457,18 +1457,18 @@ OslTableNameFromFile (
/* Ignore meaningless files */
if (strlen (Filename) < ACPI_NAME_SIZE)
if (strlen (Filename) < ACPI_NAMESEG_SIZE)
{
return (AE_BAD_SIGNATURE);
}
/* Extract instance number */
if (isdigit ((int) Filename[ACPI_NAME_SIZE]))
if (isdigit ((int) Filename[ACPI_NAMESEG_SIZE]))
{
sscanf (&Filename[ACPI_NAME_SIZE], "%u", Instance);
sscanf (&Filename[ACPI_NAMESEG_SIZE], "%u", Instance);
}
else if (strlen (Filename) != ACPI_NAME_SIZE)
else if (strlen (Filename) != ACPI_NAMESEG_SIZE)
{
return (AE_BAD_SIGNATURE);
}
@ -1629,7 +1629,7 @@ OslGetCustomizedTable (
{
void *TableDir;
UINT32 CurrentInstance = 0;
char TempName[ACPI_NAME_SIZE];
char TempName[ACPI_NAMESEG_SIZE];
char TableFilename[PATH_MAX];
char *Filename;
ACPI_STATUS Status;

View File

@ -173,7 +173,7 @@
UINT64 TimerFrequency;
char TableName[ACPI_NAME_SIZE + 1];
char TableName[ACPI_NAMESEG_SIZE + 1];
#define ACPI_OS_DEBUG_TIMEOUT 30000 /* 30 seconds */

View File

@ -475,7 +475,7 @@ int
ApDumpTableByName (
char *Signature)
{
char LocalSignature [ACPI_NAME_SIZE + 1];
char LocalSignature [ACPI_NAMESEG_SIZE + 1];
UINT32 Instance;
ACPI_TABLE_HEADER *Table;
ACPI_PHYSICAL_ADDRESS Address;
@ -483,7 +483,7 @@ ApDumpTableByName (
int TableStatus;
if (strlen (Signature) != ACPI_NAME_SIZE)
if (strlen (Signature) != ACPI_NAMESEG_SIZE)
{
fprintf (stderr,
"Invalid table signature [%s]: must be exactly 4 characters\n",

View File

@ -257,7 +257,7 @@ ApWriteToBinaryFile (
ACPI_TABLE_HEADER *Table,
UINT32 Instance)
{
char Filename[ACPI_NAME_SIZE + 16];
char Filename[ACPI_NAMESEG_SIZE + 16];
char InstanceStr [16];
ACPI_FILE File;
ACPI_SIZE Actual;
@ -283,7 +283,7 @@ ApWriteToBinaryFile (
Filename[1] = (char) tolower ((int) Filename[1]);
Filename[2] = (char) tolower ((int) Filename[2]);
Filename[3] = (char) tolower ((int) Filename[3]);
Filename[ACPI_NAME_SIZE] = 0;
Filename[ACPI_NAMESEG_SIZE] = 0;
/* Handle multiple SSDTs - create different filenames for each */

View File

@ -297,7 +297,7 @@ AhFindPredefinedNames (
{
UINT32 Length;
BOOLEAN Found;
char Name[ACPI_NAME_SIZE + 1];
char Name[ACPI_NAMESEG_SIZE + 1];
if (!NamePrefix || (*NamePrefix == '*'))
@ -307,7 +307,7 @@ AhFindPredefinedNames (
}
Length = strlen (NamePrefix);
if (Length > ACPI_NAME_SIZE)
if (Length > ACPI_NAMESEG_SIZE)
{
printf ("%.8s: Predefined name must be 4 characters maximum\n",
NamePrefix);

View File

@ -204,7 +204,7 @@ AxExtractTables (
if (Signature)
{
strncpy (UpperSignature, Signature, ACPI_NAME_SIZE);
strncpy (UpperSignature, Signature, ACPI_NAMESEG_SIZE);
AcpiUtStrupr (UpperSignature);
/* Are there enough instances of the table to continue? */

View File

@ -745,7 +745,7 @@ AxCheckTableLengths (
}
if ((ByteCount < sizeof (ACPI_TABLE_HEADER)) &&
(ByteCount >= ACPI_NAME_SIZE))
(ByteCount >= ACPI_NAMESEG_SIZE))
{
printf (" : (Table too short for an ACPI table)");
}