Skip to content

Commit c3e147d

Browse files
jmontleonandreabolognani
authored andcommitted
Implement __riscv_flush_icache
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
1 parent 32ea584 commit c3e147d

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

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 += riscv64_cache.o
3536
endif
3637

3738
LDFLAGS = -nostdlib -znocombreloc

lib/edk2asm.h

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

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 "riscv64_cache.S"
4+
.text
5+
6+
GCC_ASM_EXPORT(__riscv_flush_icache)
7+
8+
ASM_PFX(__riscv_flush_icache):
9+
fence.i
10+
ret

0 commit comments

Comments
 (0)