OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 break; | 497 break; |
498 } | 498 } |
499 // We should only ever see an interrupt error. | 499 // We should only ever see an interrupt error. |
500 ASSERT(errno == EINTR); | 500 ASSERT(errno == EINTR); |
501 // Copy remainder into requested and repeat. | 501 // Copy remainder into requested and repeat. |
502 req = rem; | 502 req = rem; |
503 } | 503 } |
504 } | 504 } |
505 | 505 |
506 | 506 |
| 507 // TODO(regis, iposva): When this function is no longer called from the |
| 508 // CodeImmutability test in object_test.cc, it will be called only from the |
| 509 // simulator, which means that only the Intel implementation is needed. |
507 void OS::DebugBreak() { | 510 void OS::DebugBreak() { |
508 #if defined(HOST_ARCH_X64) || defined(HOST_ARCH_IA32) | 511 #if defined(HOST_ARCH_X64) || defined(HOST_ARCH_IA32) |
509 asm("int $3"); | 512 asm("int $3"); |
510 #elif defined(HOST_ARCH_ARM) | 513 #elif defined(HOST_ARCH_ARM) && !defined(__THUMBEL__) |
511 asm("svc #0x9f0001"); // __ARM_NR_breakpoint | 514 asm("svc #0x9f0001"); // __ARM_NR_breakpoint |
| 515 #elif defined(HOST_ARCH_ARM) && defined(__THUMBEL__) |
| 516 UNIMPLEMENTED(); |
512 #elif defined(HOST_ARCH_MIPS) || defined(HOST_ARCH_ARM64) | 517 #elif defined(HOST_ARCH_MIPS) || defined(HOST_ARCH_ARM64) |
513 UNIMPLEMENTED(); | 518 UNIMPLEMENTED(); |
514 #else | 519 #else |
515 #error Unsupported architecture. | 520 #error Unsupported architecture. |
516 #endif | 521 #endif |
517 } | 522 } |
518 | 523 |
519 | 524 |
520 char* OS::StrNDup(const char* s, intptr_t n) { | 525 char* OS::StrNDup(const char* s, intptr_t n) { |
521 return strndup(s, n); | 526 return strndup(s, n); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 } | 621 } |
617 | 622 |
618 | 623 |
619 void OS::Exit(int code) { | 624 void OS::Exit(int code) { |
620 exit(code); | 625 exit(code); |
621 } | 626 } |
622 | 627 |
623 } // namespace dart | 628 } // namespace dart |
624 | 629 |
625 #endif // defined(TARGET_OS_LINUX) | 630 #endif // defined(TARGET_OS_LINUX) |
OLD | NEW |