Skip to content

Commit eae94d7

Browse files
jmontleonandreabolognani
authored andcommitted
Implement __riscv_flush_icache
Signed-off-by: Jason Montleon <jason@montleon.com>
1 parent 2829438 commit eae94d7

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

lib/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ DEFINES += -DMDE_CPU_ARM
3232
endif
3333
ifeq ($(ARCH),riscv64)
3434
DEFINES += -DMDE_CPU_RISCV64
35+
LIBFILES += $(ARCH)/cache.o
3536
endif
3637

3738
LDFLAGS = -nostdlib -znocombreloc

lib/riscv64/cache.S

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "edk2asm.h"
2+
3+
.file "cache.S"
4+
.text
5+
6+
GCC_ASM_EXPORT(__riscv_flush_icache)
7+
8+
ASM_PFX(__riscv_flush_icache):
9+
fence.i
10+
ret

lib/riscv64/edk2asm.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
#define ASM_PFX(x) x
3+
#define GCC_ASM_EXPORT(x) \
4+
.globl x ; \
5+
.type x, %function
6+

0 commit comments

Comments
 (0)