Skip to content
Snippets Groups Projects
  1. Jan 22, 2018
    • Heinrich Schuchardt's avatar
      vsprintf.c: add EFI device path printing · 256060e4
      Heinrich Schuchardt authored
      
      For debugging efi_loader we need the capability to print EFI
      device paths. With this patch we can write:
      
          debug("device path: %pD", dp);
      
      A possible output would be
      
          device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)
      
      This enhancement is not available when building without EFI support
      and neither in the SPL nor in the API example.
      
      A test is provided. It can be executed in the sandbox with command
      ut_print.
      
      The development for EFI support in the sandbox is currently in
      branch u-boot-dm/efi-working. The branch currently lacks
      commit 6ea8b580 ("efi_loader: correct DeviceNodeToText
      for media types"). Ater rebasing the aforementioned branch on
      U-Boot v2018.01 the test is executed successfully.
      
      Without EFI support in the sandbox the test is simply skipped.
      
      Suggested-by: default avatarRob Clark <robdclark@gmail.com>
      Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      256060e4
  2. Sep 12, 2017
  3. Jan 19, 2016
    • Tom Rini's avatar
      vsprintf.c: Always enable CONFIG_SYS_VSNPRINTF · 947c626d
      Tom Rini authored
      
      Enabling this function always removes some class of string saftey issues.
      The size change here in general is about 400 bytes and this seems a reasonable
      trade-off.
      
      Cc: Peng Fan <peng.fan@nxp.com>
      Cc: Peter Robinson <pbrobinson@gmail.com>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Adrian Alonso <aalonso@freescale.com>
      Cc: Stefano Babic <sbabic@denx.de>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      947c626d
  4. Dec 14, 2015
  5. Nov 23, 2015
    • Stefan Roese's avatar
      lib/tiny-printf.c: Add tiny printf function for space limited environments · 7d9cde10
      Stefan Roese authored
      This patch adds a small printf() version that supports all basic formats.
      Its intented to be used in U-Boot SPL versions on platforms with very
      limited internal RAM sizes.
      
      To enable it, just define CONFIG_USE_TINY_PRINTF in your defconfig. This
      will result in the SPL using this tiny function and the main U-Boot
      still using the full-blown printf() function.
      
      This code was copied from:
      http://www.sparetimelabs.com/printfrevisited
      
      
      With mostly only coding style related changes so that its checkpatch
      clean.
      
      The size reduction is about 2.5KiB. Here a comparison for the db-mv784mp-gp
      (Marvell AXP) SPL:
      
      Without this patch:
        58963   18536    1928   79427   13643 ./spl/u-boot-spl
      
      With this patch:
        56542   18536    1956   77034   12cea ./spl/u-boot-spl
      
      Note:
      To make it possible to compile tiny-printf.c instead of vsprintf.c when
      CONFIG_USE_TINY_PRINTF is defined, the functions printf() and vprintf() are
      moved from common/console.c into vsprintf.c in this patch.
      
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Tom Rini <trini@konsulko.com>
      Cc: Albert Aribaud <albert.u.boot@aribaud.net>
      7d9cde10
  6. Jul 21, 2015
  7. Jun 29, 2015
  8. Apr 23, 2015
  9. Nov 23, 2014
  10. Nov 20, 2014
    • Masahiro Yamada's avatar
      include: move various macros to include/linux/kernel.h · cba1da49
      Masahiro Yamada authored
      
      U-Boot has imported various utility macros from Linux
      scattering them to various places without consistency.
      
      In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN,
      container_of, DIV_ROUND_UP, etc.
      In include/linux/compat.h are min_t, max_t, round_up, round_down,
      etc.
      We also have duplicated defines of min_t in some *.c files.
      
      Moreover, we are suffering from too cluttered include/common.h.
      
      This commit moves various macros that originate in
      include/linux/kernel.h of Linux to their original position.
      
      Note:
      This commit simply moves the macros; the macros roundup,
      min, max, min2, max3, ARRAY_SIZE are different
      from those of Linux at this point.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      cba1da49
  11. Oct 27, 2014
  12. Jul 18, 2014
  13. Jan 24, 2014
  14. Jun 26, 2013
  15. Feb 19, 2013
  16. Dec 13, 2012
  17. Nov 04, 2012
  18. Nov 02, 2012
  19. Oct 15, 2012
  20. Dec 17, 2011
  21. Oct 26, 2011
  22. Sep 09, 2011
    • Simon Glass's avatar
      Add assert() for debug assertions · 21726a7a
      Simon Glass authored
      
      assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
      This is useful when a condition is an error but a board reset is unlikely
      to fix it, so it is better to soldier on in hope. Assertion failures should
      be caught during development/test.
      
      It turns out that assert() is defined separately in a few places in U-Boot
      with various meanings. This patch cleans up some of these.
      
      Build errors exposed by this change (and defining DEBUG) are also fixed in
      this patch.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      21726a7a
  23. Jul 28, 2011
    • Heiko Schocher's avatar
      panic: remove warning "'noreturn' function does return" · 40e01881
      Heiko Schocher authored
      
      since commit
      
      commit d2e8b911
      Author: Mike Frysinger <vapier@gentoo.org>
      Date:   Wed Jun 29 11:58:04 2011 +0000
      
          panic: add noreturn attribute
      
      I see the following warnings:
      
      vsprintf.c: In function 'panic':
      vsprintf.c:730: warning: 'noreturn' function does return
      
      for nearly all boards. This patch fixes this warning.
      
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      cc: Mike Frysinger <vapier@gentoo.org>
      40e01881
  24. May 12, 2011
  25. Nov 28, 2010
  26. Jul 04, 2010
    • Wolfgang Denk's avatar
      Make sure that argv[] argument pointers are not modified. · 54841ab5
      Wolfgang Denk authored
      
      The hush shell dynamically allocates (and re-allocates) memory for the
      argument strings in the "char *argv[]" argument vector passed to
      commands.  Any code that modifies these pointers will cause serious
      corruption of the malloc data structures and crash U-Boot, so make
      sure the compiler can check that no such modifications are being done
      by changing the code into "char * const argv[]".
      
      This modification is the result of debugging a strange crash caused
      after adding a new command, which used the following argument
      processing code which has been working perfectly fine in all Unix
      systems since version 6 - but not so in U-Boot:
      
      int main (int argc, char **argv)
      {
      	while (--argc > 0 && **++argv == '-') {
      /* ====> */	while (*++*argv) {
      			switch (**argv) {
      			case 'd':
      				debug++;
      				break;
      			...
      			default:
      				usage ();
      			}
      		}
      	}
      	...
      }
      
      The line marked "====>" will corrupt the malloc data structures and
      usually cause U-Boot to crash when the next command gets executed by
      the shell.  With the modification, the compiler will prevent this with
      an
      	error: increment of read-only location '*argv'
      
      N.B.: The code above can be trivially rewritten like this:
      
      	while (--argc > 0 && **++argv == '-') {
      		char *arg = *argv;
      		while (*++arg) {
      			switch (*arg) {
      			...
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      54841ab5
  27. Apr 13, 2010
  28. Dec 08, 2009
  29. Jul 26, 2009
  30. Apr 04, 2009
  31. Mar 20, 2009
    • Mike Frysinger's avatar
      vsprintf: pull updates from Linux kernel · 6c6166f5
      Mike Frysinger authored
      
      This brings in support for the %p modifier which allows us to easily print
      out things like ip addresses, mac addresses, and pointers.
      
      It also converts the rarely used 'q' length modifier to the common 'L'
      modifier when dealing with quad types.
      
      While this new code is a bit larger (~1k .text), most of it should be made
      up by converting the existing ip/mac address code to use format modifiers.
      
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      6c6166f5
  32. Nov 19, 2008
    • Kyungmin Park's avatar
      UBI: Add basic UBI support to U-Boot (Part 6/8) · 7e6ee7ad
      Kyungmin Park authored
      
      This patch adds basic UBI (Unsorted Block Image) support to U-Boot.
      It's based on the Linux UBI version and basically has a "OS"
      translation wrapper that defines most Linux specific calls
      (spin_lock() etc.) into no-ops. Some source code parts have been
      uncommented by "#ifdef UBI_LINUX". This makes it easier to compare
      this version with the Linux version and simplifies future UBI
      ports/bug-fixes from the Linux version.
      
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      7e6ee7ad
  33. Oct 18, 2008
  34. Jul 14, 2008
  35. Jan 11, 2008
  36. Mar 14, 2004
Loading