summaryrefslogtreecommitdiff
path: root/lib/crc32.c
AgeCommit message (Collapse)Author
2018-12-23lib: crc32: mark static variable as __efi_runtime_dataHeinrich Schuchardt
In commit 483dbab9f931 ("lib: crc32: mark function crc32() as __efi_runtime") one local static variable was missed. It did not end up in the __efi_runtime_data section as it should. If CONFIG_DYNAMIC_CRC_TABLE=y a data abort execption may occur when the UEFI payload calls the SetVirtualAddressMap() runtime service. Reported-by: Dominik Adamski <dominik.adamski@northerntech.community> Fixes: 483dbab9f931 ("lib: crc32: mark function crc32() as __efi_runtime") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20lib: crc32: mark function crc32() as __efi_runtimeHeinrich Schuchardt
The function crc32() is needed by the EFI subsystem at runtime. So it has to be linked into the runtime section together with all dependencies. Eliminate empty defines local and ZEXPORT. Mark variables as static which are not exported. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-02-14lib: Kconfig: Move DYNAMIC_CRC_TABLE to KconfigFaiz Abbas
Add CONFIG prefix to DYNAMIC_CRC_TABLE and implement it in Kconfig. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2013-04-19crc32: Correct endianness of crc32 resultSimon Glass
When crc32 is handled by the hash library, it requires the data to be in big-endian format, since it reads it byte-wise. Thus at present the 'crc32' command reports incorrect data. For example, previously we might see: Peach # crc32 40000000 100 CRC32 for 40000000 ... 400000ff ==> 0d968558 but instead with the hash library we see: Peach # crc32 40000000 100 CRC32 for 40000000 ... 400000ff ==> 5885960d Correct this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@google.com>
2013-02-28Roll crc32 into hash infrastructureSimon Glass
Add the CRC32 algorithm to the list of available hashes, and make the crc32 command use hash_command(). Add a new crc32_wd_buf() to make this possible, which puts its result in a buffer rather than returning it as a 32-bit value. Note: For some boards the hash command is not enabled, neither are sha1, sha256 or the verify option. In this case the full hash implementation adds about 500 bytes of overhead. So as a special case, we use #ifdef to select very simple bahaviour in that case. The justification for this is that it is currently a very common case (virtually all boards enable crc32 but only some enable more advanced features). Signed-off-by: Simon Glass <sjg@chromium.org>
2010-04-13Rename lib_generic/ to lib/Peter Tyser
Now that the other architecture-specific lib directories have been moved out of the top-level directory there's not much reason to have the '_generic' suffix on the common lib directory. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>