v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
cpu-riscv.cc
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// CPU specific code for arm independent of OS goes here.
6
7#include <sys/syscall.h>
8#include <unistd.h>
9
11
12namespace v8 {
13namespace internal {
14
15void CpuFeatures::FlushICache(void* start, size_t size) {
16#if !defined(USE_SIMULATOR)
17 char* end = reinterpret_cast<char*>(start) + size;
18 // SYS_riscv_flush_icache is a symbolic constant used in user-space code to
19 // identify the flush_icache system call, while __NR_riscv_flush_icache is the
20 // corresponding system call number used in the kernel to dispatch the system
21 // call.
22 // The flag set to zero will flush all cpu cores.
23 syscall(__NR_riscv_flush_icache, start, end, 0);
24#endif // !USE_SIMULATOR.
25}
26
27} // namespace internal
28} // namespace v8
static void FlushICache(void *start, size_t size)
Definition cpu-riscv.cc:15
int start
int end