-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rob Bradford <[email protected]>
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) 2001-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
* Copyright (C) ARM Ltd. 2016-2017. ALL RIGHTS RESERVED. | ||
* Copyright (C) Rivos Inc. 2023 | ||
* | ||
* See file LICENSE for terms. | ||
*/ | ||
|
||
#ifndef UCC_UTILS_ARCH_RISCV64_CPU_H_ | ||
#define UCC_UTILS_ARCH_RISCV64_CPU_H_ | ||
|
||
#define UCC_ARCH_CACHE_LINE_SIZE 64 | ||
|
||
/* RVWMO rules */ | ||
#define ucc_memory_bus_fence() asm volatile("fence iorw, iorw" ::: "memory") | ||
#define ucc_memory_bus_store_fence() asm volatile("fence ow, ow" ::: "memory") | ||
#define ucc_memory_bus_load_fence() asm volatile("fence ir, ir" ::: "memory") | ||
|
||
#define ucc_memory_cpu_fence() asm volatile("fence rw, rw" ::: "memory") | ||
#define ucc_memory_cpu_store_fence() asm volatile("fence rw, w" ::: "memory") | ||
#define ucc_memory_cpu_load_fence() asm volatile("fence r, rw" ::: "memory") | ||
|
||
static inline ucc_cpu_model_t ucc_arch_get_cpu_model() | ||
{ | ||
return UCC_CPU_MODEL_UNKNOWN; | ||
} | ||
|
||
static inline ucc_cpu_vendor_t ucc_arch_get_cpu_vendor() | ||
{ | ||
return UCC_CPU_VENDOR_GENERIC_RISCV; | ||
} | ||
|
||
#endif |