| OLD | NEW |
| (Empty) | |
| 1 // FROM ARM code below |
| 2 // CPU specific code for arm independent of OS goes here. |
| 3 |
| 4 #include "v8.h" |
| 5 #include "cpu.h" |
| 6 |
| 7 #include <sys/syscall.h> |
| 8 #include <unistd.h> |
| 9 |
| 10 #ifdef __mips |
| 11 #include <asm/cachectl.h> |
| 12 #endif // #ifdef __mips |
| 13 |
| 14 namespace v8 { |
| 15 namespace internal { |
| 16 |
| 17 void CPU::Setup() { |
| 18 // Nothing to do. |
| 19 } |
| 20 |
| 21 // TODO : Implement void CPU::FlushICache(void* start, size_t size) { |
| 22 void CPU::FlushICache(void* start, size_t size) { |
| 23 #ifdef __mips |
| 24 int res; |
| 25 |
| 26 // int cacheflush(char *addr, int nbytes, int cache); |
| 27 // See http://www.linux-mips.org/wiki/Cacheflush_Syscall |
| 28 res = syscall(__NR_cacheflush, start, size, ICACHE); |
| 29 |
| 30 if(res) |
| 31 V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache"); |
| 32 |
| 33 #endif // #ifdef __mips |
| 34 } |
| 35 |
| 36 |
| 37 void CPU::DebugBreak() { |
| 38 #ifdef __mips |
| 39 asm volatile("break"); |
| 40 #endif // #ifdef __mips |
| 41 } |
| 42 |
| 43 } } // namespace v8::internal |
| OLD | NEW |