audk/MdeModulePkg/Library/FileExplorerLib
Ard Biesheuvel 765fb87c2b MdeModulePkg/FileExplorerLib: avoid packed struct for program data
Struct packing is only necessary for data structures whose in-memory
representation is covered by the PI or UEFI specs, and may deviate
from the ordinary C rules for alignment.

So in case of FileExplorerLib, this applies to the device path struct
only, and other structures used to carry program data should not be
packed, or we may end up with alignment faults on architectures such
as ARM, which don't permit load/store double or multiple instructions
to access memory locations that are not 32-bit aligned.

E.g., the following call in FileExplorerLibConstructor()

  InitializeListHead (&gFileExplorerPrivate.FsOptionMenu->Head);

which is emitted as follows for 32-bit ARM/Thumb2 by Clang-5.0

    3de0:       b510            push    {r4, lr}
    3de2:       4604            mov     r4, r0
    ...
    3de8:       e9c4 4400       strd    r4, r4, [r4]
    3dec:       bd10            pop     {r4, pc}

will perform a double-word store on the first argument, passed in
register r0, assuming that the pointer type of the argument is
enough to guarantee that the value is suitably aligned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2018-12-11 13:14:28 +01:00
..
FileExplorer.c MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
FileExplorer.h MdeModulePkg/FileExplorerLib: avoid packed struct for program data 2018-12-11 13:14:28 +01:00
FileExplorerLib.inf MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
FileExplorerLib.uni MdeModulePkg: Add the missing library uni files of UI instances 2015-12-24 02:29:58 +00:00
FileExplorerString.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
FileExplorerVfr.vfr MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
FormGuid.h MdeModulePkg/FileExplorer: Enable functionality of creating new file/folder 2017-01-19 10:14:37 +08:00