• Laszlo Ersek's avatar
    efi: Introduce efi_md_typeattr_format() · 98d2a6ca
    Laszlo Ersek authored
    At the moment, there are three architectures debug-printing the EFI memory
    map at initialization: x86, ia64, and arm64. They all use different format
    strings, plus the EFI memory type and the EFI memory attributes are
    similarly hard to decode for a human reader.
    
    Introduce a helper __init function that formats the memory type and the
    memory attributes in a unified way, to a user-provided character buffer.
    
    The array "memory_type_name" is copied from the arm64 code, temporarily
    duplicating it. The (otherwise optional) braces around each string literal
    in the initializer list are dropped in order to match the kernel coding
    style more closely. The element size is tightened from 32 to 20 bytes
    (maximum actual string length + 1) so that we can derive the field width
    from the element size.
    Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
    Tested-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    [ Dropped useless 'register' keyword, which compiler will ignore ]
    Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
    98d2a6ca
efi.c 12.6 KB