summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include/mock
AgeCommit message (Collapse)Author
2024-10-02libpayload: Remove default empty implementations in mock cache.hYu-Ping Wu
The mock/arch/cache.h file exists for libpayload unit tests. However, the default implementations (as empty macros) in it make these functions difficult to mock in unit tests. Therefore, we follow what's done for mock/arch/io.h, by only including function declarations in the header. Each test is expected to implement mocks for these cache functions when required. Change-Id: Ie4383bf95435fd7d74d624b19b79b5a117cf6d00 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84608 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Hsuan-ting Chen <roccochen@google.com>
2021-11-04tests: Move x86 I/O functions to include/mock/arch/io.hJakub Czapiga
Move th x86 I/O functions declarations from tests mocks to the mock architecture io.h. This will make x86 I/O-dependent tests simpler, because the x86_io.h from mocks will not have to be included manually. Change-Id: Ie7f06c992be306d2523f2079bc90adf114b93946 Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58881 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-10-11libpayload: Add mock architectureJakub Czapiga
Mock architecture can be used to build libpayload using host compiler. It can be enabled by setting ARCH_MOCK=y in the dotconfig. It sets LITTLE_ENDIAN=y, as most machines these days use little-endian CPUs. Libpayload will use HOSTCC as CC, HOSTLD as LD, etc. instead of tools provided by xcompile. Mock architecture configuration can be used by payloads for testing purposes. Thanks to it, tests can be architecture-independent, and can be executed without requiring compatible Kconfig options, e.g. ARCH_ARM64=y for ARM64 machine. However, one has to provide implementation for most architecture-specific functions present in arch/* directories. Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: Ie3a6e6f6cad2f8a2e48a8e546d3b79c577653080 Reviewed-on: https://review.coreboot.org/c/coreboot/+/57708 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>