SolidRun / edk2-platforms

EDK II sample platform branches and tags
BSD 2-Clause "Simplified" License
7 stars 5 forks source link

Serdes: fix integer overflow when computing Serdes protocol map #11

Open danc86 opened 2 years ago

danc86 commented 2 years ago

SerDesPrtclMap is a UINT64 but the BIT() macro produces a UINT32, which was causing SerDesPrtclMap to be filled with incorrect values when using Serdes protocols numbered greater than 32.

This fixes a hang at boot time when I tried to use UEFI firmware with SERDES=4_5_2 on my Honeycomb.

The equivalent code in upstream edk2-platforms looks somewhat different but still seems to suffer the same int overflow undefined behaviour. But I'm sending this here first since it's of relevance to Honeycomb users.