diff options
3 files changed, 25 insertions, 11 deletions
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c index 205c444057..ef5d8823c2 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiPcctLib/PcctGenerator.c @@ -379,10 +379,12 @@ AddSubspaceStructType1 ( Doorbell = &GenericPccCmObj->DoorbellReg;
ChannelTiming = &GenericPccCmObj->ChannelTiming;
+ ASSERT ((PccCmObj->PlatIrq.Flags & ~MAX_UINT8) == 0);
+
PccAcpi->Type = GenericPccCmObj->Type;
PccAcpi->Length = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS);
PccAcpi->PlatformInterrupt = PccCmObj->PlatIrq.Interrupt;
- PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
+ PccAcpi->PlatformInterruptFlags = (UINT8)PccCmObj->PlatIrq.Flags;
PccAcpi->Reserved = EFI_ACPI_RESERVED_BYTE;
PccAcpi->BaseAddress = GenericPccCmObj->BaseAddress;
PccAcpi->AddressLength = GenericPccCmObj->AddressLength;
@@ -441,10 +443,12 @@ AddSubspaceStructType2 ( PlatIrqAck = &PccCmObj->PlatIrqAckReg;
ChannelTiming = &GenericPccCmObj->ChannelTiming;
+ ASSERT ((PccCmObj->PlatIrq.Flags & ~MAX_UINT8) == 0);
+
PccAcpi->Type = GenericPccCmObj->Type;
PccAcpi->Length = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS);
PccAcpi->PlatformInterrupt = PccCmObj->PlatIrq.Interrupt;
- PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
+ PccAcpi->PlatformInterruptFlags = (UINT8)PccCmObj->PlatIrq.Flags;
PccAcpi->BaseAddress = GenericPccCmObj->BaseAddress;
PccAcpi->Reserved = EFI_ACPI_RESERVED_BYTE;
PccAcpi->BaseAddress = GenericPccCmObj->BaseAddress;
@@ -519,13 +523,16 @@ AddSubspaceStructType34 ( ErrorStatus = &PccCmObj->ErrorStatusReg;
ChannelTiming = &GenericPccCmObj->ChannelTiming;
+ ASSERT ((PccCmObj->PlatIrq.Flags & ~MAX_UINT8) == 0);
+ ASSERT ((GenericPccCmObj->AddressLength & ~MAX_UINT32) == 0);
+
PccAcpi->Type = GenericPccCmObj->Type;
PccAcpi->Length = sizeof (EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC);
PccAcpi->PlatformInterrupt = PccCmObj->PlatIrq.Interrupt;
- PccAcpi->PlatformInterruptFlags = PccCmObj->PlatIrq.Flags;
+ PccAcpi->PlatformInterruptFlags = (UINT8)PccCmObj->PlatIrq.Flags;
PccAcpi->Reserved = EFI_ACPI_RESERVED_BYTE;
PccAcpi->BaseAddress = GenericPccCmObj->BaseAddress;
- PccAcpi->AddressLength = GenericPccCmObj->AddressLength;
+ PccAcpi->AddressLength = (UINT32)GenericPccCmObj->AddressLength;
CopyMem (
&PccAcpi->DoorbellRegister,
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c index 7459513193..9097ac3deb 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtCpuTopologyLib/SsdtCpuTopologyGenerator.c @@ -1026,7 +1026,8 @@ CreateAmlCpuTopologyTree ( if (Generator->ProcNodeList[Index].OverrideNameUidEnabled) {
Name = Generator->ProcNodeList[Index].OverrideName;
} else {
- Name = CpuIndex;
+ ASSERT ((CpuIndex & ~MAX_UINT16) == 0);
+ Name = (UINT16)CpuIndex;
}
Status = CreateAmlCpuFromProcHierarchy (
@@ -1061,7 +1062,8 @@ CreateAmlCpuTopologyTree ( Name = Generator->ProcNodeList[Index].OverrideName;
Uid = Generator->ProcNodeList[Index].OverrideUid;
} else {
- Name = ProcContainerName;
+ ASSERT ((ProcContainerName & ~MAX_UINT16) == 0);
+ Name = (UINT16)ProcContainerName;
Uid = *ProcContainerIndex;
}
diff --git a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c index 5b6d551562..618056e85a 100644 --- a/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Common/AcpiSsdtPcieLib/SsdtPcieGenerator.c @@ -311,7 +311,7 @@ GeneratePrt ( )
{
EFI_STATUS Status;
- INT32 Index;
+ UINT32 Index;
AML_OBJECT_NODE_HANDLE PrtNode;
CM_ARCH_COMMON_OBJ_REF *RefInfo;
UINT32 RefCount;
@@ -561,6 +561,11 @@ GeneratePciCrs ( break;
case PCI_SS_M32:
+ ASSERT ((AddrMapInfo->PciAddress & ~MAX_UINT32) == 0);
+ ASSERT (((AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1) & ~MAX_UINT32) == 0);
+ ASSERT (((Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0) & ~MAX_UINT32) == 0);
+ ASSERT ((AddrMapInfo->AddressSize & ~MAX_UINT32) == 0);
+
Status = AmlCodeGenRdDWordMemory (
FALSE,
IsPosDecode,
@@ -569,10 +574,10 @@ GeneratePciCrs ( AmlMemoryCacheable,
TRUE,
0,
- AddrMapInfo->PciAddress,
- AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1,
- Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0,
- AddrMapInfo->AddressSize,
+ (UINT32)(AddrMapInfo->PciAddress),
+ (UINT32)(AddrMapInfo->PciAddress + AddrMapInfo->AddressSize - 1),
+ (UINT32)(Translation ? AddrMapInfo->CpuAddress - AddrMapInfo->PciAddress : 0),
+ (UINT32)(AddrMapInfo->AddressSize),
0,
NULL,
AmlAddressRangeMemory,
|