34 IN UINT32 ParentPrefix,
38 if (((Root == 0) || (Root == 1)) &&
39 (ParentPrefix <= MAX_UINT8) &&
40 (!((ParentPrefix != 0) && (Root != 0))) &&
41 (SegCount <= MAX_UINT8) &&
42 ((SegCount + Root + ParentPrefix) != 0))
67 IN UINT32 MaxDstBufferSize,
74 if ((DstBuffer ==
NULL) ||
78 return EFI_INVALID_PARAMETER;
85 if (Count > MaxDstBufferSize) {
86 Count = MaxDstBufferSize;
89 for (Index = 0; Index < Count; Index++) {
90 if ((SrcBuffer[Index] >=
'a') && (SrcBuffer[Index] <=
'z')) {
91 DstBuffer[Index] = (CHAR8)((UINT8)SrcBuffer[Index] - (
'a' -
'A'));
93 DstBuffer[Index] = SrcBuffer[Index];
116 if (Buffer ==
NULL) {
120 if ((Buffer[0] == AML_ROOT_CHAR) && (Buffer[1] ==
'\0')) {
148 if ((Ch ==
'_') || ((Ch >=
'A') && (Ch <=
'Z')) || ((Ch >=
'a') && (Ch <=
'z'))) {
207 if ((AslBuffer ==
NULL) ||
217 for (Index = 1; Index < AML_NAME_SEG_SIZE; Index++) {
218 if ((AslBuffer[Index] ==
'.') ||
219 (AslBuffer[Index] ==
'\0'))
250 if (AmlBuffer ==
NULL) {
258 for (Index = 1; Index < AML_NAME_SEG_SIZE; Index++) {
289 OUT UINT32 *ParentPrefix,
295 if ((Buffer ==
NULL) ||
297 (ParentPrefix ==
NULL) ||
301 return EFI_INVALID_PARAMETER;
309 if (*Buffer == AML_ROOT_CHAR) {
312 }
else if (*Buffer == AML_PARENT_PREFIX_CHAR) {
316 }
while (*Buffer == AML_PARENT_PREFIX_CHAR);
322 if ((NameSegSize == 0) || (NameSegSize > AML_NAME_SEG_SIZE)) {
324 return EFI_INVALID_PARAMETER;
329 Buffer += NameSegSize;
332 if (*Buffer ==
'.') {
338 if (*Buffer !=
'\0') {
340 return EFI_INVALID_PARAMETER;
345 return EFI_INVALID_PARAMETER;
374 OUT UINT32 *ParentPrefix,
378 if ((Buffer ==
NULL) ||
380 (ParentPrefix ==
NULL) ||
384 return EFI_INVALID_PARAMETER;
392 if (*Buffer == AML_ROOT_CHAR) {
395 }
else if (*Buffer == AML_PARENT_PREFIX_CHAR) {
399 }
while (*Buffer == AML_PARENT_PREFIX_CHAR);
403 if (*Buffer == AML_DUAL_NAME_PREFIX) {
405 }
else if (*Buffer == AML_MULTI_NAME_PREFIX) {
406 *SegCount = *((UINT8 *)(Buffer + 1));
409 }
else if (*Buffer == AML_ZERO_OP) {
413 return EFI_INVALID_PARAMETER;
419 return EFI_INVALID_PARAMETER;
441 IN UINT32 ParentPrefix,
453 TotalSize = Root + ParentPrefix;
456 TotalSize += (SegCount * AML_NAME_SEG_SIZE);
459 TotalSize += (SegCount > 1) ? (SegCount - 1) : 0;
483 IN UINT32 ParentPrefix,
495 TotalSize = Root + ParentPrefix;
498 TotalSize += (SegCount == 0) ? 1 : (SegCount * AML_NAME_SEG_SIZE);
501 TotalSize += (SegCount > 2) ? 2 : ((SegCount == 2) ? 1 : 0);
518 OUT UINT32 *AslPathSizePtr
521 if ((AslPath ==
NULL) ||
522 (AslPathSizePtr ==
NULL))
525 return EFI_INVALID_PARAMETER;
532 }
while (*AslPath !=
'\0');
549 OUT UINT32 *AmlPathSizePtr
558 if ((AmlPath ==
NULL) ||
559 (AmlPathSizePtr ==
NULL))
562 return EFI_INVALID_PARAMETER;
571 if (EFI_ERROR (Status)) {
577 if (*AmlPathSizePtr == 0) {
579 return EFI_INVALID_PARAMETER;
600 OUT CHAR8 **OutAmlPath
611 CONST CHAR8 *AslBuffer;
615 if ((AslPath ==
NULL) ||
616 (OutAmlPath ==
NULL))
618 return EFI_INVALID_PARAMETER;
623 if (EFI_ERROR (Status)) {
630 if (TotalSize == 0) {
632 return EFI_INVALID_PARAMETER;
637 if (AmlPath ==
NULL) {
639 return EFI_OUT_OF_RESOURCES;
647 *AmlBuffer = AML_ROOT_CHAR;
650 }
else if (ParentPrefix > 0) {
651 SetMem (AmlBuffer, ParentPrefix, AML_PARENT_PREFIX_CHAR);
652 AmlBuffer += ParentPrefix;
653 AslBuffer += ParentPrefix;
658 *AmlBuffer = AML_MULTI_NAME_PREFIX;
660 *AmlBuffer = (UINT8)SegCount;
662 }
else if (SegCount == 2) {
663 *AmlBuffer = AML_DUAL_NAME_PREFIX;
675 Status = EFI_INVALID_PARAMETER;
686 if (EFI_ERROR (Status)) {
693 AmlBuffer + NameSegSize,
694 AML_NAME_SEG_SIZE - NameSegSize,
699 AmlBuffer += AML_NAME_SEG_SIZE;
700 AslBuffer += NameSegSize;
704 if (*AslBuffer ==
'.') {
708 Status = EFI_INVALID_PARAMETER;
713 if (*AslBuffer ==
'\0') {
717 Status = EFI_INVALID_PARAMETER;
725 *AmlBuffer = AML_ZERO_OP;
731 if ((SegCount != 0) ||
732 (*AslBuffer != AML_ZERO_OP) ||
733 (((UINT32)(AmlBuffer - AmlPath)) != TotalSize))
736 Status = EFI_INVALID_PARAMETER;
740 *OutAmlPath = AmlPath;
763 OUT CHAR8 **OutAslPath
773 CONST CHAR8 *AmlBuffer;
777 if ((AmlPath ==
NULL) ||
778 (OutAslPath ==
NULL))
781 return EFI_INVALID_PARAMETER;
786 if (EFI_ERROR (Status)) {
793 if (TotalSize == 0) {
795 return EFI_INVALID_PARAMETER;
800 if (AslPath ==
NULL) {
802 return EFI_OUT_OF_RESOURCES;
810 *AslBuffer = AML_ROOT_CHAR;
813 }
else if (ParentPrefix > 0) {
814 SetMem (AslBuffer, ParentPrefix, AML_PARENT_PREFIX_CHAR);
815 AslBuffer += ParentPrefix;
816 AmlBuffer += ParentPrefix;
823 }
else if (SegCount == 2) {
830 CopyMem (AslBuffer, AmlBuffer, AML_NAME_SEG_SIZE);
831 AslBuffer += AML_NAME_SEG_SIZE;
832 AmlBuffer += AML_NAME_SEG_SIZE;
849 if (((UINT32)(AslBuffer - AslPath)) != TotalSize) {
851 Status = EFI_INVALID_PARAMETER;
855 *OutAslPath = AslPath;
882 if ((AslName1 ==
NULL) ||
890 if (EFI_ERROR (Status)) {
896 if (EFI_ERROR (Status)) {
902 if (AslName1Len != AslName2Len) {
906 return (
CompareMem (AslName1, AslName2, AslName1Len) == 0);
928 if ((AmlName1 ==
NULL) ||
936 if (EFI_ERROR (Status)) {
942 if (EFI_ERROR (Status)) {
948 if (AmlName1Len != AmlName2Len) {
952 return (
CompareMem (AmlName1, AmlName2, AmlName1Len) == 0);
981 if ((AmlName1 ==
NULL) ||
991 if (EFI_ERROR (Status)) {
1024 IN UINT32 ParentPrefix
1027 if (AmlPath ==
NULL) {
1033 AmlPath += ParentPrefix;
1034 AmlPath += ((*AmlPath == AML_MULTI_NAME_PREFIX) ? 2
1035 : (*AmlPath == AML_DUAL_NAME_PREFIX) ? 1 : 0);
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
EFI_STATUS EFIAPI ConvertAmlNameToAslName(IN CONST CHAR8 *AmlPath, OUT CHAR8 **OutAslPath)
BOOLEAN EFIAPI AslCompareNameString(IN CONST CHAR8 *AslName1, IN CONST CHAR8 *AslName2)
EFI_STATUS EFIAPI AmlParseNameStringInfo(IN CONST CHAR8 *Buffer, OUT UINT32 *Root, OUT UINT32 *ParentPrefix, OUT UINT32 *SegCount)
EFI_STATUS EFIAPI AmlUpperCaseMemCpyS(OUT CHAR8 *DstBuffer, IN UINT32 MaxDstBufferSize, IN CONST CHAR8 *SrcBuffer, IN UINT32 Count)
BOOLEAN EFIAPI AmlCompareNameString(IN CONST CHAR8 *AmlName1, IN CONST CHAR8 *AmlName2)
BOOLEAN EFIAPI CompareAmlWithAslNameString(IN CONST CHAR8 *AmlName1, IN CONST CHAR8 *AslName2)
BOOLEAN EFIAPI AmlIsNameChar(IN CHAR8 Ch)
UINT32 EFIAPI AmlComputeNameStringSize(IN UINT32 Root, IN UINT32 ParentPrefix, IN UINT32 SegCount)
BOOLEAN EFIAPI AmlIsLeadNameChar(IN CHAR8 Ch)
BOOLEAN EFIAPI AslIsNameSeg(IN CONST CHAR8 *AslBuffer, OUT UINT32 *Size)
BOOLEAN EFIAPI AmlIsRootPath(IN CONST CHAR8 *Buffer)
EFI_STATUS EFIAPI AslParseNameStringInfo(IN CONST CHAR8 *Buffer, OUT UINT32 *Root, OUT UINT32 *ParentPrefix, OUT UINT32 *SegCount)
EFI_STATUS EFIAPI AmlGetNameStringSize(IN CONST CHAR8 *AmlPath, OUT UINT32 *AmlPathSizePtr)
EFI_STATUS EFIAPI ConvertAslNameToAmlName(IN CONST CHAR8 *AslPath, OUT CHAR8 **OutAmlPath)
CONST CHAR8 *EFIAPI AmlGetFirstNameSeg(IN CONST CHAR8 *AmlPath, IN UINT32 Root, IN UINT32 ParentPrefix)
UINT32 EFIAPI AslComputeNameStringSize(IN UINT32 Root, IN UINT32 ParentPrefix, IN UINT32 SegCount)
BOOLEAN EFIAPI AmlIsNameSeg(IN CONST CHAR8 *AmlBuffer)
BOOLEAN EFIAPI AmlIsNameString(IN UINT32 Root, IN UINT32 ParentPrefix, IN UINT32 SegCount)
EFI_STATUS EFIAPI AslGetNameStringSize(IN CONST CHAR8 *AslPath, OUT UINT32 *AslPathSizePtr)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)