| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include <sys/syscall.h> | 30 #include <sys/syscall.h> |
| 31 #include <unistd.h> | 31 #include <unistd.h> |
| 32 | 32 |
| 33 #ifdef __mips | 33 #ifdef __mips |
| 34 #include <asm/cachectl.h> | 34 #include <asm/cachectl.h> |
| 35 #endif // #ifdef __mips | 35 #endif // #ifdef __mips |
| 36 | 36 |
| 37 #include "v8.h" | 37 #include "v8.h" |
| 38 #include "cpu.h" | 38 #include "cpu.h" |
| 39 #include "macro-assembler.h" |
| 39 | 40 |
| 40 namespace v8 { | 41 namespace v8 { |
| 41 namespace internal { | 42 namespace internal { |
| 42 | 43 |
| 43 void CPU::Setup() { | 44 void CPU::Setup() { |
| 44 // Nothing to do. | 45 CpuFeatures::Probe(); |
| 45 } | 46 } |
| 46 | 47 |
| 47 void CPU::FlushICache(void* start, size_t size) { | 48 void CPU::FlushICache(void* start, size_t size) { |
| 48 #ifdef __mips | 49 #ifdef __mips |
| 49 int res; | 50 int res; |
| 50 | 51 |
| 51 // See http://www.linux-mips.org/wiki/Cacheflush_Syscall | 52 // See http://www.linux-mips.org/wiki/Cacheflush_Syscall |
| 52 res = syscall(__NR_cacheflush, start, size, ICACHE); | 53 res = syscall(__NR_cacheflush, start, size, ICACHE); |
| 53 | 54 |
| 54 if (res) { | 55 if (res) { |
| 55 V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache"); | 56 V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache"); |
| 56 } | 57 } |
| 57 | 58 |
| 58 #endif // #ifdef __mips | 59 #endif // #ifdef __mips |
| 59 } | 60 } |
| 60 | 61 |
| 61 | 62 |
| 62 void CPU::DebugBreak() { | 63 void CPU::DebugBreak() { |
| 63 #ifdef __mips | 64 #ifdef __mips |
| 64 asm volatile("break"); | 65 asm volatile("break"); |
| 65 #endif // #ifdef __mips | 66 #endif // #ifdef __mips |
| 66 } | 67 } |
| 67 | 68 |
| 68 } } // namespace v8::internal | 69 } } // namespace v8::internal |
| 69 | 70 |
| OLD | NEW |