Skip to content

Commit

Permalink
[CORE] [RISCV] Fix needed for riscv64
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Jul 29, 2024
1 parent b08f87e commit 18e38f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions FWCore/Services/plugins/CPU.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "cpu_features/cpuinfo_aarch64.h"
#elif defined(CPU_FEATURES_ARCH_PPC)
#include "cpu_features/cpuinfo_ppc.h"
#elif define(CPU_FEATURES_ARCH_RISCV)
#include "cpu_features/cpuinfo_riscv.h"
#endif

#include <cstdlib>
Expand Down Expand Up @@ -253,6 +255,9 @@ namespace edm {
#elif defined(CPU_FEATURES_ARCH_PPC)
const auto strings{GetPPCPlatformStrings()};
model = strings.machine;
#elif defined(CPU_FEATURES_ARCH_RISCV)
const auto info{GetRiscvInfo()};
model = fmt::format("riscv64 {} {}", info.vendor, info.uarch);
#endif
return model;
}
Expand Down
2 changes: 2 additions & 0 deletions FWCore/Utilities/interface/HRRealTime.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ namespace edm {
__asm__ __volatile__("isb; mrs %0, cntvct_el0" : "=r"(ret));
return ret;
}
#elif defined(__riscv)
static __inline__ unsigned long long rdtsc(void) { return 0; }
#else
#error The file FWCore/Utilities/interface/HRRealTime.h needs to be set up for your CPU type.
#endif
Expand Down

0 comments on commit 18e38f0

Please sign in to comment.