nvme_disk: Add structure padding for 32-bit.

The static asserts are broken on GCC2 and so did not catch this. It appears
nobody has ever tried to use this structure on 32-bit plaforms in the upstream
libraries or SPDK/DPDK?

Fixes #15212.
This commit is contained in:
Augustin Cavalier 2021-09-30 18:05:16 -04:00
parent 6683314327
commit 1bcecb98c3
2 changed files with 8 additions and 2 deletions

View File

@ -67,7 +67,7 @@ if $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 {
# drivers # drivers
AddNewDriversToPackage : wmi@x86,x86_64 ; AddNewDriversToPackage : wmi@x86,x86_64 ;
AddNewDriversToPackage disk : nvme_disk@x86,x86_64 ; AddNewDriversToPackage disk : nvme_disk ;
AddNewDriversToPackage disk mmc : mmc_disk ; AddNewDriversToPackage disk mmc : mmc_disk ;
AddNewDriversToPackage disk scsi : scsi_cd scsi_disk ; AddNewDriversToPackage disk scsi : scsi_cd scsi_disk ;
AddNewDriversToPackage disk virtual : virtio_block ram_disk ; AddNewDriversToPackage disk virtual : virtio_block ram_disk ;
@ -202,7 +202,7 @@ AddBootModuleSymlinksToPackage
ide_isa@x86 isa@x86,x86_64 intel it8211 ide_isa@x86 isa@x86,x86_64 intel it8211
legacy_sata locked_pool legacy_sata locked_pool
mmc mmc_disk mmc mmc_disk
nvme_disk@x86,x86_64 nvme_disk
openpic@ppc openpic@ppc
packagefs pci packagefs pci
fdt@riscv64,arm fdt@riscv64,arm

View File

@ -311,6 +311,12 @@ struct nvme_tracker {
LIST_ENTRY(nvme_tracker) list; LIST_ENTRY(nvme_tracker) list;
struct nvme_request *req; struct nvme_request *req;
#if INTPTR_MAX == INT32_MAX
int32_t __pad[3];
#elif !defined(INTPTR_MAX)
# error Need definition of INTPTR_MAX!
#endif
uint16_t cid; uint16_t cid;
uint16_t rsvd1: 15; uint16_t rsvd1: 15;