1. 25 5月, 2021 9 次提交
    • M
      efi_loader: add Sphinx doc for __efi_runtime and __efi_runtime_data · 82836973
      Marek Behún 提交于
      Document the macros __efi_runtime and __efi_runtime_data in Sphinx
      style.
      Signed-off-by: NMarek Behún <marek.behun@nic.cz>
      Reviewed-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
      82836973
    • M
      efi_loader: fix warning when linking with LTO · 2bdc6f57
      Marek Behún 提交于
      When linking with LTO, the compiler complains about type mismatch of
      variables `__efi_runtime_start`, `__efi_runtime_stop`,
      `__efi_runtime_rel_start` and `__efi_runtime_rel_stop`:
      
       include/efi_loader.h:218:21: warning: type of ‘__efi_runtime_start’
                                             does not match original
                                             declaration [-Wlto-type-mismatch]
          218 | extern unsigned int __efi_runtime_start, __efi_runtime_stop;
              |                     ^
        arch/sandbox/lib/sections.c:7:6: note: ‘__efi_runtime_start’ was
                                               previously declared here
            7 | char __efi_runtime_start[0] __attribute__((section(".__efi_run
              |      ^
      
      Change the type to char[] in include/efi_loader.h.
      Signed-off-by: NMarek Behún <marek.behun@nic.cz>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      2bdc6f57
    • M
      string: make memcpy(), memset(), memcmp() and memmove() visible for LTO · 46c3e292
      Marek Behún 提交于
      It seems that sometimes (happening on ARM64, for example with
      turris_mox_defconfig) GCC, when linking with LTO, changes the symbol
      names of some functions, for example lib/string.c's memcpy() function to
      memcpy.isra.0.
      
      This is a problem however when GCC for a code such as this:
      	struct some_struct *info = get_some_struct();
      	struct some struct tmpinfo;
      	tmpinfo = *info;
      emits a call to memcpy() by builtin behaviour, to copy *info to tmpinfo.
      
      This then results in the following linking error:
        .../lz4.c:93: undefined reference to `memcpy'
        .../uuid.c:206: more undefined references to `memcpy' follow
      
      GCC's documentation says this about -nodefaultlibs option:
        The compiler may generate calls to "memcmp", "memset", "memcpy" and
        "memmove".  These entries are usually resolved by entries in libc.
        These entry points should be supplied through some other mechanism
        when this option is specified.
      
      Make these functions visible by using the __used macro to avoid this
      error.
      Signed-off-by: NMarek Behún <marek.behun@nic.cz>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      46c3e292
    • M
      test/py: improve regular expression for ut subtest symbol matcher · 6f243e25
      Marek Behún 提交于
      Improve the regular expression that matches unittest symbols in
      u-boot.sym.
      
      Currently we do not enforce no prefix in symbol string, but with the
      soon to come change in linker lists declaring lists and entries with the
      __ADDRESSABLE macro (because of LTO), the symbol file will contain for
      every symbol of the form
        _u_boot_list_2_ut_X_2_Y
      also symbol
        __UNIQUE_ID___addressable__u_boot_list_2_ut_X_2_YN,
      (where N at the end is some number).
      
      In order to avoid matching these additional symbols, ensure that the
      character before "_u_boot_list_2_ut" is not a symbol name character.
      Signed-off-by: NMarek Behún <marek.behun@nic.cz>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      6f243e25
    • M
      compiler.h: align the __ADDRESSABLE macro with Linux' version · 998929b5
      Marek Behún 提交于
      Use UNIQUE_ID in the __ADDRESSABLE macro.
      Signed-off-by: NMarek Behún <marek.behun@nic.cz>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      998929b5
    • M
      treewide: Convert macro and uses of __section(foo) to __section("foo") · 236f2ec4
      Marek Behún 提交于
      This commit does the same thing as Linux commit 33def8498fdd.
      
      Use a more generic form for __section that requires quotes to avoid
      complications with clang and gcc differences.
      
      Remove the quote operator # from compiler_attributes.h __section macro.
      
      Convert all unquoted __section(foo) uses to quoted __section("foo").
      Also convert __attribute__((section("foo"))) uses to __section("foo")
      even if the __attribute__ has multiple list entry forms.
      Signed-off-by: NMarek Behún <marek.behun@nic.cz>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      236f2ec4
    • M
      checkpatch: require quotes around section name in the __section() macro · 9ce799aa
      Marek Behún 提交于
      This is how Linux does this now, see Linux commit 339f29d91acf.
      Signed-off-by: NMarek Behún <marek.behun@nic.cz>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      9ce799aa
    • M
      regmap: fix a serious pointer casting bug · 364bef15
      Marek Behún 提交于
      There is a serious bug in regmap_read() and regmap_write() functions
      where an uint pointer is cast to (void *) which is then cast to (u8 *),
      (u16 *), (u32 *) or (u64 *), depending on register width of the map.
      
      For example given a regmap with 16-bit register width the code
      	int val = 0x12340000;
      	regmap_read(map, 0, &val);
      only changes the lower 16 bits of val on little-endian machines.
      The upper 16 bits will remain 0x1234.
      
      Nobody noticed this probably because this bug can be triggered with
      regmap_write() only on big-endian architectures (which are not used by
      many people anymore), and on little endian this bug has consequences
      only if register width is 8 or 16 bits and also the memory place to
      which regmap_read() should store it's result has non-zero upper bits,
      which it seems doesn't happen anywhere in U-Boot normally. CI managed to
      trigger this bug in unit test of dm_test_devm_regmap_field when compiled
      for sandbox_defconfig using LTO.
      
      Fix this by utilizing an union { u8; u16; u32; u64; } and reading data
      into this union / writing data from this union.
      Signed-off-by: NMarek Behún <marek.behun@nic.cz>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Heiko Schocher <hs@denx.de>
      Cc: Bin Meng <bmeng.cn@gmail.com>
      Cc: Pratyush Yadav <p.yadav@ti.com>
      364bef15
    • S
      test: Avoid random numbers in dm_test_devm_regmap() · 2177f924
      Simon Glass 提交于
      There is no good reason to use a sequence from rand() here. We may as well
      invent our own sequence.
      
      This should molify Coverity which does not use rand() being used.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reported-by: Coverity (CID: 312949)
      2177f924
  2. 24 5月, 2021 1 次提交
    • T
      pylibfdt: Rework "avoid unused variable warning" lines · a2cfad8e
      Tom Rini 提交于
      Clang has -Wself-assign enabled by default under -Wall and so when
      building with -Werror we would get an error here.  Inspired by Linux
      kernel git commit a21151b9d81a ("tools/build: tweak unused value
      workaround") make use of the fact that both Clang and GCC support
      casting to `void` as the method to note that something is intentionally
      unused.
      Signed-off-by: NTom Rini <trini@konsulko.com>
      a2cfad8e
  3. 23 5月, 2021 1 次提交
  4. 21 5月, 2021 16 次提交
  5. 20 5月, 2021 13 次提交