Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Andre Przywara's avatar
    a28e1d98
    SPL: tiny-printf: add "l" modifier · a28e1d98
    Andre Przywara authored
    
    tiny-printf does not know about the "l" modifier so far, which breaks
    the crash dump on AArch64, because it uses %lx to print the registers.
    Add an easy way of handling longs correctly.
    
    Using a relatively decent compiler (GCC 5.3.0) this does _not_ increase
    the code size of tiny-printf.o for 32-bit builds (where long and int
    are actually the same), actually it looses three (ARM Thumb2) instructions
    from the actual SPL (numbers for orangepi_plus_defconfig):
      text    data     bss     dec     hex filename
       758       0       0     758     2f6 spl/lib/tiny-printf.o	before
     18839     488     232   19559    4c67 spl/u-boot-spl		before
       758       0       0     758     2f6 spl/lib/tiny-printf.o	after
     18833     488     232   19553    4c61 spl/u-boot-spl		after
    
    This adds some substantial amount of code to a 64-bit build, though:
    (taken after a later commit, which enables the ARM64 SPL build for sunxi)
      text    data     bss     dec     hex filename
      1542       0       0    1542     606 spl/lib/tiny-printf.o	before
     25830     392     360   26582    67d6 spl/u-boot-spl		before
      1758       0       0    1758     6de spl/lib/tiny-printf.o	after
     26040     392     360   26792    68a8 spl/u-boot-spl		after
    
    Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
    Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
    Reviewed-by: default avatarJagan Teki <jagan@openedev.com>
    a28e1d98
    History
    SPL: tiny-printf: add "l" modifier
    Andre Przywara authored
    
    tiny-printf does not know about the "l" modifier so far, which breaks
    the crash dump on AArch64, because it uses %lx to print the registers.
    Add an easy way of handling longs correctly.
    
    Using a relatively decent compiler (GCC 5.3.0) this does _not_ increase
    the code size of tiny-printf.o for 32-bit builds (where long and int
    are actually the same), actually it looses three (ARM Thumb2) instructions
    from the actual SPL (numbers for orangepi_plus_defconfig):
      text    data     bss     dec     hex filename
       758       0       0     758     2f6 spl/lib/tiny-printf.o	before
     18839     488     232   19559    4c67 spl/u-boot-spl		before
       758       0       0     758     2f6 spl/lib/tiny-printf.o	after
     18833     488     232   19553    4c61 spl/u-boot-spl		after
    
    This adds some substantial amount of code to a 64-bit build, though:
    (taken after a later commit, which enables the ARM64 SPL build for sunxi)
      text    data     bss     dec     hex filename
      1542       0       0    1542     606 spl/lib/tiny-printf.o	before
     25830     392     360   26582    67d6 spl/u-boot-spl		before
      1758       0       0    1758     6de spl/lib/tiny-printf.o	after
     26040     392     360   26792    68a8 spl/u-boot-spl		after
    
    Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
    Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
    Reviewed-by: default avatarJagan Teki <jagan@openedev.com>