Skip to content
Snippets Groups Projects
  1. Feb 19, 2014
    • Stephen Warren's avatar
      cmd_test: evaluate to false without any arguments · 2453de99
      Stephen Warren authored
      
      This emulates bash:
      $ if test; then echo yes; else echo no; fi
      no
      
      Currently, the code sets expr = -1 in this case, which gets mapped to
      0 (true) at the end of do_test() by the logical -> shell exit code
      conversion.
      
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      2453de99
    • Stephen Warren's avatar
      cmd_test: implement ! on sub-expressions · d9b651ce
      Stephen Warren authored
      
      Currently, ! can only be parsed as the first operator in an expression.
      This prevents the following from working:
      
      $ if test ! ! 1 -eq 1; then echo yes; else echo no; fi
      yes
      $ if test ! 1 -eq 2 -a ! 3 -eq 4; then echo yes; else echo no; fi
      yes
      
      Fix this by parsing ! like any other operator, and and handling it
      similarly to -a and -o.
      
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      d9b651ce
    • Stephen Warren's avatar
      cmd_test: check for binary operators before unary · 4c80f29e
      Stephen Warren authored
      
      This better mirrors the behaviour of bash, for example:
      
      $ if test -z = -z; then echo yes; else echo no; fi
      yes
      
      This is parsed as a string comparison of "-z" and "-z", since the check
      for the binary "=" operator occurs first. Without this change, the
      command would be parsed as a -z test of "-", followed by a syntax error;
      a trailing -z without and operand.
      
      This is a behavioural change, but I believe any commands affected were
      previously invalid or bizarely formed.
      
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      4c80f29e
    • Stephen Warren's avatar
      cmd_test: use table lookup for parsing · 490ba833
      Stephen Warren authored
      
      do_test() currently uses strcmp() twice to determine which operator is
      present; once to determine how many arguments the operator needs, then
      a second time to actually decode the operator and implement it.
      
      Rewrite the code so that a table lookup is used to translate the operator
      string to an integer, and use a more efficient switch statement to decode
      and execute the operator.
      
      This approach also acts as enablement for the following patches.
      
      This patch should introduce no behavioural change.
      
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      490ba833
  2. Feb 07, 2014
  3. Feb 04, 2014
  4. Feb 03, 2014
  5. Jan 27, 2014
    • Alexey Brodkin's avatar
      board_r - fixup functions table after relocation · 7395398a
      Alexey Brodkin authored
      
      This is only required for "PIC" relocation and doesn't apply to modern
      "PIE" relocation which does data relocation as well as code.
      
      "init_sequence_r" is just an array that consists of compile-time
      adresses of init functions. Since this is basically an array of integers
      (pointers to "void" to be more precise) it won't be modified during
      relocation - it will be just copied to new location as it is.
      
      As a consequence on execution after relocation "initcall_run_list" will
      be jumping to pre-relocation addresses. As long as we don't overwrite
      pre-relocation memory area init calls are executed correctly. But still
      it is dangerous because after relocation we don't expect initially used
      memory to stay untouched.
      
      Cc: Tom Rini <trini@ti.com>
      Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
      Cc: Doug Anderson <dianders@chromium.org>
      Cc: Thomas Langer <thomas.langer@lantiq.com>
      Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
      Acked-by: default avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
      7395398a
  6. Jan 24, 2014
  7. Jan 20, 2014
  8. Jan 14, 2014
    • Heiko Schocher's avatar
      common, env: optimize boottime · 1b610271
      Heiko Schocher authored
      
      when creating the hashtable, for each environmentvariable
      getenv(ENV_CALLBACK_VAR) and getenv(ENV_FLAGS_VAR) is called,
      which costs at this point a lot of time. So call this two
      getenv() calls only once.
      
      Boottime on the ids8313 board without this patch:
      
      2013-12-19 13:38:22,894:  NAND:  128 MiB
      2013-12-19 13:38:27,659:  In:    serial
      (~4.8 sec)
      
      Bootime with this patch on the ids8313 board:
      
      2013-12-19 13:40:25,332:  NAND:  128 MiB
      2013-12-19 13:40:25,546:  In:    serial
      (~0.2 sec)
      
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Cc: Tom Rini <trini@ti.com>
      Cc: Joe Hershberger <joe.hershberger@ni.com>
      Cc: Wolfgang Denk <wd@denx.de>
      1b610271
    • Simon Glass's avatar
      bootm: Reinstate special case for standalone images · c5cbe1e2
      Simon Glass authored
      
      For standalone images, bootm had a special case where the OS boot function
      was NULL but did actually exist. It was just called manually.
      
      This was removed by commit 35fc84fa which checks for the non-existence of
      this function before the special case is examined.
      
      There is no obvious reason why standalone is handled with a special case.
      Adjust the code so that standalone has a normal OS boot function. We still
      need a special case for when the function returns, but at least we can
      avoid the main problem.
      
      This is intended to fix the reported:
      
          ERROR: booting os 'U-Boot' (17) is not supported
      
      but needs testing.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      c5cbe1e2
    • miao.yan@windriver.com's avatar
      common/image.c: move VxWorks header string out of CONFIG_CMD_ELF · 68b15e83
      miao.yan@windriver.com authored
      
      Otherwise, when booting VxWorks kernel, the incorrect message will
      be seen:
      
          ARM Unknown OS Kernel Image (uncompressed)
      
      Signed-off-by: default avatarMiao Yan <miao.yan@windriver.com>
      68b15e83
    • Andrew Gabbasov's avatar
      command.c: Fix auto-completion for the full commands list case · 9b438946
      Andrew Gabbasov authored
      
      Compiling of full list of commands does not advance the counter,
      so it always results in an empty list.
      This seems to be (inadvertently?) introduced by commit
      6c7c946c.
      
      Signed-off-by: default avatarAndrew Gabbasov <andrew_gabbasov@mentor.com>
      9b438946
  9. Jan 13, 2014
  10. Jan 11, 2014
  11. Jan 09, 2014
  12. Dec 16, 2013
  13. Dec 13, 2013
Loading