28.1 General notes about porting to IPF platforms

When porting to IPF platform, most developers take as much code as possible that already exists and reuse it for the IPF platform. Unfortunately, some developers porting code do not rigorously follow the UEFI conventions, such as using only the data types defined in the Calling Conventions section of the UEFI Specification. Others may not follow best coding practices. This is a critical issue for IPF platforms because, although such code might work the first time, it may fail a more complete set of validation tests. It is also very likely that the code may not work when compiled with a different compiler, or after another developer performs maintenance on the code.

  • Use data types defined by the Calling Conventions section of the UEFI Specification.

  • Use compiler flag settings that guarantee that the UEFI calling conventions for IPF are followed.

  • If a UEFI driver contains assembly language sources for a different CPU architecture, then those sources must be converted to either IPF assembly language sources or to CPU agnostic C language sources. Conversion to C language sources is recommended and the EDK II library BaseLib and other EDK II libraries provide functions that may reduce or eliminate the need to assembly code in UEFI Drivers.

  • Avoid alignment faults. This is the top issue in porting a UEFI driver to an IPF platform. Alignment faults may be due to type casting, packed data structures, or unaligned data structures.