-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/michalbiesek/fio
* 'master' of https://github.com/michalbiesek/fio: Add RISC-V 64 support
- Loading branch information
Showing
5 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef ARCH_RISCV64_H | ||
#define ARCH_RISCV64_H | ||
|
||
#include <unistd.h> | ||
#include <stdlib.h> | ||
#include <sys/types.h> | ||
#include <sys/wait.h> | ||
|
||
#define FIO_ARCH (arch_riscv64) | ||
|
||
#define nop __asm__ __volatile__ ("nop") | ||
#define read_barrier() __asm__ __volatile__("fence r, r": : :"memory") | ||
#define write_barrier() __asm__ __volatile__("fence w, w": : :"memory") | ||
|
||
static inline unsigned long long get_cpu_clock(void) | ||
{ | ||
unsigned long val; | ||
|
||
asm volatile("rdcycle %0" : "=r"(val)); | ||
return val; | ||
} | ||
#define ARCH_HAVE_CPU_CLOCK | ||
|
||
#define ARCH_HAVE_INIT | ||
extern bool tsc_reliable; | ||
static inline int arch_init(char *envp[]) | ||
{ | ||
tsc_reliable = true; | ||
return 0; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters