| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_OS_FUCHSIA) | 6 #if defined(TARGET_OS_FUCHSIA) |
| 7 | 7 |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 | 9 |
| 10 #include <errno.h> | 10 #include <errno.h> |
| 11 #include <magenta/syscalls.h> | 11 #include <magenta/syscalls.h> |
| 12 #include <magenta/types.h> | 12 #include <magenta/types.h> |
| 13 #include <runtime/sysinfo.h> | |
| 14 | 13 |
| 15 #include "platform/assert.h" | 14 #include "platform/assert.h" |
| 16 #include "vm/zone.h" | 15 #include "vm/zone.h" |
| 17 | 16 |
| 18 namespace dart { | 17 namespace dart { |
| 19 | 18 |
| 20 #ifndef PRODUCT | 19 #ifndef PRODUCT |
| 21 | 20 |
| 22 DEFINE_FLAG(bool, generate_perf_events_symbols, false, | 21 DEFINE_FLAG(bool, generate_perf_events_symbols, false, |
| 23 "Generate events symbols for profiling with perf"); | 22 "Generate events symbols for profiling with perf"); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 144 } |
| 146 | 145 |
| 147 | 146 |
| 148 bool OS::AllowStackFrameIteratorFromAnotherThread() { | 147 bool OS::AllowStackFrameIteratorFromAnotherThread() { |
| 149 UNIMPLEMENTED(); | 148 UNIMPLEMENTED(); |
| 150 return false; | 149 return false; |
| 151 } | 150 } |
| 152 | 151 |
| 153 | 152 |
| 154 int OS::NumberOfAvailableProcessors() { | 153 int OS::NumberOfAvailableProcessors() { |
| 155 return mxr_get_nprocs_conf(); | 154 return sysconf(_SC_NPROCESSORS_CONF); |
| 156 } | 155 } |
| 157 | 156 |
| 158 | 157 |
| 159 void OS::Sleep(int64_t millis) { | 158 void OS::Sleep(int64_t millis) { |
| 160 mx_nanosleep( | 159 mx_nanosleep( |
| 161 millis * kMicrosecondsPerMillisecond * kNanosecondsPerMicrosecond); | 160 millis * kMicrosecondsPerMillisecond * kNanosecondsPerMicrosecond); |
| 162 } | 161 } |
| 163 | 162 |
| 164 | 163 |
| 165 void OS::SleepMicros(int64_t micros) { | 164 void OS::SleepMicros(int64_t micros) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 } | 302 } |
| 304 | 303 |
| 305 | 304 |
| 306 void OS::Exit(int code) { | 305 void OS::Exit(int code) { |
| 307 UNIMPLEMENTED(); | 306 UNIMPLEMENTED(); |
| 308 } | 307 } |
| 309 | 308 |
| 310 } // namespace dart | 309 } // namespace dart |
| 311 | 310 |
| 312 #endif // defined(TARGET_OS_FUCHSIA) | 311 #endif // defined(TARGET_OS_FUCHSIA) |
| OLD | NEW |