libpayload: Remove default empty implementations in mock cache.h
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>
This commit is contained in:
parent
caefaaa093
commit
e5cce00552
1 changed files with 13 additions and 10 deletions
|
|
@ -3,16 +3,19 @@
|
|||
#ifndef __ARCH_CACHE_H__
|
||||
#define __ARCH_CACHE_H__
|
||||
|
||||
/* No support for cache in the mock architecture */
|
||||
#include <stddef.h>
|
||||
|
||||
#define dmb()
|
||||
#define dsb()
|
||||
#define dcache_clean_all()
|
||||
#define dcache_clean_by_mva(addr, len)
|
||||
#define dcache_invalidate_all()
|
||||
#define dcache_invalidate_by_mva(addr, len)
|
||||
#define dcache_clean_invalidate_all()
|
||||
#define dcache_clean_invalidate_by_mva(addr, len)
|
||||
#define cache_sync_instructions()
|
||||
/* Functions in this file are unimplemented by default. Tests are expected to implement
|
||||
mocks for these functions, if tests will call functions using functions listed below. */
|
||||
|
||||
void dmb(void);
|
||||
void dsb(void);
|
||||
void dcache_clean_all(void);
|
||||
void dcache_clean_by_mva(void const *addr, size_t len);
|
||||
void dcache_invalidate_all(void);
|
||||
void dcache_invalidate_by_mva(void const *addr, size_t len);
|
||||
void dcache_clean_invalidate_all(void);
|
||||
void dcache_clean_invalidate_by_mva(void const *addr, size_t len);
|
||||
void cache_sync_instructions(void);
|
||||
|
||||
#endif /* __ARCH_CACHE_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue